X-Git-Url: https://git.openssl.org/?p=openssl.git;a=blobdiff_plain;f=crypto%2Fbn%2Fbn_print.c;h=1743b6a7e212f19bcc94f0816c71493b1270961f;hp=521e8a383165082be46b5657068c27701452a992;hb=c93233dbfd6fee35fdf8c8a45ae36b9b9bd7ad9b;hpb=4d6e1e4f29de455b5e644ea9cae5d5f5a2dbef33 diff --git a/crypto/bn/bn_print.c b/crypto/bn/bn_print.c index 521e8a3831..1743b6a7e2 100644 --- a/crypto/bn/bn_print.c +++ b/crypto/bn/bn_print.c @@ -71,7 +71,7 @@ char *BN_bn2hex(const BIGNUM *a) char *buf; char *p; - buf=OPENSSL_malloc(a->top*BN_BYTES*2+2); + buf=(char *)OPENSSL_malloc(a->top*BN_BYTES*2+2); if (buf == NULL) { BNerr(BN_F_BN_BN2HEX,ERR_R_MALLOC_FAILURE); @@ -116,7 +116,7 @@ char *BN_bn2dec(const BIGNUM *a) i=BN_num_bits(a)*3; num=(i/10+i/1000+1)+1; bn_data=(BN_ULONG *)OPENSSL_malloc((num/BN_DEC_NUM+1)*sizeof(BN_ULONG)); - buf=OPENSSL_malloc(num+3); + buf=(char *)OPENSSL_malloc(num+3); if ((buf == NULL) || (bn_data == NULL)) { BNerr(BN_F_BN_BN2DEC,ERR_R_MALLOC_FAILURE); @@ -357,3 +357,22 @@ end: return(ret); } #endif + +char *BN_options(void) + { + static int init=0; + static char data[16]; + + if (!init) + { + init++; +#ifdef BN_LLONG + BIO_snprintf(data,sizeof data,"bn(%d,%d)", + (int)sizeof(BN_ULLONG)*8,(int)sizeof(BN_ULONG)*8); +#else + BIO_snprintf(data,sizeof data,"bn(%d,%d)", + (int)sizeof(BN_ULONG)*8,(int)sizeof(BN_ULONG)*8); +#endif + } + return(data); + }