From: Dr. Stephen Henson Date: Fri, 21 Nov 2008 18:18:13 +0000 (+0000) Subject: Set memory BIOs up properly when stripping text headers from S/MIME messages. X-Git-Tag: OpenSSL_0_9_8k^2~147 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=d0c36288341ca75328eeb4cc33bce6a7d3f65c51;p=oweals%2Fopenssl.git Set memory BIOs up properly when stripping text headers from S/MIME messages. --- diff --git a/crypto/cms/cms_smime.c b/crypto/cms/cms_smime.c index dec8ef32f8..f754b3ce4f 100644 --- a/crypto/cms/cms_smime.c +++ b/crypto/cms/cms_smime.c @@ -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; diff --git a/crypto/pkcs7/pk7_smime.c b/crypto/pkcs7/pk7_smime.c index ffde1dba59..a577141d3b 100644 --- a/crypto/pkcs7/pk7_smime.c +++ b/crypto/pkcs7/pk7_smime.c @@ -380,6 +380,7 @@ int PKCS7_verify(PKCS7 *p7, STACK_OF(X509) *certs, X509_STORE *store, PKCS7err(PKCS7_F_PKCS7_VERIFY,ERR_R_MALLOC_FAILURE); goto err; } + BIO_set_mem_eof_return(tmpout, 0); } else tmpout = out; /* We now have to 'read' from p7bio to calculate digests etc. */