Commit Graph
14643 Commits
Author SHA1 Message Date
Andreas Steffen 6941dcb17a x509: Fix regression introduced by commit a22147a
Instead of the CA certificate's subjectKeyIdentifier erroneously
the CA's authorityKeyIdentifier was used as the authorityKeyIdentfier
of the certificate to be issued. This might work with a root CA
where the authorityKeyIdentifier equals its subjectKeyIdentfier
but introduces a severe regression when an intermediate CA is used.
2023-11-14 08:00:27 +01:00
Tobias Brunner 5764e1e506 pki: Pre-process common arguments
This way the position of --debug doesn't matter for it to apply to the
parsing of all command-specific arguments.
2023-11-13 12:50:47 +01:00
Tobias Brunner 95c7d49954 pki: Add option to load certificate status information from index.txt
Each index.txt is associated with the most recently loaded CA
certificate.
2023-11-13 12:50:47 +01:00
Tobias Brunner f26ca67d8c pki: Add index.txt-based OCSP responder 2023-11-13 12:50:47 +01:00
Tobias Brunner 1e8a72e7a0 chunk: Add helper to hash chunks via pointer 2023-11-13 12:50:47 +01:00
Tobias Brunner 3e42b2f5cb pki: Drop legacy registration for OCSP responders 2023-11-13 12:50:45 +01:00
Tobias Brunner efac611566 openxpki: Register as OCSP responder 2023-11-13 12:50:24 +01:00
Tobias Brunner 515cecfe3e pki: Use OCSP responder manager for --ocsp --respond 2023-11-13 12:50:22 +01:00
Tobias Brunner dab7c893a6 library: Add manager for OCSP responders
Registered OCSP responders should return VALIDATION_SKIPPED for issuer
certificates they are not responsible for. However, VALIDATION_FAILED is
currently treated the same way, so that's fine as well.
2023-11-13 12:45:54 +01:00
Andreas Steffen 821d7784a3 man: Extended pki man page and added pki --ocsp man page 2023-11-13 12:40:58 +01:00
Andreas Steffen a0c9f9b842 pki: Added ocsp command
The pki --ocsp command implements an OCSP responder.
2023-11-13 12:40:58 +01:00
Andreas Steffen ec325b4c09 pki: Added ocsp-req and ocsp-rsp types to pki --print 2023-11-13 12:40:58 +01:00
Andreas Steffen a0f672d3d1 unit-tests: Update test_serial_gen suite 2023-11-13 12:40:55 +01:00
Andreas Steffen 00ab8d62c0 x509: Support generation of OCSP responses 2023-11-13 12:40:55 +01:00
Andreas Steffen aa0fe149d6 certificates: Added ocsp_single_response object 2023-11-13 12:40:55 +01:00
Andreas Steffen 199c7083e1 openxpki: OCSP responder plugin accessing OpenXPKI
The openxpki plugin directly access the certificates table in
the OpenXPKI's MariaDB in order to retrieve the status of an
issued X.509 certificate based on its serial number.
2023-11-13 12:40:55 +01:00
Andreas Steffen 24d45de633 crl-reason: Fixed typo 2023-11-13 12:40:52 +01:00
Andreas Steffen d72d0c0dfa utils: Added chunk_to_dec() function 2023-11-13 12:39:10 +01:00
Andreas Steffen 9381559754 x509: Support parsing of OCSP requests 2023-11-13 12:39:10 +01:00
Andreas Steffen 09e2a9ff50 pki --pkcs7: Set default to res = 1 2023-11-13 12:39:10 +01:00
Tobias Brunner 3cb8434367 kernel-netlink: Don't add replay state twice when updating SAs
The kernel includes the XFRMA_REPLAY_ESN_VAL attribute when dumping
SAs since it was added with 2.6.39.  So we basically added this attribute
twice to the message sent to the kernel, potentially exceeding the
message buffer if the window size is large.

The XFRMA_REPLAY_VAL attribute is only dumped since 3.19, so that might
still be relevant (Google seems to maintain a 3.18 kernel) and since we
have to query the current lifetime stats anyway, we can just avoid adding
this attribute twice.

Closes strongswan/strongswan#1967
2023-11-13 12:36:57 +01:00
Tobias Brunner 9c2ca27b62 identification: Support explicit uri: prefix for SANs of type uniformResourceIdentifier 2023-11-13 12:33:39 +01:00
Tobias Brunner 500cacf6d8 x509: Add support to encode SANs of type uniformResourceIdentifier 2023-11-13 12:33:39 +01:00
Tobias Brunner a22147a1b2 x509: Use issuer certificate's subjectKeyIdentifier if available
Instead of just generating an authorityKeyIdentifier based on the
issuer's public key, this allows CA certificates to be issued by a
different tool that doesn't use a SHA-1 hash of the subjectPublicKey
for the subjectKeyIdentifier.

