diff options
author | jsing <> | 2019-08-11 10:41:49 +0000 |
---|---|---|
committer | jsing <> | 2019-08-11 10:41:49 +0000 |
commit | 40ce59403b918c4baa975308e0e0fed2d27b9012 (patch) | |
tree | bf1fe6334200e35a37c7fb725d2e49bb688cda57 /src/lib/libcrypto/cms/cms_pwri.c | |
parent | 66c480d1798005c797335d0f02a75fc501efcc7f (diff) | |
download | openbsd-40ce59403b918c4baa975308e0e0fed2d27b9012.tar.gz openbsd-40ce59403b918c4baa975308e0e0fed2d27b9012.tar.bz2 openbsd-40ce59403b918c4baa975308e0e0fed2d27b9012.zip |
Use malloc(3) and free(3), rather than OPENSSL_{malloc,free}().
Diffstat (limited to 'src/lib/libcrypto/cms/cms_pwri.c')
-rw-r--r-- | src/lib/libcrypto/cms/cms_pwri.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/lib/libcrypto/cms/cms_pwri.c b/src/lib/libcrypto/cms/cms_pwri.c index dd66541409..30c5ce0618 100644 --- a/src/lib/libcrypto/cms/cms_pwri.c +++ b/src/lib/libcrypto/cms/cms_pwri.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: cms_pwri.c,v 1.20 2019/08/11 10:38:27 jsing Exp $ */ | 1 | /* $OpenBSD: cms_pwri.c,v 1.21 2019/08/11 10:41:49 jsing Exp $ */ |
2 | /* | 2 | /* |
3 | * Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL | 3 | * Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL |
4 | * project. | 4 | * project. |
@@ -232,7 +232,7 @@ kek_unwrap_key(unsigned char *out, size_t *outlen, const unsigned char *in, | |||
232 | /* Invalid size */ | 232 | /* Invalid size */ |
233 | return 0; | 233 | return 0; |
234 | } | 234 | } |
235 | if ((tmp = OPENSSL_malloc(inlen)) == NULL) { | 235 | if ((tmp = malloc(inlen)) == NULL) { |
236 | CMSerror(ERR_R_MALLOC_FAILURE); | 236 | CMSerror(ERR_R_MALLOC_FAILURE); |
237 | return 0; | 237 | return 0; |
238 | } | 238 | } |
@@ -391,7 +391,7 @@ cms_RecipientInfo_pwri_crypt(CMS_ContentInfo *cms, CMS_RecipientInfo *ri, | |||
391 | if (!kek_wrap_key(NULL, &keylen, ec->key, ec->keylen, kekctx)) | 391 | if (!kek_wrap_key(NULL, &keylen, ec->key, ec->keylen, kekctx)) |
392 | goto err; | 392 | goto err; |
393 | 393 | ||
394 | key = OPENSSL_malloc(keylen); | 394 | key = malloc(keylen); |
395 | if (key == NULL) | 395 | if (key == NULL) |
396 | goto err; | 396 | goto err; |
397 | 397 | ||
@@ -400,7 +400,7 @@ cms_RecipientInfo_pwri_crypt(CMS_ContentInfo *cms, CMS_RecipientInfo *ri, | |||
400 | pwri->encryptedKey->data = key; | 400 | pwri->encryptedKey->data = key; |
401 | pwri->encryptedKey->length = keylen; | 401 | pwri->encryptedKey->length = keylen; |
402 | } else { | 402 | } else { |
403 | key = OPENSSL_malloc(pwri->encryptedKey->length); | 403 | key = malloc(pwri->encryptedKey->length); |
404 | if (key == NULL) { | 404 | if (key == NULL) { |
405 | CMSerror(ERR_R_MALLOC_FAILURE); | 405 | CMSerror(ERR_R_MALLOC_FAILURE); |
406 | goto err; | 406 | goto err; |
@@ -421,7 +421,7 @@ cms_RecipientInfo_pwri_crypt(CMS_ContentInfo *cms, CMS_RecipientInfo *ri, | |||
421 | err: | 421 | err: |
422 | EVP_CIPHER_CTX_free(kekctx); | 422 | EVP_CIPHER_CTX_free(kekctx); |
423 | if (!r) | 423 | if (!r) |
424 | OPENSSL_free(key); | 424 | free(key); |
425 | X509_ALGOR_free(kekalg); | 425 | X509_ALGOR_free(kekalg); |
426 | 426 | ||
427 | return r; | 427 | return r; |