]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
evp_kem_init(): Fix copy paste bug when checking decapsulate_init
authorWeixie Cui <cuiweixie@gmail.com>
Mon, 23 Feb 2026 14:26:17 +0000 (22:26 +0800)
committerTomas Mraz <tomas@openssl.org>
Wed, 25 Feb 2026 11:12:36 +0000 (12:12 +0100)
CLA: trivial

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Frederik Wedel-Heinen <fwh.openssl@gmail.com>
Reviewed-by: Eugene Syromiatnikov <esyr@openssl.org>
Reviewed-by: Paul Dale <paul.dale@oracle.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
MergeDate: Wed Feb 25 11:13:36 2026
(Merged from https://github.com/openssl/openssl/pull/30144)

crypto/evp/kem.c

index 6c36164760e3555b163be8d7fee6468883ed97c3..623da8f06fae03681f0ec289c1991424d8092296 100644 (file)
@@ -181,7 +181,7 @@ static int evp_kem_init(EVP_PKEY_CTX *ctx, int operation,
         if (provauthkey != NULL && kem->auth_decapsulate_init != NULL) {
             ret = kem->auth_decapsulate_init(ctx->op.encap.algctx, provkey,
                 provauthkey, params);
-        } else if (provauthkey == NULL && kem->encapsulate_init != NULL) {
+        } else if (provauthkey == NULL && kem->decapsulate_init != NULL) {
             ret = kem->decapsulate_init(ctx->op.encap.algctx, provkey, params);
         } else {
             ERR_raise(ERR_LIB_EVP, EVP_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE);