From: Dr. Stephen Henson Date: Sun, 9 Jul 2006 12:02:08 +0000 (+0000) Subject: Set detached flag in PKCS7 structure earlier to avoid eating up memory. X-Git-Tag: OpenSSL_0_9_8k^2~1208 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=067707e3673c78aa369ab84445c625719557cf8c;p=oweals%2Fopenssl.git Set detached flag in PKCS7 structure earlier to avoid eating up memory. PR: 1071 --- diff --git a/crypto/pkcs7/pk7_smime.c b/crypto/pkcs7/pk7_smime.c index f8e3682aa9..718f0db0ef 100644 --- a/crypto/pkcs7/pk7_smime.c +++ b/crypto/pkcs7/pk7_smime.c @@ -98,6 +98,9 @@ PKCS7 *PKCS7_sign(X509 *signcert, EVP_PKEY *pkey, STACK_OF(X509) *certs, } } + if(flags & PKCS7_DETACHED) + PKCS7_set_detached(p7, 1); + if (flags & (PKCS7_STREAM|PKCS7_PARTIAL)) return p7; @@ -123,8 +126,6 @@ int PKCS7_final(PKCS7 *p7, BIO *data, int flags) BIO_flush(p7bio); - if(PKCS7_type_is_signed(p7) && (flags & PKCS7_DETACHED)) - PKCS7_set_detached(p7, 1); if (!PKCS7_dataFinal(p7,p7bio)) {