Fix SCT validation when invalid certificates are in chain.

At the moment it would try to access an unset optional in this case.
This commit is contained in:
Johanna Amann 2018-05-22 17:18:14 -07:00
parent 84c1d9c808
commit 1fec186c39

View file

@ -180,6 +180,8 @@ hook ssl_finishing(c: connection) &priority=19
{
if ( i == 0 ) # end-host-cert
next;
if ( ! c$ssl$cert_chain[i]?$x509 || ! c$ssl$cert_chain[i]$x509?$handle )
next;
issuer_key_hash = x509_spki_hash(c$ssl$cert_chain[i]$x509$handle, 4);
valid = sct_verify(cert, proof$logid, log$key, proof$signature, proof$timestamp, proof$hash_alg, issuer_key_hash);