diff options
Diffstat (limited to 'src/lib/libcrypto/cms')
| -rw-r--r-- | src/lib/libcrypto/cms/cms_sd.c | 2 | ||||
| -rw-r--r-- | src/lib/libcrypto/cms/cms_smime.c | 9 |
2 files changed, 8 insertions, 3 deletions
diff --git a/src/lib/libcrypto/cms/cms_sd.c b/src/lib/libcrypto/cms/cms_sd.c index 591bfbec33..cdac3b870d 100644 --- a/src/lib/libcrypto/cms/cms_sd.c +++ b/src/lib/libcrypto/cms/cms_sd.c | |||
| @@ -830,7 +830,7 @@ int CMS_SignerInfo_verify(CMS_SignerInfo *si) | |||
| 830 | cms_fixup_mctx(&mctx, si->pkey); | 830 | cms_fixup_mctx(&mctx, si->pkey); |
| 831 | r = EVP_VerifyFinal(&mctx, | 831 | r = EVP_VerifyFinal(&mctx, |
| 832 | si->signature->data, si->signature->length, si->pkey); | 832 | si->signature->data, si->signature->length, si->pkey); |
| 833 | if (!r) | 833 | if (r <= 0) |
| 834 | CMSerr(CMS_F_CMS_SIGNERINFO_VERIFY, CMS_R_VERIFICATION_FAILURE); | 834 | CMSerr(CMS_F_CMS_SIGNERINFO_VERIFY, CMS_R_VERIFICATION_FAILURE); |
| 835 | err: | 835 | err: |
| 836 | EVP_MD_CTX_cleanup(&mctx); | 836 | EVP_MD_CTX_cleanup(&mctx); |
diff --git a/src/lib/libcrypto/cms/cms_smime.c b/src/lib/libcrypto/cms/cms_smime.c index f79c504e91..b9463f9abb 100644 --- a/src/lib/libcrypto/cms/cms_smime.c +++ b/src/lib/libcrypto/cms/cms_smime.c | |||
| @@ -68,7 +68,10 @@ static int cms_copy_content(BIO *out, BIO *in, unsigned int flags) | |||
| 68 | if (out == NULL) | 68 | if (out == NULL) |
| 69 | tmpout = BIO_new(BIO_s_null()); | 69 | tmpout = BIO_new(BIO_s_null()); |
| 70 | else if (flags & CMS_TEXT) | 70 | else if (flags & CMS_TEXT) |
| 71 | { | ||
| 71 | tmpout = BIO_new(BIO_s_mem()); | 72 | tmpout = BIO_new(BIO_s_mem()); |
| 73 | BIO_set_mem_eof_return(tmpout, 0); | ||
| 74 | } | ||
| 72 | else | 75 | else |
| 73 | tmpout = out; | 76 | tmpout = out; |
| 74 | 77 | ||
| @@ -89,11 +92,13 @@ static int cms_copy_content(BIO *out, BIO *in, unsigned int flags) | |||
| 89 | if (!BIO_get_cipher_status(in)) | 92 | if (!BIO_get_cipher_status(in)) |
| 90 | goto err; | 93 | goto err; |
| 91 | } | 94 | } |
| 95 | if (i < 0) | ||
| 96 | goto err; | ||
| 92 | break; | 97 | break; |
| 93 | } | 98 | } |
| 94 | 99 | ||
| 95 | if (tmpout) | 100 | if (tmpout && (BIO_write(tmpout, buf, i) != i)) |
| 96 | BIO_write(tmpout, buf, i); | 101 | goto err; |
| 97 | } | 102 | } |
| 98 | 103 | ||
| 99 | if(flags & CMS_TEXT) | 104 | if(flags & CMS_TEXT) |
