Ensure BN_asc2bn, BN_dec2bn, and BN_hex2bn never give -0.

When |BN_dec2bn| and |BN_hex2bn| were merged (way back in the initial
BoringSSL change), the neg flag was set too soon and could be cleared by

This is an import of upstream's c85573cc. The unittest change isn't
included here because bn_test.c has changed significantly in upstream
and BoringSSL unittests aren't run in the Android environment.

Bug: 20523350
Change-Id: Iaf8efe2fe3419218437f5ebb9a15f73559860a0f
2 files changed