diff options
author | beck <> | 2014-04-17 13:37:50 +0000 |
---|---|---|
committer | beck <> | 2014-04-17 13:37:50 +0000 |
commit | bddb7c686e3d1aeb156722adc64b6c35ae720f87 (patch) | |
tree | 7595a93a27385c367802aa17ecf20f96551cf14d /src/lib/libcrypto/cms/cms_enc.c | |
parent | ecec66222d758996a4ff2671ca5026d9ede5ef76 (diff) | |
download | openbsd-bddb7c686e3d1aeb156722adc64b6c35ae720f87.tar.gz openbsd-bddb7c686e3d1aeb156722adc64b6c35ae720f87.tar.bz2 openbsd-bddb7c686e3d1aeb156722adc64b6c35ae720f87.zip |
Change library to use intrinsic memory allocation functions instead of
OPENSSL_foo wrappers. This changes:
OPENSSL_malloc->malloc
OPENSSL_free->free
OPENSSL_relloc->realloc
OPENSSL_freeFunc->free
Diffstat (limited to 'src/lib/libcrypto/cms/cms_enc.c')
-rw-r--r-- | src/lib/libcrypto/cms/cms_enc.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/lib/libcrypto/cms/cms_enc.c b/src/lib/libcrypto/cms/cms_enc.c index bebeaf29c7..612fce6dde 100644 --- a/src/lib/libcrypto/cms/cms_enc.c +++ b/src/lib/libcrypto/cms/cms_enc.c | |||
@@ -143,7 +143,7 @@ BIO *cms_EncryptedContent_init_bio(CMS_EncryptedContentInfo *ec) | |||
143 | /* Generate random session key */ | 143 | /* Generate random session key */ |
144 | if (!enc || !ec->key) | 144 | if (!enc || !ec->key) |
145 | { | 145 | { |
146 | tkey = OPENSSL_malloc(tkeylen); | 146 | tkey = malloc(tkeylen); |
147 | if (!tkey) | 147 | if (!tkey) |
148 | { | 148 | { |
149 | CMSerr(CMS_F_CMS_ENCRYPTEDCONTENT_INIT_BIO, | 149 | CMSerr(CMS_F_CMS_ENCRYPTEDCONTENT_INIT_BIO, |
@@ -184,7 +184,7 @@ BIO *cms_EncryptedContent_init_bio(CMS_EncryptedContentInfo *ec) | |||
184 | { | 184 | { |
185 | /* Use random key */ | 185 | /* Use random key */ |
186 | OPENSSL_cleanse(ec->key, ec->keylen); | 186 | OPENSSL_cleanse(ec->key, ec->keylen); |
187 | OPENSSL_free(ec->key); | 187 | free(ec->key); |
188 | ec->key = tkey; | 188 | ec->key = tkey; |
189 | ec->keylen = tkeylen; | 189 | ec->keylen = tkeylen; |
190 | tkey = NULL; | 190 | tkey = NULL; |
@@ -222,13 +222,13 @@ BIO *cms_EncryptedContent_init_bio(CMS_EncryptedContentInfo *ec) | |||
222 | if (ec->key && !keep_key) | 222 | if (ec->key && !keep_key) |
223 | { | 223 | { |
224 | OPENSSL_cleanse(ec->key, ec->keylen); | 224 | OPENSSL_cleanse(ec->key, ec->keylen); |
225 | OPENSSL_free(ec->key); | 225 | free(ec->key); |
226 | ec->key = NULL; | 226 | ec->key = NULL; |
227 | } | 227 | } |
228 | if (tkey) | 228 | if (tkey) |
229 | { | 229 | { |
230 | OPENSSL_cleanse(tkey, tkeylen); | 230 | OPENSSL_cleanse(tkey, tkeylen); |
231 | OPENSSL_free(tkey); | 231 | free(tkey); |
232 | } | 232 | } |
233 | if (ok) | 233 | if (ok) |
234 | return b; | 234 | return b; |
@@ -243,7 +243,7 @@ int cms_EncryptedContent_init(CMS_EncryptedContentInfo *ec, | |||
243 | ec->cipher = cipher; | 243 | ec->cipher = cipher; |
244 | if (key) | 244 | if (key) |
245 | { | 245 | { |
246 | ec->key = OPENSSL_malloc(keylen); | 246 | ec->key = malloc(keylen); |
247 | if (!ec->key) | 247 | if (!ec->key) |
248 | return 0; | 248 | return 0; |
249 | memcpy(ec->key, key, keylen); | 249 | memcpy(ec->key, key, keylen); |