Commit 11d0533c authored by Tatsuhiro Tsujikawa's avatar Tatsuhiro Tsujikawa

nghttpx: Ensure that cert serial does not exceed 20 bytes

parent dbb5f00d
......@@ -2042,7 +2042,7 @@ StringRef get_x509_serial(BlockAllocator &balloc, X509 *x) {
auto sn = X509_get_serialNumber(x);
auto bn = BN_new();
auto bn_d = defer(BN_free, bn);
if (!ASN1_INTEGER_to_BN(sn, bn)) {
if (!ASN1_INTEGER_to_BN(sn, bn) || BN_num_bytes(bn) > 20) {
return StringRef{};
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment