diff options
author | Dr. Stephen Henson <steve@openssl.org> | 2007-11-21 18:25:58 +0100 |
---|---|---|
committer | Dr. Stephen Henson <steve@openssl.org> | 2007-11-21 18:25:58 +0100 |
commit | 2f0550c4c1b622540091368eabada3f5e4549976 (patch) | |
tree | 3891fa284942ec541c74c4be8117fb5455d9171e /crypto/asn1/ameth_lib.c | |
parent | Submitted by: "Victor B. Wagner" <vitus@cryptocom.ru> (diff) | |
download | openssl-2f0550c4c1b622540091368eabada3f5e4549976.tar.xz openssl-2f0550c4c1b622540091368eabada3f5e4549976.zip |
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.c | 23 |
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; |