summaryrefslogtreecommitdiffstats
path: root/crypto/evp
diff options
context:
space:
mode:
authorRichard Levitte <levitte@openssl.org>2000-06-01 22:19:21 +0000
committerRichard Levitte <levitte@openssl.org>2000-06-01 22:19:21 +0000
commit26a3a48d65c7464b400ec1de439994d7f0d25fed (patch)
tree91abb7d351b174e58f60e5353b731b916eaf0c5c /crypto/evp
parentde42b6a7a82be33d2976ab605e74d7bc95b71447 (diff)
There have been a number of complaints from a number of sources that names
like Malloc, Realloc and especially Free conflict with already existing names on some operating systems or other packages. That is reason enough to change the names of the OpenSSL memory allocation macros to something that has a better chance of being unique, like prepending them with OPENSSL_. This change includes all the name changes needed throughout all C files.
Diffstat (limited to 'crypto/evp')
-rw-r--r--crypto/evp/bio_b64.c4
-rw-r--r--crypto/evp/bio_enc.c4
-rw-r--r--crypto/evp/bio_md.c4
-rw-r--r--crypto/evp/bio_ok.c4
-rw-r--r--crypto/evp/evp_pbe.c4
-rw-r--r--crypto/evp/evp_pkey.c4
-rw-r--r--crypto/evp/p_lib.c4
-rw-r--r--crypto/evp/p_open.c4
8 files changed, 16 insertions, 16 deletions
diff --git a/crypto/evp/bio_b64.c b/crypto/evp/bio_b64.c
index e76387eaec..a275ef4c7d 100644
--- a/crypto/evp/bio_b64.c
+++ b/crypto/evp/bio_b64.c
@@ -113,7 +113,7 @@ static int b64_new(BIO *bi)
{
BIO_B64_CTX *ctx;
- ctx=(BIO_B64_CTX *)Malloc(sizeof(BIO_B64_CTX));
+ ctx=(BIO_B64_CTX *)OPENSSL_malloc(sizeof(BIO_B64_CTX));
if (ctx == NULL) return(0);
ctx->buf_len=0;
@@ -133,7 +133,7 @@ static int b64_new(BIO *bi)
static int b64_free(BIO *a)
{
if (a == NULL) return(0);
- Free(a->ptr);
+ OPENSSL_free(a->ptr);
a->ptr=NULL;
a->init=0;
a->flags=0;
diff --git a/crypto/evp/bio_enc.c b/crypto/evp/bio_enc.c
index 1b7a21010c..129e2e30a4 100644
--- a/crypto/evp/bio_enc.c
+++ b/crypto/evp/bio_enc.c
@@ -105,7 +105,7 @@ static int enc_new(BIO *bi)
{
BIO_ENC_CTX *ctx;
- ctx=(BIO_ENC_CTX *)Malloc(sizeof(BIO_ENC_CTX));
+ ctx=(BIO_ENC_CTX *)OPENSSL_malloc(sizeof(BIO_ENC_CTX));
EVP_CIPHER_CTX_init(&ctx->cipher);
if (ctx == NULL) return(0);
@@ -129,7 +129,7 @@ static int enc_free(BIO *a)
b=(BIO_ENC_CTX *)a->ptr;
EVP_CIPHER_CTX_cleanup(&(b->cipher));
memset(a->ptr,0,sizeof(BIO_ENC_CTX));
- Free(a->ptr);
+ OPENSSL_free(a->ptr);
a->ptr=NULL;
a->init=0;
a->flags=0;
diff --git a/crypto/evp/bio_md.c b/crypto/evp/bio_md.c
index f21319c04e..194555be4e 100644
--- a/crypto/evp/bio_md.c
+++ b/crypto/evp/bio_md.c
@@ -96,7 +96,7 @@ static int md_new(BIO *bi)
{
EVP_MD_CTX *ctx;
- ctx=(EVP_MD_CTX *)Malloc(sizeof(EVP_MD_CTX));
+ ctx=(EVP_MD_CTX *)OPENSSL_malloc(sizeof(EVP_MD_CTX));
if (ctx == NULL) return(0);
bi->init=0;
@@ -108,7 +108,7 @@ static int md_new(BIO *bi)
static int md_free(BIO *a)
{
if (a == NULL) return(0);
- Free(a->ptr);
+ OPENSSL_free(a->ptr);
a->ptr=NULL;
a->init=0;
a->flags=0;
diff --git a/crypto/evp/bio_ok.c b/crypto/evp/bio_ok.c
index 4f9b703a36..a358aadbaf 100644
--- a/crypto/evp/bio_ok.c
+++ b/crypto/evp/bio_ok.c
@@ -187,7 +187,7 @@ static int ok_new(BIO *bi)
{
BIO_OK_CTX *ctx;
- ctx=(BIO_OK_CTX *)Malloc(sizeof(BIO_OK_CTX));
+ ctx=(BIO_OK_CTX *)OPENSSL_malloc(sizeof(BIO_OK_CTX));
if (ctx == NULL) return(0);
ctx->buf_len=0;
@@ -209,7 +209,7 @@ static int ok_free(BIO *a)
{
if (a == NULL) return(0);
memset(a->ptr,0,sizeof(BIO_OK_CTX));
- Free(a->ptr);
+ OPENSSL_free(a->ptr);
a->ptr=NULL;
a->init=0;
a->flags=0;
diff --git a/crypto/evp/evp_pbe.c b/crypto/evp/evp_pbe.c
index 187521eb58..229ac673a7 100644
--- a/crypto/evp/evp_pbe.c
+++ b/crypto/evp/evp_pbe.c
@@ -116,7 +116,7 @@ int EVP_PBE_alg_add (int nid, EVP_CIPHER *cipher, EVP_MD *md,
{
EVP_PBE_CTL *pbe_tmp;
if (!pbe_algs) pbe_algs = sk_new ((int (*)())pbe_cmp);
- if (!(pbe_tmp = (EVP_PBE_CTL*) Malloc (sizeof(EVP_PBE_CTL)))) {
+ if (!(pbe_tmp = (EVP_PBE_CTL*) OPENSSL_malloc (sizeof(EVP_PBE_CTL)))) {
EVPerr(EVP_F_EVP_PBE_ALG_ADD,ERR_R_MALLOC_FAILURE);
return 0;
}
@@ -130,6 +130,6 @@ int EVP_PBE_alg_add (int nid, EVP_CIPHER *cipher, EVP_MD *md,
void EVP_PBE_cleanup(void)
{
- sk_pop_free(pbe_algs, FreeFunc);
+ sk_pop_free(pbe_algs, OPENSSL_freeFunc);
pbe_algs = NULL;
}
diff --git a/crypto/evp/evp_pkey.c b/crypto/evp/evp_pkey.c
index 892d1e91da..8df2874f3c 100644
--- a/crypto/evp/evp_pkey.c
+++ b/crypto/evp/evp_pkey.c
@@ -308,7 +308,7 @@ static int dsa_pkey2pkcs8(PKCS8_PRIV_KEY_INFO *p8, EVP_PKEY *pkey)
p8->pkeyalg->algorithm = OBJ_nid2obj(NID_dsa);
len = i2d_DSAparams (pkey->pkey.dsa, NULL);
- if (!(p = Malloc(len))) {
+ if (!(p = OPENSSL_malloc(len))) {
EVPerr(EVP_F_EVP_PKEY2PKCS8,ERR_R_MALLOC_FAILURE);
PKCS8_PRIV_KEY_INFO_free (p8);
return 0;
@@ -317,7 +317,7 @@ static int dsa_pkey2pkcs8(PKCS8_PRIV_KEY_INFO *p8, EVP_PKEY *pkey)
i2d_DSAparams (pkey->pkey.dsa, &q);
params = ASN1_STRING_new();
ASN1_STRING_set(params, p, len);
- Free(p);
+ OPENSSL_free(p);
/* Get private key into integer */
if (!(prkey = BN_to_ASN1_INTEGER (pkey->pkey.dsa->priv_key, NULL))) {
EVPerr(EVP_F_EVP_PKEY2PKCS8,EVP_R_ENCODE_ERROR);
diff --git a/crypto/evp/p_lib.c b/crypto/evp/p_lib.c
index 4cb387f8de..62398ed74d 100644
--- a/crypto/evp/p_lib.c
+++ b/crypto/evp/p_lib.c
@@ -180,7 +180,7 @@ EVP_PKEY *EVP_PKEY_new(void)
{
EVP_PKEY *ret;
- ret=(EVP_PKEY *)Malloc(sizeof(EVP_PKEY));
+ ret=(EVP_PKEY *)OPENSSL_malloc(sizeof(EVP_PKEY));
if (ret == NULL)
{
EVPerr(EVP_F_EVP_PKEY_NEW,ERR_R_MALLOC_FAILURE);
@@ -302,7 +302,7 @@ void EVP_PKEY_free(EVP_PKEY *x)
}
#endif
EVP_PKEY_free_it(x);
- Free(x);
+ OPENSSL_free(x);
}
static void EVP_PKEY_free_it(EVP_PKEY *x)
diff --git a/crypto/evp/p_open.c b/crypto/evp/p_open.c
index 6dbccceafa..85d5097644 100644
--- a/crypto/evp/p_open.c
+++ b/crypto/evp/p_open.c
@@ -82,7 +82,7 @@ int EVP_OpenInit(EVP_CIPHER_CTX *ctx, EVP_CIPHER *type, unsigned char *ek,
}
size=RSA_size(priv->pkey.rsa);
- key=(unsigned char *)Malloc(size+2);
+ key=(unsigned char *)OPENSSL_malloc(size+2);
if (key == NULL)
{
/* ERROR */
@@ -102,7 +102,7 @@ int EVP_OpenInit(EVP_CIPHER_CTX *ctx, EVP_CIPHER *type, unsigned char *ek,
ret=1;
err:
if (key != NULL) memset(key,0,size);
- Free(key);
+ OPENSSL_free(key);
return(ret);
}