Fix from HEAD.

This commit is contained in:
Dr. Stephen Henson 2008-04-11 17:34:42 +00:00
parent 5ca48cc853
commit 339654e163
3 changed files with 18 additions and 15 deletions

View file

@ -890,7 +890,7 @@ int MAIN(int argc, char **argv)
}
if (!(flags & CMS_STREAM))
{
if (!CMS_final(cms, in, flags))
if (!CMS_final(cms, in, NULL, flags))
goto end;
}
}
@ -977,7 +977,7 @@ int MAIN(int argc, char **argv)
/* If not streaming or resigning finalize structure */
if ((operation == SMIME_SIGN) && !(flags & CMS_STREAM))
{
if (!CMS_final(cms, in, flags))
if (!CMS_final(cms, in, NULL, flags))
goto end;
}
}
@ -1027,7 +1027,7 @@ int MAIN(int argc, char **argv)
}
else if (operation == SMIME_UNCOMPRESS)
{
if (!CMS_uncompress(cms, indata, out, flags))
if (!CMS_uncompress(cms, out, indata, flags))
goto end;
}
else if (operation == SMIME_DIGEST_VERIFY)

View file

@ -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);

View file

@ -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);