From: Norbert Pocs Date: Wed, 14 May 2025 13:59:24 +0000 (+0200) Subject: cipher_chacha20_poly1305.c: Remove unneeded check X-Git-Tag: openssl-3.6.0-alpha1~741 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1e27fb5d5b1258605315aeea2236649432b7a522;p=thirdparty%2Fopenssl.git cipher_chacha20_poly1305.c: Remove unneeded check This iterates through the given param list which means the param p should always be present in the given array. Resolves coverity scan issue 1646880. Signed-off-by: Norbert Pocs Reviewed-by: Saša Nedvědický Reviewed-by: Neil Horman Reviewed-by: Tomas Mraz (Merged from https://github.com/openssl/openssl/pull/27623) --- diff --git a/providers/implementations/ciphers/cipher_chacha20_poly1305.c.in b/providers/implementations/ciphers/cipher_chacha20_poly1305.c.in index 2b59dfd4231..8e32bf3fd9a 100644 --- a/providers/implementations/ciphers/cipher_chacha20_poly1305.c.in +++ b/providers/implementations/ciphers/cipher_chacha20_poly1305.c.in @@ -128,7 +128,7 @@ static int chacha20_poly1305_get_ctx_params(void *vctx, OSSL_PARAM params[]) break; case PIDX_CIPHER_PARAM_AEAD_TAGLEN: - if (p != NULL && !OSSL_PARAM_set_size_t(p, ctx->tag_len)) { + if (!OSSL_PARAM_set_size_t(p, ctx->tag_len)) { ERR_raise(ERR_LIB_PROV, PROV_R_FAILED_TO_SET_PARAMETER); return 0; }