]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
dh_cms_set_peerkey(): Fix the incorrect condition
authorShakti Shah <shaktishah33@gmail.com>
Mon, 25 Nov 2024 15:16:45 +0000 (20:46 +0530)
committerTomas Mraz <tomas@openssl.org>
Wed, 11 Dec 2024 17:13:52 +0000 (18:13 +0100)
Only absent parameters allowed in RFC 3370.

Fixes #25824

Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26058)

(cherry picked from commit 02e72ccffacf2d01295810798ca1c86a438ee712)

crypto/cms/cms_dh.c

index 2f54ed2673a9881e33830af334465403019da888..3f931d6e6fef327b2e5a45573ffa9fb6599d5e8a 100644 (file)
@@ -34,7 +34,7 @@ static int dh_cms_set_peerkey(EVP_PKEY_CTX *pctx,
     if (OBJ_obj2nid(aoid) != NID_dhpublicnumber)
         goto err;
     /* Only absent parameters allowed in RFC XXXX */
-    if (atype != V_ASN1_UNDEF && atype == V_ASN1_NULL)
+    if (atype != V_ASN1_UNDEF && atype != V_ASN1_NULL)
         goto err;
 
     pk = EVP_PKEY_CTX_get0_pkey(pctx);