From: Aki Tuomi Date: Mon, 8 May 2023 05:23:39 +0000 (+0300) Subject: lib-oauth2: Remove typ check X-Git-Tag: 2.4.0~2768 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=386848ec8e1a80f7687d39151360b91d8e8f1b8d;p=thirdparty%2Fdovecot%2Fcore.git lib-oauth2: Remove typ check It is not really useful. And mostly just keeps breaking when people invent new kty values. --- diff --git a/src/lib-oauth2/oauth2-jwt.c b/src/lib-oauth2/oauth2-jwt.c index 0068dd3e96..bb7c8e763a 100644 --- a/src/lib-oauth2/oauth2-jwt.c +++ b/src/lib-oauth2/oauth2-jwt.c @@ -337,15 +337,9 @@ static int oauth2_jwt_header_process(struct json_tree *tree, const char **alg_r, const char **kid_r, const char **error_r) { - const char *typ = get_field(tree, "typ", NULL); const char *alg = get_field(tree, "alg", NULL); const char *kid = get_field(tree, "kid", NULL); - if (typ != NULL && strcasecmp(typ, "JWT") != 0) { - *error_r = t_strdup_printf("Unsupported typ value '%s'", typ); - return -1; - } - if (alg == NULL) { *error_r = "Cannot find 'alg' field"; return -1;