X-Git-Url: https://git.openssl.org/gitweb/?p=openssl.git;a=blobdiff_plain;f=crypto%2Fasn1%2Fi2d_r_pr.c;h=518f4af9a66ee6577b17958977dbdb6ada5cf032;hp=cc61637de453ef6fa5a24f9a4f2dd24b44cbafdf;hb=66ebbb6a56bc1688fa37878e4feec985b0c260d7;hpb=ec577822f95a8bca0023c5c77cef1a4916822d4a diff --git a/crypto/asn1/i2d_r_pr.c b/crypto/asn1/i2d_r_pr.c index cc61637de4..518f4af9a6 100644 --- a/crypto/asn1/i2d_r_pr.c +++ b/crypto/asn1/i2d_r_pr.c @@ -56,6 +56,7 @@ * [including the GNU Public Licence.] */ +#ifndef NO_RSA #include #include "cryptlib.h" #include @@ -63,12 +64,7 @@ #include #include -/* - * ASN1err(ASN1_F_D2I_RSAPRIVATEKEY,ERR_R_ASN1_LENGTH_MISMATCH); - * ASN1err(ASN1_F_I2D_RSAPRIVATEKEY,ASN1_R_UNKNOWN_ATTRIBUTE_TYPE); - */ - -int i2d_RSAPrivateKey(RSA *a, unsigned char **pp) +int i2d_RSAPrivateKey(const RSA *a, unsigned char **pp) { BIGNUM *num[9]; unsigned char data[1]; @@ -111,7 +107,7 @@ int i2d_RSAPrivateKey(RSA *a, unsigned char **pp) i2d_ASN1_INTEGER(&bs,&p); - bs.data=(unsigned char *)Malloc(max+4); + bs.data=(unsigned char *)OPENSSL_malloc(max+4); if (bs.data == NULL) { ASN1err(ASN1_F_I2D_RSAPRIVATEKEY,ERR_R_MALLOC_FAILURE); @@ -123,8 +119,15 @@ int i2d_RSAPrivateKey(RSA *a, unsigned char **pp) bs.length=BN_bn2bin(num[i],bs.data); i2d_ASN1_INTEGER(&bs,&p); } - Free((char *)bs.data); + OPENSSL_free(bs.data); *pp=p; return(t); } +#else /* !NO_RSA */ + +# if PEDANTIC +static void *dummy=&dummy; +# endif + +#endif