Skip to content
Snippets Groups Projects
Commit 2cbc8d7d authored by Matt Caswell's avatar Matt Caswell
Browse files

Implement internally opaque bn access from ts


Reviewed-by: default avatarTim Hudson <tjh@openssl.org>
parent aeb556f8
No related branches found
No related tags found
No related merge requests found
......@@ -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;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment