Commit Graph
19030 Commits
Author SHA1 Message Date
Tobias Brunner 4aab3153a4 pkcs11: Properly handle EC_POINTs returned as ASN.1 octet string
This is the correct encoding but we internally only use unwrapped keys
and some tokens return them unwrapped.

Fixes #872.
2015-03-09 15:36:07 +01:00
Andreas Steffen 8fa9312f09 Updated products in imv database 2015-03-08 17:18:34 +01:00
Andreas Steffen 20f90d7160 attest: output trusted flag and device description 2015-03-08 17:17:11 +01:00
Andreas Steffen 00cd79b678 Make access requestor IP address available to TNC server 2015-03-08 17:17:11 +01:00
Tobias Brunner 8b2af616ac testing: Update modified updown scripts to the latest template
This avoids confusion and makes identifying the changes needed for each
scenario easier.
2015-03-06 16:51:50 +01:00
Tobias Brunner 4e92441d0c Remove obsolete _updown_espmark script
According to NEWS it was created to support kernels < 2.6.16.
2015-03-06 16:51:50 +01:00
Tobias Brunner fd25fb3118 _updown: Remove obsolete stuff from default script 2015-03-06 16:51:50 +01:00
Tobias Brunner 9fda0bf007 ikev1: Set protocol ID and SPIs in INITIAL-CONTACT notification payloads
The payload we sent before is not compliant with RFC 2407 and thus some
peers might abort negotiation (e.g. with an INVALID-PROTOCOL-ID error).

Fixes #819.
2015-03-06 16:50:13 +01:00
Tobias Brunner 6133770db4 x509: Use subjectKeyIdentifier provided by issuer cert when checking CRL issuer
Some CAs don't use SHA-1 hashes of the public key as subjectKeyIdentifier and
authorityKeyIdentifier.  If that's the case we can't force the
calculation of the hash to compare that to authorityKeyIdentifier in the CRL,
instead we use the subjectKeyIdentifier stored in the issuer certificate, if
available.  Otherwise, we fall back to the SHA-1 hash (or comparing the
DNs) as before.
2015-03-06 16:49:12 +01:00
Tobias Brunner 96e6130537 kernel-pfkey: Add option to set receive buffer size of event socket
If many requests are sent to the kernel the events generated by these
requests may fill the receive buffer before the daemon is able to read
these messages.

Fixes #783.
2015-03-06 16:45:22 +01:00
Andreas Steffen 3fcb59b62a use SHA512 for moon's BLISS signature 2015-03-04 14:08:37 +01:00
Tobias Brunner 0a8268d0f1 Merge branch 'ikev2-signature-authentication'
This adds support for RFC 7427 signature authentication in IKEv2,
enabling the use of stronger signature schemes (e.g. RSA with SHA-2)
for IKE authentication.

Public key constraints defined in `rightauth` are now also checked
against IKEv2 signature schemes (may be disabled via strongswan.conf).

Fixes #863.
2015-03-04 13:56:50 +01:00
Tobias Brunner 3f1ef3a678 NEWS: Introduce RFC 7427 signature authentication 2015-03-04 13:54:12 +01:00
Tobias Brunner 276cf3b725 man: Add documentation about IKEv2 signature schemes 2015-03-04 13:54:12 +01:00
Tobias Brunner 26ebe5fea8 testing: Test classic public key authentication in ikev2/net2net-cert scenario 2015-03-04 13:54:12 +01:00
Tobias Brunner 53217d70b0 testing: Disable signature authentication on dave in openssl-ikev2/ecdsa-certs scenario 2015-03-04 13:54:12 +01:00
Tobias Brunner 4e6f102842 ikev2: Try all RSA signature schemes if none is configured 2015-03-04 13:54:12 +01:00
Tobias Brunner 1d94b7950b ikev2: Consider signature schemes in rightauth when sending hash algorithms 2015-03-04 13:54:12 +01:00
Tobias Brunner 1cbd34b9d4 tkm: Implement hash algorithm storage methods of keymat_v2_t interface 2015-03-04 13:54:11 +01:00
Tobias Brunner f9e0caab6d keymat: Use hash algorithm set 2015-03-04 13:54:11 +01:00
Tobias Brunner 1d384bf8aa hash-algorithm-set: Add class to manage a set of hash algorithms 2015-03-04 13:54:11 +01:00
Tobias Brunner b67ae0f89c ikev2: Add an option to disable constraints against signature schemes
If this is disabled the schemes configured in `rightauth` are only
checked against signature schemes used in the certificate chain and
signature schemes used during IKEv2 are ignored.

