diff options
author | Dr. Stephen Henson <steve@openssl.org> | 2008-04-11 17:34:42 +0000 |
---|---|---|
committer | Dr. Stephen Henson <steve@openssl.org> | 2008-04-11 17:34:42 +0000 |
commit | 339654e1631f5e0707db0ad3cbad8b4db02cf4f9 (patch) | |
tree | 1596c4a3c1caf35934e948a4ea97a97610ac3a33 /crypto/cms | |
parent | 5ca48cc853961f050ec844050333f75440927fd6 (diff) |
Fix from HEAD.
Diffstat (limited to 'crypto/cms')
-rw-r--r-- | crypto/cms/cms.h | 4 | ||||
-rw-r--r-- | crypto/cms/cms_smime.c | 23 |
2 files changed, 15 insertions, 12 deletions
diff --git a/crypto/cms/cms.h b/crypto/cms/cms.h index 0494170af8..0323de717f 100644 --- a/crypto/cms/cms.h +++ b/crypto/cms/cms.h @@ -130,7 +130,7 @@ int i2d_CMS_bio(BIO *bp, CMS_ContentInfo *cms); CMS_ContentInfo *SMIME_read_CMS(BIO *bio, BIO **bcont); int SMIME_write_CMS(BIO *bio, CMS_ContentInfo *cms, BIO *data, int flags); -int CMS_final(CMS_ContentInfo *cms, BIO *data, int flags); +int CMS_final(CMS_ContentInfo *cms, BIO *data, BIO *dcont, unsigned int flags); CMS_ContentInfo *CMS_sign(X509 *signcert, EVP_PKEY *pkey, STACK_OF(X509) *certs, BIO *data, unsigned int flags); @@ -216,7 +216,7 @@ int CMS_RecipientInfo_kekri_id_cmp(CMS_RecipientInfo *ri, int CMS_RecipientInfo_decrypt(CMS_ContentInfo *cms, CMS_RecipientInfo *ri); -int CMS_uncompress(CMS_ContentInfo *cms, BIO *dcont, BIO *out, +int CMS_uncompress(CMS_ContentInfo *cms, BIO *out, BIO *dcont, unsigned int flags); CMS_ContentInfo *CMS_compress(BIO *in, int comp_nid, unsigned int flags); diff --git a/crypto/cms/cms_smime.c b/crypto/cms/cms_smime.c index 06dd8995ec..a529feb30e 100644 --- a/crypto/cms/cms_smime.c +++ b/crypto/cms/cms_smime.c @@ -149,7 +149,7 @@ CMS_ContentInfo *CMS_data_create(BIO *in, unsigned int flags) if (!cms) return NULL; - if (CMS_final(cms, in, flags)) + if (CMS_final(cms, in, NULL, flags)) return cms; CMS_ContentInfo_free(cms); @@ -197,7 +197,7 @@ CMS_ContentInfo *CMS_digest_create(BIO *in, const EVP_MD *md, CMS_set_detached(cms, 0); } - if ((flags & CMS_STREAM) || CMS_final(cms, in, flags)) + if ((flags & CMS_STREAM) || CMS_final(cms, in, NULL, flags)) return cms; CMS_ContentInfo_free(cms); @@ -252,7 +252,8 @@ CMS_ContentInfo *CMS_EncryptedData_encrypt(BIO *in, const EVP_CIPHER *cipher, CMS_set_detached(cms, 0); } - if ((flags & (CMS_STREAM|CMS_PARTIAL)) || CMS_final(cms, in, flags)) + if ((flags & (CMS_STREAM|CMS_PARTIAL)) + || CMS_final(cms, in, NULL, flags)) return cms; CMS_ContentInfo_free(cms); @@ -467,7 +468,8 @@ CMS_ContentInfo *CMS_sign(X509 *signcert, EVP_PKEY *pkey, STACK_OF(X509) *certs, CMS_set_detached(cms, 0); } - if ((flags & (CMS_STREAM|CMS_PARTIAL)) || CMS_final(cms, data, flags)) + if ((flags & (CMS_STREAM|CMS_PARTIAL)) + || CMS_final(cms, data, NULL, flags)) return cms; else goto err; @@ -534,7 +536,7 @@ CMS_ContentInfo *CMS_sign_receipt(CMS_SignerInfo *si, goto err; /* Finalize structure */ - if (!CMS_final(cms, rct_cont, flags)) + if (!CMS_final(cms, rct_cont, NULL, flags)) goto err; /* Set embedded content */ @@ -578,7 +580,8 @@ CMS_ContentInfo *CMS_encrypt(STACK_OF(X509) *certs, BIO *data, CMS_set_detached(cms, 0); } - if ((flags & (CMS_STREAM|CMS_PARTIAL)) || CMS_final(cms, data, flags)) + if ((flags & (CMS_STREAM|CMS_PARTIAL)) + || CMS_final(cms, data, NULL, flags)) return cms; else goto err; @@ -690,11 +693,11 @@ int CMS_decrypt(CMS_ContentInfo *cms, EVP_PKEY *pk, X509 *cert, return r; } -int CMS_final(CMS_ContentInfo *cms, BIO *data, int flags) +int CMS_final(CMS_ContentInfo *cms, BIO *data, BIO *dcont, unsigned int flags) { BIO *cmsbio; int ret = 0; - if (!(cmsbio = CMS_dataInit(cms, NULL))) + if (!(cmsbio = CMS_dataInit(cms, dcont))) { CMSerr(CMS_F_CMS_FINAL,ERR_R_MALLOC_FAILURE); return 0; @@ -722,7 +725,7 @@ int CMS_final(CMS_ContentInfo *cms, BIO *data, int flags) #ifdef ZLIB -int CMS_uncompress(CMS_ContentInfo *cms, BIO *dcont, BIO *out, +int CMS_uncompress(CMS_ContentInfo *cms, BIO *out, BIO *dcont, unsigned int flags) { BIO *cont; @@ -760,7 +763,7 @@ CMS_ContentInfo *CMS_compress(BIO *in, int comp_nid, unsigned int flags) CMS_set_detached(cms, 0); } - if (CMS_final(cms, in, flags)) + if (CMS_final(cms, in, NULL, flags)) return cms; CMS_ContentInfo_free(cms); |