X509_print_ex tries to print negative serial numbers in decimal. In doing so, it ends up passing a signed long to %lx and trips -Wformat-signed. A minimal fix would be to cast to unsigned long, but this unsigned long is the absolute value of a signed long (l = -l). This is tricky because -LONG_MIN does not fit in long. It all works because the length check only allows one bit short of sizeof(long)*8 bits (ASN1_INTEGER is sign-and-magnitude). Still, this is a whole lot of subtlety to account for an invalid case. Instead, send negative serial numbers down the generic path. Bug: 450 Change-Id: Ib215fd23863de27e01f7ededf95578f9c800da37 Reviewed-on: https://boringssl-review.googlesource.com/c/boringssl/+/50766 Reviewed-by: Adam Langley <agl@google.com> Commit-Queue: David Benjamin <davidben@google.com>fips-20220613
parent
4f1fae3043
commit
866b88dfe7
1 changed files with 19 additions and 19 deletions
Loading…
Reference in new issue