summaryrefslogtreecommitdiff
path: root/src/lib/libssl/s3_clnt.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libssl/s3_clnt.c')
-rw-r--r--src/lib/libssl/s3_clnt.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/lib/libssl/s3_clnt.c b/src/lib/libssl/s3_clnt.c
index 88be294ab7..26bdef6b4f 100644
--- a/src/lib/libssl/s3_clnt.c
+++ b/src/lib/libssl/s3_clnt.c
@@ -1222,7 +1222,7 @@ ssl3_get_key_exchange(SSL *s)
1222 if (s->s3->tmp.new_cipher->algorithm_mkey & SSL_kPSK) { 1222 if (s->s3->tmp.new_cipher->algorithm_mkey & SSL_kPSK) {
1223 s->session->sess_cert = ssl_sess_cert_new(); 1223 s->session->sess_cert = ssl_sess_cert_new();
1224 if (s->ctx->psk_identity_hint) 1224 if (s->ctx->psk_identity_hint)
1225 OPENSSL_free(s->ctx->psk_identity_hint); 1225 free(s->ctx->psk_identity_hint);
1226 s->ctx->psk_identity_hint = NULL; 1226 s->ctx->psk_identity_hint = NULL;
1227 } 1227 }
1228#endif 1228#endif
@@ -1288,7 +1288,7 @@ ssl3_get_key_exchange(SSL *s)
1288 memcpy(tmp_id_hint, p, i); 1288 memcpy(tmp_id_hint, p, i);
1289 memset(tmp_id_hint + i, 0, PSK_MAX_IDENTITY_LEN + 1 - i); 1289 memset(tmp_id_hint + i, 0, PSK_MAX_IDENTITY_LEN + 1 - i);
1290 if (s->ctx->psk_identity_hint != NULL) 1290 if (s->ctx->psk_identity_hint != NULL)
1291 OPENSSL_free(s->ctx->psk_identity_hint); 1291 free(s->ctx->psk_identity_hint);
1292 s->ctx->psk_identity_hint = BUF_strdup(tmp_id_hint); 1292 s->ctx->psk_identity_hint = BUF_strdup(tmp_id_hint);
1293 if (s->ctx->psk_identity_hint == NULL) { 1293 if (s->ctx->psk_identity_hint == NULL) {
1294 SSLerr(SSL_F_SSL3_GET_KEY_EXCHANGE, ERR_R_MALLOC_FAILURE); 1294 SSLerr(SSL_F_SSL3_GET_KEY_EXCHANGE, ERR_R_MALLOC_FAILURE);
@@ -1913,10 +1913,10 @@ ssl3_get_new_session_ticket(SSL *s)
1913 goto f_err; 1913 goto f_err;
1914 } 1914 }
1915 if (s->session->tlsext_tick) { 1915 if (s->session->tlsext_tick) {
1916 OPENSSL_free(s->session->tlsext_tick); 1916 free(s->session->tlsext_tick);
1917 s->session->tlsext_ticklen = 0; 1917 s->session->tlsext_ticklen = 0;
1918 } 1918 }
1919 s->session->tlsext_tick = OPENSSL_malloc(ticklen); 1919 s->session->tlsext_tick = malloc(ticklen);
1920 if (!s->session->tlsext_tick) { 1920 if (!s->session->tlsext_tick) {
1921 SSLerr(SSL_F_SSL3_GET_NEW_SESSION_TICKET, ERR_R_MALLOC_FAILURE); 1921 SSLerr(SSL_F_SSL3_GET_NEW_SESSION_TICKET, ERR_R_MALLOC_FAILURE);
1922 goto err; 1922 goto err;
@@ -1988,7 +1988,7 @@ ssl3_get_cert_status(SSL *s)
1988 goto f_err; 1988 goto f_err;
1989 } 1989 }
1990 if (s->tlsext_ocsp_resp) 1990 if (s->tlsext_ocsp_resp)
1991 OPENSSL_free(s->tlsext_ocsp_resp); 1991 free(s->tlsext_ocsp_resp);
1992 s->tlsext_ocsp_resp = BUF_memdup(p, resplen); 1992 s->tlsext_ocsp_resp = BUF_memdup(p, resplen);
1993 if (!s->tlsext_ocsp_resp) { 1993 if (!s->tlsext_ocsp_resp) {
1994 al = SSL_AD_INTERNAL_ERROR; 1994 al = SSL_AD_INTERNAL_ERROR;
@@ -2449,7 +2449,7 @@ ssl3_send_client_key_exchange(SSL *s)
2449 NULL, 0, NULL); 2449 NULL, 0, NULL);
2450 2450
2451 encodedPoint = 2451 encodedPoint =
2452 (unsigned char *)OPENSSL_malloc( 2452 (unsigned char *)malloc(
2453 encoded_pt_len * sizeof(unsigned char)); 2453 encoded_pt_len * sizeof(unsigned char));
2454 2454
2455 bn_ctx = BN_CTX_new(); 2455 bn_ctx = BN_CTX_new();
@@ -2479,7 +2479,7 @@ ssl3_send_client_key_exchange(SSL *s)
2479 /* Free allocated memory */ 2479 /* Free allocated memory */
2480 BN_CTX_free(bn_ctx); 2480 BN_CTX_free(bn_ctx);
2481 if (encodedPoint != NULL) 2481 if (encodedPoint != NULL)
2482 OPENSSL_free(encodedPoint); 2482 free(encodedPoint);
2483 if (clnt_ecdh != NULL) 2483 if (clnt_ecdh != NULL)
2484 EC_KEY_free(clnt_ecdh); 2484 EC_KEY_free(clnt_ecdh);
2485 EVP_PKEY_free(srvr_pub_pkey); 2485 EVP_PKEY_free(srvr_pub_pkey);
@@ -2584,7 +2584,7 @@ ssl3_send_client_key_exchange(SSL *s)
2584 goto err; 2584 goto err;
2585 } 2585 }
2586 if (s->session->srp_username != NULL) 2586 if (s->session->srp_username != NULL)
2587 OPENSSL_free(s->session->srp_username); 2587 free(s->session->srp_username);
2588 s->session->srp_username = BUF_strdup(s->srp_ctx.login); 2588 s->session->srp_username = BUF_strdup(s->srp_ctx.login);
2589 if (s->session->srp_username == NULL) { 2589 if (s->session->srp_username == NULL) {
2590 SSLerr(SSL_F_SSL3_SEND_CLIENT_KEY_EXCHANGE, 2590 SSLerr(SSL_F_SSL3_SEND_CLIENT_KEY_EXCHANGE,
@@ -2636,7 +2636,7 @@ ssl3_send_client_key_exchange(SSL *s)
2636 s2n(psk_len, t); 2636 s2n(psk_len, t);
2637 2637
2638 if (s->session->psk_identity_hint != NULL) 2638 if (s->session->psk_identity_hint != NULL)
2639 OPENSSL_free(s->session->psk_identity_hint); 2639 free(s->session->psk_identity_hint);
2640 s->session->psk_identity_hint = BUF_strdup(s->ctx->psk_identity_hint); 2640 s->session->psk_identity_hint = BUF_strdup(s->ctx->psk_identity_hint);
2641 if (s->ctx->psk_identity_hint != NULL && 2641 if (s->ctx->psk_identity_hint != NULL &&
2642 s->session->psk_identity_hint == NULL) { 2642 s->session->psk_identity_hint == NULL) {
@@ -2646,7 +2646,7 @@ ssl3_send_client_key_exchange(SSL *s)
2646 } 2646 }
2647 2647
2648 if (s->session->psk_identity != NULL) 2648 if (s->session->psk_identity != NULL)
2649 OPENSSL_free(s->session->psk_identity); 2649 free(s->session->psk_identity);
2650 s->session->psk_identity = BUF_strdup(identity); 2650 s->session->psk_identity = BUF_strdup(identity);
2651 if (s->session->psk_identity == NULL) { 2651 if (s->session->psk_identity == NULL) {
2652 SSLerr(SSL_F_SSL3_SEND_CLIENT_KEY_EXCHANGE, 2652 SSLerr(SSL_F_SSL3_SEND_CLIENT_KEY_EXCHANGE,
@@ -2696,7 +2696,7 @@ err:
2696#ifndef OPENSSL_NO_ECDH 2696#ifndef OPENSSL_NO_ECDH
2697 BN_CTX_free(bn_ctx); 2697 BN_CTX_free(bn_ctx);
2698 if (encodedPoint != NULL) 2698 if (encodedPoint != NULL)
2699 OPENSSL_free(encodedPoint); 2699 free(encodedPoint);
2700 if (clnt_ecdh != NULL) 2700 if (clnt_ecdh != NULL)
2701 EC_KEY_free(clnt_ecdh); 2701 EC_KEY_free(clnt_ecdh);
2702 EVP_PKEY_free(srvr_pub_pkey); 2702 EVP_PKEY_free(srvr_pub_pkey);