Harmonize Tru64 and Linux make rules.
[oweals/openssl.git] / crypto / rsa / rsa_ameth.c
index db926b0e4260a8f67959c4502c37dd7002bf11ae..41bacc874792c362c172fdea558b795c6c2e893a 100644 (file)
@@ -370,7 +370,7 @@ static int rsa_pss_param_print(BIO *bp, RSA_PSS_PARAMS *pss,
                if (i2a_ASN1_INTEGER(bp, pss->saltLength) <= 0)
                        goto err;
                }
-       else if (BIO_puts(bp, "0x14 (default)") <= 0)
+       else if (BIO_puts(bp, "14 (default)") <= 0)
                goto err;
        BIO_puts(bp, "\n");
 
@@ -455,7 +455,7 @@ static int rsa_pkey_ctrl(EVP_PKEY *pkey, int op, long arg1, void *arg2)
 #endif
 
                case ASN1_PKEY_CTRL_DEFAULT_MD_NID:
-               *(int *)arg2 = NID_sha1;
+               *(int *)arg2 = NID_sha256;
                return 1;
 
                default:
@@ -700,7 +700,7 @@ static int rsa_pss_to_ctx(EVP_MD_CTX *ctx, EVP_PKEY_CTX *pkctx,
 
 static int rsa_cms_verify(CMS_SignerInfo *si)
        {
-       int nid;
+       int nid, nid2;
        X509_ALGOR *alg;
        EVP_PKEY_CTX *pkctx = CMS_SignerInfo_get0_pkey_ctx(si);
        CMS_SignerInfo_get0_algs(si, NULL, NULL, NULL, &alg);
@@ -709,6 +709,12 @@ static int rsa_cms_verify(CMS_SignerInfo *si)
                return 1;
        if (nid == NID_rsassaPss)
                return rsa_pss_to_ctx(NULL, pkctx, alg, NULL);
+       /* Workaround for some implementation that use a signature OID */
+       if (OBJ_find_sigid_algs(nid, NULL, &nid2))
+               {
+               if (nid2 == NID_rsaEncryption)
+                       return 1;
+               }
        return 0;
        }