diff options
author | Dr. Stephen Henson <steve@openssl.org> | 2007-05-10 17:37:15 +0000 |
---|---|---|
committer | Dr. Stephen Henson <steve@openssl.org> | 2007-05-10 17:37:15 +0000 |
commit | 62178961456bae47fae35a3960b4d4d70995c9e3 (patch) | |
tree | 007c29fd1b14137a3a2a2f99f59cda3bbf34d384 /apps/smime.c | |
parent | ee7ca0941aa245f1f6b01fca03228aabb72c51cb (diff) |
Improve error detection when streaming S/MIME.
Only use streaming when appropriate for detached data in smime utility.
Diffstat (limited to 'apps/smime.c')
-rw-r--r-- | apps/smime.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/apps/smime.c b/apps/smime.c index a76e88d141..af2960685f 100644 --- a/apps/smime.c +++ b/apps/smime.c @@ -688,15 +688,22 @@ int MAIN(int argc, char **argv) else if (operation & SMIME_SIGNERS) { int i; - /* If detached data and SMIME output enable partial - * signing. + /* If detached data content we only enable streaming if + * S/MIME output format. */ if (operation == SMIME_SIGN) { - if (indef || (flags & PKCS7_DETACHED)) + if (flags & PKCS7_DETACHED) + { + if (outformat == FORMAT_SMIME) + flags |= PKCS7_STREAM; + } + else if (indef) flags |= PKCS7_STREAM; flags |= PKCS7_PARTIAL; p7 = PKCS7_sign(NULL, NULL, other, in, flags); + if (!p7) + goto end; } else flags |= PKCS7_REUSE_DIGEST; |