Use X509_get_ext_d2i() also for x509_get_aki() and x509_get_ski().
authorclaudio <claudio@openbsd.org>
Thu, 18 Feb 2021 16:23:17 +0000 (16:23 +0000)
committerclaudio <claudio@openbsd.org>
Thu, 18 Feb 2021 16:23:17 +0000 (16:23 +0000)
commit356f9aec6fc409e8f24cb6609ee9cdf7d4d265e9
tree449063c8faf966145ab24724a762d4aca8f279f6
parentf6e3c5bdecb2b816f862080d1b1fea6a09ada44c
Use X509_get_ext_d2i() also for x509_get_aki() and x509_get_ski().
Now x509_get_extensions() is no longer required to loop over all
extensions and the code becomes a lot simpler.
While there cleanup x509_get_crl(), as explained by tb@ X509_get_ext_d2i()
allocates memory so one needs to free the pointer at the end.
For x509_crl_get_aki() use X509_CRL_get_ext_d2i() and more or less
copy the rest over from x509_get_aki().
Warn if extensions are missing or present when not expected and also
check the the extensions are marked non-critical as required.
OK job@ tb@
usr.sbin/rpki-client/cert.c
usr.sbin/rpki-client/extern.h
usr.sbin/rpki-client/parser.c
usr.sbin/rpki-client/x509.c