1
0
Fork 0
mirror of https://github.com/warmcat/libwebsockets.git synced 2025-03-09 00:00:04 +01:00

jose: copy typ into jose object without testing for JWT

This commit is contained in:
Andy Green 2020-02-28 17:41:20 +00:00
parent 9adc64114b
commit 94d488d2d5
2 changed files with 4 additions and 2 deletions

View file

@ -119,6 +119,8 @@ struct lws_jose {
struct lws_jws_recpient recipient[LWS_JWS_MAX_RECIPIENTS];
char typ[32];
/* information from the protected header part */
const struct lws_jose_jwe_alg *alg;
const struct lws_jose_jwe_alg *enc_alg;

View file

@ -228,8 +228,8 @@ lws_jws_jose_cb(struct lejp_ctx *ctx, char reason)
return 0;
case LJJHI_TYP: /* Optional: string: media type */
if (strcmp(ctx->buf, "JWT"))
return -1;
lws_strnncpy(args->jose->typ, ctx->buf, ctx->npos,
sizeof(args->jose->typ));
break;
case LJJHI_JKU: /* Optional: string */