summaryrefslogtreecommitdiffstats
path: root/lib/libssl/s3_clnt.c
diff options
context:
space:
mode:
authorbeck <beck@openbsd.org>2014-04-17 13:37:48 +0000
committerbeck <beck@openbsd.org>2014-04-17 13:37:48 +0000
commit6f3a6cb14ff86acbae89a0395ba3cdc01e85fa54 (patch)
treee7ca531f41f3403bf7f04411c40317e859a02460 /lib/libssl/s3_clnt.c
parentRevert unintended whitespace changes. (diff)
downloadwireguard-openbsd-6f3a6cb14ff86acbae89a0395ba3cdc01e85fa54.tar.xz
wireguard-openbsd-6f3a6cb14ff86acbae89a0395ba3cdc01e85fa54.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 'lib/libssl/s3_clnt.c')
-rw-r--r--lib/libssl/s3_clnt.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/lib/libssl/s3_clnt.c b/lib/libssl/s3_clnt.c
index 88be294ab78..26bdef6b4fc 100644
--- a/lib/libssl/s3_clnt.c
+++ b/lib/libssl/s3_clnt.c
@@ -1222,7 +1222,7 @@ ssl3_get_key_exchange(SSL *s)
if (s->s3->tmp.new_cipher->algorithm_mkey & SSL_kPSK) {
s->session->sess_cert = ssl_sess_cert_new();
if (s->ctx->psk_identity_hint)
- OPENSSL_free(s->ctx->psk_identity_hint);
+ free(s->ctx->psk_identity_hint);
s->ctx->psk_identity_hint = NULL;
}
#endif
@@ -1288,7 +1288,7 @@ ssl3_get_key_exchange(SSL *s)
memcpy(tmp_id_hint, p, i);
memset(tmp_id_hint + i, 0, PSK_MAX_IDENTITY_LEN + 1 - i);
if (s->ctx->psk_identity_hint != NULL)
- OPENSSL_free(s->ctx->psk_identity_hint);
+ free(s->ctx->psk_identity_hint);
s->ctx->psk_identity_hint = BUF_strdup(tmp_id_hint);
if (s->ctx->psk_identity_hint == NULL) {
SSLerr(SSL_F_SSL3_GET_KEY_EXCHANGE, ERR_R_MALLOC_FAILURE);
@@ -1913,10 +1913,10 @@ ssl3_get_new_session_ticket(SSL *s)
goto f_err;
}
if (s->session->tlsext_tick) {
- OPENSSL_free(s->session->tlsext_tick);
+ free(s->session->tlsext_tick);
s->session->tlsext_ticklen = 0;
}
- s->session->tlsext_tick = OPENSSL_malloc(ticklen);
+ s->session->tlsext_tick = malloc(ticklen);
if (!s->session->tlsext_tick) {
SSLerr(SSL_F_SSL3_GET_NEW_SESSION_TICKET, ERR_R_MALLOC_FAILURE);
goto err;
@@ -1988,7 +1988,7 @@ ssl3_get_cert_status(SSL *s)
goto f_err;
}
if (s->tlsext_ocsp_resp)
- OPENSSL_free(s->tlsext_ocsp_resp);
+ free(s->tlsext_ocsp_resp);
s->tlsext_ocsp_resp = BUF_memdup(p, resplen);
if (!s->tlsext_ocsp_resp) {
al = SSL_AD_INTERNAL_ERROR;
@@ -2449,7 +2449,7 @@ ssl3_send_client_key_exchange(SSL *s)
NULL, 0, NULL);
encodedPoint =
- (unsigned char *)OPENSSL_malloc(
+ (unsigned char *)malloc(
encoded_pt_len * sizeof(unsigned char));
bn_ctx = BN_CTX_new();
@@ -2479,7 +2479,7 @@ ssl3_send_client_key_exchange(SSL *s)
/* Free allocated memory */
BN_CTX_free(bn_ctx);
if (encodedPoint != NULL)
- OPENSSL_free(encodedPoint);
+ free(encodedPoint);
if (clnt_ecdh != NULL)
EC_KEY_free(clnt_ecdh);
EVP_PKEY_free(srvr_pub_pkey);
@@ -2584,7 +2584,7 @@ ssl3_send_client_key_exchange(SSL *s)
goto err;
}
if (s->session->srp_username != NULL)
- OPENSSL_free(s->session->srp_username);
+ free(s->session->srp_username);
s->session->srp_username = BUF_strdup(s->srp_ctx.login);
if (s->session->srp_username == NULL) {
SSLerr(SSL_F_SSL3_SEND_CLIENT_KEY_EXCHANGE,
@@ -2636,7 +2636,7 @@ ssl3_send_client_key_exchange(SSL *s)
s2n(psk_len, t);
if (s->session->psk_identity_hint != NULL)
- OPENSSL_free(s->session->psk_identity_hint);
+ free(s->session->psk_identity_hint);
s->session->psk_identity_hint = BUF_strdup(s->ctx->psk_identity_hint);
if (s->ctx->psk_identity_hint != NULL &&
s->session->psk_identity_hint == NULL) {
@@ -2646,7 +2646,7 @@ ssl3_send_client_key_exchange(SSL *s)
}
if (s->session->psk_identity != NULL)
- OPENSSL_free(s->session->psk_identity);
+ free(s->session->psk_identity);
s->session->psk_identity = BUF_strdup(identity);
if (s->session->psk_identity == NULL) {
SSLerr(SSL_F_SSL3_SEND_CLIENT_KEY_EXCHANGE,
@@ -2696,7 +2696,7 @@ err:
#ifndef OPENSSL_NO_ECDH
BN_CTX_free(bn_ctx);
if (encodedPoint != NULL)
- OPENSSL_free(encodedPoint);
+ free(encodedPoint);
if (clnt_ecdh != NULL)
EC_KEY_free(clnt_ecdh);
EVP_PKEY_free(srvr_pub_pkey);