We currently ignore the Key Usage extension because some old roots had gotten it wrong. Things probably improved by now and we can take a stab at following the spec again. AFAIK other verifiers do check them.
The text was updated successfully, but these errors were encountered:
I searched the crypto pkg and found there are two functions in crypto which relate to KU extension checking:
CheckSignature(x509.go 823) and verifyHandshakeSignature(auth.go 22). But it seems hard to check the KU inside the func body. I think maybe we can check KU before use one PublicKey.
I think the method makes a bit too straightforward assumption about KUs if the opts.KeyUsages is left empty. I'm not sure if it would be better to then assume that no usage is ok or to get the acceptable KUs from the cert chain.