The branch master has been updated
       via  5eb774324a14b03835020bb3ae2e1c6c92515db0 (commit)
      from  5f49783c12e9e6100075e50fe727ee2d5cc30445 (commit)


- Log -----------------------------------------------------------------
commit 5eb774324a14b03835020bb3ae2e1c6c92515db0
Author: Richard Levitte <[email protected]>
Date:   Thu May 31 11:12:34 2018 +0200

    ENGINE_pkey_asn1_find_str(): don't assume an engine implements ASN1 method
    
    Just because an engine implements algorithm methods, that doesn't mean
    it also implements the ASN1 method.  Therefore, be careful when looking
    for an ASN1 method among all engines, don't try to use one that doesn't
    exist.
    
    Fixes #6381
    
    Reviewed-by: Tim Hudson <[email protected]>
    (Merged from https://github.com/openssl/openssl/pull/6383)
    
    (cherry picked from commit 1ac3cd6277f880fac4df313702d5e3b3814e56e2)
    (cherry picked from commit 13b578ada3106a4ce9b836f167ee520539f5fa8f)

-----------------------------------------------------------------------

Summary of changes:
 crypto/engine/tb_asnmth.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/crypto/engine/tb_asnmth.c b/crypto/engine/tb_asnmth.c
index bc6e91c..ae99a37 100644
--- a/crypto/engine/tb_asnmth.c
+++ b/crypto/engine/tb_asnmth.c
@@ -171,7 +171,8 @@ static void look_str_cb(int nid, STACK_OF(ENGINE) *sk, 
ENGINE *def, void *arg)
         ENGINE *e = sk_ENGINE_value(sk, i);
         EVP_PKEY_ASN1_METHOD *ameth;
         e->pkey_asn1_meths(e, &ameth, NULL, nid);
-        if (((int)strlen(ameth->pem_str) == lk->len)
+        if (ameth != NULL
+                && ((int)strlen(ameth->pem_str) == lk->len)
                 && strncasecmp(ameth->pem_str, lk->str, lk->len) == 0) {
             lk->e = e;
             lk->ameth = ameth;
_____
openssl-commits mailing list
To unsubscribe: https://mta.openssl.org/mailman/listinfo/openssl-commits

Reply via email to