File tree Expand file tree Collapse file tree 2 files changed +3
-4
lines changed
Expand file tree Collapse file tree 2 files changed +3
-4
lines changed Original file line number Diff line number Diff line change @@ -352,7 +352,7 @@ PHP_FUNCTION(jwt_encode)
352352 zend_string * key = NULL ;
353353 smart_str json_header = {0 }, json_claims = {0 }, segments = {0 };
354354
355- char * sig = NULL , * alg = NULL ;
355+ char * sig = NULL , * alg = "HS256" ;
356356 unsigned int sig_len ;
357357 size_t alg_len ;
358358 jwt_t * jwt = NULL ;
@@ -364,8 +364,7 @@ PHP_FUNCTION(jwt_encode)
364364 /* init jwt */
365365 jwt_new (& jwt );
366366
367- /* not set algorithm */
368- alg = (alg == NULL ) ? "HS256" : alg ;
367+ printf ("%s\n" , alg );
369368
370369 /* check algorithm */
371370 jwt -> alg = jwt_str_alg (alg );
Original file line number Diff line number Diff line change 11--TEST--
2- Check for jwt none algorithm
2+ Check for jwt NONE algorithm
33--SKIPIF--
44<?php if (!extension_loaded ("jwt " )) print "skip " ; ?>
55--FILE--
You can’t perform that action at this time.
0 commit comments