aboutsummaryrefslogtreecommitdiffstats
path: root/crypto/rsa
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/rsa')
-rw-r--r--crypto/rsa/rsa_eay.c16
-rw-r--r--crypto/rsa/rsa_lib.c10
-rw-r--r--crypto/rsa/rsa_oaep.c8
-rw-r--r--crypto/rsa/rsa_saos.c8
-rw-r--r--crypto/rsa/rsa_sign.c8
5 files changed, 25 insertions, 25 deletions
diff --git a/crypto/rsa/rsa_eay.c b/crypto/rsa/rsa_eay.c
index b7d2460754..618b5bd595 100644
--- a/crypto/rsa/rsa_eay.c
+++ b/crypto/rsa/rsa_eay.c
@@ -106,7 +106,7 @@ static int RSA_eay_public_encrypt(int flen, unsigned char *from,
BN_init(&ret);
if ((ctx=BN_CTX_new()) == NULL) goto err;
num=BN_num_bytes(rsa->n);
- if ((buf=(unsigned char *)Malloc(num)) == NULL)
+ if ((buf=(unsigned char *)OPENSSL_malloc(num)) == NULL)
{
RSAerr(RSA_F_RSA_EAY_PUBLIC_ENCRYPT,ERR_R_MALLOC_FAILURE);
goto err;
@@ -161,7 +161,7 @@ err:
if (buf != NULL)
{
memset(buf,0,num);
- Free(buf);
+ OPENSSL_free(buf);
}
return(r);
}
@@ -179,7 +179,7 @@ static int RSA_eay_private_encrypt(int flen, unsigned char *from,
if ((ctx=BN_CTX_new()) == NULL) goto err;
num=BN_num_bytes(rsa->n);
- if ((buf=(unsigned char *)Malloc(num)) == NULL)
+ if ((buf=(unsigned char *)OPENSSL_malloc(num)) == NULL)
{
RSAerr(RSA_F_RSA_EAY_PRIVATE_ENCRYPT,ERR_R_MALLOC_FAILURE);
goto err;
@@ -237,7 +237,7 @@ err:
if (buf != NULL)
{
memset(buf,0,num);
- Free(buf);
+ OPENSSL_free(buf);
}
return(r);
}
@@ -258,7 +258,7 @@ static int RSA_eay_private_decrypt(int flen, unsigned char *from,
num=BN_num_bytes(rsa->n);
- if ((buf=(unsigned char *)Malloc(num)) == NULL)
+ if ((buf=(unsigned char *)OPENSSL_malloc(num)) == NULL)
{
RSAerr(RSA_F_RSA_EAY_PRIVATE_DECRYPT,ERR_R_MALLOC_FAILURE);
goto err;
@@ -330,7 +330,7 @@ err:
if (buf != NULL)
{
memset(buf,0,num);
- Free(buf);
+ OPENSSL_free(buf);
}
return(r);
}
@@ -350,7 +350,7 @@ static int RSA_eay_public_decrypt(int flen, unsigned char *from,
if (ctx == NULL) goto err;
num=BN_num_bytes(rsa->n);
- buf=(unsigned char *)Malloc(num);
+ buf=(unsigned char *)OPENSSL_malloc(num);
if (buf == NULL)
{
RSAerr(RSA_F_RSA_EAY_PUBLIC_DECRYPT,ERR_R_MALLOC_FAILURE);
@@ -402,7 +402,7 @@ err:
if (buf != NULL)
{
memset(buf,0,num);
- Free(buf);
+ OPENSSL_free(buf);
}
return(r);
}
diff --git a/crypto/rsa/rsa_lib.c b/crypto/rsa/rsa_lib.c
index 88d93a46dd..bbddd3f0f0 100644
--- a/crypto/rsa/rsa_lib.c
+++ b/crypto/rsa/rsa_lib.c
@@ -116,7 +116,7 @@ RSA *RSA_new_method(RSA_METHOD *meth)
{
RSA *ret;
- ret=(RSA *)Malloc(sizeof(RSA));
+ ret=(RSA *)OPENSSL_malloc(sizeof(RSA));
if (ret == NULL)
{
RSAerr(RSA_F_RSA_NEW_METHOD,ERR_R_MALLOC_FAILURE);
@@ -147,7 +147,7 @@ RSA *RSA_new_method(RSA_METHOD *meth)
ret->flags=ret->meth->flags;
if ((ret->meth->init != NULL) && !ret->meth->init(ret))
{
- Free(ret);
+ OPENSSL_free(ret);
ret=NULL;
}
else
@@ -188,8 +188,8 @@ void RSA_free(RSA *r)
if (r->dmq1 != NULL) BN_clear_free(r->dmq1);
if (r->iqmp != NULL) BN_clear_free(r->iqmp);
if (r->blinding != NULL) BN_BLINDING_free(r->blinding);
- if (r->bignum_data != NULL) Free_locked(r->bignum_data);
- Free(r);
+ if (r->bignum_data != NULL) OPENSSL_free_locked(r->bignum_data);
+ OPENSSL_free(r);
}
int RSA_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new *new_func,
@@ -306,7 +306,7 @@ int RSA_memory_lock(RSA *r)
j=1;
for (i=0; i<6; i++)
j+= (*t[i])->top;
- if ((p=Malloc_locked((off+j)*sizeof(BN_ULONG))) == NULL)
+ if ((p=OPENSSL_malloc_locked((off+j)*sizeof(BN_ULONG))) == NULL)
{
RSAerr(RSA_F_MEMORY_LOCK,ERR_R_MALLOC_FAILURE);
return(0);
diff --git a/crypto/rsa/rsa_oaep.c b/crypto/rsa/rsa_oaep.c
index 1465c01f4f..fd0b7f361f 100644
--- a/crypto/rsa/rsa_oaep.c
+++ b/crypto/rsa/rsa_oaep.c
@@ -34,7 +34,7 @@ int RSA_padding_add_PKCS1_OAEP(unsigned char *to, int tlen,
return (0);
}
- dbmask = Malloc(emlen - SHA_DIGEST_LENGTH);
+ dbmask = OPENSSL_malloc(emlen - SHA_DIGEST_LENGTH);
if (dbmask == NULL)
{
RSAerr(RSA_F_RSA_PADDING_ADD_PKCS1_OAEP, ERR_R_MALLOC_FAILURE);
@@ -66,7 +66,7 @@ int RSA_padding_add_PKCS1_OAEP(unsigned char *to, int tlen,
for (i = 0; i < SHA_DIGEST_LENGTH; i++)
seed[i] ^= seedmask[i];
- Free(dbmask);
+ OPENSSL_free(dbmask);
return (1);
}
@@ -86,7 +86,7 @@ int RSA_padding_check_PKCS1_OAEP(unsigned char *to, int tlen,
}
dblen = num - SHA_DIGEST_LENGTH;
- db = Malloc(dblen);
+ db = OPENSSL_malloc(dblen);
if (db == NULL)
{
RSAerr(RSA_F_RSA_PADDING_ADD_PKCS1_OAEP, ERR_R_MALLOC_FAILURE);
@@ -128,7 +128,7 @@ int RSA_padding_check_PKCS1_OAEP(unsigned char *to, int tlen,
memcpy(to, db + i, mlen);
}
}
- Free(db);
+ OPENSSL_free(db);
return (mlen);
}
diff --git a/crypto/rsa/rsa_saos.c b/crypto/rsa/rsa_saos.c
index 61efb0b00f..c77f4381ff 100644
--- a/crypto/rsa/rsa_saos.c
+++ b/crypto/rsa/rsa_saos.c
@@ -81,7 +81,7 @@ int RSA_sign_ASN1_OCTET_STRING(int type, unsigned char *m, unsigned int m_len,
RSAerr(RSA_F_RSA_SIGN_ASN1_OCTET_STRING,RSA_R_DIGEST_TOO_BIG_FOR_RSA_KEY);
return(0);
}
- s=(unsigned char *)Malloc((unsigned int)j+1);
+ s=(unsigned char *)OPENSSL_malloc((unsigned int)j+1);
if (s == NULL)
{
RSAerr(RSA_F_RSA_SIGN_ASN1_OCTET_STRING,ERR_R_MALLOC_FAILURE);
@@ -96,7 +96,7 @@ int RSA_sign_ASN1_OCTET_STRING(int type, unsigned char *m, unsigned int m_len,
*siglen=i;
memset(s,0,(unsigned int)j+1);
- Free(s);
+ OPENSSL_free(s);
return(ret);
}
@@ -114,7 +114,7 @@ int RSA_verify_ASN1_OCTET_STRING(int dtype, unsigned char *m,
return(0);
}
- s=(unsigned char *)Malloc((unsigned int)siglen);
+ s=(unsigned char *)OPENSSL_malloc((unsigned int)siglen);
if (s == NULL)
{
RSAerr(RSA_F_RSA_VERIFY_ASN1_OCTET_STRING,ERR_R_MALLOC_FAILURE);
@@ -138,7 +138,7 @@ int RSA_verify_ASN1_OCTET_STRING(int dtype, unsigned char *m,
err:
if (sig != NULL) M_ASN1_OCTET_STRING_free(sig);
memset(s,0,(unsigned int)siglen);
- Free(s);
+ OPENSSL_free(s);
return(ret);
}
diff --git a/crypto/rsa/rsa_sign.c b/crypto/rsa/rsa_sign.c
index 05bb7fb74a..31049b9791 100644
--- a/crypto/rsa/rsa_sign.c
+++ b/crypto/rsa/rsa_sign.c
@@ -115,7 +115,7 @@ int RSA_sign(int type, unsigned char *m, unsigned int m_len,
return(0);
}
if(type != NID_md5_sha1) {
- s=(unsigned char *)Malloc((unsigned int)j+1);
+ s=(unsigned char *)OPENSSL_malloc((unsigned int)j+1);
if (s == NULL)
{
RSAerr(RSA_F_RSA_SIGN,ERR_R_MALLOC_FAILURE);
@@ -132,7 +132,7 @@ int RSA_sign(int type, unsigned char *m, unsigned int m_len,
if(type != NID_md5_sha1) {
memset(s,0,(unsigned int)j+1);
- Free(s);
+ OPENSSL_free(s);
}
return(ret);
}
@@ -153,7 +153,7 @@ int RSA_verify(int dtype, unsigned char *m, unsigned int m_len,
if(rsa->flags & RSA_FLAG_SIGN_VER)
return rsa->meth->rsa_verify(dtype, m, m_len, sigbuf, siglen, rsa);
- s=(unsigned char *)Malloc((unsigned int)siglen);
+ s=(unsigned char *)OPENSSL_malloc((unsigned int)siglen);
if (s == NULL)
{
RSAerr(RSA_F_RSA_VERIFY,ERR_R_MALLOC_FAILURE);
@@ -215,7 +215,7 @@ int RSA_verify(int dtype, unsigned char *m, unsigned int m_len,
err:
if (sig != NULL) X509_SIG_free(sig);
memset(s,0,(unsigned int)siglen);
- Free(s);
+ OPENSSL_free(s);
return(ret);
}