Commit Graph

30 Commits

Author SHA1 Message Date
Tobias Brunner 0cf3549675 revocation: Fix memory leak if fetching CRL/OCSP fails
We might get a 404 error page back.
2018-05-22 09:50:47 +02:00
Tobias Brunner cae43b890a revocation: Set defaults if CRL/OCSP checking is disabled in config 2018-05-22 09:50:47 +02:00
Tobias Brunner b00d3adbd1 revocation: Also store validation results for intermediate CA certificates
If the certificate is revoked, we immediately returned and the chain was
invalid, however, if we couldn't fetch the CRL that result was not stored
for intermediate CAs and we weren't able to enforce a strict CRL policy
later.
2018-05-22 09:50:47 +02:00
Tobias Brunner 13f76a241c revocation: Ignore CRLs that are not yet valid
Using such CRLs can be a problem if the clock on the host doing the
revocation check is trailing behind that of the host issuing CRLs in
scenarios where expired certificates are removed from CRLs.  As revoked
certificates that expired will then not be part of new CRLs a host with
trailing clock might still accept such a certificate if it is still
valid according to its system clock but is not contained anymore in the
not yet valid CRL.
2018-05-22 09:50:47 +02:00
Tobias Brunner 21553276a3 revocation: Make sure issuer of fetched CRL matches that of the certificate
Unless there is a cRLIssuer listed in the CDP, the CRL should be issued
by the same issuer as the checked certificate.

Fixes #2608.
2018-04-12 15:45:24 +02:00
Tobias Brunner 432358cf49 revocation: Skip any zero bytes when comparing serials in CRLs
Depending on the plugins that eventually parse the certificate and CRL,
serials with MSB set (i.e. negative numbers that have a zero byte prefixed
when encoded as ASN.1 INTEGER) might have (x509 plugin) or not have
(openssl plugin) a zero byte prefix when returned by get_serial() or
enumerated from the CRL.  Strip them before doing the comparison or
revocation checking might fail if not both credentials are parsed by the
same plugin (which should be rare and only happen if parsing of either
cert or CRL fails with one of the plugins and there is a fallback to the
implementation provided by the other plugin).

Fixes #2509.
2018-01-31 10:50:41 +01:00
Tobias Brunner 2de9bb30fe revocation: More accurately describe the flags to disable OCSP/CRL validation
These options disable validation as such, e.g. even from cached CRLs, not
only the fetching.  Also made the plugin's validate() implementation a
no-op if both options are disabled.
2017-02-15 10:41:38 +01:00
Andreas Steffen e3f63c6469 revocation: OCSP and/or CRL fetching can be disabled 2016-12-30 18:12:53 +01:00
Tobias Brunner cee01fc9bf revocation: Cache valid CRL also if certificate is revoked 2016-10-11 17:18:22 +02:00
Tobias Brunner e161238e8e revocation: Allow CRLs to be encoded in PEM format
Since the textual representation for a CRL is now standardized
in RFC 7468 one could argue that we should accept that too, even
though RFC 5280 explicitly demands CRLs fetched via HTTP/FTP to
be in DER format.  But in particular for file URIs enforcing that
seems inconvenient.

Fixes #1203.
2015-11-12 14:40:44 +01:00
Martin Willi 94fb33bb88 revocation: Log error if no OCSP signer candidate found
Fixes evaluation of ikev2/ocsp-untrusted-cert.
2014-03-31 15:02:17 +02:00
Martin Willi 91d71abb16 revocation: Restrict OCSP signing to specific certificates
To avoid considering each cached OCSP response and evaluating its trustchain,
we limit the certificates considered for OCSP signing to:

- The issuing CA of the checked certificate
- A directly delegated signer by the same CA, having the OCSP signer constraint
- Any locally installed (trusted) certificate having the OCSP signer constraint

The first two options cover the requirements from RFC 6960 2.6. For
compatibility with non-conforming CAs, we allow the third option as exception,
but require the installation of such certificates locally.
2014-03-31 14:40:33 +02:00
Martin Willi a844b65890 revocation: Don't merge auth config of CLR/OCSP trustchain validation
This behavior was introduced with 6840a6fb to avoid key/signature strength
checking for the revocation trustchain as we do it for end entity certificates.
Unfortunately this breaks CA constraint checking under certain conditions, as
we merge additional intermediate/CA certificates to the auth config.

As key/signature strength checking of the revocation trustchain is a rather
exotic requirement we drop support for that to properly enforce CA constraints.
2014-03-31 14:40:33 +02:00
Martin Willi 4d7a762871 credmgr: introduce a hook function to catch trust chain validation errors 2013-07-18 16:00:30 +02:00
Tobias Brunner f05b427265 Moved debug.[ch] to utils folder 2012-10-24 16:00:51 +02:00
Martin Willi fd4ff11858 Add signature schemes to auth_cfg during trustchain validation 2012-06-12 14:24:49 +02:00
Martin Willi 747f837cce Added a flag to register local credential sets exclusively, disabling all others 2012-03-20 17:31:28 +01:00
Thomas Egerer 6e5e2762d3 Handle certificates being on hold in a CRL
Certificates which are set on hold in a CRL might be removed from any
subsequent CRL. Hence you cannot conclude that a certificate is revoked
for good in this case, you would try to retrieve an update CRL to see if
the certificate on hold is still on it or not.
2011-11-04 11:11:17 +01:00
Andreas Steffen d390b3b901 [hopefully] fixed pathlen problem on ARM platforms 2011-02-10 15:51:18 +01:00
Martin Willi 7b3740d958 Added support for delta CRL checking to revocation plugin 2011-01-05 16:46:07 +01:00
Martin Willi d3a18dade1 Check for issuer only if we actually got a CRL 2011-01-05 16:46:06 +01:00
Martin Willi 6aba6ff061 Pass an additional anchor flag to validate() hook if we reach the root CA 2011-01-05 16:46:04 +01:00
Martin Willi 09e319d419 Always pass auth info to validate(), use pathlen to check for user certificate 2011-01-05 16:46:04 +01:00
Martin Willi a6478a0402 Simplified format of x509 CRL URI parsing/enumerator 2011-01-05 16:46:03 +01:00
Martin Willi 6840a6fb98 CRL/OCSP validation stores trustchain information in auth_cfg 2011-01-05 16:45:56 +01:00
Martin Willi 7d7beaa1fa Use certificate CRLIssuer information to look up cacched CRLs or CDPs 2011-01-05 16:45:56 +01:00
Martin Willi 4e508517d7 Added support for CRL Issuers to x509 and OpenSSL plugins 2011-01-05 16:45:55 +01:00
Martin Willi 0406eeaacb Support different encoding types in certificate.get_encoding() 2010-07-13 13:53:20 +02:00
Martin Willi da9724e6d0 Renamed key_encod{ing,der}_t and constants, prepare for generic credential encoding 2010-07-13 11:29:35 +02:00
Martin Willi c2e5cee413 Moved CRL/OCSP checking to a dedicated plugin called revocation 2010-07-13 10:26:07 +02:00