crypto/x509: check the Key Usage extension #40100
Comments
Change https://golang.org/cl/246877 mentions this issue: |
I searched the crypto pkg and found there are two functions in crypto which relate to KU extension checking: |
KU extensions can also be checked with the Verify method available for certificates. If you are considering rewriting KU extension checking I suggest you also take a look at this: 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. |
Thanks everyone for the interaction. Not much action during Go1.16, thus I'll punt to Go1.17, and I'll kindly tag you @FiloSottile @katiehockman @rolandshoemaker to help review @SparrowLii's CL from #40100 (comment) |
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: