aboutsummaryrefslogtreecommitdiff
path: root/crypto/bn/bn_print.c
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/bn/bn_print.c')
-rw-r--r--crypto/bn/bn_print.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/crypto/bn/bn_print.c b/crypto/bn/bn_print.c
index 0c3b214..c00b724 100644
--- a/crypto/bn/bn_print.c
+++ b/crypto/bn/bn_print.c
@@ -215,13 +215,8 @@ int BN_hex2bn(BIGNUM **bn, const char *a)
l = 0;
for (;;) {
c = a[j - m];
- if ((c >= '0') && (c <= '9'))
- k = c - '0';
- else if ((c >= 'a') && (c <= 'f'))
- k = c - 'a' + 10;
- else if ((c >= 'A') && (c <= 'F'))
- k = c - 'A' + 10;
- else
+ k = OPENSSL_hexchar2int(c);
+ if (k < 0)
k = 0; /* paranoia */
l = (l << 4) | k;