Closes strongswan/strongswan#1992
References strongswan/strongswan#1975
2023-11-13 12:32:32 +01:00
Tobias Brunner 8581a19dd7 charon-cmd: Add support for key types other than RSA 2023-11-13 12:26:07 +01:00
Tobias Brunner 799511d90f pkcs12: Add support for PKCS#12 containers with empty or no password 2023-11-13 12:26:07 +01:00
Tobias Brunner bdd8f14354 pkcs7: Add supported for unprotected PKCS#7 encrypted-data 2023-11-13 12:26:07 +01:00
Tobias Brunner dc704cf206 pkcs8: Add support for unprotected PKCS#8 containers 2023-11-13 12:26:07 +01:00
Tobias Brunner ad804fa036 pkcs12: Treat empty string and no password differently
When deriving the PKCS#12 key, the empty string should result in a
non-zero length Unicode string (two bytes for the 0 terminator).
2023-11-13 12:26:07 +01:00
Tobias Brunner 7bb6aed5ab openssl: Add support for unprotected PKCS#12 containers 2023-11-13 12:26:07 +01:00
Tobias Brunner 1589f2d9ae constraints: Add support for IP address nameConstraints 2023-11-13 12:23:33 +01:00
Tobias Brunner 1c3096fe50 openssl: Add support for IP address nameConstraints 2023-11-13 12:23:33 +01:00
Tobias Brunner ede96fe3db x509: Add support for IP address nameConstraints
According to RFC 5280, section 4.2.1.10, these are encoded as address
followed by a network mask of the same length.
2023-11-13 12:23:33 +01:00
Tobias Brunner f781b9d326 openssl: Add support for nameConstraints X.509 extension
Closes strongswan/strongswan#1990
2023-11-13 12:23:02 +01:00
Tobias Brunner 00d054aae5 ikev2: Correctly maintain allocated reqid during make-before-break reauth 2023-11-13 12:02:11 +01:00
Tobias Brunner 04bfe83f71 trap-manager: Maintain allocated reqids when handling acquires 2023-11-13 12:02:11 +01:00
Tobias Brunner f9a9188a36 quick-delete: Correctly maintain allocated reqid when recreating CHILD_SA 2023-11-13 12:02:11 +01:00
Tobias Brunner c923022733 child-delete: Correctly maintain allocated reqid when recreating CHILD_SA
The old CHILD_SA is destroyed even before the new task is queued, this
makes sure we always maintain a reference to the reqid.
2023-11-13 12:02:11 +01:00
Tobias Brunner c2a4c8e38a ike-sa: Correctly maintain allocated reqid when recreating CHILD_SA
Maintaining the reqid when recreating a CHILD_SA from scratch night not
strictly be necessary as we usually don't have to replace any temporary
states in the kernel.  However, there could be concurrent acquires that
might actually make it necessary (we use the reqid to keep track of
acquires and it's also part of the duplicate check).
2023-11-13 12:02:11 +01:00
Tobias Brunner f2bc526dbb ikev1: Only set reqid on rekeyed CHILD_SA if it was allocated dynamically 2023-11-13 12:02:11 +01:00
Tobias Brunner bc39a3aecb child-rekey: Only set reqid on new CHILD_SA if it was allocated dynamically
Keeping a reference ensures that if the old SA expires before the new
one is installed, the previous reqid isn't reallocated to a concurrently
established CHILD_SA with different selectors.
2023-11-13 12:02:11 +01:00
Tobias Brunner 4ea739baf4 quick-mode: Maintain reference to reqid while CHILD_SA is established 2023-11-13 12:02:11 +01:00
Tobias Brunner 4bfd93b8db child-create: Maintain reference to reqid while CHILD_SA is established 2023-11-13 12:02:11 +01:00
Tobias Brunner ff269f7f1f child-sa: Add method that returns a reference to an allocated reqid 2023-11-13 12:02:11 +01:00
Tobias Brunner 13771206d4 child-sa: Keep a reference to the previous reqid
The reference is kept until the reqid is either confirmed (i.e.
re-allocated) or replaced by a different reqid, which happens only once
we know the final traffic selectors, or the SA is destroyed without
installing it.
2023-11-13 12:02:11 +01:00
Tobias Brunner e623f5792b kernel-interface: Add method to increase refcount for allocated reqid 2023-11-13 12:02:11 +01:00
Tobias Brunner 02180ae2ff kernel-interface: Remove unnecessary parameters for release_reqid()
These are not included in the initial lookup anymore. Also simplified
the implementation as we always add the same entry to the two hash
tables.
2023-11-13 12:02:11 +01:00
Tobias Brunner 90cf0078e1 kernel-interface: Use reqid as sole key in hash table
Every reqid is allocated once, we don't store the same reqid with e.g.
different marks or interface IDs that would make it necessary to make
them part of the key in that table (that's different in the other table).

To preserve the current behavior, that is, allocating a new reqid if e.g.
the marks are different, the additional selector values (which will
result in an additional policy in the Linux kernel) are compared after
the initial lookup.
2023-11-13 12:02:11 +01:00
Tobias Brunner 04c17ab56a credential-manager: Add option to reject trusted end-entity certificates
This allows preventing peers from authenticating with certificates
that are locally trusted, in particular, our own local certificate (which
safeguards against accidental reuse of certificates on multiple peers).

On the other hand, if this option is enabled, end-entity certificates
for peers can't be configured anymore explicitly (e.g. via remote.certs
in swanctl.conf).
2023-11-13 12:01:41 +01:00
Andreas Steffen 28ccdff692 cert-enroll: Preventing some errors that might occur 2023-11-13 11:57:51 +01:00