mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-08-06 23:27:04 +02:00
CLEANUP: jwt: Remove the use of a trash buffer in jwt_jwsverify_rsa_ecdsa()
`trash` was completely unused within this function.
This commit is contained in:
parent
c87d3c21bf
commit
e0c1d749a8
10
src/jwt.c
10
src/jwt.c
@ -214,14 +214,9 @@ jwt_jwsverify_rsa_ecdsa(const struct jwt_ctx *ctx, const struct buffer *decoded_
|
|||||||
const EVP_MD *evp = NULL;
|
const EVP_MD *evp = NULL;
|
||||||
EVP_MD_CTX *evp_md_ctx;
|
EVP_MD_CTX *evp_md_ctx;
|
||||||
enum jwt_vrfy_status retval = JWT_VRFY_KO;
|
enum jwt_vrfy_status retval = JWT_VRFY_KO;
|
||||||
struct buffer *trash = NULL;
|
|
||||||
struct ebmb_node *eb;
|
struct ebmb_node *eb;
|
||||||
struct jwt_cert_tree_entry *entry = NULL;
|
struct jwt_cert_tree_entry *entry = NULL;
|
||||||
|
|
||||||
trash = alloc_trash_chunk();
|
|
||||||
if (!trash)
|
|
||||||
return JWT_VRFY_OUT_OF_MEMORY;
|
|
||||||
|
|
||||||
switch(ctx->alg) {
|
switch(ctx->alg) {
|
||||||
case JWS_ALG_RS256:
|
case JWS_ALG_RS256:
|
||||||
case JWS_ALG_ES256:
|
case JWS_ALG_ES256:
|
||||||
@ -239,10 +234,8 @@ jwt_jwsverify_rsa_ecdsa(const struct jwt_ctx *ctx, const struct buffer *decoded_
|
|||||||
}
|
}
|
||||||
|
|
||||||
evp_md_ctx = EVP_MD_CTX_new();
|
evp_md_ctx = EVP_MD_CTX_new();
|
||||||
if (!evp_md_ctx) {
|
if (!evp_md_ctx)
|
||||||
free_trash_chunk(trash);
|
|
||||||
return JWT_VRFY_OUT_OF_MEMORY;
|
return JWT_VRFY_OUT_OF_MEMORY;
|
||||||
}
|
|
||||||
|
|
||||||
eb = ebst_lookup(&jwt_cert_tree, ctx->key);
|
eb = ebst_lookup(&jwt_cert_tree, ctx->key);
|
||||||
|
|
||||||
@ -267,7 +260,6 @@ jwt_jwsverify_rsa_ecdsa(const struct jwt_ctx *ctx, const struct buffer *decoded_
|
|||||||
|
|
||||||
end:
|
end:
|
||||||
EVP_MD_CTX_free(evp_md_ctx);
|
EVP_MD_CTX_free(evp_md_ctx);
|
||||||
free_trash_chunk(trash);
|
|
||||||
return retval;
|
return retval;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user