diff options
Diffstat (limited to 'src/lib/libcrypto/cms/cms_env.c')
| -rw-r--r-- | src/lib/libcrypto/cms/cms_env.c | 20 | 
1 files changed, 10 insertions, 10 deletions
| diff --git a/src/lib/libcrypto/cms/cms_env.c b/src/lib/libcrypto/cms/cms_env.c index be20b1c024..78fa2aa7b7 100644 --- a/src/lib/libcrypto/cms/cms_env.c +++ b/src/lib/libcrypto/cms/cms_env.c | |||
| @@ -334,7 +334,7 @@ static int cms_RecipientInfo_ktri_encrypt(CMS_ContentInfo *cms, | |||
| 334 | if (EVP_PKEY_encrypt(pctx, NULL, &eklen, ec->key, ec->keylen) <= 0) | 334 | if (EVP_PKEY_encrypt(pctx, NULL, &eklen, ec->key, ec->keylen) <= 0) | 
| 335 | goto err; | 335 | goto err; | 
| 336 | 336 | ||
| 337 | ek = OPENSSL_malloc(eklen); | 337 | ek = malloc(eklen); | 
| 338 | 338 | ||
| 339 | if (ek == NULL) | 339 | if (ek == NULL) | 
| 340 | { | 340 | { | 
| @@ -355,7 +355,7 @@ static int cms_RecipientInfo_ktri_encrypt(CMS_ContentInfo *cms, | |||
| 355 | if (pctx) | 355 | if (pctx) | 
| 356 | EVP_PKEY_CTX_free(pctx); | 356 | EVP_PKEY_CTX_free(pctx); | 
| 357 | if (ek) | 357 | if (ek) | 
| 358 | OPENSSL_free(ek); | 358 | free(ek); | 
| 359 | return ret; | 359 | return ret; | 
| 360 | 360 | ||
| 361 | } | 361 | } | 
| @@ -399,7 +399,7 @@ static int cms_RecipientInfo_ktri_decrypt(CMS_ContentInfo *cms, | |||
| 399 | ktri->encryptedKey->length) <= 0) | 399 | ktri->encryptedKey->length) <= 0) | 
| 400 | goto err; | 400 | goto err; | 
| 401 | 401 | ||
| 402 | ek = OPENSSL_malloc(eklen); | 402 | ek = malloc(eklen); | 
| 403 | 403 | ||
| 404 | if (ek == NULL) | 404 | if (ek == NULL) | 
| 405 | { | 405 | { | 
| @@ -421,7 +421,7 @@ static int cms_RecipientInfo_ktri_decrypt(CMS_ContentInfo *cms, | |||
| 421 | if (ec->key) | 421 | if (ec->key) | 
| 422 | { | 422 | { | 
| 423 | OPENSSL_cleanse(ec->key, ec->keylen); | 423 | OPENSSL_cleanse(ec->key, ec->keylen); | 
| 424 | OPENSSL_free(ec->key); | 424 | free(ec->key); | 
| 425 | } | 425 | } | 
| 426 | 426 | ||
| 427 | ec->key = ek; | 427 | ec->key = ek; | 
| @@ -431,7 +431,7 @@ static int cms_RecipientInfo_ktri_decrypt(CMS_ContentInfo *cms, | |||
| 431 | if (pctx) | 431 | if (pctx) | 
| 432 | EVP_PKEY_CTX_free(pctx); | 432 | EVP_PKEY_CTX_free(pctx); | 
| 433 | if (!ret && ek) | 433 | if (!ret && ek) | 
| 434 | OPENSSL_free(ek); | 434 | free(ek); | 
| 435 | 435 | ||
| 436 | return ret; | 436 | return ret; | 
| 437 | } | 437 | } | 
| @@ -671,7 +671,7 @@ static int cms_RecipientInfo_kekri_encrypt(CMS_ContentInfo *cms, | |||
| 671 | goto err; | 671 | goto err; | 
| 672 | } | 672 | } | 
| 673 | 673 | ||
| 674 | wkey = OPENSSL_malloc(ec->keylen + 8); | 674 | wkey = malloc(ec->keylen + 8); | 
| 675 | 675 | ||
| 676 | if (!wkey) | 676 | if (!wkey) | 
| 677 | { | 677 | { | 
| @@ -695,7 +695,7 @@ static int cms_RecipientInfo_kekri_encrypt(CMS_ContentInfo *cms, | |||
| 695 | err: | 695 | err: | 
| 696 | 696 | ||
| 697 | if (!r && wkey) | 697 | if (!r && wkey) | 
| 698 | OPENSSL_free(wkey); | 698 | free(wkey); | 
| 699 | OPENSSL_cleanse(&actx, sizeof(actx)); | 699 | OPENSSL_cleanse(&actx, sizeof(actx)); | 
| 700 | 700 | ||
| 701 | return r; | 701 | return r; | 
| @@ -748,7 +748,7 @@ static int cms_RecipientInfo_kekri_decrypt(CMS_ContentInfo *cms, | |||
| 748 | goto err; | 748 | goto err; | 
| 749 | } | 749 | } | 
| 750 | 750 | ||
| 751 | ukey = OPENSSL_malloc(kekri->encryptedKey->length - 8); | 751 | ukey = malloc(kekri->encryptedKey->length - 8); | 
| 752 | 752 | ||
| 753 | if (!ukey) | 753 | if (!ukey) | 
| 754 | { | 754 | { | 
| @@ -776,7 +776,7 @@ static int cms_RecipientInfo_kekri_decrypt(CMS_ContentInfo *cms, | |||
| 776 | err: | 776 | err: | 
| 777 | 777 | ||
| 778 | if (!r && ukey) | 778 | if (!r && ukey) | 
| 779 | OPENSSL_free(ukey); | 779 | free(ukey); | 
| 780 | OPENSSL_cleanse(&actx, sizeof(actx)); | 780 | OPENSSL_cleanse(&actx, sizeof(actx)); | 
| 781 | 781 | ||
| 782 | return r; | 782 | return r; | 
| @@ -864,7 +864,7 @@ BIO *cms_EnvelopedData_init_bio(CMS_ContentInfo *cms) | |||
| 864 | if (ec->key) | 864 | if (ec->key) | 
| 865 | { | 865 | { | 
| 866 | OPENSSL_cleanse(ec->key, ec->keylen); | 866 | OPENSSL_cleanse(ec->key, ec->keylen); | 
| 867 | OPENSSL_free(ec->key); | 867 | free(ec->key); | 
| 868 | ec->key = NULL; | 868 | ec->key = NULL; | 
| 869 | ec->keylen = 0; | 869 | ec->keylen = 0; | 
| 870 | } | 870 | } | 
