Skip to content

Commit 2078f1d

Browse files
committed
test
1 parent c06f501 commit 2078f1d

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

jwt.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff 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);

tests/005.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
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--

0 commit comments

Comments
 (0)