Disabling this could be helpful if existing connections with peers that
don't support RFC 7427 use signature schemes in `rightauth` to verify
certificate chains.
2015-03-04 13:54:11 +01:00
Tobias Brunner 31bccf4ba1 stroke: Enable BLISS-based public key constraints 2015-03-04 13:54:11 +01:00
Tobias Brunner 83dcb2d46d credential-manager: Store BLISS key strength in auth config 2015-03-04 13:54:11 +01:00
Tobias Brunner ddb09a0603 auth-cfg: Add BLISS key strength constraint 2015-03-04 13:54:11 +01:00
Tobias Brunner 7a9c0d51f4 testing: Don't check for exact IKEv2 fragment size
Because SHA-256 is now used for signatures the size of the two IKE_AUTH
messages changed.
2015-03-04 13:54:10 +01:00
Tobias Brunner 4aa24d4c13 testing: Update test conditions because signature schemes are now logged
RFC 7427 signature authentication is now used between strongSwan hosts
by default, which causes the actual signature schemes to get logged.
2015-03-04 13:54:10 +01:00
Tobias Brunner 2f1b2d9183 testing: Add ikev2/rw-sig-auth scenario 2015-03-04 13:54:10 +01:00
Tobias Brunner 3b31245a0f testing: Add ikev2/net2net-cert-sha2 scenario 2015-03-04 13:54:10 +01:00
Tobias Brunner cc048f0c50 ikev2: Fall back to SHA-1 signatures for RSA
This is really just a fallback to "classic" IKEv2 authentication if the other
peer supports no stronger hash algorithms.
2015-03-04 13:54:10 +01:00
Tobias Brunner 0bdc79b5f9 ikev2: Select a signature scheme appropriate for the given key
By enumerating hashes we'd use SHA-1 by default.  This way stronger
signature schemes are preferred.
2015-03-04 13:54:10 +01:00
Tobias Brunner 1f648d756b public-key: Add helper to determine acceptable signature schemes for keys 2015-03-04 13:54:10 +01:00
Tobias Brunner 0b14ce5802 ikev2: Log the actual signature scheme used for RFC 7427 authentication 2015-03-04 13:54:09 +01:00
Tobias Brunner a7bbe59f85 ikev2: Store signature scheme used to verify peer in auth_cfg
This enables late connection switching based on the signature scheme used
for IKEv2 and allows to enforce stronger signature schemes.

This may break existing connections with peers that don't support RFC 7427
if signature schemes are currently used in `rightauth` for certificate chain
validation and if the configured schemes are stronger than the default used
for IKE (e.g. SHA-1 for RSA).
2015-03-04 13:54:09 +01:00
Tobias Brunner fff3576b6b ikev2: Add a global option to disable RFC 7427 signature authentication
This is mostly for testing.
2015-03-04 13:54:09 +01:00
Tobias Brunner 6a2a9bfb48 ikev2: Remove private AUTH_BLISS method
We use the new signature authentication instead for this.  This is not
backward compatible but we only released one version with BLISS support,
and the key format will change anyway with the next release.
2015-03-04 13:54:09 +01:00
Tobias Brunner 295e37ab66 ikev2: Handle RFC 7427 signature authentication in pubkey authenticator 2015-03-04 13:54:09 +01:00
Tobias Brunner d874101055 hasher: Add helper to determine hash algorithm from signature scheme 2015-03-04 13:54:09 +01:00
Tobias Brunner 353294ea5c public-key: Add helper to map signature schemes to ASN.1 OIDs
There is a similar function to map key_type_t and hasher_t to an OID,
but this maps schemes directly (and to use the other function we'd
have to have a function to map schemes to hash algorithms first).
2015-03-04 13:54:08 +01:00
Tobias Brunner 0f29f5ed02 public-key: Add helper to determine key type from signature scheme 2015-03-04 13:54:08 +01:00
Tobias Brunner f6329cae9c ikev2: Enable signature authentication by transmitting supported hash algorithms 2015-03-04 13:54:08 +01:00
Tobias Brunner 828e71bd43 keymat: Add facility to store supported hash algorithms 2015-03-04 13:54:08 +01:00
Tobias Brunner 247eadb73d hasher: Add filter function for algorithms permitted by RFC 7427 2015-03-04 13:54:08 +01:00
Tobias Brunner 4f9e1c49eb hasher: Redefine hash algorithms to match values defined by RFC 7427
Other algorithms are defined in private use range.
2015-03-04 13:54:08 +01:00
Tobias Brunner 159b7bec9e ikev2: Add SIGNATURE_HASH_ALGORITHMS notify payload 2015-03-04 13:54:08 +01:00
Tobias Brunner 7cd8371da2 ikev2: Add new authentication method defined by RFC 7427 2015-03-04 13:54:08 +01:00
Tobias Brunner dd0ebb5483 ikev2: Only accept initial messages in specific states
The previous code allowed an attacker to slip in an IKE_SA_INIT with
both SPIs and MID 1 set when an IKE_AUTH would be expected instead.

References #816.
2015-03-04 13:47:53 +01:00
Tobias Brunner 650a3ad515 ike-sa-manager: Make sure the message ID of initial messages is 0
It is mandated by the RFCs and it is expected by the task managers.

Initial messages with invalid MID will be treated like regular messages,
so no IKE_SA will be created for them.  Instead, if the responder SPI is 0
no SA will be found and the message is rejected with ALERT_INVALID_IKE_SPI.
If an SPI is set and we do find an SA, then we either ignore the message
because the MID is unexpected, or because we don't allow initial messages
on established connections.

There is one exception, though, if an attacker can slip in an IKE_SA_INIT
with both SPIs set before the client's IKE_AUTH is handled by the server,
it does get processed (see next commit).

References #816.
2015-03-04 13:47:53 +01:00
Tobias Brunner eb25190629 ikev2: Don't destroy the SA if an IKE_SA_INIT with unexpected MID is received
This reverts 8f727d8007 ("Clean up IKE_SA state if IKE_SA_INIT request
does not have message ID 0") because it allowed to close any IKE_SA by
sending an IKE_SA_INIT with an unexpected MID and both SPIs set to those
of that SA.

The next commit will prevent SAs from getting created for IKE_SA_INIT messages
with invalid MID.

Fixes #816.
2015-03-04 13:47:53 +01:00
Martin Willi 1a31fe5580 ikev2: Don't adopt any CHILD_SA during make-before-break reauthentication
While the comment is rather clear that we should not adopt live CHILD_SAs
during reauthentication in IKEv2, the code does nonetheless. Add an additional
version check to fix reauthentication if the reauth responder has a replace
uniqueids policy.

Fixes #871.
2015-03-04 11:18:42 +01:00