From 47793328424b4d61956eb7c06d601680c233987d Mon Sep 17 00:00:00 2001
From: hangze <hangzegao@gmail.com>
Date: Thu, 3 Aug 2023 03:38:29 +0000
Subject: [PATCH] Fix EVP_PKEY_asn1_copy

Add the copy of the omitted ASN1 public key method and
other members.

Reviewed-by: Bernd Edlinger <bernd.edlinger@hotmail.de>
Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
(Merged from https://github.com/openssl/openssl/pull/21125)
---
 crypto/asn1/ameth_lib.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/crypto/asn1/ameth_lib.c b/crypto/asn1/ameth_lib.c
index 5e8c3ed1d5..228dbef40d 100644
--- a/crypto/asn1/ameth_lib.c
+++ b/crypto/asn1/ameth_lib.c
@@ -264,6 +264,7 @@ void EVP_PKEY_asn1_copy(EVP_PKEY_ASN1_METHOD *dst,
 
     dst->pkey_size = src->pkey_size;
     dst->pkey_bits = src->pkey_bits;
+    dst->pkey_security_bits = src->pkey_security_bits;
 
     dst->param_decode = src->param_decode;
     dst->param_encode = src->param_encode;
@@ -271,6 +272,7 @@ void EVP_PKEY_asn1_copy(EVP_PKEY_ASN1_METHOD *dst,
     dst->param_copy = src->param_copy;
     dst->param_cmp = src->param_cmp;
     dst->param_print = src->param_print;
+    dst->sig_print = src->sig_print;
 
     dst->pkey_free = src->pkey_free;
     dst->pkey_ctrl = src->pkey_ctrl;
@@ -281,6 +283,13 @@ void EVP_PKEY_asn1_copy(EVP_PKEY_ASN1_METHOD *dst,
     dst->siginf_set = src->siginf_set;
 
     dst->pkey_check = src->pkey_check;
+    dst->pkey_public_check = src->pkey_public_check;
+    dst->pkey_param_check = src->pkey_param_check;
+
+    dst->set_priv_key = src->set_priv_key;
+    dst->set_pub_key = src->set_pub_key;
+    dst->get_priv_key = src->get_priv_key;
+    dst->get_pub_key = src->get_pub_key;
 
 }
 
-- 
2.33.0

