Module: kamailio
Branch: master
Commit: 76b250c8b4c2b5bd81b5e776e9e726350bb65b7b
URL:
https://github.com/kamailio/kamailio/commit/76b250c8b4c2b5bd81b5e776e9e7263…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2024-11-14T09:57:52+01:00
jwt: use JWT_VALIDATION_SUCCESS for validate check
---
Modified: src/modules/jwt/jwt_mod.c
---
Diff:
https://github.com/kamailio/kamailio/commit/76b250c8b4c2b5bd81b5e776e9e7263…
Patch:
https://github.com/kamailio/kamailio/commit/76b250c8b4c2b5bd81b5e776e9e7263…
---
diff --git a/src/modules/jwt/jwt_mod.c b/src/modules/jwt/jwt_mod.c
index af3d42f79c5..90d8fa5bd03 100644
--- a/src/modules/jwt/jwt_mod.c
+++ b/src/modules/jwt/jwt_mod.c
@@ -437,6 +437,7 @@ static int ki_jwt_verify_key(
jwt_valid_t *jwt_valid = NULL;
str sparams = STR_NULL;
long lval = 0;
+ unsigned int jwtret = 0;
if(key == NULL || key->s == NULL || alg == NULL || alg->s == NULL
|| claims == NULL || claims->s == NULL || claims->len <= 0
@@ -501,9 +502,10 @@ static int ki_jwt_verify_key(
LM_ERR("failed to decode jwt value (ret: %d jwt: %p)\n", ret, jwt);
goto error;
}
- if(jwt_validate(jwt, jwt_valid) != 0) {
+ if((jwtret = jwt_validate(jwt, jwt_valid)) != JWT_VALIDATION_SUCCESS) {
_jwt_verify_status = jwt_valid_get_status(jwt_valid);
- LM_ERR("failed to validate jwt: %08x\n", _jwt_verify_status);
+ LM_ERR("failed to validate jwt: %08x (ret: %08x)\n", _jwt_verify_status,
+ jwtret);
goto error;
}