summaryrefslogtreecommitdiffstats
path: root/crypto/asn1/ameth_lib.c
diff options
context:
space:
mode:
authorDr. Stephen Henson <steve@openssl.org>2007-05-15 23:52:03 +0000
committerDr. Stephen Henson <steve@openssl.org>2007-05-15 23:52:03 +0000
commite69adea53921cac7a7a012cade24cce228a310a5 (patch)
treeb4720b439776fb071d1d1d2c8b23c5403b27e315 /crypto/asn1/ameth_lib.c
parent9660cbcd6b5981f631d10dad6a55008306e5c20b (diff)
New function EVP_PKEY_asn1_copy(). Use default MD if type param is NULL.
Diffstat (limited to 'crypto/asn1/ameth_lib.c')
-rw-r--r--crypto/asn1/ameth_lib.c33
1 files changed, 32 insertions, 1 deletions
diff --git a/crypto/asn1/ameth_lib.c b/crypto/asn1/ameth_lib.c
index 92e8d59ca6..13129bcd7f 100644
--- a/crypto/asn1/ameth_lib.c
+++ b/crypto/asn1/ameth_lib.c
@@ -301,7 +301,7 @@ EVP_PKEY_ASN1_METHOD* EVP_PKEY_asn1_new(int id, int flags,
if (!ameth->pem_str)
goto err;
}
-
+
ameth->pub_decode = 0;
ameth->pub_encode = 0;
ameth->pub_cmp = 0;
@@ -336,6 +336,37 @@ EVP_PKEY_ASN1_METHOD* EVP_PKEY_asn1_new(int id, int flags,
}
+void EVP_PKEY_asn1_copy(EVP_PKEY_ASN1_METHOD *dst,
+ const EVP_PKEY_ASN1_METHOD *src)
+ {
+
+ dst->pub_decode = src->pub_decode;
+ dst->pub_encode = src->pub_encode;
+ dst->pub_cmp = src->pub_cmp;
+ dst->pub_print = src->pub_print;
+
+ dst->priv_decode = src->priv_decode;
+ dst->priv_encode = src->priv_encode;
+ dst->priv_print = src->priv_print;
+
+ dst->old_priv_encode = src->old_priv_encode;
+ dst->old_priv_decode = src->old_priv_decode;
+
+ dst->pkey_size = src->pkey_size;
+ dst->pkey_bits = src->pkey_bits;
+
+ dst->param_decode = src->param_decode;
+ dst->param_encode = src->param_encode;
+ dst->param_missing = src->param_missing;
+ dst->param_copy = src->param_copy;
+ dst->param_cmp = src->param_cmp;
+ dst->param_print = src->param_print;
+
+ dst->pkey_free = src->pkey_free;
+ dst->pkey_ctrl = src->pkey_ctrl;
+
+ }
+
void EVP_PKEY_asn1_free(EVP_PKEY_ASN1_METHOD *ameth)
{
if (ameth && (ameth->pkey_flags & ASN1_PKEY_DYNAMIC))