]> git.kaiwu.me - nginx.git/commit
OCSP: preserved serial number sign in cache keys
authorAleksei Bavshin <a.bavshin@nginx.com>
Thu, 17 Sep 2026 20:22:33 +0000 (13:22 -0700)
committerSergey Kandaurov <pluknet@nginx.com>
Thu, 5 Nov 2026 14:27:12 +0000 (18:27 +0400)
commitd45e6c5c49b54a8146c79df81a9caa0196698eb9
tree8e9b3fb3986cc2a39978e64d8baee7cc19a2d80f
parentd56c3fb5dc9903cd3d6b9eee5617a0f14700df7a
OCSP: preserved serial number sign in cache keys

As OpenSSL does not store the sign in the ASN1_INTEGER string data,
it is not possible to distinguish positive and negative serial numbers.
While negative serials are forbidden in RFC 5280 4.1.2.2, it also says
that we SHOULD expect these from non-conforming CAs.
The solution is to use full DER-encoding of a signed integer obtained
with i2d_ASN1_INTEGER.

The change also addresses a correctness issue, as ASN1_STRING accessors
should not be used on ASN1_INTEGER.
src/event/ngx_event_openssl.h
src/event/ngx_event_openssl_stapling.c