diff options
author | tb <> | 2023-06-23 10:48:40 +0000 |
---|---|---|
committer | tb <> | 2023-06-23 10:48:40 +0000 |
commit | 03192bd2803d5709fc909973fdedc8b7237ab2dc (patch) | |
tree | 67c5a0de710d097470e85a35c2df241dea7f9da7 /src/lib/libcrypto/ec/ec_lib.c | |
parent | 897bfa360be535489769bcdbfdfbf80cc844730d (diff) | |
download | openbsd-03192bd2803d5709fc909973fdedc8b7237ab2dc.tar.gz openbsd-03192bd2803d5709fc909973fdedc8b7237ab2dc.tar.bz2 openbsd-03192bd2803d5709fc909973fdedc8b7237ab2dc.zip |
Avoid crash in BN_asc2bn()
Historically (and currently in OpenSSL), BN_asc2bn() could be called with
NULL, but only for positive numbers. So BN_asc2bn(NULL, "1") would succeed
but BN_asc2bn(NULL, "-1"), would crash. The other *2bn functions return a
length, so accepting a NULL makes some sense since it allows callers to
skip over part of the string just parsed (atoi-style).
For BN_asc2bn() a NULL bn makes no sense because it returns a boolean. The
recent CBS rewrite makes BN_asc2bn(NULL, *) always crash which in turn made
Coverity throw a fit.
Another change of behavior from that rewrite pertains to accidents (or is
it madness?) like -0x-11 and 0x-11 being parsed as decimal -17 (which Ingo
of course spotted and diligently documented). This will be addressed later.
ok jsing
Diffstat (limited to 'src/lib/libcrypto/ec/ec_lib.c')
0 files changed, 0 insertions, 0 deletions