summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatt Caswell <matt@openssl.org>2014-10-28 23:04:10 +0000
committerMatt Caswell <matt@openssl.org>2014-12-08 21:41:07 +0000
commit2cbc8d7de5265aa86f739a5f7806d95eb8c31c87 (patch)
tree9b317c410b535baf3167029a337068265948e0de
parentaeb556f8317cb5affcadafe17cf59242f1822a2a (diff)
Implement internally opaque bn access from ts
Reviewed-by: Tim Hudson <tjh@openssl.org>
-rw-r--r--crypto/ts/ts_lib.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/crypto/ts/ts_lib.c b/crypto/ts/ts_lib.c
index ca510267fc..c8f41f6fd0 100644
--- a/crypto/ts/ts_lib.c
+++ b/crypto/ts/ts_lib.c
@@ -69,19 +69,20 @@
int TS_ASN1_INTEGER_print_bio(BIO *bio, const ASN1_INTEGER *num)
{
- BIGNUM num_bn;
+ BIGNUM *num_bn;
int result = 0;
char *hex;
- BN_init(&num_bn);
- ASN1_INTEGER_to_BN(num, &num_bn);
- if ((hex = BN_bn2hex(&num_bn)))
+ num_bn = BN_new();
+ if(!num_bn) return -1;
+ ASN1_INTEGER_to_BN(num, num_bn);
+ if ((hex = BN_bn2hex(num_bn)))
{
result = BIO_write(bio, "0x", 2) > 0;
result = result && BIO_write(bio, hex, strlen(hex)) > 0;
OPENSSL_free(hex);
}
- BN_free(&num_bn);
+ BN_free(num_bn);
return result;
}