update pkey method initialisation and copy
authorDr. Stephen Henson <steve@openssl.org>
Tue, 11 Oct 2011 18:15:31 +0000 (18:15 +0000)
committerDr. Stephen Henson <steve@openssl.org>
Tue, 11 Oct 2011 18:15:31 +0000 (18:15 +0000)
crypto/asn1/ameth_lib.c
crypto/evp/pmeth_lib.c

index b5854f101a43f1aeccde0ce6f147501d21132e69..a19e058fca693f429868bd3e5d9be5ecec133fac 100644 (file)
@@ -293,6 +293,8 @@ EVP_PKEY_ASN1_METHOD* EVP_PKEY_asn1_new(int id, int flags,
        if (!ameth)
                return NULL;
 
+       memset(ameth, 0, sizeof(EVP_PKEY_ASN1_METHOD));
+
        ameth->pkey_id = id;
        ameth->pkey_base_id = id;
        ameth->pkey_flags = flags | ASN1_PKEY_DYNAMIC;
@@ -327,6 +329,9 @@ EVP_PKEY_ASN1_METHOD* EVP_PKEY_asn1_new(int id, int flags,
        ameth->old_priv_encode = 0;
        ameth->old_priv_decode = 0;
 
+       ameth->item_verify = 0;
+       ameth->item_sign = 0;
+
        ameth->pkey_size = 0;
        ameth->pkey_bits = 0;
 
@@ -378,6 +383,9 @@ void EVP_PKEY_asn1_copy(EVP_PKEY_ASN1_METHOD *dst,
        dst->pkey_free = src->pkey_free;
        dst->pkey_ctrl = src->pkey_ctrl;
 
+       dst->item_sign = src->item_sign;
+       dst->item_verify = src->item_verify;
+
        }
 
 void EVP_PKEY_asn1_free(EVP_PKEY_ASN1_METHOD *ameth)
index 9820f69b04905dfe941b2e546571cf0427505cef..acfa7b6f873d48fba49d22ea2a8b66b0530989cb 100644 (file)
@@ -204,6 +204,8 @@ EVP_PKEY_METHOD* EVP_PKEY_meth_new(int id, int flags)
        if (!pmeth)
                return NULL;
 
+       memset(pmeth, 0, sizeof(EVP_PKEY_METHOD));
+
        pmeth->pkey_id = id;
        pmeth->flags = flags | EVP_PKEY_FLAG_DYNAMIC;