Index: openssl/crypto/cms/cms_smime.c |
=================================================================== |
--- openssl/crypto/cms/cms_smime.c (revision 105093) |
+++ openssl/crypto/cms/cms_smime.c (working copy) |
@@ -171,7 +171,7 @@ |
if (!cms) |
return NULL; |
- if (CMS_final(cms, in, NULL, flags)) |
+ if ((flags & CMS_STREAM) || CMS_final(cms, in, NULL, flags)) |
return cms; |
CMS_ContentInfo_free(cms); |
@@ -214,10 +214,7 @@ |
return NULL; |
if(!(flags & CMS_DETACHED)) |
- { |
- flags &= ~CMS_STREAM; |
CMS_set_detached(cms, 0); |
- } |
if ((flags & CMS_STREAM) || CMS_final(cms, in, NULL, flags)) |
return cms; |
@@ -269,10 +266,7 @@ |
return NULL; |
if(!(flags & CMS_DETACHED)) |
- { |
- flags &= ~CMS_STREAM; |
CMS_set_detached(cms, 0); |
- } |
if ((flags & (CMS_STREAM|CMS_PARTIAL)) |
|| CMS_final(cms, in, NULL, flags)) |
@@ -456,6 +450,7 @@ |
X509_STORE *store, unsigned int flags) |
{ |
int r; |
+ flags &= ~(CMS_DETACHED|CMS_TEXT); |
r = CMS_verify(rcms, certs, store, NULL, NULL, flags); |
if (r <= 0) |
return r; |
@@ -486,10 +481,7 @@ |
} |
if(!(flags & CMS_DETACHED)) |
- { |
- flags &= ~CMS_STREAM; |
CMS_set_detached(cms, 0); |
- } |
if ((flags & (CMS_STREAM|CMS_PARTIAL)) |
|| CMS_final(cms, data, NULL, flags)) |
@@ -517,7 +509,7 @@ |
BIO *rct_cont = NULL; |
int r = 0; |
- flags &= ~CMS_STREAM; |
+ flags &= ~(CMS_STREAM|CMS_TEXT); |
/* Not really detached but avoids content being allocated */ |
flags |= CMS_PARTIAL|CMS_BINARY|CMS_DETACHED; |
if (!pkey || !signcert) |
@@ -598,10 +590,7 @@ |
} |
if(!(flags & CMS_DETACHED)) |
- { |
- flags &= ~CMS_STREAM; |
CMS_set_detached(cms, 0); |
- } |
if ((flags & (CMS_STREAM|CMS_PARTIAL)) |
|| CMS_final(cms, data, NULL, flags)) |
@@ -781,12 +770,9 @@ |
return NULL; |
if(!(flags & CMS_DETACHED)) |
- { |
- flags &= ~CMS_STREAM; |
CMS_set_detached(cms, 0); |
- } |
- if (CMS_final(cms, in, NULL, flags)) |
+ if ((flags & CMS_STREAM) || CMS_final(cms, in, NULL, flags)) |
return cms; |
CMS_ContentInfo_free(cms); |