Fix from stable branch.
[openssl.git] / crypto / cms / cms_smime.c
index dec8ef32f87d76df48866807bf01a9150fc4c6d7..faa9c1d1d79db77fe9bdd11e82f933a06a4c5b5c 100644 (file)
@@ -68,7 +68,10 @@ static int cms_copy_content(BIO *out, BIO *in, unsigned int flags)
        if (out == NULL)
                tmpout = BIO_new(BIO_s_null());
        else if (flags & CMS_TEXT)
+               {
                tmpout = BIO_new(BIO_s_mem());
+               BIO_set_mem_eof_return(tmpout, 0);
+               }
        else
                tmpout = out;
 
@@ -289,7 +292,7 @@ static int cms_signerinfo_verify_cert(CMS_SignerInfo *si,
                                                CMS_R_STORE_INIT_ERROR);
                goto err;
                }
-       X509_STORE_CTX_set_purpose(&ctx, X509_PURPOSE_SMIME_SIGN);
+       X509_STORE_CTX_set_default(&cert_ctx, "smime_sign");
        if (crls)
                X509_STORE_CTX_set0_crls(&ctx, crls);