don't add digest alias if signature algorithm is undefined
authorDr. Stephen Henson <steve@openssl.org>
Sat, 6 Mar 2010 20:47:45 +0000 (20:47 +0000)
committerDr. Stephen Henson <steve@openssl.org>
Sat, 6 Mar 2010 20:47:45 +0000 (20:47 +0000)
crypto/evp/names.c

index 7e4d742a666892f31b550057708efc146a1e7dcf..f2869f5c7853bdf1f63f6bfa3b78a6ad25dfabf3 100644 (file)
@@ -86,7 +86,7 @@ int EVP_add_digest(const EVP_MD *md)
        r=OBJ_NAME_add(OBJ_nid2ln(md->type),OBJ_NAME_TYPE_MD_METH,(const char *)md);
        if (r == 0) return(0);
 
-       if (md->type != md->pkey_type)
+       if (md->pkey_type && md->type != md->pkey_type)
                {
                r=OBJ_NAME_add(OBJ_nid2sn(md->pkey_type),
                        OBJ_NAME_TYPE_MD_METH|OBJ_NAME_ALIAS,name);