summaryrefslogtreecommitdiffstats
path: root/crypto/pkcs7
diff options
context:
space:
mode:
authorDr. Stephen Henson <steve@openssl.org>2004-03-26 00:24:38 +0000
committerDr. Stephen Henson <steve@openssl.org>2004-03-26 00:24:38 +0000
commitbeedea2fefcb085250389f2987b52fe3e0e4975c (patch)
treea9c3e90c76b285c06c1694a36112f924044a92ae /crypto/pkcs7
parent34be34fdd0f46d762ec51f698d76a219396fb3f6 (diff)
Free up BIO properly when using streaming S/MIME sign.
Diffstat (limited to 'crypto/pkcs7')
-rw-r--r--crypto/pkcs7/pk7_mime.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/crypto/pkcs7/pk7_mime.c b/crypto/pkcs7/pk7_mime.c
index 1823418465..210ec1e8c4 100644
--- a/crypto/pkcs7/pk7_mime.c
+++ b/crypto/pkcs7/pk7_mime.c
@@ -239,14 +239,13 @@ static int pkcs7_output_data(BIO *out, BIO *data, PKCS7 *p7, int flags)
/* Finalize signatures */
PKCS7_dataFinal(p7, p7bio);
- /* Now remove any digests from output BIO */
+ /* Now remove any digests prepended to the BIO */
- while (1)
+ while (p7bio != out)
{
tmpbio = BIO_pop(p7bio);
- if (tmpbio == out)
- break;
- BIO_free(tmpbio);
+ BIO_free(p7bio);
+ p7bio = tmpbio;
}
return 1;