]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
Fix BN_print()
authorKazuki Yamaguchi <k@rhe.jp>
Wed, 23 Aug 2017 16:28:05 +0000 (01:28 +0900)
committerKazuki Yamaguchi <k@rhe.jp>
Wed, 23 Aug 2017 16:28:15 +0000 (01:28 +0900)
Fix a typo made in commit 27c6d63dad08 (#4202).

Reviewed-by: Rich Salz <rsalz@openssl.org>
Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/4235)

crypto/bn/bn_print.c

index 0aaa9d53734ce4fc01d26917b2a531c623d8a679..1853269d903df17db2196b436a7c916cef38b30c 100644 (file)
@@ -313,7 +313,7 @@ int BN_print(BIO *bp, const BIGNUM *a)
     for (i = a->top - 1; i >= 0; i--) {
         for (j = BN_BITS2 - 4; j >= 0; j -= 4) {
             /* strip leading zeros */
-            v = (int)((a->d[i] >> j) & 0xff);
+            v = (int)((a->d[i] >> j) & 0x0f);
             if (z || v != 0) {
                 if (BIO_write(bp, &Hex[v], 1) != 1)
                     goto end;