]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
cipher_chacha20_poly1305.c: Remove unneeded check
authorNorbert Pocs <norbertp@openssl.org>
Wed, 14 May 2025 13:59:24 +0000 (15:59 +0200)
committerNeil Horman <nhorman@openssl.org>
Thu, 15 May 2025 19:38:10 +0000 (15:38 -0400)
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 <norbertp@openssl.org>
Reviewed-by: Saša Nedvědický <sashan@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/27623)

providers/implementations/ciphers/cipher_chacha20_poly1305.c.in

index 2b59dfd42319dda390e09e95b6be3954f126d9e5..8e32bf3fd9a7be064b8e57a06995bab5e638eb68 100644 (file)
@@ -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;
             }