summaryrefslogtreecommitdiffstats
path: root/ssl
diff options
context:
space:
mode:
Diffstat (limited to 'ssl')
-rw-r--r--ssl/bio_ssl.c4
-rw-r--r--ssl/s23_srvr.c6
-rw-r--r--ssl/s2_enc.c4
-rw-r--r--ssl/s2_lib.c18
-rw-r--r--ssl/s2_srvr.c4
-rw-r--r--ssl/s3_both.c4
-rw-r--r--ssl/s3_enc.c10
-rw-r--r--ssl/s3_lib.c12
-rw-r--r--ssl/ssl_asn1.c16
-rw-r--r--ssl/ssl_cert.c10
-rw-r--r--ssl/ssl_ciph.c24
-rw-r--r--ssl/ssl_lib.c16
-rw-r--r--ssl/ssl_sess.c6
-rw-r--r--ssl/ssltest.c2
-rw-r--r--ssl/t1_enc.c12
15 files changed, 74 insertions, 74 deletions
diff --git a/ssl/bio_ssl.c b/ssl/bio_ssl.c
index ae99a6aceb..f6396db82e 100644
--- a/ssl/bio_ssl.c
+++ b/ssl/bio_ssl.c
@@ -105,7 +105,7 @@ static int ssl_new(BIO *bi)
{
BIO_SSL *bs;
- bs=(BIO_SSL *)Malloc(sizeof(BIO_SSL));
+ bs=(BIO_SSL *)OPENSSL_malloc(sizeof(BIO_SSL));
if (bs == NULL)
{
BIOerr(BIO_F_SSL_NEW,ERR_R_MALLOC_FAILURE);
@@ -133,7 +133,7 @@ static int ssl_free(BIO *a)
a->flags=0;
}
if (a->ptr != NULL)
- Free(a->ptr);
+ OPENSSL_free(a->ptr);
return(1);
}
diff --git a/ssl/s23_srvr.c b/ssl/s23_srvr.c
index 6a3bbb10b9..930769be0d 100644
--- a/ssl/s23_srvr.c
+++ b/ssl/s23_srvr.c
@@ -297,7 +297,7 @@ int ssl23_get_client_hello(SSL *s)
if (n <= 0) return(n);
p=s->packet;
- if ((buf=Malloc(n)) == NULL)
+ if ((buf=OPENSSL_malloc(n)) == NULL)
{
SSLerr(SSL_F_SSL23_GET_CLIENT_HELLO,ERR_R_MALLOC_FAILURE);
goto err;
@@ -559,10 +559,10 @@ int ssl23_get_client_hello(SSL *s)
}
s->init_num=0;
- if (buf != buf_space) Free(buf);
+ if (buf != buf_space) OPENSSL_free(buf);
s->first_packet=1;
return(SSL_accept(s));
err:
- if (buf != buf_space) Free(buf);
+ if (buf != buf_space) OPENSSL_free(buf);
return(-1);
}
diff --git a/ssl/s2_enc.c b/ssl/s2_enc.c
index a9458e7fa7..35acdf8276 100644
--- a/ssl/s2_enc.c
+++ b/ssl/s2_enc.c
@@ -80,11 +80,11 @@ int ssl2_enc_init(SSL *s, int client)
if ((s->enc_read_ctx == NULL) &&
((s->enc_read_ctx=(EVP_CIPHER_CTX *)
- Malloc(sizeof(EVP_CIPHER_CTX))) == NULL))
+ OPENSSL_malloc(sizeof(EVP_CIPHER_CTX))) == NULL))
goto err;
if ((s->enc_write_ctx == NULL) &&
((s->enc_write_ctx=(EVP_CIPHER_CTX *)
- Malloc(sizeof(EVP_CIPHER_CTX))) == NULL))
+ OPENSSL_malloc(sizeof(EVP_CIPHER_CTX))) == NULL))
goto err;
rs= s->enc_read_ctx;
diff --git a/ssl/s2_lib.c b/ssl/s2_lib.c
index 5ddba23a06..8c9d992541 100644
--- a/ssl/s2_lib.c
+++ b/ssl/s2_lib.c
@@ -267,12 +267,12 @@ int ssl2_new(SSL *s)
{
SSL2_STATE *s2;
- if ((s2=Malloc(sizeof *s2)) == NULL) goto err;
+ if ((s2=OPENSSL_malloc(sizeof *s2)) == NULL) goto err;
memset(s2,0,sizeof *s2);
- if ((s2->rbuf=Malloc(
+ if ((s2->rbuf=OPENSSL_malloc(
SSL2_MAX_RECORD_LENGTH_2_BYTE_HEADER+2)) == NULL) goto err;
- if ((s2->wbuf=Malloc(
+ if ((s2->wbuf=OPENSSL_malloc(
SSL2_MAX_RECORD_LENGTH_2_BYTE_HEADER+2)) == NULL) goto err;
s->s2=s2;
@@ -281,9 +281,9 @@ int ssl2_new(SSL *s)
err:
if (s2 != NULL)
{
- if (s2->wbuf != NULL) Free(s2->wbuf);
- if (s2->rbuf != NULL) Free(s2->rbuf);
- Free(s2);
+ if (s2->wbuf != NULL) OPENSSL_free(s2->wbuf);
+ if (s2->rbuf != NULL) OPENSSL_free(s2->rbuf);
+ OPENSSL_free(s2);
}
return(0);
}
@@ -296,10 +296,10 @@ void ssl2_free(SSL *s)
return;
s2=s->s2;
- if (s2->rbuf != NULL) Free(s2->rbuf);
- if (s2->wbuf != NULL) Free(s2->wbuf);
+ if (s2->rbuf != NULL) OPENSSL_free(s2->rbuf);
+ if (s2->wbuf != NULL) OPENSSL_free(s2->wbuf);
memset(s2,0,sizeof *s2);
- Free(s2);
+ OPENSSL_free(s2);
s->s2=NULL;
}
diff --git a/ssl/s2_srvr.c b/ssl/s2_srvr.c
index 332e284451..1ed02540ae 100644
--- a/ssl/s2_srvr.c
+++ b/ssl/s2_srvr.c
@@ -898,7 +898,7 @@ static int request_certificate(SSL *s)
EVP_VerifyUpdate(&ctx,ccd,SSL2_MIN_CERT_CHALLENGE_LENGTH);
i=i2d_X509(s->cert->pkeys[SSL_PKEY_RSA_ENC].x509,NULL);
- buf2=Malloc((unsigned int)i);
+ buf2=OPENSSL_malloc((unsigned int)i);
if (buf2 == NULL)
{
SSLerr(SSL_F_REQUEST_CERTIFICATE,ERR_R_MALLOC_FAILURE);
@@ -907,7 +907,7 @@ static int request_certificate(SSL *s)
p2=buf2;
i=i2d_X509(s->cert->pkeys[SSL_PKEY_RSA_ENC].x509,&p2);
EVP_VerifyUpdate(&ctx,buf2,(unsigned int)i);
- Free(buf2);
+ OPENSSL_free(buf2);
pkey=X509_get_pubkey(x509);
if (pkey == NULL) goto end;
diff --git a/ssl/s3_both.c b/ssl/s3_both.c
index 03e0c38770..d92c164b0f 100644
--- a/ssl/s3_both.c
+++ b/ssl/s3_both.c
@@ -567,7 +567,7 @@ int ssl3_setup_buffers(SSL *s)
extra=SSL3_RT_MAX_EXTRA;
else
extra=0;
- if ((p=Malloc(SSL3_RT_MAX_PACKET_SIZE+extra))
+ if ((p=OPENSSL_malloc(SSL3_RT_MAX_PACKET_SIZE+extra))
== NULL)
goto err;
s->s3->rbuf.buf=p;
@@ -575,7 +575,7 @@ int ssl3_setup_buffers(SSL *s)
if (s->s3->wbuf.buf == NULL)
{
- if ((p=Malloc(SSL3_RT_MAX_PACKET_SIZE))
+ if ((p=OPENSSL_malloc(SSL3_RT_MAX_PACKET_SIZE))
== NULL)
goto err;
s->s3->wbuf.buf=p;
diff --git a/ssl/s3_enc.c b/ssl/s3_enc.c
index df4acab3d0..012a4b8740 100644
--- a/ssl/s3_enc.c
+++ b/ssl/s3_enc.c
@@ -150,7 +150,7 @@ int ssl3_change_cipher_state(SSL *s, int which)
{
if ((s->enc_read_ctx == NULL) &&
((s->enc_read_ctx=(EVP_CIPHER_CTX *)
- Malloc(sizeof(EVP_CIPHER_CTX))) == NULL))
+ OPENSSL_malloc(sizeof(EVP_CIPHER_CTX))) == NULL))
goto err;
dd= s->enc_read_ctx;
s->read_hash=m;
@@ -170,7 +170,7 @@ int ssl3_change_cipher_state(SSL *s, int which)
}
if (s->s3->rrec.comp == NULL)
s->s3->rrec.comp=(unsigned char *)
- Malloc(SSL3_RT_MAX_PLAIN_LENGTH);
+ OPENSSL_malloc(SSL3_RT_MAX_PLAIN_LENGTH);
if (s->s3->rrec.comp == NULL)
goto err;
}
@@ -181,7 +181,7 @@ int ssl3_change_cipher_state(SSL *s, int which)
{
if ((s->enc_write_ctx == NULL) &&
((s->enc_write_ctx=(EVP_CIPHER_CTX *)
- Malloc(sizeof(EVP_CIPHER_CTX))) == NULL))
+ OPENSSL_malloc(sizeof(EVP_CIPHER_CTX))) == NULL))
goto err;
dd= s->enc_write_ctx;
s->write_hash=m;
@@ -300,7 +300,7 @@ int ssl3_setup_key_block(SSL *s)
ssl3_cleanup_key_block(s);
- if ((p=Malloc(num)) == NULL)
+ if ((p=OPENSSL_malloc(num)) == NULL)
goto err;
s->s3->tmp.key_block_length=num;
@@ -320,7 +320,7 @@ void ssl3_cleanup_key_block(SSL *s)
{
memset(s->s3->tmp.key_block,0,
s->s3->tmp.key_block_length);
- Free(s->s3->tmp.key_block);
+ OPENSSL_free(s->s3->tmp.key_block);
s->s3->tmp.key_block=NULL;
}
s->s3->tmp.key_block_length=0;
diff --git a/ssl/s3_lib.c b/ssl/s3_lib.c
index 7ada26cbb6..9b664ab4cb 100644
--- a/ssl/s3_lib.c
+++ b/ssl/s3_lib.c
@@ -648,7 +648,7 @@ int ssl3_new(SSL *s)
{
SSL3_STATE *s3;
- if ((s3=Malloc(sizeof *s3)) == NULL) goto err;
+ if ((s3=OPENSSL_malloc(sizeof *s3)) == NULL) goto err;
memset(s3,0,sizeof *s3);
s->s3=s3;
@@ -666,11 +666,11 @@ void ssl3_free(SSL *s)
ssl3_cleanup_key_block(s);
if (s->s3->rbuf.buf != NULL)
- Free(s->s3->rbuf.buf);
+ OPENSSL_free(s->s3->rbuf.buf);
if (s->s3->wbuf.buf != NULL)
- Free(s->s3->wbuf.buf);
+ OPENSSL_free(s->s3->wbuf.buf);
if (s->s3->rrec.comp != NULL)
- Free(s->s3->rrec.comp);
+ OPENSSL_free(s->s3->rrec.comp);
#ifndef NO_DH
if (s->s3->tmp.dh != NULL)
DH_free(s->s3->tmp.dh);
@@ -678,7 +678,7 @@ void ssl3_free(SSL *s)
if (s->s3->tmp.ca_names != NULL)
sk_X509_NAME_pop_free(s->s3->tmp.ca_names,X509_NAME_free);
memset(s->s3,0,sizeof *s->s3);
- Free(s->s3);
+ OPENSSL_free(s->s3);
s->s3=NULL;
}
@@ -692,7 +692,7 @@ void ssl3_clear(SSL *s)
if (s->s3->rrec.comp != NULL)
{
- Free(s->s3->rrec.comp);
+ OPENSSL_free(s->s3->rrec.comp);
s->s3->rrec.comp=NULL;
}
#ifndef NO_DH
diff --git a/ssl/ssl_asn1.c b/ssl/ssl_asn1.c
index e77cdddfd3..fa6456e4f5 100644
--- a/ssl/ssl_asn1.c
+++ b/ssl/ssl_asn1.c
@@ -92,7 +92,7 @@ int i2d_SSL_SESSION(SSL_SESSION *in, unsigned char **pp)
/* Note that I cheat in the following 2 assignments. I know
* that if the ASN1_INTEGER passed to ASN1_INTEGER_set
- * is > sizeof(long)+1, the buffer will not be re-Malloc()ed.
+ * is > sizeof(long)+1, the buffer will not be re-OPENSSL_malloc()ed.
* This is a bit evil but makes things simple, no dynamic allocation
* to clean up :-) */
a.version.length=LSIZE2;
@@ -223,13 +223,13 @@ SSL_SESSION *d2i_SSL_SESSION(SSL_SESSION **a, unsigned char **pp,
ai.data=NULL; ai.length=0;
M_ASN1_D2I_get(aip,d2i_ASN1_INTEGER);
version=(int)ASN1_INTEGER_get(aip);
- if (ai.data != NULL) { Free(ai.data); ai.data=NULL; ai.length=0; }
+ if (ai.data != NULL) { OPENSSL_free(ai.data); ai.data=NULL; ai.length=0; }
/* we don't care about the version right now :-) */
M_ASN1_D2I_get(aip,d2i_ASN1_INTEGER);
ssl_version=(int)ASN1_INTEGER_get(aip);
ret->ssl_version=ssl_version;
- if (ai.data != NULL) { Free(ai.data); ai.data=NULL; ai.length=0; }
+ if (ai.data != NULL) { OPENSSL_free(ai.data); ai.data=NULL; ai.length=0; }
os.data=NULL; os.length=0;
M_ASN1_D2I_get(osp,d2i_ASN1_OCTET_STRING);
@@ -291,14 +291,14 @@ SSL_SESSION *d2i_SSL_SESSION(SSL_SESSION **a, unsigned char **pp,
else
ret->key_arg_length=os.length;
memcpy(ret->key_arg,os.data,ret->key_arg_length);
- if (os.data != NULL) Free(os.data);
+ if (os.data != NULL) OPENSSL_free(os.data);
ai.length=0;
M_ASN1_D2I_get_EXP_opt(aip,d2i_ASN1_INTEGER,1);
if (ai.data != NULL)
{
ret->time=ASN1_INTEGER_get(aip);
- Free(ai.data); ai.data=NULL; ai.length=0;
+ OPENSSL_free(ai.data); ai.data=NULL; ai.length=0;
}
else
ret->time=time(NULL);
@@ -308,7 +308,7 @@ SSL_SESSION *d2i_SSL_SESSION(SSL_SESSION **a, unsigned char **pp,
if (ai.data != NULL)
{
ret->timeout=ASN1_INTEGER_get(aip);
- Free(ai.data); ai.data=NULL; ai.length=0;
+ OPENSSL_free(ai.data); ai.data=NULL; ai.length=0;
}
else
ret->timeout=3;
@@ -330,7 +330,7 @@ SSL_SESSION *d2i_SSL_SESSION(SSL_SESSION **a, unsigned char **pp,
SSLerr(SSL_F_D2I_SSL_SESSION,SSL_R_BAD_LENGTH);
ret->sid_ctx_length=os.length;
memcpy(ret->sid_ctx,os.data,os.length);
- Free(os.data); os.data=NULL; os.length=0;
+ OPENSSL_free(os.data); os.data=NULL; os.length=0;
}
else
ret->sid_ctx_length=0;
@@ -340,7 +340,7 @@ SSL_SESSION *d2i_SSL_SESSION(SSL_SESSION **a, unsigned char **pp,
if (ai.data != NULL)
{
ret->verify_result=ASN1_INTEGER_get(aip);
- Free(ai.data); ai.data=NULL; ai.length=0;
+ OPENSSL_free(ai.data); ai.data=NULL; ai.length=0;
}
else
ret->verify_result=X509_V_OK;
diff --git a/ssl/ssl_cert.c b/ssl/ssl_cert.c
index fc8b8a7a53..7579a3432d 100644
--- a/ssl/ssl_cert.c
+++ b/ssl/ssl_cert.c
@@ -143,7 +143,7 @@ CERT *ssl_cert_new(void)
{
CERT *ret;
- ret=(CERT *)Malloc(sizeof(CERT));
+ ret=(CERT *)OPENSSL_malloc(sizeof(CERT));
if (ret == NULL)
{
SSLerr(SSL_F_SSL_CERT_NEW,ERR_R_MALLOC_FAILURE);
@@ -162,7 +162,7 @@ CERT *ssl_cert_dup(CERT *cert)
CERT *ret;
int i;
- ret = (CERT *)Malloc(sizeof(CERT));
+ ret = (CERT *)OPENSSL_malloc(sizeof(CERT));
if (ret == NULL)
{
SSLerr(SSL_F_SSL_CERT_DUP, ERR_R_MALLOC_FAILURE);
@@ -331,7 +331,7 @@ void ssl_cert_free(CERT *c)
EVP_PKEY_free(c->pkeys[i].publickey);
#endif
}
- Free(c);
+ OPENSSL_free(c);
}
int ssl_cert_inst(CERT **o)
@@ -367,7 +367,7 @@ SESS_CERT *ssl_sess_cert_new(void)
{
SESS_CERT *ret;
- ret = Malloc(sizeof *ret);
+ ret = OPENSSL_malloc(sizeof *ret);
if (ret == NULL)
{
SSLerr(SSL_F_SSL_SESS_CERT_NEW, ERR_R_MALLOC_FAILURE);
@@ -426,7 +426,7 @@ void ssl_sess_cert_free(SESS_CERT *sc)
DH_free(sc->peer_dh_tmp);
#endif
- Free(sc);
+ OPENSSL_free(sc);
}
int ssl_set_peer_cert_type(SESS_CERT *sc,int type)
diff --git a/ssl/ssl_ciph.c b/ssl/ssl_ciph.c
index 817b6b31f4..ce73213b12 100644
--- a/ssl/ssl_ciph.c
+++ b/ssl/ssl_ciph.c
@@ -518,7 +518,7 @@ static int ssl_cipher_strength_sort(CIPHER_ORDER *list, CIPHER_ORDER **head_p,
curr = curr->next;
}
- number_uses = Malloc((max_strength_bits + 1) * sizeof(int));
+ number_uses = OPENSSL_malloc((max_strength_bits + 1) * sizeof(int));
if (!number_uses)
{
SSLerr(SSL_F_SSL_CIPHER_STRENGTH_SORT,ERR_R_MALLOC_FAILURE);
@@ -545,7 +545,7 @@ static int ssl_cipher_strength_sort(CIPHER_ORDER *list, CIPHER_ORDER **head_p,
ssl_cipher_apply_rule(0, 0, 0, 0, CIPHER_ORD, i,
list, head_p, tail_p);
- Free(number_uses);
+ OPENSSL_free(number_uses);
return(1);
}
@@ -738,7 +738,7 @@ STACK_OF(SSL_CIPHER) *ssl_create_cipher_list(const SSL_METHOD *ssl_method,
* it is used for allocation.
*/
num_of_ciphers = ssl_method->num_ciphers();
- list = (CIPHER_ORDER *)Malloc(sizeof(CIPHER_ORDER) * num_of_ciphers);
+ list = (CIPHER_ORDER *)OPENSSL_malloc(sizeof(CIPHER_ORDER) * num_of_ciphers);
if (list == NULL)
{
SSLerr(SSL_F_SSL_CREATE_CIPHER_LIST,ERR_R_MALLOC_FAILURE);
@@ -759,10 +759,10 @@ STACK_OF(SSL_CIPHER) *ssl_create_cipher_list(const SSL_METHOD *ssl_method,
num_of_group_aliases = sizeof(cipher_aliases) / sizeof(SSL_CIPHER);
num_of_alias_max = num_of_ciphers + num_of_group_aliases + 1;
ca_list =
- (SSL_CIPHER **)Malloc(sizeof(SSL_CIPHER *) * num_of_alias_max);
+ (SSL_CIPHER **)OPENSSL_malloc(sizeof(SSL_CIPHER *) * num_of_alias_max);
if (ca_list == NULL)
{
- Free(list);
+ OPENSSL_free(list);
SSLerr(SSL_F_SSL_CREATE_CIPHER_LIST,ERR_R_MALLOC_FAILURE);
return(NULL); /* Failure */
}
@@ -788,11 +788,11 @@ STACK_OF(SSL_CIPHER) *ssl_create_cipher_list(const SSL_METHOD *ssl_method,
ok = ssl_cipher_process_rulestr(rule_p, list, &head, &tail,
ca_list);
- Free(ca_list); /* Not needed anymore */
+ OPENSSL_free(ca_list); /* Not needed anymore */
if (!ok)
{ /* Rule processing failure */
- Free(list);
+ OPENSSL_free(list);
return(NULL);
}
/*
@@ -801,7 +801,7 @@ STACK_OF(SSL_CIPHER) *ssl_create_cipher_list(const SSL_METHOD *ssl_method,
*/
if ((cipherstack = sk_SSL_CIPHER_new(NULL)) == NULL)
{
- Free(list);
+ OPENSSL_free(list);
return(NULL);
}
@@ -819,7 +819,7 @@ STACK_OF(SSL_CIPHER) *ssl_create_cipher_list(const SSL_METHOD *ssl_method,
#endif
}
}
- Free(list); /* Not needed any longer */
+ OPENSSL_free(list); /* Not needed any longer */
/*
* The following passage is a little bit odd. If pointer variables
@@ -976,8 +976,8 @@ char *SSL_CIPHER_description(SSL_CIPHER *cipher, char *buf, int len)
if (buf == NULL)
{
len=128;
- buf=Malloc(len);
- if (buf == NULL) return("Malloc Error");
+ buf=OPENSSL_malloc(len);
+ if (buf == NULL) return("OPENSSL_malloc Error");
}
else if (len < 128)
return("Buffer too small");
@@ -1053,7 +1053,7 @@ int SSL_COMP_add_compression_method(int id, COMP_METHOD *cm)
SSL_COMP *comp;
STACK_OF(SSL_COMP) *sk;
- comp=(SSL_COMP *)Malloc(sizeof(SSL_COMP));
+ comp=(SSL_COMP *)OPENSSL_malloc(sizeof(SSL_COMP));
comp->id=id;
comp->method=cm;
if (ssl_comp_methods == NULL)
diff --git a/ssl/ssl_lib.c b/ssl/ssl_lib.c
index f4eb35b15e..ee840f09c5 100644
--- a/ssl/ssl_lib.c
+++ b/ssl/ssl_lib.c
@@ -183,7 +183,7 @@ SSL *SSL_new(SSL_CTX *ctx)
return(NULL);
}
- s=(SSL *)Malloc(sizeof(SSL));
+ s=(SSL *)OPENSSL_malloc(sizeof(SSL));
if (s == NULL) goto err;
memset(s,0,sizeof(SSL));
@@ -239,7 +239,7 @@ err:
ssl_cert_free(s->cert);
if (s->ctx != NULL)
SSL_CTX_free(s->ctx); /* decrement reference count */
- Free(s);
+ OPENSSL_free(s);
}
SSLerr(SSL_F_SSL_NEW,ERR_R_MALLOC_FAILURE);
return(NULL);
@@ -375,7 +375,7 @@ void SSL_free(SSL *s)
if (s->method != NULL) s->method->ssl_free(s);
- Free(s);
+ OPENSSL_free(s);
}
void SSL_set_bio(SSL *s,BIO *rbio,BIO *wbio)
@@ -1100,7 +1100,7 @@ SSL_CTX *SSL_CTX_new(SSL_METHOD *meth)
SSLerr(SSL_F_SSL_CTX_NEW,SSL_R_X509_VERIFICATION_SETUP_PROBLEMS);
goto err;
}
- ret=(SSL_CTX *)Malloc(sizeof(SSL_CTX));
+ ret=(SSL_CTX *)OPENSSL_malloc(sizeof(SSL_CTX));
if (ret == NULL)
goto err;
@@ -1196,7 +1196,7 @@ err2:
}
static void SSL_COMP_free(SSL_COMP *comp)
- { Free(comp); }
+ { OPENSSL_free(comp); }
void SSL_CTX_free(SSL_CTX *a)
{
@@ -1237,7 +1237,7 @@ void SSL_CTX_free(SSL_CTX *a)
sk_X509_pop_free(a->extra_certs,X509_free);
if (a->comp_methods != NULL)
sk_SSL_COMP_pop_free(a->comp_methods,SSL_COMP_free);
- Free(a);
+ OPENSSL_free(a);
}
void SSL_CTX_set_default_passwd_cb(SSL_CTX *ctx, pem_password_cb *cb)
@@ -1760,13 +1760,13 @@ void ssl_clear_cipher_ctx(SSL *s)
if (s->enc_read_ctx != NULL)
{
EVP_CIPHER_CTX_cleanup(s->enc_read_ctx);
- Free(s->enc_read_ctx);
+ OPENSSL_free(s->enc_read_ctx);
s->enc_read_ctx=NULL;
}
if (s->enc_write_ctx != NULL)
{
EVP_CIPHER_CTX_cleanup(s->enc_write_ctx);
- Free(s->enc_write_ctx);
+ OPENSSL_free(s->enc_write_ctx);
s->enc_write_ctx=NULL;
}
if (s->expand != NULL)
diff --git a/ssl/ssl_sess.c b/ssl/ssl_sess.c
index 9e01f72753..416def8908 100644
--- a/ssl/ssl_sess.c
+++ b/ssl/ssl_sess.c
@@ -111,7 +111,7 @@ SSL_SESSION *SSL_SESSION_new(void)
{
SSL_SESSION *ss;
- ss=(SSL_SESSION *)Malloc(sizeof(SSL_SESSION));
+ ss=(SSL_SESSION *)OPENSSL_malloc(sizeof(SSL_SESSION));
if (ss == NULL)
{
SSLerr(SSL_F_SSL_SESSION_NEW,ERR_R_MALLOC_FAILURE);
@@ -310,7 +310,7 @@ int ssl_get_prev_session(SSL *s, unsigned char *session_id, int len)
#if 0 /* This is way too late. */
/* If a thread got the session, then 'swaped', and another got
- * it and then due to a time-out decided to 'Free' it we could
+ * it and then due to a time-out decided to 'OPENSSL_free' it we could
* be in trouble. So I'll increment it now, then double decrement
* later - am I speaking rubbish?. */
CRYPTO_add(&ret->references,1,CRYPTO_LOCK_SSL_SESSION);
@@ -474,7 +474,7 @@ void SSL_SESSION_free(SSL_SESSION *ss)
if (ss->peer != NULL) X509_free(ss->peer);
if (ss->ciphers != NULL) sk_SSL_CIPHER_free(ss->ciphers);
memset(ss,0,sizeof(*ss));
- Free(ss);
+ OPENSSL_free(ss);
}
int SSL_set_session(SSL *s, SSL_SESSION *session)
diff --git a/ssl/ssltest.c b/ssl/ssltest.c
index caf5876e5a..2ef8a50785 100644
--- a/ssl/ssltest.c
+++ b/ssl/ssltest.c
@@ -1193,7 +1193,7 @@ int doit(SSL *s_ssl, SSL *c_ssl, long count)
ret=0;
err:
/* We have to set the BIO's to NULL otherwise they will be
- * Free()ed twice. Once when th s_ssl is SSL_free()ed and
+ * OPENSSL_free()ed twice. Once when th s_ssl is SSL_free()ed and
* again when c_ssl is SSL_free()ed.
* This is a hack required because s_ssl and c_ssl are sharing the same
* BIO structure and SSL_set_bio() and SSL_free() automatically
diff --git a/ssl/t1_enc.c b/ssl/t1_enc.c
index 279e45db5d..0d34357eb4 100644
--- a/ssl/t1_enc.c
+++ b/ssl/t1_enc.c
@@ -178,7 +178,7 @@ int tls1_change_cipher_state(SSL *s, int which)
{
if ((s->enc_read_ctx == NULL) &&
((s->enc_read_ctx=(EVP_CIPHER_CTX *)
- Malloc(sizeof(EVP_CIPHER_CTX))) == NULL))
+ OPENSSL_malloc(sizeof(EVP_CIPHER_CTX))) == NULL))
goto err;
dd= s->enc_read_ctx;
s->read_hash=m;
@@ -197,7 +197,7 @@ int tls1_change_cipher_state(SSL *s, int which)
}
if (s->s3->rrec.comp == NULL)
s->s3->rrec.comp=(unsigned char *)
- Malloc(SSL3_RT_MAX_ENCRYPTED_LENGTH);
+ OPENSSL_malloc(SSL3_RT_MAX_ENCRYPTED_LENGTH);
if (s->s3->rrec.comp == NULL)
goto err;
}
@@ -208,7 +208,7 @@ int tls1_change_cipher_state(SSL *s, int which)
{
if ((s->enc_write_ctx == NULL) &&
((s->enc_write_ctx=(EVP_CIPHER_CTX *)
- Malloc(sizeof(EVP_CIPHER_CTX))) == NULL))
+ OPENSSL_malloc(sizeof(EVP_CIPHER_CTX))) == NULL))
goto err;
dd= s->enc_write_ctx;
s->write_hash=m;
@@ -355,9 +355,9 @@ int tls1_setup_key_block(SSL *s)
ssl3_cleanup_key_block(s);
- if ((p1=(unsigned char *)Malloc(num)) == NULL)
+ if ((p1=(unsigned char *)OPENSSL_malloc(num)) == NULL)
goto err;
- if ((p2=(unsigned char *)Malloc(num)) == NULL)
+ if ((p2=(unsigned char *)OPENSSL_malloc(num)) == NULL)
goto err;
s->s3->tmp.key_block_length=num;
@@ -374,7 +374,7 @@ printf("pre-master\n");
#endif
tls1_generate_key_block(s,p1,p2,num);
memset(p2,0,num);
- Free(p2);
+ OPENSSL_free(p2);
#ifdef TLS_DEBUG
printf("\nkey block\n");
{ int z; for (z=0; z<num; z++) printf("%02X%c",p1[z],((z+1)%16)?' ':'\n'); }