summaryrefslogtreecommitdiffstats
path: root/crypto/bn/bn_print.c
diff options
context:
space:
mode:
authorDr. Stephen Henson <steve@openssl.org>2006-04-11 17:28:37 +0000
committerDr. Stephen Henson <steve@openssl.org>2006-04-11 17:28:37 +0000
commit54d853ebc380d06502bbb517a7ce116af52c123c (patch)
treeb70a663977feb86d8e3b0c6f5c1a44df8f35e0b0 /crypto/bn/bn_print.c
parentf5cda4cbb17c908ceef33f4f52d94e8e04b7c1ab (diff)
Add support for setting keybits and public exponent value for pkey RSA keygen.
Diffstat (limited to 'crypto/bn/bn_print.c')
-rw-r--r--crypto/bn/bn_print.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/crypto/bn/bn_print.c b/crypto/bn/bn_print.c
index 055d048856..1451d966f7 100644
--- a/crypto/bn/bn_print.c
+++ b/crypto/bn/bn_print.c
@@ -294,6 +294,27 @@ err:
return(0);
}
+int BN_asc2bn(BIGNUM **bn, const char *a)
+ {
+ const char *p = a;
+ if (*p == '-')
+ p++;
+
+ if (p[0] == '0' && (p[1] == 'X' || p[1] == 'x'))
+ {
+ if (!BN_hex2bn(bn, p + 2))
+ return 0;
+ }
+ else
+ {
+ if (!BN_dec2bn(bn, p))
+ return 0;
+ }
+ if (*a == '-')
+ (*bn)->neg = 1;
+ return 1;
+ }
+
#ifndef OPENSSL_NO_BIO
#ifndef OPENSSL_NO_FP_API
int BN_print_fp(FILE *fp, const BIGNUM *a)