summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/cms/cms_kari.c
diff options
context:
space:
mode:
authorjsing <>2019-08-11 10:41:49 +0000
committerjsing <>2019-08-11 10:41:49 +0000
commit54114f8225ed9f3d426ca49ff8e0df410a310372 (patch)
treebf1fe6334200e35a37c7fb725d2e49bb688cda57 /src/lib/libcrypto/cms/cms_kari.c
parentf7a527513ace17b70b14f3975dd212ba42e464c8 (diff)
downloadopenbsd-54114f8225ed9f3d426ca49ff8e0df410a310372.tar.gz
openbsd-54114f8225ed9f3d426ca49ff8e0df410a310372.tar.bz2
openbsd-54114f8225ed9f3d426ca49ff8e0df410a310372.zip
Use malloc(3) and free(3), rather than OPENSSL_{malloc,free}().
Diffstat (limited to 'src/lib/libcrypto/cms/cms_kari.c')
-rw-r--r--src/lib/libcrypto/cms/cms_kari.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/lib/libcrypto/cms/cms_kari.c b/src/lib/libcrypto/cms/cms_kari.c
index e1f22cc43a..19513e3658 100644
--- a/src/lib/libcrypto/cms/cms_kari.c
+++ b/src/lib/libcrypto/cms/cms_kari.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: cms_kari.c,v 1.7 2019/08/11 10:38:27 jsing Exp $ */ 1/* $OpenBSD: cms_kari.c,v 1.8 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.
@@ -256,7 +256,7 @@ cms_kek_cipher(unsigned char **pout, size_t *poutlen, const unsigned char *in,
256 /* obtain output length of ciphered key */ 256 /* obtain output length of ciphered key */
257 if (!EVP_CipherUpdate(kari->ctx, NULL, &outlen, in, inlen)) 257 if (!EVP_CipherUpdate(kari->ctx, NULL, &outlen, in, inlen))
258 goto err; 258 goto err;
259 out = OPENSSL_malloc(outlen); 259 out = malloc(outlen);
260 if (out == NULL) 260 if (out == NULL)
261 goto err; 261 goto err;
262 if (!EVP_CipherUpdate(kari->ctx, out, &outlen, in, inlen)) 262 if (!EVP_CipherUpdate(kari->ctx, out, &outlen, in, inlen))
@@ -268,7 +268,7 @@ cms_kek_cipher(unsigned char **pout, size_t *poutlen, const unsigned char *in,
268 err: 268 err:
269 OPENSSL_cleanse(kek, keklen); 269 OPENSSL_cleanse(kek, keklen);
270 if (!rv) 270 if (!rv)
271 OPENSSL_free(out); 271 free(out);
272 EVP_CIPHER_CTX_reset(kari->ctx); 272 EVP_CIPHER_CTX_reset(kari->ctx);
273 /* FIXME: WHY IS kari->pctx freed here? /RL */ 273 /* FIXME: WHY IS kari->pctx freed here? /RL */
274 EVP_PKEY_CTX_free(kari->pctx); 274 EVP_PKEY_CTX_free(kari->pctx);
@@ -303,7 +303,7 @@ CMS_RecipientInfo_kari_decrypt(CMS_ContentInfo *cms, CMS_RecipientInfo *ri,
303 rv = 1; 303 rv = 1;
304 304
305 err: 305 err:
306 OPENSSL_free(cek); 306 free(cek);
307 307
308 return rv; 308 return rv;
309} 309}