summaryrefslogtreecommitdiffstats
path: root/crypto/asn1/ameth_lib.c
diff options
context:
space:
mode:
authorDr. Stephen Henson <steve@openssl.org>2006-03-20 17:56:05 +0000
committerDr. Stephen Henson <steve@openssl.org>2006-03-20 17:56:05 +0000
commit6f81892e6ba0bf0840d12e27f695817230dd42c1 (patch)
treec3d333fb4e22dbaa99408d60cbe4c0406ae0d4c8 /crypto/asn1/ameth_lib.c
parent448be743350791d32764fac38f5d3c8ffda481b2 (diff)
Transfer parameter handling and key comparison to algorithm methods.
Diffstat (limited to 'crypto/asn1/ameth_lib.c')
-rw-r--r--crypto/asn1/ameth_lib.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/crypto/asn1/ameth_lib.c b/crypto/asn1/ameth_lib.c
index ddb6333913..f2c4166f1d 100644
--- a/crypto/asn1/ameth_lib.c
+++ b/crypto/asn1/ameth_lib.c
@@ -64,6 +64,7 @@
extern const EVP_PKEY_ASN1_METHOD rsa_asn1_meths[];
extern const EVP_PKEY_ASN1_METHOD dsa_asn1_meths[];
+extern const EVP_PKEY_ASN1_METHOD dh_asn1_meth;
extern const EVP_PKEY_ASN1_METHOD eckey_asn1_meth;
/* Keep this sorted in type order !! */
@@ -71,6 +72,7 @@ const EVP_PKEY_ASN1_METHOD *standard_methods[] =
{
&rsa_asn1_meths[0],
&rsa_asn1_meths[1],
+ &dh_asn1_meth,
&dsa_asn1_meths[0],
&dsa_asn1_meths[1],
&dsa_asn1_meths[2],
@@ -86,14 +88,16 @@ void main()
for (i = 0;
i < sizeof(standard_methods)/sizeof(EVP_PKEY_ASN1_METHOD *);
i++)
- fprintf(stderr, "Number %d id=%d\n", i,
- standard_methods[i]->pkey_id);
+ fprintf(stderr, "Number %d id=%d (%s)\n", i,
+ standard_methods[i]->pkey_id,
+ OBJ_nid2sn(standard_methods[i]->pkey_id));
}
#endif
static int ameth_cmp(const EVP_PKEY_ASN1_METHOD * const *a,
const EVP_PKEY_ASN1_METHOD * const *b)
{
+/*fprintf(stderr, "Comparing %d with %d\n", (*a)->pkey_id, (*b)->pkey_id);*/
return ((*a)->pkey_id - (*b)->pkey_id);
}
@@ -106,6 +110,8 @@ const EVP_PKEY_ASN1_METHOD *EVP_PKEY_ASN1_find(int type)
sizeof(standard_methods)/sizeof(EVP_PKEY_ASN1_METHOD *),
sizeof(EVP_PKEY_ASN1_METHOD *),
(int (*)(const void *, const void *))ameth_cmp);
+ if (!ret || !*ret)
+ return NULL;
if ((*ret)->pkey_flags & ASN1_PKEY_ALIAS)
return EVP_PKEY_ASN1_find((*ret)->pkey_base_id);
return *ret;