summaryrefslogtreecommitdiffstats
path: root/crypto/asn1/ameth_lib.c
diff options
context:
space:
mode:
authorDr. Stephen Henson <steve@openssl.org>2007-11-21 17:25:58 +0000
committerDr. Stephen Henson <steve@openssl.org>2007-11-21 17:25:58 +0000
commit2f0550c4c1b622540091368eabada3f5e4549976 (patch)
tree3891fa284942ec541c74c4be8117fb5455d9171e /crypto/asn1/ameth_lib.c
parent98057eba7794790f6de51da83f3c9ed8faf3279b (diff)
Lookup public key ASN1 methods by string by iterating through all
implementations instead of all added ENGINEs to cover case where an ENGINE is not added.
Diffstat (limited to 'crypto/asn1/ameth_lib.c')
-rw-r--r--crypto/asn1/ameth_lib.c23
1 files changed, 10 insertions, 13 deletions
diff --git a/crypto/asn1/ameth_lib.c b/crypto/asn1/ameth_lib.c
index 7c385f6dd3..cfaef87555 100644
--- a/crypto/asn1/ameth_lib.c
+++ b/crypto/asn1/ameth_lib.c
@@ -203,20 +203,17 @@ const EVP_PKEY_ASN1_METHOD *EVP_PKEY_asn1_find_str(ENGINE **pe,
{
#ifndef OPENSSL_NO_ENGINE
ENGINE *e;
- for (e = ENGINE_get_first(); e; e = ENGINE_get_next(e))
+ ameth = ENGINE_pkey_asn1_find_str(&e, str, len);
+ if (ameth)
{
- ameth = ENGINE_get_pkey_asn1_meth_str(e, str, len);
- if (ameth)
- {
- /* Convert structural into
- * functional reference
- */
- if (!ENGINE_init(e))
- ameth = NULL;
- ENGINE_free(e);
- *pe = e;
- return ameth;
- }
+ /* Convert structural into
+ * functional reference
+ */
+ if (!ENGINE_init(e))
+ ameth = NULL;
+ ENGINE_free(e);
+ *pe = e;
+ return ameth;
}
#endif
*pe = NULL;