Thanks, I will change it as you suggest. christos > On Oct 5, 2020, at 6:20 AM, Rin Okuyama <rokuyama.rk%gmail.com@localhost> wrote: > > Hi, > > On 2020/10/05 4:32, Christos Zoulas wrote: >> Module Name: src >> Committed By: christos >> Date: Sun Oct 4 19:32:48 UTC 2020 >> Modified Files: >> src/crypto/external/bsd/openssl/dist/crypto/bn: bn_print.c >> src/crypto/external/bsd/openssl/dist/include/openssl: bn.h >> src/crypto/external/bsd/openssl/lib/libcrypto: crypto.map >> Log Message: >> Add BN_oct2bn(3) for factor(6) >> To generate a diff of this commit: >> cvs rdiff -u -r1.1.1.10 -r1.2 \ >> src/crypto/external/bsd/openssl/dist/crypto/bn/bn_print.c >> cvs rdiff -u -r1.1.1.3 -r1.2 \ >> src/crypto/external/bsd/openssl/dist/include/openssl/bn.h >> cvs rdiff -u -r1.8 -r1.9 \ >> src/crypto/external/bsd/openssl/lib/libcrypto/crypto.map > > This commit breaks tests/crypto/libcrypto/t_libcrypto:bn as > > | # atf-run t_libcrypto > | ... > | tc-se:stderr: > | tc-se:# ERROR: (bool) 'BN_asc2bn(&bn, "0") == true' failed @ /usr/src/crypto/external/bsd/openssl/dist/test/bntest.c:1865 > | tc-se:# false > | tc-se: # ERROR: (bool) 'BN_asc2bn(&bn, test->base10) == true' failed @ /usr/src/crypto/external/bsd/openssl/dist/test/bntest.c:1930 > | tc-se: # false > | tc-se: > | tc-end: 1601892266.153458, bn, failed, atf-check failed; see the output of the test for details > >> Index: src/crypto/external/bsd/openssl/dist/crypto/bn/bn_print.c >> diff -u src/crypto/external/bsd/openssl/dist/crypto/bn/bn_print.c:1.1.1.10 src/crypto/external/bsd/openssl/dist/crypto/bn/bn_print.c:1.2 >> --- src/crypto/external/bsd/openssl/dist/crypto/bn/bn_print.c:1.1.1.10 Sat Mar 21 20:49:05 2020 >> +++ src/crypto/external/bsd/openssl/dist/crypto/bn/bn_print.c Sun Oct 4 15:32:48 2020 > ... >> @@ -273,9 +354,14 @@ int BN_asc2bn(BIGNUM **bn, const char *a >> if (*p == '-') >> p++; >> - if (p[0] == '0' && (p[1] == 'X' || p[1] == 'x')) { >> - if (!BN_hex2bn(bn, p + 2)) >> - return 0; >> + if (p[0] == '0') { >> + if (p[1] == 'X' || p[1] == 'x') { >> + if (!BN_hex2bn(bn, p + 2)) >> + return 0; >> + } else { >> + if (!BN_oct2bn(bn, p + 1)) >> + return 0; >> + } >> } else { >> if (!BN_dec2bn(bn, p)) >> return 0; > > This part probably should be > > | } else if (p[1] != '\0') { > | if (!BN_oct2bn(bn, p + 1)) > | return 0; > | } > > Otherwise, conversion fails for "0". > > Thanks, > rin
Attachment:
signature.asc
Description: Message signed with OpenPGP