Apply self-imposed path length also to root CAs
authorViktor Dukhovni <openssl-users@dukhovni.org>
Mon, 8 Oct 2018 16:05:14 +0000 (12:05 -0400)
committerViktor Dukhovni <openssl-users@dukhovni.org>
Thu, 18 Oct 2018 04:43:52 +0000 (00:43 -0400)
commit35cf781c20b65e51c6d0d3e9a199e74534b60b4a
treefcdb9c174fdb703e3a80e746da440c638c4750eb
parentc8ce9e50d50af58d878d81522a3d592c00a17ba0
Apply self-imposed path length also to root CAs

Also, some readers of the code find starting the count at 1 for EE
cert confusing (since RFC5280 counts only non-self-issued intermediate
CAs, but we also counted the leaf).  Therefore, never count the EE
cert, and adjust the path length comparison accordinly.  This may
be more clear to the reader.

Reviewed-by: Matt Caswell <matt@openssl.org>
(cherry picked from commit dc5831da59e9bfad61ba425d886a0b06ac160cd6)
crypto/x509/x509_vfy.c