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.
This commit is contained in:
@@ -9,6 +9,19 @@ strongswan-5.3.0
|
|||||||
as any previous strongSwan release) it must be explicitly enabled using
|
as any previous strongSwan release) it must be explicitly enabled using
|
||||||
the charon.make_before_break strongswan.conf option.
|
the charon.make_before_break strongswan.conf option.
|
||||||
|
|
||||||
|
- Support for "Signature Authentication in IKEv2" (RFC 7427) has been added.
|
||||||
|
This allows the use of stronger hash algorithms for public key authentication.
|
||||||
|
By default, signature schemes are chosen based on the strength of the
|
||||||
|
signature key, but specific hash algorithms may be configured in leftauth.
|
||||||
|
|
||||||
|
- Key types and hash algorithms specified in rightauth are now also checked
|
||||||
|
against IKEv2 signature schemes. If such constraints are used for certificate
|
||||||
|
chain validation in existing configurations, in particular with peers that
|
||||||
|
don't support RFC 7427, it may be necessary to disable this feature with the
|
||||||
|
charon.signature_authentication_constraints setting, because the signature
|
||||||
|
scheme used in classic IKEv2 public key authentication may not be strong
|
||||||
|
enough.
|
||||||
|
|
||||||
- The new connmark plugin allows a host to bind conntrack flows to a specific
|
- The new connmark plugin allows a host to bind conntrack flows to a specific
|
||||||
CHILD_SA by applying and restoring the SA mark to conntrack entries. This
|
CHILD_SA by applying and restoring the SA mark to conntrack entries. This
|
||||||
allows a peer to handle multiple transport mode connections coming over the
|
allows a peer to handle multiple transport mode connections coming over the
|
||||||
|
|||||||
@@ -287,6 +287,17 @@ charon.send_delay_type = 0
|
|||||||
charon.send_vendor_id = no
|
charon.send_vendor_id = no
|
||||||
Send strongSwan vendor ID payload
|
Send strongSwan vendor ID payload
|
||||||
|
|
||||||
|
charon.signature_authentication = yes
|
||||||
|
Whether to enable Signature Authentication as per RFC 7427.
|
||||||
|
|
||||||
|
charon.signature_authentication_constraints = yes
|
||||||
|
Whether to enable constraints against IKEv2 signature schemes.
|
||||||
|
|
||||||
|
If enabled, signature schemes configured in _rightauth_, in addition to
|
||||||
|
getting used as constraints against signature schemes employed in the
|
||||||
|
certificate chain, are also used as constraints against the signature scheme
|
||||||
|
used by peers during IKEv2.
|
||||||
|
|
||||||
charon.start-scripts {}
|
charon.start-scripts {}
|
||||||
Section containing a list of scripts (name = path) that are executed when
|
Section containing a list of scripts (name = path) that are executed when
|
||||||
the daemon is started.
|
the daemon is started.
|
||||||
|
|||||||
@@ -584,6 +584,7 @@ for pre-shared key authentication,
|
|||||||
to (require the) use of the Extensible Authentication Protocol in IKEv2, and
|
to (require the) use of the Extensible Authentication Protocol in IKEv2, and
|
||||||
.B xauth
|
.B xauth
|
||||||
for IKEv1 eXtended Authentication.
|
for IKEv1 eXtended Authentication.
|
||||||
|
|
||||||
To require a trustchain public key strength for the remote side, specify the
|
To require a trustchain public key strength for the remote side, specify the
|
||||||
key type followed by the minimum strength in bits (for example
|
key type followed by the minimum strength in bits (for example
|
||||||
.BR ecdsa-384
|
.BR ecdsa-384
|
||||||
@@ -596,6 +597,20 @@ or a key strength definition (for example
|
|||||||
.BR pubkey-sha1-sha256
|
.BR pubkey-sha1-sha256
|
||||||
or
|
or
|
||||||
.BR rsa-2048-ecdsa-256-sha256-sha384-sha512 ).
|
.BR rsa-2048-ecdsa-256-sha256-sha384-sha512 ).
|
||||||
|
Unless disabled in
|
||||||
|
.BR strongswan.conf (5)
|
||||||
|
such key types and hash algorithms are also applied as constraints against IKEv2
|
||||||
|
signature authentication schemes used by the remote side.
|
||||||
|
|
||||||
|
If both peers support RFC 7427 ("Signature Authentication in IKEv2") specific
|
||||||
|
hash algorithms to be used during IKEv2 authentication may be configured.
|
||||||
|
The syntax is the same as above. For example, with
|
||||||
|
.B pubkey-sha384-sha256
|
||||||
|
a public key signature scheme with either SHA-384 or SHA-256 would get used for
|
||||||
|
authentication, in that order and depending on the hash algorithms supported by
|
||||||
|
the peer. If no specific hash algorithms are configured, the default is to
|
||||||
|
prefer an algorithm that matches or exceeds the strength of the signature key.
|
||||||
|
|
||||||
For
|
For
|
||||||
.BR eap ,
|
.BR eap ,
|
||||||
an optional EAP method can be appended. Currently defined methods are
|
an optional EAP method can be appended. Currently defined methods are
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
|
* Copyright (C) 2015 Tobias Brunner
|
||||||
* Copyrigth (C) 2012 Reto Buerki
|
* Copyrigth (C) 2012 Reto Buerki
|
||||||
* Copyright (C) 2012 Adrian-Ken Rueegsegger
|
* Copyright (C) 2012 Adrian-Ken Rueegsegger
|
||||||
* Hochschule fuer Technik Rapperswil
|
* Hochschule fuer Technik Rapperswil
|
||||||
@@ -17,6 +18,7 @@
|
|||||||
#include <daemon.h>
|
#include <daemon.h>
|
||||||
#include <tkm/constants.h>
|
#include <tkm/constants.h>
|
||||||
#include <tkm/client.h>
|
#include <tkm/client.h>
|
||||||
|
#include <crypto/hashers/hash_algorithm_set.h>
|
||||||
|
|
||||||
#include "tkm.h"
|
#include "tkm.h"
|
||||||
#include "tkm_types.h"
|
#include "tkm_types.h"
|
||||||
@@ -71,6 +73,10 @@ struct private_tkm_keymat_t {
|
|||||||
*/
|
*/
|
||||||
chunk_t other_init_msg;
|
chunk_t other_init_msg;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set of hash algorithms supported by peer for signature authentication
|
||||||
|
*/
|
||||||
|
hash_algorithm_set_t *hash_algorithms;
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -417,6 +423,26 @@ METHOD(keymat_v2_t, get_psk_sig, bool,
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
METHOD(keymat_v2_t, hash_algorithm_supported, bool,
|
||||||
|
private_tkm_keymat_t *this, hash_algorithm_t hash)
|
||||||
|
{
|
||||||
|
if (!this->hash_algorithms)
|
||||||
|
{
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
return this->hash_algorithms->contains(this->hash_algorithms, hash);
|
||||||
|
}
|
||||||
|
|
||||||
|
METHOD(keymat_v2_t, add_hash_algorithm, void,
|
||||||
|
private_tkm_keymat_t *this, hash_algorithm_t hash)
|
||||||
|
{
|
||||||
|
if (!this->hash_algorithms)
|
||||||
|
{
|
||||||
|
this->hash_algorithms = hash_algorithm_set_create();
|
||||||
|
}
|
||||||
|
this->hash_algorithms->add(this->hash_algorithms, hash);
|
||||||
|
}
|
||||||
|
|
||||||
METHOD(keymat_t, destroy, void,
|
METHOD(keymat_t, destroy, void,
|
||||||
private_tkm_keymat_t *this)
|
private_tkm_keymat_t *this)
|
||||||
{
|
{
|
||||||
@@ -435,6 +461,7 @@ METHOD(keymat_t, destroy, void,
|
|||||||
tkm->idmgr->release_id(tkm->idmgr, TKM_CTX_AE, this->ae_ctx_id);
|
tkm->idmgr->release_id(tkm->idmgr, TKM_CTX_AE, this->ae_ctx_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
DESTROY_IF(this->hash_algorithms);
|
||||||
DESTROY_IF(this->aead_in);
|
DESTROY_IF(this->aead_in);
|
||||||
DESTROY_IF(this->aead_out);
|
DESTROY_IF(this->aead_out);
|
||||||
chunk_free(&this->auth_payload);
|
chunk_free(&this->auth_payload);
|
||||||
@@ -488,6 +515,8 @@ tkm_keymat_t *tkm_keymat_create(bool initiator)
|
|||||||
.get_skd = _get_skd,
|
.get_skd = _get_skd,
|
||||||
.get_auth_octets = _get_auth_octets,
|
.get_auth_octets = _get_auth_octets,
|
||||||
.get_psk_sig = _get_psk_sig,
|
.get_psk_sig = _get_psk_sig,
|
||||||
|
.add_hash_algorithm = _add_hash_algorithm,
|
||||||
|
.hash_algorithm_supported = _hash_algorithm_supported,
|
||||||
},
|
},
|
||||||
.get_isa_id = _get_isa_id,
|
.get_isa_id = _get_isa_id,
|
||||||
.set_auth_payload = _set_auth_payload,
|
.set_auth_payload = _set_auth_payload,
|
||||||
|
|||||||
@@ -65,7 +65,7 @@ ENUM_NEXT(notify_type_names, ME_CONNECT_FAILED, ME_CONNECT_FAILED, CHILD_SA_NOT_
|
|||||||
"ME_CONNECT_FAILED");
|
"ME_CONNECT_FAILED");
|
||||||
ENUM_NEXT(notify_type_names, MS_NOTIFY_STATUS, MS_NOTIFY_STATUS, ME_CONNECT_FAILED,
|
ENUM_NEXT(notify_type_names, MS_NOTIFY_STATUS, MS_NOTIFY_STATUS, ME_CONNECT_FAILED,
|
||||||
"MS_NOTIFY_STATUS");
|
"MS_NOTIFY_STATUS");
|
||||||
ENUM_NEXT(notify_type_names, INITIAL_CONTACT, FRAGMENTATION_SUPPORTED, MS_NOTIFY_STATUS,
|
ENUM_NEXT(notify_type_names, INITIAL_CONTACT, SIGNATURE_HASH_ALGORITHMS, MS_NOTIFY_STATUS,
|
||||||
"INITIAL_CONTACT",
|
"INITIAL_CONTACT",
|
||||||
"SET_WINDOW_SIZE",
|
"SET_WINDOW_SIZE",
|
||||||
"ADDITIONAL_TS_POSSIBLE",
|
"ADDITIONAL_TS_POSSIBLE",
|
||||||
@@ -112,8 +112,9 @@ ENUM_NEXT(notify_type_names, INITIAL_CONTACT, FRAGMENTATION_SUPPORTED, MS_NOTIFY
|
|||||||
"ERX_SUPPORTED",
|
"ERX_SUPPORTED",
|
||||||
"IFOM_CAPABILITY",
|
"IFOM_CAPABILITY",
|
||||||
"SENDER_REQUEST_ID",
|
"SENDER_REQUEST_ID",
|
||||||
"FRAGMENTATION_SUPPORTED");
|
"FRAGMENTATION_SUPPORTED",
|
||||||
ENUM_NEXT(notify_type_names, INITIAL_CONTACT_IKEV1, INITIAL_CONTACT_IKEV1, FRAGMENTATION_SUPPORTED,
|
"SIGNATURE_HASH_ALGORITHMS");
|
||||||
|
ENUM_NEXT(notify_type_names, INITIAL_CONTACT_IKEV1, INITIAL_CONTACT_IKEV1, SIGNATURE_HASH_ALGORITHMS,
|
||||||
"INITIAL_CONTACT");
|
"INITIAL_CONTACT");
|
||||||
ENUM_NEXT(notify_type_names, DPD_R_U_THERE, DPD_R_U_THERE_ACK, INITIAL_CONTACT_IKEV1,
|
ENUM_NEXT(notify_type_names, DPD_R_U_THERE, DPD_R_U_THERE_ACK, INITIAL_CONTACT_IKEV1,
|
||||||
"DPD_R_U_THERE",
|
"DPD_R_U_THERE",
|
||||||
@@ -174,7 +175,7 @@ ENUM_NEXT(notify_type_short_names, ME_CONNECT_FAILED, ME_CONNECT_FAILED, CHILD_S
|
|||||||
"ME_CONN_FAIL");
|
"ME_CONN_FAIL");
|
||||||
ENUM_NEXT(notify_type_short_names, MS_NOTIFY_STATUS, MS_NOTIFY_STATUS, ME_CONNECT_FAILED,
|
ENUM_NEXT(notify_type_short_names, MS_NOTIFY_STATUS, MS_NOTIFY_STATUS, ME_CONNECT_FAILED,
|
||||||
"MS_STATUS");
|
"MS_STATUS");
|
||||||
ENUM_NEXT(notify_type_short_names, INITIAL_CONTACT, FRAGMENTATION_SUPPORTED, MS_NOTIFY_STATUS,
|
ENUM_NEXT(notify_type_short_names, INITIAL_CONTACT, SIGNATURE_HASH_ALGORITHMS, MS_NOTIFY_STATUS,
|
||||||
"INIT_CONTACT",
|
"INIT_CONTACT",
|
||||||
"SET_WINSIZE",
|
"SET_WINSIZE",
|
||||||
"ADD_TS_POSS",
|
"ADD_TS_POSS",
|
||||||
@@ -221,8 +222,9 @@ ENUM_NEXT(notify_type_short_names, INITIAL_CONTACT, FRAGMENTATION_SUPPORTED, MS_
|
|||||||
"ERX_SUP",
|
"ERX_SUP",
|
||||||
"IFOM_CAP",
|
"IFOM_CAP",
|
||||||
"SENDER_REQ_ID",
|
"SENDER_REQ_ID",
|
||||||
"FRAG_SUP");
|
"FRAG_SUP",
|
||||||
ENUM_NEXT(notify_type_short_names, INITIAL_CONTACT_IKEV1, INITIAL_CONTACT_IKEV1, FRAGMENTATION_SUPPORTED,
|
"HASH_ALG");
|
||||||
|
ENUM_NEXT(notify_type_short_names, INITIAL_CONTACT_IKEV1, INITIAL_CONTACT_IKEV1, SIGNATURE_HASH_ALGORITHMS,
|
||||||
"INITIAL_CONTACT");
|
"INITIAL_CONTACT");
|
||||||
ENUM_NEXT(notify_type_short_names, DPD_R_U_THERE, DPD_R_U_THERE_ACK, INITIAL_CONTACT_IKEV1,
|
ENUM_NEXT(notify_type_short_names, DPD_R_U_THERE, DPD_R_U_THERE_ACK, INITIAL_CONTACT_IKEV1,
|
||||||
"DPD",
|
"DPD",
|
||||||
@@ -473,6 +475,14 @@ METHOD(payload_t, verify, status_t,
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
case SIGNATURE_HASH_ALGORITHMS:
|
||||||
|
{
|
||||||
|
if (this->notify_data.len % 2)
|
||||||
|
{
|
||||||
|
bad_length = TRUE;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
case AUTH_LIFETIME:
|
case AUTH_LIFETIME:
|
||||||
{
|
{
|
||||||
if (this->notify_data.len != 4)
|
if (this->notify_data.len != 4)
|
||||||
|
|||||||
@@ -151,6 +151,8 @@ enum notify_type_t {
|
|||||||
SENDER_REQUEST_ID = 16429,
|
SENDER_REQUEST_ID = 16429,
|
||||||
/* IKEv2 fragmentation supported, RFC 7383 */
|
/* IKEv2 fragmentation supported, RFC 7383 */
|
||||||
FRAGMENTATION_SUPPORTED = 16430,
|
FRAGMENTATION_SUPPORTED = 16430,
|
||||||
|
/* Signature Hash Algorithms, RFC 7427 */
|
||||||
|
SIGNATURE_HASH_ALGORITHMS = 16431,
|
||||||
/* IKEv1 initial contact */
|
/* IKEv1 initial contact */
|
||||||
INITIAL_CONTACT_IKEV1 = 24578,
|
INITIAL_CONTACT_IKEV1 = 24578,
|
||||||
/* IKEv1 DPD */
|
/* IKEv1 DPD */
|
||||||
|
|||||||
@@ -301,7 +301,8 @@ static void build_crl_policy(auth_cfg_t *cfg, bool local, int policy)
|
|||||||
static void parse_pubkey_constraints(char *auth, auth_cfg_t *cfg)
|
static void parse_pubkey_constraints(char *auth, auth_cfg_t *cfg)
|
||||||
{
|
{
|
||||||
enumerator_t *enumerator;
|
enumerator_t *enumerator;
|
||||||
bool rsa = FALSE, ecdsa = FALSE, rsa_len = FALSE, ecdsa_len = FALSE;
|
bool rsa = FALSE, ecdsa = FALSE, bliss = FALSE,
|
||||||
|
rsa_len = FALSE, ecdsa_len = FALSE, bliss_strength = FALSE;
|
||||||
int strength;
|
int strength;
|
||||||
char *token;
|
char *token;
|
||||||
|
|
||||||
@@ -328,6 +329,9 @@ static void parse_pubkey_constraints(char *auth, auth_cfg_t *cfg)
|
|||||||
{ "sha256", SIGN_ECDSA_256, KEY_ECDSA, },
|
{ "sha256", SIGN_ECDSA_256, KEY_ECDSA, },
|
||||||
{ "sha384", SIGN_ECDSA_384, KEY_ECDSA, },
|
{ "sha384", SIGN_ECDSA_384, KEY_ECDSA, },
|
||||||
{ "sha512", SIGN_ECDSA_521, KEY_ECDSA, },
|
{ "sha512", SIGN_ECDSA_521, KEY_ECDSA, },
|
||||||
|
{ "sha256", SIGN_BLISS_WITH_SHA256, KEY_BLISS, },
|
||||||
|
{ "sha384", SIGN_BLISS_WITH_SHA384, KEY_BLISS, },
|
||||||
|
{ "sha512", SIGN_BLISS_WITH_SHA512, KEY_BLISS, },
|
||||||
};
|
};
|
||||||
|
|
||||||
if (rsa_len || ecdsa_len)
|
if (rsa_len || ecdsa_len)
|
||||||
@@ -343,8 +347,12 @@ static void parse_pubkey_constraints(char *auth, auth_cfg_t *cfg)
|
|||||||
{
|
{
|
||||||
cfg->add(cfg, AUTH_RULE_ECDSA_STRENGTH, (uintptr_t)strength);
|
cfg->add(cfg, AUTH_RULE_ECDSA_STRENGTH, (uintptr_t)strength);
|
||||||
}
|
}
|
||||||
|
else if (bliss_strength)
|
||||||
|
{
|
||||||
|
cfg->add(cfg, AUTH_RULE_BLISS_STRENGTH, (uintptr_t)strength);
|
||||||
}
|
}
|
||||||
rsa_len = ecdsa_len = FALSE;
|
}
|
||||||
|
rsa_len = ecdsa_len = bliss_strength = FALSE;
|
||||||
if (strength)
|
if (strength)
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
@@ -360,6 +368,11 @@ static void parse_pubkey_constraints(char *auth, auth_cfg_t *cfg)
|
|||||||
ecdsa = ecdsa_len = TRUE;
|
ecdsa = ecdsa_len = TRUE;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
if (streq(token, "bliss"))
|
||||||
|
{
|
||||||
|
bliss = bliss_strength = TRUE;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
if (streq(token, "pubkey"))
|
if (streq(token, "pubkey"))
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
@@ -376,7 +389,8 @@ static void parse_pubkey_constraints(char *auth, auth_cfg_t *cfg)
|
|||||||
*/
|
*/
|
||||||
if ((rsa && schemes[i].key == KEY_RSA) ||
|
if ((rsa && schemes[i].key == KEY_RSA) ||
|
||||||
(ecdsa && schemes[i].key == KEY_ECDSA) ||
|
(ecdsa && schemes[i].key == KEY_ECDSA) ||
|
||||||
(!rsa && !ecdsa))
|
(bliss && schemes[i].key == KEY_BLISS) ||
|
||||||
|
(!rsa && !ecdsa && !bliss))
|
||||||
{
|
{
|
||||||
cfg->add(cfg, AUTH_RULE_SIGNATURE_SCHEME,
|
cfg->add(cfg, AUTH_RULE_SIGNATURE_SCHEME,
|
||||||
(uintptr_t)schemes[i].scheme);
|
(uintptr_t)schemes[i].scheme);
|
||||||
@@ -590,7 +604,8 @@ static auth_cfg_t *build_auth_cfg(private_stroke_config_t *this,
|
|||||||
/* authentication metod (class, actually) */
|
/* authentication metod (class, actually) */
|
||||||
if (strpfx(auth, "pubkey") ||
|
if (strpfx(auth, "pubkey") ||
|
||||||
strpfx(auth, "rsa") ||
|
strpfx(auth, "rsa") ||
|
||||||
strpfx(auth, "ecdsa"))
|
strpfx(auth, "ecdsa") ||
|
||||||
|
strpfx(auth, "bliss"))
|
||||||
{
|
{
|
||||||
cfg->add(cfg, AUTH_RULE_AUTH_CLASS, AUTH_CLASS_PUBKEY);
|
cfg->add(cfg, AUTH_RULE_AUTH_CLASS, AUTH_CLASS_PUBKEY);
|
||||||
build_crl_policy(cfg, local, msg->add_conn.crl_policy);
|
build_crl_policy(cfg, local, msg->add_conn.crl_policy);
|
||||||
|
|||||||
@@ -31,15 +31,14 @@ ENUM_BEGIN(auth_method_names, AUTH_RSA, AUTH_DSS,
|
|||||||
"RSA signature",
|
"RSA signature",
|
||||||
"pre-shared key",
|
"pre-shared key",
|
||||||
"DSS signature");
|
"DSS signature");
|
||||||
ENUM_NEXT(auth_method_names, AUTH_ECDSA_256, AUTH_NULL, AUTH_DSS,
|
ENUM_NEXT(auth_method_names, AUTH_ECDSA_256, AUTH_DS, AUTH_DSS,
|
||||||
"ECDSA-256 signature",
|
"ECDSA-256 signature",
|
||||||
"ECDSA-384 signature",
|
"ECDSA-384 signature",
|
||||||
"ECDSA-521 signature",
|
"ECDSA-521 signature",
|
||||||
"secure password method",
|
"secure password method",
|
||||||
"NULL authentication");
|
"NULL authentication",
|
||||||
ENUM_NEXT(auth_method_names, AUTH_BLISS, AUTH_BLISS, AUTH_NULL,
|
"digital signature");
|
||||||
"BLISS signature");
|
ENUM_NEXT(auth_method_names, AUTH_XAUTH_INIT_PSK, AUTH_HYBRID_RESP_RSA, AUTH_DS,
|
||||||
ENUM_NEXT(auth_method_names, AUTH_XAUTH_INIT_PSK, AUTH_HYBRID_RESP_RSA, AUTH_BLISS,
|
|
||||||
"XAuthInitPSK",
|
"XAuthInitPSK",
|
||||||
"XAuthRespPSK",
|
"XAuthRespPSK",
|
||||||
"XAuthInitRSA",
|
"XAuthInitRSA",
|
||||||
@@ -102,7 +101,7 @@ authenticator_t *authenticator_create_verifier(
|
|||||||
case AUTH_ECDSA_256:
|
case AUTH_ECDSA_256:
|
||||||
case AUTH_ECDSA_384:
|
case AUTH_ECDSA_384:
|
||||||
case AUTH_ECDSA_521:
|
case AUTH_ECDSA_521:
|
||||||
case AUTH_BLISS:
|
case AUTH_DS:
|
||||||
return (authenticator_t*)pubkey_authenticator_create_verifier(ike_sa,
|
return (authenticator_t*)pubkey_authenticator_create_verifier(ike_sa,
|
||||||
sent_nonce, received_init, reserved);
|
sent_nonce, received_init, reserved);
|
||||||
case AUTH_PSK:
|
case AUTH_PSK:
|
||||||
|
|||||||
@@ -85,9 +85,9 @@ enum auth_method_t {
|
|||||||
AUTH_NULL = 13,
|
AUTH_NULL = 13,
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* BLISS Authentication Method
|
* Digital Signature as specified in RFC 7427
|
||||||
*/
|
*/
|
||||||
AUTH_BLISS = 220,
|
AUTH_DS = 14,
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* IKEv1 initiator XAUTH with PSK, outside of IANA range
|
* IKEv1 initiator XAUTH with PSK, outside of IANA range
|
||||||
|
|||||||
@@ -131,6 +131,11 @@ enum ike_extension_t {
|
|||||||
* peer supports proprietary IKEv1 or standardized IKEv2 fragmentation
|
* peer supports proprietary IKEv1 or standardized IKEv2 fragmentation
|
||||||
*/
|
*/
|
||||||
EXT_IKE_FRAGMENTATION = (1<<11),
|
EXT_IKE_FRAGMENTATION = (1<<11),
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Signature Authentication, RFC 7427
|
||||||
|
*/
|
||||||
|
EXT_SIGNATURE_AUTH = (1<<12),
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2008 Tobias Brunner
|
* Copyright (C) 2008-2015 Tobias Brunner
|
||||||
* Copyright (C) 2005-2009 Martin Willi
|
* Copyright (C) 2005-2009 Martin Willi
|
||||||
* Copyright (C) 2005 Jan Hutter
|
* Copyright (C) 2005 Jan Hutter
|
||||||
* Hochschule fuer Technik Rapperswil
|
* Hochschule fuer Technik Rapperswil
|
||||||
@@ -20,6 +20,8 @@
|
|||||||
#include <daemon.h>
|
#include <daemon.h>
|
||||||
#include <encoding/payloads/auth_payload.h>
|
#include <encoding/payloads/auth_payload.h>
|
||||||
#include <sa/ikev2/keymat_v2.h>
|
#include <sa/ikev2/keymat_v2.h>
|
||||||
|
#include <asn1/asn1.h>
|
||||||
|
#include <asn1/oid.h>
|
||||||
|
|
||||||
typedef struct private_pubkey_authenticator_t private_pubkey_authenticator_t;
|
typedef struct private_pubkey_authenticator_t private_pubkey_authenticator_t;
|
||||||
|
|
||||||
@@ -52,8 +54,136 @@ struct private_pubkey_authenticator_t {
|
|||||||
* Reserved bytes of ID payload
|
* Reserved bytes of ID payload
|
||||||
*/
|
*/
|
||||||
char reserved[3];
|
char reserved[3];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Whether to store signature schemes on remote auth configs.
|
||||||
|
*/
|
||||||
|
bool store_signature_scheme;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Parse authentication data used for Signature Authentication as per RFC 7427
|
||||||
|
*/
|
||||||
|
static bool parse_signature_auth_data(chunk_t *auth_data, key_type_t *key_type,
|
||||||
|
signature_scheme_t *scheme)
|
||||||
|
{
|
||||||
|
u_int8_t len;
|
||||||
|
int oid;
|
||||||
|
|
||||||
|
if (!auth_data->len)
|
||||||
|
{
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
len = auth_data->ptr[0];
|
||||||
|
*auth_data = chunk_skip(*auth_data, 1);
|
||||||
|
/* we currently don't support schemes that require parameters */
|
||||||
|
oid = asn1_parse_algorithmIdentifier(*auth_data, 1, NULL);
|
||||||
|
*scheme = signature_scheme_from_oid(oid);
|
||||||
|
if (*scheme == SIGN_UNKNOWN)
|
||||||
|
{
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
*key_type = key_type_from_signature_scheme(*scheme);
|
||||||
|
*auth_data = chunk_skip(*auth_data, len);
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Build authentication data used for Signature Authentication as per RFC 7427
|
||||||
|
*/
|
||||||
|
static bool build_signature_auth_data(chunk_t *auth_data,
|
||||||
|
signature_scheme_t scheme)
|
||||||
|
{
|
||||||
|
chunk_t data;
|
||||||
|
u_int8_t len;
|
||||||
|
int oid;
|
||||||
|
|
||||||
|
oid = signature_scheme_to_oid(scheme);
|
||||||
|
if (oid == OID_UNKNOWN)
|
||||||
|
{
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
data = asn1_algorithmIdentifier(oid);
|
||||||
|
len = data.len;
|
||||||
|
*auth_data = chunk_cat("cmm", chunk_from_thing(len), data, *auth_data);
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Select a signature scheme based on our configuration, the other peer's
|
||||||
|
* capabilities and the private key
|
||||||
|
*/
|
||||||
|
static signature_scheme_t select_signature_scheme(keymat_v2_t *keymat,
|
||||||
|
auth_cfg_t *auth, private_key_t *private)
|
||||||
|
{
|
||||||
|
enumerator_t *enumerator;
|
||||||
|
signature_scheme_t selected = SIGN_UNKNOWN, scheme;
|
||||||
|
uintptr_t config;
|
||||||
|
auth_rule_t rule;
|
||||||
|
key_type_t key_type;
|
||||||
|
bool have_config = FALSE;
|
||||||
|
|
||||||
|
key_type = private->get_type(private);
|
||||||
|
enumerator = auth->create_enumerator(auth);
|
||||||
|
while (enumerator->enumerate(enumerator, &rule, &config))
|
||||||
|
{
|
||||||
|
if (rule != AUTH_RULE_SIGNATURE_SCHEME)
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
have_config = TRUE;
|
||||||
|
if (key_type == key_type_from_signature_scheme(config) &&
|
||||||
|
keymat->hash_algorithm_supported(keymat,
|
||||||
|
hasher_from_signature_scheme(config)))
|
||||||
|
{
|
||||||
|
selected = config;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
enumerator->destroy(enumerator);
|
||||||
|
|
||||||
|
if (selected == SIGN_UNKNOWN && !have_config)
|
||||||
|
{
|
||||||
|
/* if no specific configuration, find a scheme appropriate for the key
|
||||||
|
* and supported by the other peer */
|
||||||
|
enumerator = signature_schemes_for_key(key_type,
|
||||||
|
private->get_keysize(private));
|
||||||
|
while (enumerator->enumerate(enumerator, &scheme))
|
||||||
|
{
|
||||||
|
if (keymat->hash_algorithm_supported(keymat,
|
||||||
|
hasher_from_signature_scheme(scheme)))
|
||||||
|
{
|
||||||
|
selected = scheme;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
enumerator->destroy(enumerator);
|
||||||
|
|
||||||
|
/* for RSA we tried at least SHA-512, also try other schemes down to
|
||||||
|
* what we'd use with classic authentication */
|
||||||
|
if (selected == SIGN_UNKNOWN && key_type == KEY_RSA)
|
||||||
|
{
|
||||||
|
signature_scheme_t schemes[] = {
|
||||||
|
SIGN_RSA_EMSA_PKCS1_SHA384,
|
||||||
|
SIGN_RSA_EMSA_PKCS1_SHA256,
|
||||||
|
SIGN_RSA_EMSA_PKCS1_SHA1,
|
||||||
|
};
|
||||||
|
int i;
|
||||||
|
|
||||||
|
for (i = 0; i < countof(schemes); i++)
|
||||||
|
{
|
||||||
|
if (keymat->hash_algorithm_supported(keymat,
|
||||||
|
hasher_from_signature_scheme(schemes[i])))
|
||||||
|
{
|
||||||
|
selected = scheme;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return selected;
|
||||||
|
}
|
||||||
|
|
||||||
METHOD(authenticator_t, build, status_t,
|
METHOD(authenticator_t, build, status_t,
|
||||||
private_pubkey_authenticator_t *this, message_t *message)
|
private_pubkey_authenticator_t *this, message_t *message)
|
||||||
{
|
{
|
||||||
@@ -64,7 +194,7 @@ METHOD(authenticator_t, build, status_t,
|
|||||||
auth_cfg_t *auth;
|
auth_cfg_t *auth;
|
||||||
auth_payload_t *auth_payload;
|
auth_payload_t *auth_payload;
|
||||||
auth_method_t auth_method;
|
auth_method_t auth_method;
|
||||||
signature_scheme_t scheme;
|
signature_scheme_t scheme = SIGN_UNKNOWN;
|
||||||
keymat_v2_t *keymat;
|
keymat_v2_t *keymat;
|
||||||
|
|
||||||
id = this->ike_sa->get_my_id(this->ike_sa);
|
id = this->ike_sa->get_my_id(this->ike_sa);
|
||||||
@@ -75,17 +205,29 @@ METHOD(authenticator_t, build, status_t,
|
|||||||
DBG1(DBG_IKE, "no private key found for '%Y'", id);
|
DBG1(DBG_IKE, "no private key found for '%Y'", id);
|
||||||
return NOT_FOUND;
|
return NOT_FOUND;
|
||||||
}
|
}
|
||||||
|
keymat = (keymat_v2_t*)this->ike_sa->get_keymat(this->ike_sa);
|
||||||
|
|
||||||
|
if (this->ike_sa->supports_extension(this->ike_sa, EXT_SIGNATURE_AUTH))
|
||||||
|
{
|
||||||
|
scheme = select_signature_scheme(keymat, auth, private);
|
||||||
|
auth_method = AUTH_DS;
|
||||||
|
if (scheme == SIGN_UNKNOWN)
|
||||||
|
{
|
||||||
|
DBG1(DBG_IKE, "no common hash algorithm found to create signature "
|
||||||
|
"with %N key", key_type_names, private->get_type(private));
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
switch (private->get_type(private))
|
switch (private->get_type(private))
|
||||||
{
|
{
|
||||||
case KEY_RSA:
|
case KEY_RSA:
|
||||||
/* we currently use always SHA1 for signatures,
|
|
||||||
* TODO: support other hashes depending on configuration/auth */
|
|
||||||
scheme = SIGN_RSA_EMSA_PKCS1_SHA1;
|
scheme = SIGN_RSA_EMSA_PKCS1_SHA1;
|
||||||
auth_method = AUTH_RSA;
|
auth_method = AUTH_RSA;
|
||||||
break;
|
break;
|
||||||
case KEY_ECDSA:
|
case KEY_ECDSA:
|
||||||
/* we try to deduct the signature scheme from the keysize */
|
/* deduct the signature scheme from the keysize */
|
||||||
switch (private->get_keysize(private))
|
switch (private->get_keysize(private))
|
||||||
{
|
{
|
||||||
case 256:
|
case 256:
|
||||||
@@ -101,25 +243,24 @@ METHOD(authenticator_t, build, status_t,
|
|||||||
auth_method = AUTH_ECDSA_521;
|
auth_method = AUTH_ECDSA_521;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
DBG1(DBG_IKE, "%d bit ECDSA private key size not supported",
|
DBG1(DBG_IKE, "%d bit ECDSA private key size not "
|
||||||
private->get_keysize(private));
|
"supported", private->get_keysize(private));
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case KEY_BLISS:
|
|
||||||
/* we currently use SHA512 only */
|
|
||||||
scheme = SIGN_BLISS_WITH_SHA512;
|
|
||||||
auth_method = AUTH_BLISS;
|
|
||||||
break;
|
|
||||||
default:
|
default:
|
||||||
DBG1(DBG_IKE, "private key of type %N not supported",
|
DBG1(DBG_IKE, "private key of type %N not supported",
|
||||||
key_type_names, private->get_type(private));
|
key_type_names, private->get_type(private));
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
keymat = (keymat_v2_t*)this->ike_sa->get_keymat(this->ike_sa);
|
}
|
||||||
|
|
||||||
if (keymat->get_auth_octets(keymat, FALSE, this->ike_sa_init,
|
if (keymat->get_auth_octets(keymat, FALSE, this->ike_sa_init,
|
||||||
this->nonce, id, this->reserved, &octets) &&
|
this->nonce, id, this->reserved, &octets) &&
|
||||||
private->sign(private, scheme, octets, &auth_data))
|
private->sign(private, scheme, octets, &auth_data))
|
||||||
|
{
|
||||||
|
if (auth_method != AUTH_DS ||
|
||||||
|
build_signature_auth_data(&auth_data, scheme))
|
||||||
{
|
{
|
||||||
auth_payload = auth_payload_create();
|
auth_payload = auth_payload_create();
|
||||||
auth_payload->set_auth_method(auth_payload, auth_method);
|
auth_payload->set_auth_method(auth_payload, auth_method);
|
||||||
@@ -128,9 +269,11 @@ METHOD(authenticator_t, build, status_t,
|
|||||||
message->add_payload(message, (payload_t*)auth_payload);
|
message->add_payload(message, (payload_t*)auth_payload);
|
||||||
status = SUCCESS;
|
status = SUCCESS;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
DBG1(DBG_IKE, "authentication of '%Y' (myself) with %N %s", id,
|
DBG1(DBG_IKE, "authentication of '%Y' (myself) with %N %s", id,
|
||||||
auth_method_names, auth_method,
|
auth_method == AUTH_DS ? signature_scheme_names : auth_method_names,
|
||||||
(status == SUCCESS)? "successful":"failed");
|
auth_method == AUTH_DS ? scheme : auth_method,
|
||||||
|
status == SUCCESS ? "successful" : "failed");
|
||||||
chunk_free(&octets);
|
chunk_free(&octets);
|
||||||
private->destroy(private);
|
private->destroy(private);
|
||||||
|
|
||||||
@@ -158,11 +301,10 @@ METHOD(authenticator_t, process, status_t,
|
|||||||
return FAILED;
|
return FAILED;
|
||||||
}
|
}
|
||||||
auth_method = auth_payload->get_auth_method(auth_payload);
|
auth_method = auth_payload->get_auth_method(auth_payload);
|
||||||
|
auth_data = auth_payload->get_data(auth_payload);
|
||||||
switch (auth_method)
|
switch (auth_method)
|
||||||
{
|
{
|
||||||
case AUTH_RSA:
|
case AUTH_RSA:
|
||||||
/* We currently accept SHA1 signatures only
|
|
||||||
* TODO: allow other hash algorithms and note it in "auth" */
|
|
||||||
key_type = KEY_RSA;
|
key_type = KEY_RSA;
|
||||||
scheme = SIGN_RSA_EMSA_PKCS1_SHA1;
|
scheme = SIGN_RSA_EMSA_PKCS1_SHA1;
|
||||||
break;
|
break;
|
||||||
@@ -175,14 +317,15 @@ METHOD(authenticator_t, process, status_t,
|
|||||||
case AUTH_ECDSA_521:
|
case AUTH_ECDSA_521:
|
||||||
scheme = SIGN_ECDSA_521;
|
scheme = SIGN_ECDSA_521;
|
||||||
break;
|
break;
|
||||||
case AUTH_BLISS:
|
case AUTH_DS:
|
||||||
key_type = KEY_BLISS;
|
if (parse_signature_auth_data(&auth_data, &key_type, &scheme))
|
||||||
scheme = SIGN_BLISS_WITH_SHA512;
|
{
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
|
/* fall-through */
|
||||||
default:
|
default:
|
||||||
return INVALID_ARG;
|
return INVALID_ARG;
|
||||||
}
|
}
|
||||||
auth_data = auth_payload->get_data(auth_payload);
|
|
||||||
id = this->ike_sa->get_other_id(this->ike_sa);
|
id = this->ike_sa->get_other_id(this->ike_sa);
|
||||||
keymat = (keymat_v2_t*)this->ike_sa->get_keymat(this->ike_sa);
|
keymat = (keymat_v2_t*)this->ike_sa->get_keymat(this->ike_sa);
|
||||||
if (!keymat->get_auth_octets(keymat, TRUE, this->ike_sa_init,
|
if (!keymat->get_auth_octets(keymat, TRUE, this->ike_sa_init,
|
||||||
@@ -197,11 +340,16 @@ METHOD(authenticator_t, process, status_t,
|
|||||||
{
|
{
|
||||||
if (public->verify(public, scheme, octets, auth_data))
|
if (public->verify(public, scheme, octets, auth_data))
|
||||||
{
|
{
|
||||||
DBG1(DBG_IKE, "authentication of '%Y' with %N successful",
|
DBG1(DBG_IKE, "authentication of '%Y' with %N successful", id,
|
||||||
id, auth_method_names, auth_method);
|
auth_method == AUTH_DS ? signature_scheme_names : auth_method_names,
|
||||||
|
auth_method == AUTH_DS ? scheme : auth_method);
|
||||||
status = SUCCESS;
|
status = SUCCESS;
|
||||||
auth->merge(auth, current_auth, FALSE);
|
auth->merge(auth, current_auth, FALSE);
|
||||||
auth->add(auth, AUTH_RULE_AUTH_CLASS, AUTH_CLASS_PUBKEY);
|
auth->add(auth, AUTH_RULE_AUTH_CLASS, AUTH_CLASS_PUBKEY);
|
||||||
|
if (this->store_signature_scheme)
|
||||||
|
{
|
||||||
|
auth->add(auth, AUTH_RULE_SIGNATURE_SCHEME, (uintptr_t)scheme);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -274,6 +422,8 @@ pubkey_authenticator_t *pubkey_authenticator_create_verifier(ike_sa_t *ike_sa,
|
|||||||
.ike_sa = ike_sa,
|
.ike_sa = ike_sa,
|
||||||
.ike_sa_init = received_init,
|
.ike_sa_init = received_init,
|
||||||
.nonce = sent_nonce,
|
.nonce = sent_nonce,
|
||||||
|
.store_signature_scheme = lib->settings->get_bool(lib->settings,
|
||||||
|
"%s.signature_authentication_constraints", TRUE, lib->ns),
|
||||||
);
|
);
|
||||||
memcpy(this->reserved, reserved, sizeof(this->reserved));
|
memcpy(this->reserved, reserved, sizeof(this->reserved));
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
|
* Copyright (C) 2015 Tobias Brunner
|
||||||
* Copyright (C) 2008 Martin Willi
|
* Copyright (C) 2008 Martin Willi
|
||||||
* Hochschule fuer Technik Rapperswil
|
* Hochschule fuer Technik Rapperswil
|
||||||
*
|
*
|
||||||
@@ -17,6 +18,7 @@
|
|||||||
|
|
||||||
#include <daemon.h>
|
#include <daemon.h>
|
||||||
#include <crypto/prf_plus.h>
|
#include <crypto/prf_plus.h>
|
||||||
|
#include <crypto/hashers/hash_algorithm_set.h>
|
||||||
|
|
||||||
typedef struct private_keymat_v2_t private_keymat_v2_t;
|
typedef struct private_keymat_v2_t private_keymat_v2_t;
|
||||||
|
|
||||||
@@ -69,6 +71,11 @@ struct private_keymat_v2_t {
|
|||||||
* Key to verify incoming authentication data (SKp)
|
* Key to verify incoming authentication data (SKp)
|
||||||
*/
|
*/
|
||||||
chunk_t skp_verify;
|
chunk_t skp_verify;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set of hash algorithms supported by peer for signature authentication
|
||||||
|
*/
|
||||||
|
hash_algorithm_set_t *hash_algorithms;
|
||||||
};
|
};
|
||||||
|
|
||||||
METHOD(keymat_t, get_version, ike_version_t,
|
METHOD(keymat_t, get_version, ike_version_t,
|
||||||
@@ -676,6 +683,26 @@ METHOD(keymat_v2_t, get_psk_sig, bool,
|
|||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
METHOD(keymat_v2_t, hash_algorithm_supported, bool,
|
||||||
|
private_keymat_v2_t *this, hash_algorithm_t hash)
|
||||||
|
{
|
||||||
|
if (!this->hash_algorithms)
|
||||||
|
{
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
return this->hash_algorithms->contains(this->hash_algorithms, hash);
|
||||||
|
}
|
||||||
|
|
||||||
|
METHOD(keymat_v2_t, add_hash_algorithm, void,
|
||||||
|
private_keymat_v2_t *this, hash_algorithm_t hash)
|
||||||
|
{
|
||||||
|
if (!this->hash_algorithms)
|
||||||
|
{
|
||||||
|
this->hash_algorithms = hash_algorithm_set_create();
|
||||||
|
}
|
||||||
|
this->hash_algorithms->add(this->hash_algorithms, hash);
|
||||||
|
}
|
||||||
|
|
||||||
METHOD(keymat_t, destroy, void,
|
METHOD(keymat_t, destroy, void,
|
||||||
private_keymat_v2_t *this)
|
private_keymat_v2_t *this)
|
||||||
{
|
{
|
||||||
@@ -685,6 +712,7 @@ METHOD(keymat_t, destroy, void,
|
|||||||
chunk_clear(&this->skd);
|
chunk_clear(&this->skd);
|
||||||
chunk_clear(&this->skp_verify);
|
chunk_clear(&this->skp_verify);
|
||||||
chunk_clear(&this->skp_build);
|
chunk_clear(&this->skp_build);
|
||||||
|
DESTROY_IF(this->hash_algorithms);
|
||||||
free(this);
|
free(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -709,6 +737,9 @@ keymat_v2_t *keymat_v2_create(bool initiator)
|
|||||||
.get_skd = _get_skd,
|
.get_skd = _get_skd,
|
||||||
.get_auth_octets = _get_auth_octets,
|
.get_auth_octets = _get_auth_octets,
|
||||||
.get_psk_sig = _get_psk_sig,
|
.get_psk_sig = _get_psk_sig,
|
||||||
|
.add_hash_algorithm = _add_hash_algorithm,
|
||||||
|
.hash_algorithm_supported = _hash_algorithm_supported,
|
||||||
|
|
||||||
},
|
},
|
||||||
.initiator = initiator,
|
.initiator = initiator,
|
||||||
.prf_alg = PRF_UNDEFINED,
|
.prf_alg = PRF_UNDEFINED,
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2011 Tobias Brunner
|
* Copyright (C) 2011-2015 Tobias Brunner
|
||||||
* Hochschule fuer Technik Rapperswil
|
* Hochschule fuer Technik Rapperswil
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify it
|
* This program is free software; you can redistribute it and/or modify it
|
||||||
@@ -124,6 +124,22 @@ struct keymat_v2_t {
|
|||||||
bool (*get_psk_sig)(keymat_v2_t *this, bool verify, chunk_t ike_sa_init,
|
bool (*get_psk_sig)(keymat_v2_t *this, bool verify, chunk_t ike_sa_init,
|
||||||
chunk_t nonce, chunk_t secret,
|
chunk_t nonce, chunk_t secret,
|
||||||
identification_t *id, char reserved[3], chunk_t *sig);
|
identification_t *id, char reserved[3], chunk_t *sig);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Add a hash algorithm supported by the peer for signature authentication.
|
||||||
|
*
|
||||||
|
* @param hash hash algorithm
|
||||||
|
*/
|
||||||
|
void (*add_hash_algorithm)(keymat_v2_t *this, hash_algorithm_t hash);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check if a given hash algorithm is supported by the peer for signature
|
||||||
|
* authentication.
|
||||||
|
*
|
||||||
|
* @param hash hash algorithm
|
||||||
|
* @return TRUE if supported, FALSE otherwise
|
||||||
|
*/
|
||||||
|
bool (*hash_algorithm_supported)(keymat_v2_t *this, hash_algorithm_t hash);
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2008-2009 Tobias Brunner
|
* Copyright (C) 2008-2015 Tobias Brunner
|
||||||
* Copyright (C) 2005-2008 Martin Willi
|
* Copyright (C) 2005-2008 Martin Willi
|
||||||
* Copyright (C) 2005 Jan Hutter
|
* Copyright (C) 2005 Jan Hutter
|
||||||
* Hochschule fuer Technik Rapperswil
|
* Hochschule fuer Technik Rapperswil
|
||||||
@@ -20,8 +20,11 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
#include <daemon.h>
|
#include <daemon.h>
|
||||||
|
#include <bio/bio_reader.h>
|
||||||
|
#include <bio/bio_writer.h>
|
||||||
#include <sa/ikev2/keymat_v2.h>
|
#include <sa/ikev2/keymat_v2.h>
|
||||||
#include <crypto/diffie_hellman.h>
|
#include <crypto/diffie_hellman.h>
|
||||||
|
#include <crypto/hashers/hash_algorithm_set.h>
|
||||||
#include <encoding/payloads/sa_payload.h>
|
#include <encoding/payloads/sa_payload.h>
|
||||||
#include <encoding/payloads/ke_payload.h>
|
#include <encoding/payloads/ke_payload.h>
|
||||||
#include <encoding/payloads/nonce_payload.h>
|
#include <encoding/payloads/nonce_payload.h>
|
||||||
@@ -100,8 +103,110 @@ struct private_ike_init_t {
|
|||||||
* retries done so far after failure (cookie or bad dh group)
|
* retries done so far after failure (cookie or bad dh group)
|
||||||
*/
|
*/
|
||||||
u_int retry;
|
u_int retry;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Whether to use Signature Authentication as per RFC 7427
|
||||||
|
*/
|
||||||
|
bool signature_authentication;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Notify the peer about the hash algorithms we support or expect,
|
||||||
|
* as per RFC 7427
|
||||||
|
*/
|
||||||
|
static void send_supported_hash_algorithms(private_ike_init_t *this,
|
||||||
|
message_t *message)
|
||||||
|
{
|
||||||
|
hash_algorithm_set_t *algos;
|
||||||
|
enumerator_t *enumerator, *rounds;
|
||||||
|
bio_writer_t *writer;
|
||||||
|
hash_algorithm_t hash;
|
||||||
|
peer_cfg_t *peer;
|
||||||
|
auth_cfg_t *auth;
|
||||||
|
auth_rule_t rule;
|
||||||
|
uintptr_t config;
|
||||||
|
char *plugin_name;
|
||||||
|
|
||||||
|
algos = hash_algorithm_set_create();
|
||||||
|
peer = this->ike_sa->get_peer_cfg(this->ike_sa);
|
||||||
|
if (peer)
|
||||||
|
{
|
||||||
|
rounds = peer->create_auth_cfg_enumerator(peer, FALSE);
|
||||||
|
while (rounds->enumerate(rounds, &auth))
|
||||||
|
{
|
||||||
|
enumerator = auth->create_enumerator(auth);
|
||||||
|
while (enumerator->enumerate(enumerator, &rule, &config))
|
||||||
|
{
|
||||||
|
if (rule == AUTH_RULE_SIGNATURE_SCHEME)
|
||||||
|
{
|
||||||
|
hash = hasher_from_signature_scheme(config);
|
||||||
|
if (hasher_algorithm_for_ikev2(hash))
|
||||||
|
{
|
||||||
|
algos->add(algos, hash);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
enumerator->destroy(enumerator);
|
||||||
|
}
|
||||||
|
rounds->destroy(rounds);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!algos->count(algos))
|
||||||
|
{
|
||||||
|
enumerator = lib->crypto->create_hasher_enumerator(lib->crypto);
|
||||||
|
while (enumerator->enumerate(enumerator, &hash, &plugin_name))
|
||||||
|
{
|
||||||
|
if (hasher_algorithm_for_ikev2(hash))
|
||||||
|
{
|
||||||
|
algos->add(algos, hash);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
enumerator->destroy(enumerator);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (algos->count(algos))
|
||||||
|
{
|
||||||
|
writer = bio_writer_create(0);
|
||||||
|
enumerator = algos->create_enumerator(algos);
|
||||||
|
while (enumerator->enumerate(enumerator, &hash))
|
||||||
|
{
|
||||||
|
writer->write_uint16(writer, hash);
|
||||||
|
}
|
||||||
|
enumerator->destroy(enumerator);
|
||||||
|
message->add_notify(message, FALSE, SIGNATURE_HASH_ALGORITHMS,
|
||||||
|
writer->get_buf(writer));
|
||||||
|
writer->destroy(writer);
|
||||||
|
}
|
||||||
|
algos->destroy(algos);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Store algorithms supported by other peer
|
||||||
|
*/
|
||||||
|
static void handle_supported_hash_algorithms(private_ike_init_t *this,
|
||||||
|
notify_payload_t *notify)
|
||||||
|
{
|
||||||
|
bio_reader_t *reader;
|
||||||
|
u_int16_t algo;
|
||||||
|
bool added = FALSE;
|
||||||
|
|
||||||
|
reader = bio_reader_create(notify->get_notification_data(notify));
|
||||||
|
while (reader->remaining(reader) >= 2 && reader->read_uint16(reader, &algo))
|
||||||
|
{
|
||||||
|
if (hasher_algorithm_for_ikev2(algo))
|
||||||
|
{
|
||||||
|
this->keymat->add_hash_algorithm(this->keymat, algo);
|
||||||
|
added = TRUE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
reader->destroy(reader);
|
||||||
|
|
||||||
|
if (added)
|
||||||
|
{
|
||||||
|
this->ike_sa->enable_extension(this->ike_sa, EXT_SIGNATURE_AUTH);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* build the payloads for the message
|
* build the payloads for the message
|
||||||
*/
|
*/
|
||||||
@@ -174,6 +279,16 @@ static void build_payloads(private_ike_init_t *this, message_t *message)
|
|||||||
chunk_empty);
|
chunk_empty);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
/* submit supported hash algorithms for signature authentication */
|
||||||
|
if (!this->old_sa && this->signature_authentication)
|
||||||
|
{
|
||||||
|
if (this->initiator ||
|
||||||
|
this->ike_sa->supports_extension(this->ike_sa,
|
||||||
|
EXT_SIGNATURE_AUTH))
|
||||||
|
{
|
||||||
|
send_supported_hash_algorithms(this, message);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -228,11 +343,23 @@ static void process_payloads(private_ike_init_t *this, message_t *message)
|
|||||||
{
|
{
|
||||||
notify_payload_t *notify = (notify_payload_t*)payload;
|
notify_payload_t *notify = (notify_payload_t*)payload;
|
||||||
|
|
||||||
if (notify->get_notify_type(notify) == FRAGMENTATION_SUPPORTED)
|
switch (notify->get_notify_type(notify))
|
||||||
{
|
{
|
||||||
|
case FRAGMENTATION_SUPPORTED:
|
||||||
this->ike_sa->enable_extension(this->ike_sa,
|
this->ike_sa->enable_extension(this->ike_sa,
|
||||||
EXT_IKE_FRAGMENTATION);
|
EXT_IKE_FRAGMENTATION);
|
||||||
|
break;
|
||||||
|
case SIGNATURE_HASH_ALGORITHMS:
|
||||||
|
if (this->signature_authentication)
|
||||||
|
{
|
||||||
|
handle_supported_hash_algorithms(this, notify);
|
||||||
}
|
}
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
/* other notifies are handled elsewhere */
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
@@ -637,6 +764,8 @@ ike_init_t *ike_init_create(ike_sa_t *ike_sa, bool initiator, ike_sa_t *old_sa)
|
|||||||
.dh_group = MODP_NONE,
|
.dh_group = MODP_NONE,
|
||||||
.keymat = (keymat_v2_t*)ike_sa->get_keymat(ike_sa),
|
.keymat = (keymat_v2_t*)ike_sa->get_keymat(ike_sa),
|
||||||
.old_sa = old_sa,
|
.old_sa = old_sa,
|
||||||
|
.signature_authentication = lib->settings->get_bool(lib->settings,
|
||||||
|
"%s.signature_authentication", TRUE, lib->ns),
|
||||||
);
|
);
|
||||||
|
|
||||||
if (initiator)
|
if (initiator)
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ asn1/asn1.c asn1/asn1_parser.c asn1/oid.c bio/bio_reader.c bio/bio_writer.c \
|
|||||||
collections/blocking_queue.c collections/enumerator.c collections/hashtable.c \
|
collections/blocking_queue.c collections/enumerator.c collections/hashtable.c \
|
||||||
collections/array.c \
|
collections/array.c \
|
||||||
collections/linked_list.c crypto/crypters/crypter.c crypto/hashers/hasher.c \
|
collections/linked_list.c crypto/crypters/crypter.c crypto/hashers/hasher.c \
|
||||||
|
crypto/hashers/hash_algorithm_set.c \
|
||||||
crypto/proposal/proposal_keywords.c crypto/proposal/proposal_keywords_static.c \
|
crypto/proposal/proposal_keywords.c crypto/proposal/proposal_keywords_static.c \
|
||||||
crypto/prfs/prf.c crypto/prfs/mac_prf.c crypto/pkcs5.c \
|
crypto/prfs/prf.c crypto/prfs/mac_prf.c crypto/pkcs5.c \
|
||||||
crypto/rngs/rng.c crypto/prf_plus.c crypto/signers/signer.c \
|
crypto/rngs/rng.c crypto/prf_plus.c crypto/signers/signer.c \
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ asn1/asn1.c asn1/asn1_parser.c asn1/oid.c bio/bio_reader.c bio/bio_writer.c \
|
|||||||
collections/blocking_queue.c collections/enumerator.c collections/hashtable.c \
|
collections/blocking_queue.c collections/enumerator.c collections/hashtable.c \
|
||||||
collections/array.c \
|
collections/array.c \
|
||||||
collections/linked_list.c crypto/crypters/crypter.c crypto/hashers/hasher.c \
|
collections/linked_list.c crypto/crypters/crypter.c crypto/hashers/hasher.c \
|
||||||
|
crypto/hashers/hash_algorithm_set.c \
|
||||||
crypto/proposal/proposal_keywords.c crypto/proposal/proposal_keywords_static.c \
|
crypto/proposal/proposal_keywords.c crypto/proposal/proposal_keywords_static.c \
|
||||||
crypto/prfs/prf.c crypto/prfs/mac_prf.c crypto/pkcs5.c \
|
crypto/prfs/prf.c crypto/prfs/mac_prf.c crypto/pkcs5.c \
|
||||||
crypto/rngs/rng.c crypto/prf_plus.c crypto/signers/signer.c \
|
crypto/rngs/rng.c crypto/prf_plus.c crypto/signers/signer.c \
|
||||||
@@ -61,7 +62,8 @@ library.h \
|
|||||||
asn1/asn1.h asn1/asn1_parser.h asn1/oid.h bio/bio_reader.h bio/bio_writer.h \
|
asn1/asn1.h asn1/asn1_parser.h asn1/oid.h bio/bio_reader.h bio/bio_writer.h \
|
||||||
collections/blocking_queue.h collections/enumerator.h collections/hashtable.h \
|
collections/blocking_queue.h collections/enumerator.h collections/hashtable.h \
|
||||||
collections/linked_list.h collections/array.h collections/dictionary.h \
|
collections/linked_list.h collections/array.h collections/dictionary.h \
|
||||||
crypto/crypters/crypter.h crypto/hashers/hasher.h crypto/mac.h \
|
crypto/crypters/crypter.h crypto/hashers/hasher.h \
|
||||||
|
crypto/hashers/hash_algorithm_set.h crypto/mac.h \
|
||||||
crypto/proposal/proposal_keywords.h crypto/proposal/proposal_keywords_static.h \
|
crypto/proposal/proposal_keywords.h crypto/proposal/proposal_keywords_static.h \
|
||||||
crypto/prfs/prf.h crypto/prfs/mac_prf.h crypto/rngs/rng.h crypto/nonce_gen.h \
|
crypto/prfs/prf.h crypto/prfs/mac_prf.h crypto/rngs/rng.h crypto/nonce_gen.h \
|
||||||
crypto/prf_plus.h crypto/signers/signer.h crypto/signers/mac_signer.h \
|
crypto/prf_plus.h crypto/signers/signer.h crypto/signers/mac_signer.h \
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2008-2012 Tobias Brunner
|
* Copyright (C) 2008-2015 Tobias Brunner
|
||||||
* Copyright (C) 2007-2009 Martin Willi
|
* Copyright (C) 2007-2009 Martin Willi
|
||||||
* Hochschule fuer Technik Rapperswil
|
* Hochschule fuer Technik Rapperswil
|
||||||
*
|
*
|
||||||
@@ -49,6 +49,7 @@ ENUM(auth_rule_names, AUTH_RULE_IDENTITY, AUTH_HELPER_AC_CERT,
|
|||||||
"RULE_GROUP",
|
"RULE_GROUP",
|
||||||
"RULE_RSA_STRENGTH",
|
"RULE_RSA_STRENGTH",
|
||||||
"RULE_ECDSA_STRENGTH",
|
"RULE_ECDSA_STRENGTH",
|
||||||
|
"RULE_BLISS_STRENGTH",
|
||||||
"RULE_SIGNATURE_SCHEME",
|
"RULE_SIGNATURE_SCHEME",
|
||||||
"RULE_CERT_POLICY",
|
"RULE_CERT_POLICY",
|
||||||
"HELPER_IM_CERT",
|
"HELPER_IM_CERT",
|
||||||
@@ -71,6 +72,7 @@ static inline bool is_multi_value_rule(auth_rule_t type)
|
|||||||
case AUTH_RULE_EAP_VENDOR:
|
case AUTH_RULE_EAP_VENDOR:
|
||||||
case AUTH_RULE_RSA_STRENGTH:
|
case AUTH_RULE_RSA_STRENGTH:
|
||||||
case AUTH_RULE_ECDSA_STRENGTH:
|
case AUTH_RULE_ECDSA_STRENGTH:
|
||||||
|
case AUTH_RULE_BLISS_STRENGTH:
|
||||||
case AUTH_RULE_IDENTITY:
|
case AUTH_RULE_IDENTITY:
|
||||||
case AUTH_RULE_IDENTITY_LOOSE:
|
case AUTH_RULE_IDENTITY_LOOSE:
|
||||||
case AUTH_RULE_EAP_IDENTITY:
|
case AUTH_RULE_EAP_IDENTITY:
|
||||||
@@ -207,6 +209,7 @@ static void init_entry(entry_t *this, auth_rule_t type, va_list args)
|
|||||||
case AUTH_RULE_OCSP_VALIDATION:
|
case AUTH_RULE_OCSP_VALIDATION:
|
||||||
case AUTH_RULE_RSA_STRENGTH:
|
case AUTH_RULE_RSA_STRENGTH:
|
||||||
case AUTH_RULE_ECDSA_STRENGTH:
|
case AUTH_RULE_ECDSA_STRENGTH:
|
||||||
|
case AUTH_RULE_BLISS_STRENGTH:
|
||||||
case AUTH_RULE_SIGNATURE_SCHEME:
|
case AUTH_RULE_SIGNATURE_SCHEME:
|
||||||
/* integer type */
|
/* integer type */
|
||||||
this->value = (void*)(uintptr_t)va_arg(args, u_int);
|
this->value = (void*)(uintptr_t)va_arg(args, u_int);
|
||||||
@@ -255,6 +258,7 @@ static bool entry_equals(entry_t *e1, entry_t *e2)
|
|||||||
case AUTH_RULE_OCSP_VALIDATION:
|
case AUTH_RULE_OCSP_VALIDATION:
|
||||||
case AUTH_RULE_RSA_STRENGTH:
|
case AUTH_RULE_RSA_STRENGTH:
|
||||||
case AUTH_RULE_ECDSA_STRENGTH:
|
case AUTH_RULE_ECDSA_STRENGTH:
|
||||||
|
case AUTH_RULE_BLISS_STRENGTH:
|
||||||
case AUTH_RULE_SIGNATURE_SCHEME:
|
case AUTH_RULE_SIGNATURE_SCHEME:
|
||||||
{
|
{
|
||||||
return e1->value == e2->value;
|
return e1->value == e2->value;
|
||||||
@@ -345,6 +349,7 @@ static void destroy_entry_value(entry_t *entry)
|
|||||||
case AUTH_RULE_OCSP_VALIDATION:
|
case AUTH_RULE_OCSP_VALIDATION:
|
||||||
case AUTH_RULE_RSA_STRENGTH:
|
case AUTH_RULE_RSA_STRENGTH:
|
||||||
case AUTH_RULE_ECDSA_STRENGTH:
|
case AUTH_RULE_ECDSA_STRENGTH:
|
||||||
|
case AUTH_RULE_BLISS_STRENGTH:
|
||||||
case AUTH_RULE_SIGNATURE_SCHEME:
|
case AUTH_RULE_SIGNATURE_SCHEME:
|
||||||
case AUTH_RULE_MAX:
|
case AUTH_RULE_MAX:
|
||||||
break;
|
break;
|
||||||
@@ -376,6 +381,7 @@ static void replace(private_auth_cfg_t *this, entry_enumerator_t *enumerator,
|
|||||||
case AUTH_RULE_OCSP_VALIDATION:
|
case AUTH_RULE_OCSP_VALIDATION:
|
||||||
case AUTH_RULE_RSA_STRENGTH:
|
case AUTH_RULE_RSA_STRENGTH:
|
||||||
case AUTH_RULE_ECDSA_STRENGTH:
|
case AUTH_RULE_ECDSA_STRENGTH:
|
||||||
|
case AUTH_RULE_BLISS_STRENGTH:
|
||||||
case AUTH_RULE_SIGNATURE_SCHEME:
|
case AUTH_RULE_SIGNATURE_SCHEME:
|
||||||
/* integer type */
|
/* integer type */
|
||||||
entry->value = (void*)(uintptr_t)va_arg(args, u_int);
|
entry->value = (void*)(uintptr_t)va_arg(args, u_int);
|
||||||
@@ -450,6 +456,7 @@ METHOD(auth_cfg_t, get, void*,
|
|||||||
case AUTH_RULE_EAP_VENDOR:
|
case AUTH_RULE_EAP_VENDOR:
|
||||||
case AUTH_RULE_RSA_STRENGTH:
|
case AUTH_RULE_RSA_STRENGTH:
|
||||||
case AUTH_RULE_ECDSA_STRENGTH:
|
case AUTH_RULE_ECDSA_STRENGTH:
|
||||||
|
case AUTH_RULE_BLISS_STRENGTH:
|
||||||
return (void*)0;
|
return (void*)0;
|
||||||
case AUTH_RULE_SIGNATURE_SCHEME:
|
case AUTH_RULE_SIGNATURE_SCHEME:
|
||||||
return (void*)HASH_UNKNOWN;
|
return (void*)HASH_UNKNOWN;
|
||||||
@@ -513,6 +520,7 @@ METHOD(auth_cfg_t, complies, bool,
|
|||||||
signature_scheme_t scheme = SIGN_UNKNOWN;
|
signature_scheme_t scheme = SIGN_UNKNOWN;
|
||||||
u_int strength = 0;
|
u_int strength = 0;
|
||||||
auth_rule_t t1, t2;
|
auth_rule_t t1, t2;
|
||||||
|
char *key_type;
|
||||||
void *value;
|
void *value;
|
||||||
|
|
||||||
e1 = constraints->create_enumerator(constraints);
|
e1 = constraints->create_enumerator(constraints);
|
||||||
@@ -703,6 +711,7 @@ METHOD(auth_cfg_t, complies, bool,
|
|||||||
}
|
}
|
||||||
case AUTH_RULE_RSA_STRENGTH:
|
case AUTH_RULE_RSA_STRENGTH:
|
||||||
case AUTH_RULE_ECDSA_STRENGTH:
|
case AUTH_RULE_ECDSA_STRENGTH:
|
||||||
|
case AUTH_RULE_BLISS_STRENGTH:
|
||||||
{
|
{
|
||||||
strength = (uintptr_t)value;
|
strength = (uintptr_t)value;
|
||||||
break;
|
break;
|
||||||
@@ -797,9 +806,20 @@ METHOD(auth_cfg_t, complies, bool,
|
|||||||
e2 = create_enumerator(this);
|
e2 = create_enumerator(this);
|
||||||
while (e2->enumerate(e2, &t2, &strength))
|
while (e2->enumerate(e2, &t2, &strength))
|
||||||
{
|
{
|
||||||
if (t2 == AUTH_RULE_RSA_STRENGTH ||
|
switch (t2)
|
||||||
t2 == AUTH_RULE_ECDSA_STRENGTH)
|
|
||||||
{
|
{
|
||||||
|
default:
|
||||||
|
continue;
|
||||||
|
case AUTH_RULE_RSA_STRENGTH:
|
||||||
|
key_type = "RSA";
|
||||||
|
break;
|
||||||
|
case AUTH_RULE_ECDSA_STRENGTH:
|
||||||
|
key_type = "ECDSA";
|
||||||
|
break;
|
||||||
|
case AUTH_RULE_BLISS_STRENGTH:
|
||||||
|
key_type = "BLISS";
|
||||||
|
break;
|
||||||
|
}
|
||||||
success = FALSE;
|
success = FALSE;
|
||||||
e1 = constraints->create_enumerator(constraints);
|
e1 = constraints->create_enumerator(constraints);
|
||||||
while (e1->enumerate(e1, &t1, &value))
|
while (e1->enumerate(e1, &t1, &value))
|
||||||
@@ -816,13 +836,11 @@ METHOD(auth_cfg_t, complies, bool,
|
|||||||
if (log_error)
|
if (log_error)
|
||||||
{
|
{
|
||||||
DBG1(DBG_CFG, "%s-%d signatures not acceptable",
|
DBG1(DBG_CFG, "%s-%d signatures not acceptable",
|
||||||
t2 == AUTH_RULE_RSA_STRENGTH ? "RSA" : "ECDSA",
|
key_type, strength);
|
||||||
strength);
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
e2->destroy(e2);
|
e2->destroy(e2);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -891,6 +909,7 @@ static void merge(private_auth_cfg_t *this, private_auth_cfg_t *other, bool copy
|
|||||||
case AUTH_RULE_EAP_VENDOR:
|
case AUTH_RULE_EAP_VENDOR:
|
||||||
case AUTH_RULE_RSA_STRENGTH:
|
case AUTH_RULE_RSA_STRENGTH:
|
||||||
case AUTH_RULE_ECDSA_STRENGTH:
|
case AUTH_RULE_ECDSA_STRENGTH:
|
||||||
|
case AUTH_RULE_BLISS_STRENGTH:
|
||||||
case AUTH_RULE_SIGNATURE_SCHEME:
|
case AUTH_RULE_SIGNATURE_SCHEME:
|
||||||
{
|
{
|
||||||
add(this, type, (uintptr_t)value);
|
add(this, type, (uintptr_t)value);
|
||||||
@@ -1060,6 +1079,7 @@ METHOD(auth_cfg_t, clone_, auth_cfg_t*,
|
|||||||
case AUTH_RULE_OCSP_VALIDATION:
|
case AUTH_RULE_OCSP_VALIDATION:
|
||||||
case AUTH_RULE_RSA_STRENGTH:
|
case AUTH_RULE_RSA_STRENGTH:
|
||||||
case AUTH_RULE_ECDSA_STRENGTH:
|
case AUTH_RULE_ECDSA_STRENGTH:
|
||||||
|
case AUTH_RULE_BLISS_STRENGTH:
|
||||||
case AUTH_RULE_SIGNATURE_SCHEME:
|
case AUTH_RULE_SIGNATURE_SCHEME:
|
||||||
clone->add(clone, type, (uintptr_t)value);
|
clone->add(clone, type, (uintptr_t)value);
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2008-2012 Tobias Brunner
|
* Copyright (C) 2008-2015 Tobias Brunner
|
||||||
* Copyright (C) 2007-2009 Martin Willi
|
* Copyright (C) 2007-2009 Martin Willi
|
||||||
* Hochschule fuer Technik Rapperswil
|
* Hochschule fuer Technik Rapperswil
|
||||||
*
|
*
|
||||||
@@ -102,6 +102,8 @@ enum auth_rule_t {
|
|||||||
AUTH_RULE_RSA_STRENGTH,
|
AUTH_RULE_RSA_STRENGTH,
|
||||||
/** required ECDSA public key strength, u_int in bits */
|
/** required ECDSA public key strength, u_int in bits */
|
||||||
AUTH_RULE_ECDSA_STRENGTH,
|
AUTH_RULE_ECDSA_STRENGTH,
|
||||||
|
/** required BLISS public key strength, u_int in bits */
|
||||||
|
AUTH_RULE_BLISS_STRENGTH,
|
||||||
/** required signature scheme, signature_scheme_t */
|
/** required signature scheme, signature_scheme_t */
|
||||||
AUTH_RULE_SIGNATURE_SCHEME,
|
AUTH_RULE_SIGNATURE_SCHEME,
|
||||||
/** certificatePolicy constraint, numerical OID as char* */
|
/** certificatePolicy constraint, numerical OID as char* */
|
||||||
|
|||||||
@@ -698,6 +698,9 @@ static void get_key_strength(certificate_t *cert, auth_cfg_t *auth)
|
|||||||
case KEY_ECDSA:
|
case KEY_ECDSA:
|
||||||
auth->add(auth, AUTH_RULE_ECDSA_STRENGTH, strength);
|
auth->add(auth, AUTH_RULE_ECDSA_STRENGTH, strength);
|
||||||
break;
|
break;
|
||||||
|
case KEY_BLISS:
|
||||||
|
auth->add(auth, AUTH_RULE_BLISS_STRENGTH, strength);
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
|
* Copyright (C) 2015 Tobias Brunner
|
||||||
* Copyright (C) 2007 Martin Willi
|
* Copyright (C) 2007 Martin Willi
|
||||||
* Copyright (C) 2014 Andreas Steffen
|
* Copyright (C) 2014 Andreas Steffen
|
||||||
* HSR Hochschule fuer Technik Rapperswil
|
* HSR Hochschule fuer Technik Rapperswil
|
||||||
@@ -142,8 +143,151 @@ signature_scheme_t signature_scheme_from_oid(int oid)
|
|||||||
return SIGN_BLISS_WITH_SHA256;
|
return SIGN_BLISS_WITH_SHA256;
|
||||||
case OID_BLISS_WITH_SHA384:
|
case OID_BLISS_WITH_SHA384:
|
||||||
return SIGN_BLISS_WITH_SHA384;
|
return SIGN_BLISS_WITH_SHA384;
|
||||||
default:
|
}
|
||||||
return SIGN_UNKNOWN;
|
return SIGN_UNKNOWN;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Defined in header.
|
||||||
|
*/
|
||||||
|
int signature_scheme_to_oid(signature_scheme_t scheme)
|
||||||
|
{
|
||||||
|
switch (scheme)
|
||||||
|
{
|
||||||
|
case SIGN_UNKNOWN:
|
||||||
|
case SIGN_RSA_EMSA_PKCS1_NULL:
|
||||||
|
case SIGN_ECDSA_WITH_NULL:
|
||||||
|
case SIGN_ECDSA_256:
|
||||||
|
case SIGN_ECDSA_384:
|
||||||
|
case SIGN_ECDSA_521:
|
||||||
|
break;
|
||||||
|
case SIGN_RSA_EMSA_PKCS1_MD5:
|
||||||
|
return OID_MD5_WITH_RSA;
|
||||||
|
case SIGN_RSA_EMSA_PKCS1_SHA1:
|
||||||
|
return OID_SHA1_WITH_RSA;
|
||||||
|
case SIGN_RSA_EMSA_PKCS1_SHA224:
|
||||||
|
return OID_SHA224_WITH_RSA;
|
||||||
|
case SIGN_RSA_EMSA_PKCS1_SHA256:
|
||||||
|
return OID_SHA256_WITH_RSA;
|
||||||
|
case SIGN_RSA_EMSA_PKCS1_SHA384:
|
||||||
|
return OID_SHA384_WITH_RSA;
|
||||||
|
case SIGN_RSA_EMSA_PKCS1_SHA512:
|
||||||
|
return OID_SHA512_WITH_RSA;
|
||||||
|
case SIGN_ECDSA_WITH_SHA1_DER:
|
||||||
|
return OID_ECDSA_WITH_SHA1;
|
||||||
|
case SIGN_ECDSA_WITH_SHA256_DER:
|
||||||
|
return OID_ECDSA_WITH_SHA256;
|
||||||
|
case SIGN_ECDSA_WITH_SHA384_DER:
|
||||||
|
return OID_ECDSA_WITH_SHA384;
|
||||||
|
case SIGN_ECDSA_WITH_SHA512_DER:
|
||||||
|
return OID_ECDSA_WITH_SHA512;
|
||||||
|
case SIGN_BLISS_WITH_SHA256:
|
||||||
|
return OID_BLISS_WITH_SHA256;
|
||||||
|
case SIGN_BLISS_WITH_SHA384:
|
||||||
|
return OID_BLISS_WITH_SHA384;
|
||||||
|
case SIGN_BLISS_WITH_SHA512:
|
||||||
|
return OID_BLISS_WITH_SHA512;
|
||||||
|
}
|
||||||
|
return OID_UNKNOWN;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Map for signature schemes to the key type and maximum key size allowed.
|
||||||
|
* We only cover schemes with hash algorithms supported by IKEv2 signature
|
||||||
|
* authentication.
|
||||||
|
*/
|
||||||
|
static struct {
|
||||||
|
signature_scheme_t scheme;
|
||||||
|
key_type_t type;
|
||||||
|
int max_keysize;
|
||||||
|
} scheme_map[] = {
|
||||||
|
{ SIGN_RSA_EMSA_PKCS1_SHA256, KEY_RSA, 3072 },
|
||||||
|
{ SIGN_RSA_EMSA_PKCS1_SHA384, KEY_RSA, 7680 },
|
||||||
|
{ SIGN_RSA_EMSA_PKCS1_SHA512, KEY_RSA, 0 },
|
||||||
|
{ SIGN_ECDSA_WITH_SHA256_DER, KEY_ECDSA, 256 },
|
||||||
|
{ SIGN_ECDSA_WITH_SHA384_DER, KEY_ECDSA, 384 },
|
||||||
|
{ SIGN_ECDSA_WITH_SHA512_DER, KEY_ECDSA, 0 },
|
||||||
|
{ SIGN_BLISS_WITH_SHA256, KEY_BLISS, 128 },
|
||||||
|
{ SIGN_BLISS_WITH_SHA384, KEY_BLISS, 192 },
|
||||||
|
{ SIGN_BLISS_WITH_SHA512, KEY_BLISS, 0 },
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Private data for signature scheme enumerator
|
||||||
|
*/
|
||||||
|
typedef struct {
|
||||||
|
enumerator_t public;
|
||||||
|
int index;
|
||||||
|
key_type_t type;
|
||||||
|
int size;
|
||||||
|
} private_enumerator_t;
|
||||||
|
|
||||||
|
METHOD(enumerator_t, signature_schemes_enumerate, bool,
|
||||||
|
private_enumerator_t *this, signature_scheme_t *scheme)
|
||||||
|
{
|
||||||
|
while (++this->index < countof(scheme_map))
|
||||||
|
{
|
||||||
|
if (this->type == scheme_map[this->index].type &&
|
||||||
|
(this->size <= scheme_map[this->index].max_keysize ||
|
||||||
|
!scheme_map[this->index].max_keysize))
|
||||||
|
{
|
||||||
|
*scheme = scheme_map[this->index].scheme;
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Defined in header.
|
||||||
|
*/
|
||||||
|
enumerator_t *signature_schemes_for_key(key_type_t type, int size)
|
||||||
|
{
|
||||||
|
private_enumerator_t *this;
|
||||||
|
|
||||||
|
INIT(this,
|
||||||
|
.public = {
|
||||||
|
.enumerate = (void*)_signature_schemes_enumerate,
|
||||||
|
.destroy = (void*)free,
|
||||||
|
},
|
||||||
|
.index = -1,
|
||||||
|
.type = type,
|
||||||
|
.size = size,
|
||||||
|
);
|
||||||
|
|
||||||
|
return &this->public;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Defined in header.
|
||||||
|
*/
|
||||||
|
key_type_t key_type_from_signature_scheme(signature_scheme_t scheme)
|
||||||
|
{
|
||||||
|
switch (scheme)
|
||||||
|
{
|
||||||
|
case SIGN_UNKNOWN:
|
||||||
|
break;
|
||||||
|
case SIGN_RSA_EMSA_PKCS1_NULL:
|
||||||
|
case SIGN_RSA_EMSA_PKCS1_MD5:
|
||||||
|
case SIGN_RSA_EMSA_PKCS1_SHA1:
|
||||||
|
case SIGN_RSA_EMSA_PKCS1_SHA224:
|
||||||
|
case SIGN_RSA_EMSA_PKCS1_SHA256:
|
||||||
|
case SIGN_RSA_EMSA_PKCS1_SHA384:
|
||||||
|
case SIGN_RSA_EMSA_PKCS1_SHA512:
|
||||||
|
return KEY_RSA;
|
||||||
|
case SIGN_ECDSA_WITH_SHA1_DER:
|
||||||
|
case SIGN_ECDSA_WITH_SHA256_DER:
|
||||||
|
case SIGN_ECDSA_WITH_SHA384_DER:
|
||||||
|
case SIGN_ECDSA_WITH_SHA512_DER:
|
||||||
|
case SIGN_ECDSA_WITH_NULL:
|
||||||
|
case SIGN_ECDSA_256:
|
||||||
|
case SIGN_ECDSA_384:
|
||||||
|
case SIGN_ECDSA_521:
|
||||||
|
return KEY_ECDSA;
|
||||||
|
case SIGN_BLISS_WITH_SHA256:
|
||||||
|
case SIGN_BLISS_WITH_SHA384:
|
||||||
|
case SIGN_BLISS_WITH_SHA512:
|
||||||
|
return KEY_BLISS;
|
||||||
|
}
|
||||||
|
return KEY_ANY;
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
|
* Copyright (C) 2015 Tobias Brunner
|
||||||
* Copyright (C) 2007 Martin Willi
|
* Copyright (C) 2007 Martin Willi
|
||||||
* Copyright (C) 2014 Andreas Steffen
|
* Copyright (C) 2014 Andreas Steffen
|
||||||
* HSR Hochschule fuer Technik Rapperswil
|
* HSR Hochschule fuer Technik Rapperswil
|
||||||
@@ -243,8 +244,35 @@ bool public_key_has_fingerprint(public_key_t *public, chunk_t fingerprint);
|
|||||||
* Conversion of ASN.1 signature or hash OID to signature scheme.
|
* Conversion of ASN.1 signature or hash OID to signature scheme.
|
||||||
*
|
*
|
||||||
* @param oid ASN.1 OID
|
* @param oid ASN.1 OID
|
||||||
* @return signature_scheme, SIGN_UNKNOWN if OID is unsupported
|
* @return signature scheme, SIGN_UNKNOWN if OID is unsupported
|
||||||
*/
|
*/
|
||||||
signature_scheme_t signature_scheme_from_oid(int oid);
|
signature_scheme_t signature_scheme_from_oid(int oid);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Conversion of signature scheme to ASN.1 signature OID.
|
||||||
|
*
|
||||||
|
* @param scheme signature scheme
|
||||||
|
* @return ASN.1 OID, OID_UNKNOWN if not supported
|
||||||
|
*/
|
||||||
|
int signature_scheme_to_oid(signature_scheme_t scheme);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Enumerate signature schemes that are appropriate for a key of the given type
|
||||||
|
* and size|strength.
|
||||||
|
*
|
||||||
|
* @param type type of the key
|
||||||
|
* @param size size or strength of the key
|
||||||
|
* @return enumerator over signature_scheme_t (increasing strength)
|
||||||
|
*/
|
||||||
|
enumerator_t *signature_schemes_for_key(key_type_t type, int size);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Determine the type of key associated with a given signature scheme.
|
||||||
|
*
|
||||||
|
* @param scheme signature scheme
|
||||||
|
* @return key type (could be KEY_ANY)
|
||||||
|
*/
|
||||||
|
key_type_t key_type_from_signature_scheme(signature_scheme_t scheme);
|
||||||
|
|
||||||
|
|
||||||
#endif /** PUBLIC_KEY_H_ @}*/
|
#endif /** PUBLIC_KEY_H_ @}*/
|
||||||
|
|||||||
@@ -0,0 +1,113 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) 2015 Tobias Brunner
|
||||||
|
* Hochschule fuer Technik Rapperswil
|
||||||
|
*
|
||||||
|
* This program is free software; you can redistribute it and/or modify it
|
||||||
|
* under the terms of the GNU General Public License as published by the
|
||||||
|
* Free Software Foundation; either version 2 of the License, or (at your
|
||||||
|
* option) any later version. See <http://www.fsf.org/copyleft/gpl.txt>.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful, but
|
||||||
|
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||||
|
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
* for more details.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "hash_algorithm_set.h"
|
||||||
|
|
||||||
|
#include <collections/array.h>
|
||||||
|
|
||||||
|
typedef struct private_hash_algorithm_set_t private_hash_algorithm_set_t;
|
||||||
|
|
||||||
|
struct private_hash_algorithm_set_t {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Public interface
|
||||||
|
*/
|
||||||
|
hash_algorithm_set_t public;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Algorithms contained in the set
|
||||||
|
*/
|
||||||
|
array_t *algorithms;
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sort hash algorithms
|
||||||
|
*/
|
||||||
|
static int hash_sort(const void *a, const void *b, void *user)
|
||||||
|
{
|
||||||
|
const hash_algorithm_t *ha = a, *hb = b;
|
||||||
|
return *ha - *hb;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Find a hash algorithm
|
||||||
|
*/
|
||||||
|
static int hash_find(const void *a, const void *b)
|
||||||
|
{
|
||||||
|
return hash_sort(a, b, NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
METHOD(hash_algorithm_set_t, contains, bool,
|
||||||
|
private_hash_algorithm_set_t *this, hash_algorithm_t hash)
|
||||||
|
{
|
||||||
|
return array_bsearch(this->algorithms, &hash, hash_find, NULL) != -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
METHOD(hash_algorithm_set_t, add, void,
|
||||||
|
private_hash_algorithm_set_t *this, hash_algorithm_t hash)
|
||||||
|
{
|
||||||
|
if (!contains(this, hash))
|
||||||
|
{
|
||||||
|
array_insert(this->algorithms, ARRAY_TAIL, &hash);
|
||||||
|
array_sort(this->algorithms, hash_sort, NULL);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
METHOD(hash_algorithm_set_t, count, int,
|
||||||
|
private_hash_algorithm_set_t *this)
|
||||||
|
{
|
||||||
|
return array_count(this->algorithms);
|
||||||
|
}
|
||||||
|
|
||||||
|
static bool hash_filter(void *data, void **in, hash_algorithm_t *out)
|
||||||
|
{
|
||||||
|
*out = **(hash_algorithm_t**)in;
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
METHOD(hash_algorithm_set_t, create_enumerator, enumerator_t*,
|
||||||
|
private_hash_algorithm_set_t *this)
|
||||||
|
{
|
||||||
|
return enumerator_create_filter(array_create_enumerator(this->algorithms),
|
||||||
|
(void*)hash_filter, NULL, NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
METHOD(hash_algorithm_set_t, destroy, void,
|
||||||
|
private_hash_algorithm_set_t *this)
|
||||||
|
{
|
||||||
|
array_destroy(this->algorithms);
|
||||||
|
free(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Described in header
|
||||||
|
*/
|
||||||
|
hash_algorithm_set_t *hash_algorithm_set_create()
|
||||||
|
{
|
||||||
|
private_hash_algorithm_set_t *this;
|
||||||
|
|
||||||
|
INIT(this,
|
||||||
|
.public = {
|
||||||
|
.add = _add,
|
||||||
|
.contains = _contains,
|
||||||
|
.count = _count,
|
||||||
|
.create_enumerator = _create_enumerator,
|
||||||
|
.destroy = _destroy,
|
||||||
|
},
|
||||||
|
.algorithms = array_create(sizeof(hash_algorithm_t), 0),
|
||||||
|
);
|
||||||
|
|
||||||
|
return &this->public;
|
||||||
|
}
|
||||||
@@ -0,0 +1,76 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) 2015 Tobias Brunner
|
||||||
|
* Hochschule fuer Technik Rapperswil
|
||||||
|
*
|
||||||
|
* This program is free software; you can redistribute it and/or modify it
|
||||||
|
* under the terms of the GNU General Public License as published by the
|
||||||
|
* Free Software Foundation; either version 2 of the License, or (at your
|
||||||
|
* option) any later version. See <http://www.fsf.org/copyleft/gpl.txt>.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful, but
|
||||||
|
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||||
|
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
* for more details.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @defgroup hash_algorithm_set hash_algorithm_set
|
||||||
|
* @{ @ingroup crypto
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef HASH_ALGORITHM_SET_H_
|
||||||
|
#define HASH_ALGORITHM_SET_H_
|
||||||
|
|
||||||
|
typedef struct hash_algorithm_set_t hash_algorithm_set_t;
|
||||||
|
|
||||||
|
#include <library.h>
|
||||||
|
#include <crypto/hashers/hasher.h>
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A set of hash algorithms
|
||||||
|
*/
|
||||||
|
struct hash_algorithm_set_t {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Add the given algorithm to the set.
|
||||||
|
*
|
||||||
|
* @param alg hash algorithm
|
||||||
|
*/
|
||||||
|
void (*add)(hash_algorithm_set_t *this, hash_algorithm_t alg);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check if the given algorithm is contained in the set.
|
||||||
|
*
|
||||||
|
* @param alg hash algorithm
|
||||||
|
* @return TRUE if contained in set
|
||||||
|
*/
|
||||||
|
bool (*contains)(hash_algorithm_set_t *this, hash_algorithm_t alg);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Number of hash algorithms contained in the set.
|
||||||
|
*
|
||||||
|
* @return number of algorithms
|
||||||
|
*/
|
||||||
|
int (*count)(hash_algorithm_set_t *this);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Enumerate the algorithms contained in the set.
|
||||||
|
*
|
||||||
|
* @return enumerator over hash_algorithm_t (sorted by identifier)
|
||||||
|
*/
|
||||||
|
enumerator_t *(*create_enumerator)(hash_algorithm_set_t *this);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Destroy a hash_algorithm_set_t instance
|
||||||
|
*/
|
||||||
|
void (*destroy)(hash_algorithm_set_t *this);
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Create a set of hash algorithms.
|
||||||
|
*
|
||||||
|
* @return hash_algorithm_set_t instance
|
||||||
|
*/
|
||||||
|
hash_algorithm_set_t *hash_algorithm_set_create();
|
||||||
|
|
||||||
|
#endif /** HASH_ALGORITHM_SET_H_ @}*/
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2012 Tobias Brunner
|
* Copyright (C) 2012-2015 Tobias Brunner
|
||||||
* Copyright (C) 2005-2006 Martin Willi
|
* Copyright (C) 2005-2006 Martin Willi
|
||||||
* Copyright (C) 2005 Jan Hutter
|
* Copyright (C) 2005 Jan Hutter
|
||||||
* Hochschule fuer Technik Rapperswil
|
* Hochschule fuer Technik Rapperswil
|
||||||
@@ -19,29 +19,31 @@
|
|||||||
|
|
||||||
#include <asn1/oid.h>
|
#include <asn1/oid.h>
|
||||||
|
|
||||||
ENUM(hash_algorithm_names, HASH_UNKNOWN, HASH_SHA512,
|
ENUM_BEGIN(hash_algorithm_names, HASH_SHA1, HASH_SHA512,
|
||||||
|
"HASH_SHA1",
|
||||||
|
"HASH_SHA256",
|
||||||
|
"HASH_SHA384",
|
||||||
|
"HASH_SHA512");
|
||||||
|
ENUM_NEXT(hash_algorithm_names, HASH_UNKNOWN, HASH_SHA224, HASH_SHA512,
|
||||||
"HASH_UNKNOWN",
|
"HASH_UNKNOWN",
|
||||||
"HASH_MD2",
|
"HASH_MD2",
|
||||||
"HASH_MD4",
|
"HASH_MD4",
|
||||||
"HASH_MD5",
|
"HASH_MD5",
|
||||||
"HASH_SHA1",
|
"HASH_SHA224");
|
||||||
"HASH_SHA224",
|
ENUM_END(hash_algorithm_names, HASH_SHA224);
|
||||||
"HASH_SHA256",
|
|
||||||
"HASH_SHA384",
|
|
||||||
"HASH_SHA512"
|
|
||||||
);
|
|
||||||
|
|
||||||
ENUM(hash_algorithm_short_names, HASH_UNKNOWN, HASH_SHA512,
|
ENUM_BEGIN(hash_algorithm_short_names, HASH_SHA1, HASH_SHA512,
|
||||||
|
"sha1",
|
||||||
|
"sha256",
|
||||||
|
"sha384",
|
||||||
|
"sha512");
|
||||||
|
ENUM_NEXT(hash_algorithm_short_names, HASH_UNKNOWN, HASH_SHA224, HASH_SHA512,
|
||||||
"unknown",
|
"unknown",
|
||||||
"md2",
|
"md2",
|
||||||
"md4",
|
"md4",
|
||||||
"md5",
|
"md5",
|
||||||
"sha1",
|
"sha224");
|
||||||
"sha224",
|
ENUM_END(hash_algorithm_short_names, HASH_SHA224);
|
||||||
"sha256",
|
|
||||||
"sha384",
|
|
||||||
"sha512"
|
|
||||||
);
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Described in header.
|
* Described in header.
|
||||||
@@ -246,6 +248,28 @@ integrity_algorithm_t hasher_algorithm_to_integrity(hash_algorithm_t alg,
|
|||||||
return AUTH_UNDEFINED;
|
return AUTH_UNDEFINED;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Described in header.
|
||||||
|
*/
|
||||||
|
bool hasher_algorithm_for_ikev2(hash_algorithm_t alg)
|
||||||
|
{
|
||||||
|
switch (alg)
|
||||||
|
{
|
||||||
|
case HASH_SHA1:
|
||||||
|
case HASH_SHA256:
|
||||||
|
case HASH_SHA384:
|
||||||
|
case HASH_SHA512:
|
||||||
|
return TRUE;
|
||||||
|
case HASH_UNKNOWN:
|
||||||
|
case HASH_MD2:
|
||||||
|
case HASH_MD4:
|
||||||
|
case HASH_MD5:
|
||||||
|
case HASH_SHA224:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Described in header.
|
* Described in header.
|
||||||
*/
|
*/
|
||||||
@@ -340,3 +364,39 @@ int hasher_signature_algorithm_to_oid(hash_algorithm_t alg, key_type_t key)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Defined in header.
|
||||||
|
*/
|
||||||
|
hash_algorithm_t hasher_from_signature_scheme(signature_scheme_t scheme)
|
||||||
|
{
|
||||||
|
switch (scheme)
|
||||||
|
{
|
||||||
|
case SIGN_UNKNOWN:
|
||||||
|
case SIGN_RSA_EMSA_PKCS1_NULL:
|
||||||
|
case SIGN_ECDSA_WITH_NULL:
|
||||||
|
break;
|
||||||
|
case SIGN_RSA_EMSA_PKCS1_MD5:
|
||||||
|
return HASH_MD5;
|
||||||
|
case SIGN_RSA_EMSA_PKCS1_SHA1:
|
||||||
|
case SIGN_ECDSA_WITH_SHA1_DER:
|
||||||
|
return HASH_SHA1;
|
||||||
|
case SIGN_RSA_EMSA_PKCS1_SHA224:
|
||||||
|
return HASH_SHA224;
|
||||||
|
case SIGN_RSA_EMSA_PKCS1_SHA256:
|
||||||
|
case SIGN_ECDSA_WITH_SHA256_DER:
|
||||||
|
case SIGN_ECDSA_256:
|
||||||
|
case SIGN_BLISS_WITH_SHA256:
|
||||||
|
return HASH_SHA256;
|
||||||
|
case SIGN_RSA_EMSA_PKCS1_SHA384:
|
||||||
|
case SIGN_ECDSA_WITH_SHA384_DER:
|
||||||
|
case SIGN_ECDSA_384:
|
||||||
|
case SIGN_BLISS_WITH_SHA384:
|
||||||
|
return HASH_SHA384;
|
||||||
|
case SIGN_RSA_EMSA_PKCS1_SHA512:
|
||||||
|
case SIGN_ECDSA_WITH_SHA512_DER:
|
||||||
|
case SIGN_ECDSA_521:
|
||||||
|
case SIGN_BLISS_WITH_SHA512:
|
||||||
|
return HASH_SHA512;
|
||||||
|
}
|
||||||
|
return HASH_UNKNOWN;
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2012 Tobias Brunner
|
* Copyright (C) 2012-2015 Tobias Brunner
|
||||||
* Copyright (C) 2005-2006 Martin Willi
|
* Copyright (C) 2005-2006 Martin Willi
|
||||||
* Copyright (C) 2005 Jan Hutter
|
* Copyright (C) 2005 Jan Hutter
|
||||||
* Hochschule fuer Technik Rapperswil
|
* Hochschule fuer Technik Rapperswil
|
||||||
@@ -32,19 +32,19 @@ typedef struct hasher_t hasher_t;
|
|||||||
#include <credentials/keys/public_key.h>
|
#include <credentials/keys/public_key.h>
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Algorithms to use for hashing.
|
* Hash algorithms as defined for IKEv2 by RFC 7427
|
||||||
*/
|
*/
|
||||||
enum hash_algorithm_t {
|
enum hash_algorithm_t {
|
||||||
/** not specified hash function */
|
HASH_SHA1 = 1,
|
||||||
HASH_UNKNOWN = 0,
|
HASH_SHA256 = 2,
|
||||||
HASH_MD2 = 1,
|
HASH_SHA384 = 3,
|
||||||
HASH_MD4 = 2,
|
HASH_SHA512 = 4,
|
||||||
HASH_MD5 = 3,
|
/* use private use range for algorithms not defined/permitted by RFC 7427 */
|
||||||
HASH_SHA1 = 4,
|
HASH_UNKNOWN = 1024,
|
||||||
HASH_SHA224 = 5,
|
HASH_MD2 = 1025,
|
||||||
HASH_SHA256 = 6,
|
HASH_MD4 = 1026,
|
||||||
HASH_SHA384 = 7,
|
HASH_MD5 = 1027,
|
||||||
HASH_SHA512 = 8
|
HASH_SHA224 = 1028,
|
||||||
};
|
};
|
||||||
|
|
||||||
#define HASH_SIZE_MD2 16
|
#define HASH_SIZE_MD2 16
|
||||||
@@ -162,6 +162,14 @@ hash_algorithm_t hasher_algorithm_from_integrity(integrity_algorithm_t alg,
|
|||||||
integrity_algorithm_t hasher_algorithm_to_integrity(hash_algorithm_t alg,
|
integrity_algorithm_t hasher_algorithm_to_integrity(hash_algorithm_t alg,
|
||||||
size_t length);
|
size_t length);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check if the given algorithm may be used for IKEv2 signature authentication.
|
||||||
|
*
|
||||||
|
* @param alg hash algorithm
|
||||||
|
* @return TRUE if algorithm may be used, FALSE otherwise
|
||||||
|
*/
|
||||||
|
bool hasher_algorithm_for_ikev2(hash_algorithm_t alg);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Conversion of hash algorithm into ASN.1 OID.
|
* Conversion of hash algorithm into ASN.1 OID.
|
||||||
*
|
*
|
||||||
@@ -179,4 +187,12 @@ int hasher_algorithm_to_oid(hash_algorithm_t alg);
|
|||||||
*/
|
*/
|
||||||
int hasher_signature_algorithm_to_oid(hash_algorithm_t alg, key_type_t key);
|
int hasher_signature_algorithm_to_oid(hash_algorithm_t alg, key_type_t key);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Determine the hash algorithm associated with a given signature scheme.
|
||||||
|
*
|
||||||
|
* @param scheme signature scheme
|
||||||
|
* @return hash algorithm (could be HASH_UNKNOWN)
|
||||||
|
*/
|
||||||
|
hash_algorithm_t hasher_from_signature_scheme(signature_scheme_t scheme);
|
||||||
|
|
||||||
#endif /** HASHER_H_ @}*/
|
#endif /** HASHER_H_ @}*/
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2013 Tobias Brunner
|
* Copyright (C) 2013-2015 Tobias Brunner
|
||||||
* Hochschule fuer Technik Rapperswil
|
* Hochschule fuer Technik Rapperswil
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify it
|
* This program is free software; you can redistribute it and/or modify it
|
||||||
@@ -18,6 +18,7 @@
|
|||||||
#include <library.h>
|
#include <library.h>
|
||||||
#include <utils/utils.h>
|
#include <utils/utils.h>
|
||||||
#include <ipsec/ipsec_types.h>
|
#include <ipsec/ipsec_types.h>
|
||||||
|
#include <credentials/keys/public_key.h>
|
||||||
|
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
|
|
||||||
@@ -695,6 +696,44 @@ START_TEST(test_mark_from_string)
|
|||||||
}
|
}
|
||||||
END_TEST
|
END_TEST
|
||||||
|
|
||||||
|
/*******************************************************************************
|
||||||
|
* signature_schemes_for_key
|
||||||
|
*/
|
||||||
|
|
||||||
|
static struct {
|
||||||
|
key_type_t type;
|
||||||
|
int size;
|
||||||
|
signature_scheme_t expected[4];
|
||||||
|
} scheme_data[] = {
|
||||||
|
{KEY_RSA, 1024, { SIGN_RSA_EMSA_PKCS1_SHA256, SIGN_RSA_EMSA_PKCS1_SHA384, SIGN_RSA_EMSA_PKCS1_SHA512, SIGN_UNKNOWN }},
|
||||||
|
{KEY_RSA, 2048, { SIGN_RSA_EMSA_PKCS1_SHA256, SIGN_RSA_EMSA_PKCS1_SHA384, SIGN_RSA_EMSA_PKCS1_SHA512, SIGN_UNKNOWN }},
|
||||||
|
{KEY_RSA, 4096, { SIGN_RSA_EMSA_PKCS1_SHA384, SIGN_RSA_EMSA_PKCS1_SHA512, SIGN_UNKNOWN }},
|
||||||
|
{KEY_RSA, 8192, { SIGN_RSA_EMSA_PKCS1_SHA512, SIGN_UNKNOWN }},
|
||||||
|
{KEY_ECDSA, 256, { SIGN_ECDSA_WITH_SHA256_DER, SIGN_ECDSA_WITH_SHA384_DER, SIGN_ECDSA_WITH_SHA512_DER, SIGN_UNKNOWN }},
|
||||||
|
{KEY_ECDSA, 384, { SIGN_ECDSA_WITH_SHA384_DER, SIGN_ECDSA_WITH_SHA512_DER, SIGN_UNKNOWN }},
|
||||||
|
{KEY_ECDSA, 512, { SIGN_ECDSA_WITH_SHA512_DER, SIGN_UNKNOWN }},
|
||||||
|
{KEY_BLISS, 128, { SIGN_BLISS_WITH_SHA256, SIGN_BLISS_WITH_SHA384, SIGN_BLISS_WITH_SHA512, SIGN_UNKNOWN }},
|
||||||
|
{KEY_BLISS, 192, { SIGN_BLISS_WITH_SHA384, SIGN_BLISS_WITH_SHA512, SIGN_UNKNOWN }},
|
||||||
|
{KEY_BLISS, 256, { SIGN_BLISS_WITH_SHA512, SIGN_UNKNOWN }},
|
||||||
|
};
|
||||||
|
|
||||||
|
START_TEST(test_signature_schemes_for_key)
|
||||||
|
{
|
||||||
|
enumerator_t *enumerator;
|
||||||
|
signature_scheme_t scheme;
|
||||||
|
int i;
|
||||||
|
|
||||||
|
enumerator = signature_schemes_for_key(scheme_data[_i].type, scheme_data[_i].size);
|
||||||
|
for (i = 0; scheme_data[_i].expected[i] != SIGN_UNKNOWN; i++)
|
||||||
|
{
|
||||||
|
ck_assert(enumerator->enumerate(enumerator, &scheme));
|
||||||
|
ck_assert_int_eq(scheme_data[_i].expected[i], scheme);
|
||||||
|
}
|
||||||
|
ck_assert(!enumerator->enumerate(enumerator, &scheme));
|
||||||
|
enumerator->destroy(enumerator);
|
||||||
|
}
|
||||||
|
END_TEST
|
||||||
|
|
||||||
Suite *utils_suite_create()
|
Suite *utils_suite_create()
|
||||||
{
|
{
|
||||||
Suite *s;
|
Suite *s;
|
||||||
@@ -777,5 +816,9 @@ Suite *utils_suite_create()
|
|||||||
tcase_add_loop_test(tc, test_mark_from_string, 0, countof(mark_data));
|
tcase_add_loop_test(tc, test_mark_from_string, 0, countof(mark_data));
|
||||||
suite_add_tcase(s, tc);
|
suite_add_tcase(s, tc);
|
||||||
|
|
||||||
|
tc = tcase_create("signature_schemes_for_key");
|
||||||
|
tcase_add_loop_test(tc, test_signature_schemes_for_key, 0, countof(scheme_data));
|
||||||
|
suite_add_tcase(s, tc);
|
||||||
|
|
||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
moon:: cat /var/log/daemon.log::parsed IKE_AUTH request.*N(AUTH_FOLLOWS)::YES
|
moon:: cat /var/log/daemon.log::parsed IKE_AUTH request.*N(AUTH_FOLLOWS)::YES
|
||||||
moon:: cat /var/log/daemon.log::authentication of .*[email protected].* with RSA signature successful::YES
|
moon:: cat /var/log/daemon.log::authentication of .*[email protected].* with RSA.* successful::YES
|
||||||
carol::cat /var/log/daemon.log::authentication of .*moon.strongswan.org.* with RSA signature successful::YES
|
carol::cat /var/log/daemon.log::authentication of .*moon.strongswan.org.* with RSA.* successful::YES
|
||||||
carol::cat /var/log/daemon.log::server requested EAP_SIM authentication::YES
|
carol::cat /var/log/daemon.log::server requested EAP_SIM authentication::YES
|
||||||
moon:: cat /var/log/daemon.log::received EAP identity .*228060123456001::YES
|
moon:: cat /var/log/daemon.log::received EAP identity .*228060123456001::YES
|
||||||
moon:: cat /var/log/daemon.log::authentication of .*[email protected].* with EAP successful::YES
|
moon:: cat /var/log/daemon.log::authentication of .*[email protected].* with EAP successful::YES
|
||||||
@@ -9,8 +9,8 @@ carol::ipsec status 2> /dev/null::home.*ESTABLISHED.*228060123456001@strongswan.
|
|||||||
carol::ping -c 1 PH_IP_ALICE::64 bytes from PH_IP_ALICE: icmp_req=1::YES
|
carol::ping -c 1 PH_IP_ALICE::64 bytes from PH_IP_ALICE: icmp_req=1::YES
|
||||||
moon::tcpdump::IP carol.strongswan.org > moon.strongswan.org: ESP::YES
|
moon::tcpdump::IP carol.strongswan.org > moon.strongswan.org: ESP::YES
|
||||||
moon::tcpdump::IP moon.strongswan.org > carol.strongswan.org: ESP::YES
|
moon::tcpdump::IP moon.strongswan.org > carol.strongswan.org: ESP::YES
|
||||||
moon::cat /var/log/daemon.log::authentication of .*[email protected].* with RSA signature successful::YES
|
moon::cat /var/log/daemon.log::authentication of .*[email protected].* with RSA.* successful::YES
|
||||||
dave::cat /var/log/daemon.log::authentication of .*moon.strongswan.org.* with RSA signature successful::YES
|
dave::cat /var/log/daemon.log::authentication of .*moon.strongswan.org.* with RSA.* successful::YES
|
||||||
dave::cat /var/log/daemon.log::server requested EAP_SIM authentication::YES
|
dave::cat /var/log/daemon.log::server requested EAP_SIM authentication::YES
|
||||||
moon::cat /var/log/daemon.log::received EAP identity .*228060123456002::YES
|
moon::cat /var/log/daemon.log::received EAP identity .*228060123456002::YES
|
||||||
moon::cat /var/log/daemon.log::RADIUS authentication of '228060123456002' failed::YES
|
moon::cat /var/log/daemon.log::RADIUS authentication of '228060123456002' failed::YES
|
||||||
|
|||||||
@@ -0,0 +1,7 @@
|
|||||||
|
A connection between the subnets behind the gateways <b>moon</b> and <b>sun</b> is set up.
|
||||||
|
The authentication is based on <b>X.509 certificates</b> using SHA-2 to create signatures
|
||||||
|
as enabled by the IKEv2 Signature Authentication extension described in <b>RFC 7427</b>.
|
||||||
|
Upon the successful establishment of the IPsec tunnel, <b>leftfirewall=yes</b> automatically
|
||||||
|
inserts iptables-based firewall rules that let pass the tunneled traffic.
|
||||||
|
In order to test both tunnel and firewall, client <b>alice</b> behind gateway <b>moon</b>
|
||||||
|
pings client <b>bob</b> located behind gateway <b>sun</b>.
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
moon:: cat /var/log/daemon.log::authentication of.*sun.strongswan.org.*with RSA_EMSA_PKCS1_SHA512 successful::YES
|
||||||
|
moon::ipsec status 2> /dev/null::net-net.*ESTABLISHED.*moon.strongswan.org.*sun.strongswan.org::YES
|
||||||
|
sun:: cat /var/log/daemon.log::authentication of.*moon.strongswan.org.*with RSA_EMSA_PKCS1_SHA384 successful::YES
|
||||||
|
sun:: ipsec status 2> /dev/null::net-net.*ESTABLISHED.*sun.strongswan.org.*moon.strongswan.org::YES
|
||||||
|
moon::ipsec status 2> /dev/null::net-net.*INSTALLED, TUNNEL::YES
|
||||||
|
sun:: ipsec status 2> /dev/null::net-net.*INSTALLED, TUNNEL::YES
|
||||||
|
alice::ping -c 1 PH_IP_BOB::64 bytes from PH_IP_BOB: icmp_req=1::YES
|
||||||
|
sun::tcpdump::IP moon.strongswan.org > sun.strongswan.org: ESP::YES
|
||||||
|
sun::tcpdump::IP sun.strongswan.org > moon.strongswan.org: ESP::YES
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
# /etc/ipsec.conf - strongSwan IPsec configuration file
|
||||||
|
|
||||||
|
config setup
|
||||||
|
|
||||||
|
conn %default
|
||||||
|
ikelifetime=60m
|
||||||
|
keylife=20m
|
||||||
|
rekeymargin=3m
|
||||||
|
keyingtries=1
|
||||||
|
keyexchange=ikev2
|
||||||
|
mobike=no
|
||||||
|
|
||||||
|
conn net-net
|
||||||
|
left=PH_IP_MOON
|
||||||
|
leftcert=moonCert.pem
|
||||||
|
leftauth=rsa-sha384
|
||||||
|
[email protected]
|
||||||
|
leftsubnet=10.1.0.0/16
|
||||||
|
leftfirewall=yes
|
||||||
|
right=PH_IP_SUN
|
||||||
|
[email protected]
|
||||||
|
rightsubnet=10.2.0.0/16
|
||||||
|
auto=add
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
# /etc/strongswan.conf - strongSwan configuration file
|
||||||
|
|
||||||
|
charon {
|
||||||
|
load = aes des sha1 sha2 md5 pem pkcs1 gmp random nonce x509 curl revocation hmac stroke kernel-netlink socket-default updown
|
||||||
|
}
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
# /etc/ipsec.conf - strongSwan IPsec configuration file
|
||||||
|
|
||||||
|
config setup
|
||||||
|
|
||||||
|
conn %default
|
||||||
|
ikelifetime=60m
|
||||||
|
keylife=20m
|
||||||
|
rekeymargin=3m
|
||||||
|
keyingtries=1
|
||||||
|
keyexchange=ikev2
|
||||||
|
mobike=no
|
||||||
|
|
||||||
|
conn net-net
|
||||||
|
left=PH_IP_SUN
|
||||||
|
leftcert=sunCert.pem
|
||||||
|
leftauth=rsa-sha512
|
||||||
|
[email protected]
|
||||||
|
leftsubnet=10.2.0.0/16
|
||||||
|
leftfirewall=yes
|
||||||
|
right=PH_IP_MOON
|
||||||
|
[email protected]
|
||||||
|
rightsubnet=10.1.0.0/16
|
||||||
|
auto=add
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
# /etc/strongswan.conf - strongSwan configuration file
|
||||||
|
|
||||||
|
charon {
|
||||||
|
load = aes des sha1 sha2 md5 pem pkcs1 gmp random nonce x509 curl revocation hmac stroke kernel-netlink socket-default updown
|
||||||
|
}
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
moon::ipsec stop
|
||||||
|
sun::ipsec stop
|
||||||
|
moon::iptables-restore < /etc/iptables.flush
|
||||||
|
sun::iptables-restore < /etc/iptables.flush
|
||||||
|
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
moon::iptables-restore < /etc/iptables.rules
|
||||||
|
sun::iptables-restore < /etc/iptables.rules
|
||||||
|
moon::ipsec start
|
||||||
|
sun::ipsec start
|
||||||
|
moon::sleep 1
|
||||||
|
moon::ipsec up net-net
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
#
|
||||||
|
# This configuration file provides information on the
|
||||||
|
# guest instances used for this test
|
||||||
|
|
||||||
|
# All guest instances that are required for this test
|
||||||
|
#
|
||||||
|
VIRTHOSTS="alice moon winnetou sun bob"
|
||||||
|
|
||||||
|
# Corresponding block diagram
|
||||||
|
#
|
||||||
|
DIAGRAM="a-m-w-s-b.png"
|
||||||
|
|
||||||
|
# Guest instances on which tcpdump is to be started
|
||||||
|
#
|
||||||
|
TCPDUMPHOSTS="sun"
|
||||||
|
|
||||||
|
# Guest instances on which IPsec is started
|
||||||
|
# Used for IPsec logging purposes
|
||||||
|
#
|
||||||
|
IPSECHOSTS="moon sun"
|
||||||
@@ -3,4 +3,5 @@
|
|||||||
charon {
|
charon {
|
||||||
load = aes des sha1 sha2 md5 pem pkcs1 gmp random nonce x509 curl revocation hmac stroke kernel-netlink socket-default updown
|
load = aes des sha1 sha2 md5 pem pkcs1 gmp random nonce x509 curl revocation hmac stroke kernel-netlink socket-default updown
|
||||||
multiple_authentication = no
|
multiple_authentication = no
|
||||||
|
signature_authentication = no
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,4 +3,5 @@
|
|||||||
charon {
|
charon {
|
||||||
load = aes des sha1 sha2 md5 pem pkcs1 gmp random nonce x509 curl revocation hmac stroke kernel-netlink socket-default updown
|
load = aes des sha1 sha2 md5 pem pkcs1 gmp random nonce x509 curl revocation hmac stroke kernel-netlink socket-default updown
|
||||||
multiple_authentication = no
|
multiple_authentication = no
|
||||||
|
signature_authentication = no
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
moon::cat /var/log/daemon.log::IKE_SA_INIT request 0.*FRAG_SUP::YES
|
moon::cat /var/log/daemon.log::IKE_SA_INIT request 0.*FRAG_SUP::YES
|
||||||
sun::cat /var/log/daemon.log::IKE_SA_INIT response 0.*FRAG_SUP::YES
|
sun::cat /var/log/daemon.log::IKE_SA_INIT response 0.*FRAG_SUP::YES
|
||||||
moon::cat /var/log/daemon.log::splitting IKE message with length of 1804 bytes into 2 fragments::YES
|
moon::cat /var/log/daemon.log::splitting IKE message with length of .*bytes into 2 fragments::YES
|
||||||
sun::cat /var/log/daemon.log::splitting IKE message with length of 1596 bytes into 2 fragments::YES
|
sun::cat /var/log/daemon.log::splitting IKE message with length of .*bytes into 2 fragments::YES
|
||||||
moon::cat /var/log/daemon.log::received fragment #1 of 2, waiting for complete IKE message::YES
|
moon::cat /var/log/daemon.log::received fragment #1 of 2, waiting for complete IKE message::YES
|
||||||
moon::cat /var/log/daemon.log::received fragment #2 of 2, reassembling fragmented IKE message::YES
|
moon::cat /var/log/daemon.log::received fragment #2 of 2, reassembling fragmented IKE message::YES
|
||||||
sun::cat /var/log/daemon.log::received fragment #1 of 2, waiting for complete IKE message::YES
|
sun::cat /var/log/daemon.log::received fragment #1 of 2, waiting for complete IKE message::YES
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
carol::cat /var/log/daemon.log::authentication of 'moon.strongswan.org' with RSA signature successful::YES
|
carol::cat /var/log/daemon.log::authentication of 'moon.strongswan.org' with RSA.* successful::YES
|
||||||
carol::cat /var/log/daemon.log::server requested EAP_AKA authentication::YES
|
carol::cat /var/log/daemon.log::server requested EAP_AKA authentication::YES
|
||||||
carol::cat /var/log/daemon.log::authentication of 'moon.strongswan.org' with EAP successful::YES
|
carol::cat /var/log/daemon.log::authentication of 'moon.strongswan.org' with EAP successful::YES
|
||||||
moon:: cat /var/log/daemon.log::received EAP identity.*carol::YES
|
moon:: cat /var/log/daemon.log::received EAP identity.*carol::YES
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
carol::cat /var/log/daemon.log::authentication of 'moon.strongswan.org' with RSA signature successful::YES
|
carol::cat /var/log/daemon.log::authentication of 'moon.strongswan.org' with RSA.* successful::YES
|
||||||
carol::cat /var/log/daemon.log::server requested EAP_AKA authentication::YES
|
carol::cat /var/log/daemon.log::server requested EAP_AKA authentication::YES
|
||||||
carol::cat /var/log/daemon.log::authentication of 'moon.strongswan.org' with EAP successful::YES
|
carol::cat /var/log/daemon.log::authentication of 'moon.strongswan.org' with EAP successful::YES
|
||||||
moon:: cat /var/log/daemon.log::authentication of '[email protected]' with EAP successful::YES
|
moon:: cat /var/log/daemon.log::authentication of '[email protected]' with EAP successful::YES
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
carol::cat /var/log/daemon.log::authentication of 'moon.strongswan.org' with RSA signature successful::YES
|
carol::cat /var/log/daemon.log::authentication of 'moon.strongswan.org' with RSA.* successful::YES
|
||||||
carol::cat /var/log/daemon.log::authentication of 'moon.strongswan.org' with EAP successful::YES
|
carol::cat /var/log/daemon.log::authentication of 'moon.strongswan.org' with EAP successful::YES
|
||||||
carol::cat /var/log/daemon.log::EAP method EAP_MD5 succeeded, no MSK established::YES
|
carol::cat /var/log/daemon.log::EAP method EAP_MD5 succeeded, no MSK established::YES
|
||||||
dave:: cat /var/log/daemon.log::authentication of 'moon.strongswan.org' with RSA signature successful::YES
|
dave:: cat /var/log/daemon.log::authentication of 'moon.strongswan.org' with RSA.* successful::YES
|
||||||
dave:: cat /var/log/daemon.log::requesting EAP_TLS authentication, sending EAP_NAK::YES
|
dave:: cat /var/log/daemon.log::requesting EAP_TLS authentication, sending EAP_NAK::YES
|
||||||
dave:: cat /var/log/daemon.log::authentication of 'moon.strongswan.org' with EAP successful::YES
|
dave:: cat /var/log/daemon.log::authentication of 'moon.strongswan.org' with EAP successful::YES
|
||||||
dave:: cat /var/log/daemon.log::EAP method EAP_TLS succeeded, MSK established::YES
|
dave:: cat /var/log/daemon.log::EAP method EAP_TLS succeeded, MSK established::YES
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
carol::cat /var/log/daemon.log::authentication of .*moon.strongswan.org.* with RSA signature successful::YES
|
carol::cat /var/log/daemon.log::authentication of .*moon.strongswan.org.* with RSA.* successful::YES
|
||||||
moon ::cat /var/log/daemon.log::received EAP identity .*carol::YES
|
moon ::cat /var/log/daemon.log::received EAP identity .*carol::YES
|
||||||
carol::cat /var/log/daemon.log::server requested EAP_MD5 authentication::YES
|
carol::cat /var/log/daemon.log::server requested EAP_MD5 authentication::YES
|
||||||
carol::cat /var/log/daemon.log::authentication of .*moon.strongswan.org.* with EAP successful::YES
|
carol::cat /var/log/daemon.log::authentication of .*moon.strongswan.org.* with EAP successful::YES
|
||||||
@@ -8,7 +8,7 @@ carol::ipsec status 2> /dev/null::home.*ESTABLISHED.*PH_IP_CAROL.*moon.strongswa
|
|||||||
moon ::ipsec status 2> /dev/null::rw-eap[{]1}.*INSTALLED, TUNNEL::YES
|
moon ::ipsec status 2> /dev/null::rw-eap[{]1}.*INSTALLED, TUNNEL::YES
|
||||||
carol::ipsec status 2> /dev/null::home.*INSTALLED, TUNNEL::YES
|
carol::ipsec status 2> /dev/null::home.*INSTALLED, TUNNEL::YES
|
||||||
carol::cat /var/log/daemon.log::installing new virtual IP 10.3.0.1::YES
|
carol::cat /var/log/daemon.log::installing new virtual IP 10.3.0.1::YES
|
||||||
dave ::cat /var/log/daemon.log::authentication of .*moon.strongswan.org.* with RSA signature successful::YES
|
dave ::cat /var/log/daemon.log::authentication of .*moon.strongswan.org.* with RSA.* successful::YES
|
||||||
moon ::cat /var/log/daemon.log::received EAP identity .*dave::YES
|
moon ::cat /var/log/daemon.log::received EAP identity .*dave::YES
|
||||||
dave ::cat /var/log/daemon.log::server requested EAP_MD5 authentication::YES
|
dave ::cat /var/log/daemon.log::server requested EAP_MD5 authentication::YES
|
||||||
dave ::cat /var/log/daemon.log::authentication of .*moon.strongswan.org.* with EAP successful::YES
|
dave ::cat /var/log/daemon.log::authentication of .*moon.strongswan.org.* with EAP successful::YES
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
carol::cat /var/log/daemon.log::authentication of .*moon.strongswan.org.* with RSA signature successful::YES
|
carol::cat /var/log/daemon.log::authentication of .*moon.strongswan.org.* with RSA.* successful::YES
|
||||||
moon ::cat /var/log/daemon.log::received EAP identity .*carol::YES
|
moon ::cat /var/log/daemon.log::received EAP identity .*carol::YES
|
||||||
carol::cat /var/log/daemon.log::server requested EAP_MD5 authentication::YES
|
carol::cat /var/log/daemon.log::server requested EAP_MD5 authentication::YES
|
||||||
carol::cat /var/log/daemon.log::authentication of .*moon.strongswan.org.* with EAP successful::YES
|
carol::cat /var/log/daemon.log::authentication of .*moon.strongswan.org.* with EAP successful::YES
|
||||||
@@ -8,7 +8,7 @@ carol::ipsec status 2> /dev/null::alice.*ESTABLISHED.*PH_IP_CAROL.*moon.strongsw
|
|||||||
moon ::ipsec status 2> /dev/null::research.*INSTALLED, TUNNEL::YES
|
moon ::ipsec status 2> /dev/null::research.*INSTALLED, TUNNEL::YES
|
||||||
carol::ipsec status 2> /dev/null::alice.*INSTALLED, TUNNEL::YES
|
carol::ipsec status 2> /dev/null::alice.*INSTALLED, TUNNEL::YES
|
||||||
carol::ipsec status 2> /dev/null::venus.*INSTALLED, TUNNEL::NO
|
carol::ipsec status 2> /dev/null::venus.*INSTALLED, TUNNEL::NO
|
||||||
dave ::cat /var/log/daemon.log::authentication of .*moon.strongswan.org.* with RSA signature successful::YES
|
dave ::cat /var/log/daemon.log::authentication of .*moon.strongswan.org.* with RSA.* successful::YES
|
||||||
moon ::cat /var/log/daemon.log::received EAP identity .*dave::YES
|
moon ::cat /var/log/daemon.log::received EAP identity .*dave::YES
|
||||||
dave ::cat /var/log/daemon.log::server requested EAP_MD5 authentication::YES
|
dave ::cat /var/log/daemon.log::server requested EAP_MD5 authentication::YES
|
||||||
dave ::cat /var/log/daemon.log::authentication of .*moon.strongswan.org.* with EAP successful::YES
|
dave ::cat /var/log/daemon.log::authentication of .*moon.strongswan.org.* with EAP successful::YES
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
carol::cat /var/log/daemon.log::configured EAP-Identity carol::YES
|
carol::cat /var/log/daemon.log::configured EAP-Identity carol::YES
|
||||||
carol::cat /var/log/daemon.log::added EAP secret for carol moon.strongswan.org::YES
|
carol::cat /var/log/daemon.log::added EAP secret for carol moon.strongswan.org::YES
|
||||||
carol::cat /var/log/daemon.log::authentication of 'moon.strongswan.org' with RSA signature successful::YES
|
carol::cat /var/log/daemon.log::authentication of 'moon.strongswan.org' with RSA.* successful::YES
|
||||||
carol::cat /var/log/daemon.log::authentication of 'moon.strongswan.org' with EAP successful::YES
|
carol::cat /var/log/daemon.log::authentication of 'moon.strongswan.org' with EAP successful::YES
|
||||||
moon:: cat /var/log/daemon.log::authentication of 'PH_IP_CAROL' with EAP successful::YES
|
moon:: cat /var/log/daemon.log::authentication of 'PH_IP_CAROL' with EAP successful::YES
|
||||||
moon:: cat /var/log/daemon.log::received EAP identity.*carol::YES
|
moon:: cat /var/log/daemon.log::received EAP identity.*carol::YES
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
carol::cat /var/log/daemon.log::authentication of .*moon.strongswan.org.* with RSA signature successful::YES
|
carol::cat /var/log/daemon.log::authentication of .*moon.strongswan.org.* with RSA.* successful::YES
|
||||||
moon:: cat /var/log/daemon.log::received EAP identity .*carol::YES
|
moon:: cat /var/log/daemon.log::received EAP identity .*carol::YES
|
||||||
carol::cat /var/log/daemon.log::server requested EAP_MD5 authentication::YES
|
carol::cat /var/log/daemon.log::server requested EAP_MD5 authentication::YES
|
||||||
carol::cat /var/log/daemon.log::authentication of .*moon.strongswan.org.* with EAP successful::YES
|
carol::cat /var/log/daemon.log::authentication of .*moon.strongswan.org.* with EAP successful::YES
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
carol::cat /var/log/daemon.log::authentication of 'moon.strongswan.org' with RSA signature successful::YES
|
carol::cat /var/log/daemon.log::authentication of 'moon.strongswan.org' with RSA.* successful::YES
|
||||||
carol::cat /var/log/daemon.log::server requested EAP_MD5 authentication::YES
|
carol::cat /var/log/daemon.log::server requested EAP_MD5 authentication::YES
|
||||||
carol::cat /var/log/daemon.log::authentication of 'moon.strongswan.org' with EAP successful::YES
|
carol::cat /var/log/daemon.log::authentication of 'moon.strongswan.org' with EAP successful::YES
|
||||||
moon:: cat /var/log/daemon.log::authentication of '[email protected]' with EAP successful::YES
|
moon:: cat /var/log/daemon.log::authentication of '[email protected]' with EAP successful::YES
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
carol::cat /var/log/daemon.log::authentication of 'moon.strongswan.org' with RSA signature successful::YES
|
carol::cat /var/log/daemon.log::authentication of 'moon.strongswan.org' with RSA.* successful::YES
|
||||||
carol::cat /var/log/daemon.log::authentication of 'moon.strongswan.org' with EAP successful::YES
|
carol::cat /var/log/daemon.log::authentication of 'moon.strongswan.org' with EAP successful::YES
|
||||||
moon:: cat /var/log/daemon.log::authentication of '[email protected]' with EAP successful::YES
|
moon:: cat /var/log/daemon.log::authentication of '[email protected]' with EAP successful::YES
|
||||||
moon:: ipsec status 2> /dev/null::rw-eap.*ESTABLISHED.*moon.strongswan.org.*[email protected]::YES
|
moon:: ipsec status 2> /dev/null::rw-eap.*ESTABLISHED.*moon.strongswan.org.*[email protected]::YES
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
carol::cat /var/log/daemon.log::authentication of .*moon.strongswan.org.* with RSA signature successful::YES
|
carol::cat /var/log/daemon.log::authentication of .*moon.strongswan.org.* with RSA.* successful::YES
|
||||||
carol::cat /var/log/daemon.log::server requested EAP_MSCHAPV2 authentication::YES
|
carol::cat /var/log/daemon.log::server requested EAP_MSCHAPV2 authentication::YES
|
||||||
carol::cat /var/log/daemon.log::authentication of .*moon.strongswan.org.* with EAP successful::YES
|
carol::cat /var/log/daemon.log::authentication of .*moon.strongswan.org.* with EAP successful::YES
|
||||||
moon:: cat /var/log/daemon.log::received EAP identity.*carol::YES
|
moon:: cat /var/log/daemon.log::received EAP identity.*carol::YES
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
carol::cat /var/log/daemon.log::authentication of 'moon.strongswan.org' with RSA signature successful::YES
|
carol::cat /var/log/daemon.log::authentication of 'moon.strongswan.org' with RSA.* successful::YES
|
||||||
carol::cat /var/log/daemon.log::server requested EAP_PEAP authentication::YES
|
carol::cat /var/log/daemon.log::server requested EAP_PEAP authentication::YES
|
||||||
carol::cat /var/log/daemon.log::server requested EAP_MD5 authentication::YES
|
carol::cat /var/log/daemon.log::server requested EAP_MD5 authentication::YES
|
||||||
carol::cat /var/log/daemon.log::EAP method EAP_PEAP succeeded, MSK established::YES
|
carol::cat /var/log/daemon.log::EAP method EAP_PEAP succeeded, MSK established::YES
|
||||||
carol::cat /var/log/daemon.log::authentication of 'moon.strongswan.org' with EAP successful::YES
|
carol::cat /var/log/daemon.log::authentication of 'moon.strongswan.org' with EAP successful::YES
|
||||||
dave:: cat /var/log/daemon.log::authentication of 'moon.strongswan.org' with RSA signature successful::YES
|
dave:: cat /var/log/daemon.log::authentication of 'moon.strongswan.org' with RSA.* successful::YES
|
||||||
dave:: cat /var/log/daemon.log::server requested EAP_PEAP authentication::YES
|
dave:: cat /var/log/daemon.log::server requested EAP_PEAP authentication::YES
|
||||||
dave:: cat /var/log/daemon.log::server requested EAP_MD5 authentication::YES
|
dave:: cat /var/log/daemon.log::server requested EAP_MD5 authentication::YES
|
||||||
dave:: cat /var/log/daemon.log::received EAP_FAILURE, EAP authentication failed::YES
|
dave:: cat /var/log/daemon.log::received EAP_FAILURE, EAP authentication failed::YES
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
carol::cat /var/log/daemon.log::authentication of 'moon.strongswan.org' with RSA signature successful::YES
|
carol::cat /var/log/daemon.log::authentication of 'moon.strongswan.org' with RSA.* successful::YES
|
||||||
moon:: cat /var/log/daemon.log::received EAP identity .*228060123456001::YES
|
moon:: cat /var/log/daemon.log::received EAP identity .*228060123456001::YES
|
||||||
carol::cat /var/log/daemon.log::server requested EAP_SIM authentication::YES
|
carol::cat /var/log/daemon.log::server requested EAP_SIM authentication::YES
|
||||||
carol::cat /var/log/daemon.log::authentication of 'moon.strongswan.org' with EAP successful::YES
|
carol::cat /var/log/daemon.log::authentication of 'moon.strongswan.org' with EAP successful::YES
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
carol::cat /var/log/daemon.log::authentication of 'moon.strongswan.org' with RSA signature successful::YES
|
carol::cat /var/log/daemon.log::authentication of 'moon.strongswan.org' with RSA.* successful::YES
|
||||||
carol::cat /var/log/daemon.log::server requested EAP_SIM authentication::YES
|
carol::cat /var/log/daemon.log::server requested EAP_SIM authentication::YES
|
||||||
carol::cat /var/log/daemon.log::authentication of 'moon.strongswan.org' with EAP successful::YES
|
carol::cat /var/log/daemon.log::authentication of 'moon.strongswan.org' with EAP successful::YES
|
||||||
moon:: cat /var/log/daemon.log::authentication of '[email protected]' with EAP successful::YES
|
moon:: cat /var/log/daemon.log::authentication of '[email protected]' with EAP successful::YES
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
carol::cat /var/log/daemon.log::authentication of 'moon.strongswan.org' with RSA signature successful::YES
|
carol::cat /var/log/daemon.log::authentication of 'moon.strongswan.org' with RSA.* successful::YES
|
||||||
carol::cat /var/log/daemon.log::authentication of 'moon.strongswan.org' with EAP successful::YES
|
carol::cat /var/log/daemon.log::authentication of 'moon.strongswan.org' with EAP successful::YES
|
||||||
moon:: cat /var/log/daemon.log::authentication of '[email protected]' with EAP successful::YES
|
moon:: cat /var/log/daemon.log::authentication of '[email protected]' with EAP successful::YES
|
||||||
moon:: ipsec status 2> /dev/null::rw-eap-sim.*ESTABLISHED.*moon.strongswan.org.*[email protected]::YES
|
moon:: ipsec status 2> /dev/null::rw-eap-sim.*ESTABLISHED.*moon.strongswan.org.*[email protected]::YES
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
carol::cat /var/log/daemon.log::authentication of 'C=CH, O=Linux strongSwan, CN=moon.strongswan.org' with RSA signature successful::YES
|
carol::cat /var/log/daemon.log::authentication of 'C=CH, O=Linux strongSwan, CN=moon.strongswan.org' with RSA.* successful::YES
|
||||||
carol::cat /var/log/daemon.log::server requested EAP_TLS authentication::YES
|
carol::cat /var/log/daemon.log::server requested EAP_TLS authentication::YES
|
||||||
carol::cat /var/log/daemon.log::authentication of 'C=CH, O=Linux strongSwan, CN=moon.strongswan.org' with EAP successful::YES
|
carol::cat /var/log/daemon.log::authentication of 'C=CH, O=Linux strongSwan, CN=moon.strongswan.org' with EAP successful::YES
|
||||||
moon:: cat /var/log/daemon.log::authentication of 'C=CH, O=Linux strongSwan, OU=Research, [email protected]' with EAP successful::YES
|
moon:: cat /var/log/daemon.log::authentication of 'C=CH, O=Linux strongSwan, OU=Research, [email protected]' with EAP successful::YES
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
carol::cat /var/log/daemon.log::authentication of 'moon.strongswan.org' with RSA signature successful::YES
|
carol::cat /var/log/daemon.log::authentication of 'moon.strongswan.org' with RSA.* successful::YES
|
||||||
carol::cat /var/log/daemon.log::server requested EAP_TTLS authentication::YES
|
carol::cat /var/log/daemon.log::server requested EAP_TTLS authentication::YES
|
||||||
carol::cat /var/log/daemon.log::server requested EAP_MD5 authentication::YES
|
carol::cat /var/log/daemon.log::server requested EAP_MD5 authentication::YES
|
||||||
carol::cat /var/log/daemon.log::EAP method EAP_TTLS succeeded, MSK established::YES
|
carol::cat /var/log/daemon.log::EAP method EAP_TTLS succeeded, MSK established::YES
|
||||||
carol::cat /var/log/daemon.log::authentication of 'moon.strongswan.org' with EAP successful::YES
|
carol::cat /var/log/daemon.log::authentication of 'moon.strongswan.org' with EAP successful::YES
|
||||||
dave:: cat /var/log/daemon.log::authentication of 'moon.strongswan.org' with RSA signature successful::YES
|
dave:: cat /var/log/daemon.log::authentication of 'moon.strongswan.org' with RSA.* successful::YES
|
||||||
dave:: cat /var/log/daemon.log::server requested EAP_TTLS authentication::YES
|
dave:: cat /var/log/daemon.log::server requested EAP_TTLS authentication::YES
|
||||||
dave:: cat /var/log/daemon.log::server requested EAP_MD5 authentication::YES
|
dave:: cat /var/log/daemon.log::server requested EAP_MD5 authentication::YES
|
||||||
dave:: cat /var/log/daemon.log::received EAP_FAILURE, EAP authentication failed::YES
|
dave:: cat /var/log/daemon.log::received EAP_FAILURE, EAP authentication failed::YES
|
||||||
|
|||||||
@@ -1,15 +1,15 @@
|
|||||||
carol::cat /var/log/daemon.log::authentication of.*moon.strongswan.org.*with BLISS signature successful::YES
|
carol::cat /var/log/daemon.log::authentication of.*moon.strongswan.org.*with BLISS_WITH_SHA384 successful::YES
|
||||||
carol::ipsec statusall 2> /dev/null::home.*IKE proposal: AES_CBC_128/HMAC_SHA2_256_128/PRF_HMAC_SHA2_256/NTRU_128::YES
|
carol::ipsec statusall 2> /dev/null::home.*IKE proposal: AES_CBC_128/HMAC_SHA2_256_128/PRF_HMAC_SHA2_256/NTRU_128::YES
|
||||||
carol::ipsec status 2> /dev/null::home.*ESTABLISHED.*[email protected].*moon.strongswan.org::YES
|
carol::ipsec status 2> /dev/null::home.*ESTABLISHED.*[email protected].*moon.strongswan.org::YES
|
||||||
carol::ipsec status 2> /dev/null::home.*INSTALLED, TUNNEL::YES
|
carol::ipsec status 2> /dev/null::home.*INSTALLED, TUNNEL::YES
|
||||||
carol::ping -c 1 PH_IP_ALICE::64 bytes from PH_IP_ALICE: icmp_req=1::YES
|
carol::ping -c 1 PH_IP_ALICE::64 bytes from PH_IP_ALICE: icmp_req=1::YES
|
||||||
dave::cat /var/log/daemon.log::authentication of.*moon.strongswan.org.*with BLISS signature successful::YES
|
dave::cat /var/log/daemon.log::authentication of.*moon.strongswan.org.*with BLISS_WITH_SHA384 successful::YES
|
||||||
dave:: ipsec statusall 2> /dev/null::home.*IKE proposal: AES_CBC_192/HMAC_SHA2_384_192/PRF_HMAC_SHA2_384/NTRU_192::YES
|
dave:: ipsec statusall 2> /dev/null::home.*IKE proposal: AES_CBC_192/HMAC_SHA2_384_192/PRF_HMAC_SHA2_384/NTRU_192::YES
|
||||||
dave:: ipsec status 2> /dev/null::home.*ESTABLISHED.*[email protected].*moon.strongswan.org::YES
|
dave:: ipsec status 2> /dev/null::home.*ESTABLISHED.*[email protected].*moon.strongswan.org::YES
|
||||||
dave:: ipsec status 2> /dev/null::home.*INSTALLED, TUNNEL::YES
|
dave:: ipsec status 2> /dev/null::home.*INSTALLED, TUNNEL::YES
|
||||||
dave:: ping -c 1 PH_IP_ALICE::64 bytes from PH_IP_ALICE: icmp_req=1::YES
|
dave:: ping -c 1 PH_IP_ALICE::64 bytes from PH_IP_ALICE: icmp_req=1::YES
|
||||||
moon:: cat /var/log/daemon.log::authentication of.*[email protected].*with BLISS signature successful::YES
|
moon:: cat /var/log/daemon.log::authentication of.*[email protected].*with BLISS_WITH_SHA256 successful::YES
|
||||||
moon:: cat /var/log/daemon.log::authentication of.*[email protected].*with BLISS signature successful::YES
|
moon:: cat /var/log/daemon.log::authentication of.*[email protected].*with BLISS_WITH_SHA384 successful::YES
|
||||||
moon:: ipsec statusall 2> /dev/null::rw\[1]: IKE proposal: AES_CBC_128/HMAC_SHA2_256_128/PRF_HMAC_SHA2_256/NTRU_128::YES
|
moon:: ipsec statusall 2> /dev/null::rw\[1]: IKE proposal: AES_CBC_128/HMAC_SHA2_256_128/PRF_HMAC_SHA2_256/NTRU_128::YES
|
||||||
moon:: ipsec statusall 2> /dev/null::rw\[2]: IKE proposal: AES_CBC_192/HMAC_SHA2_384_192/PRF_HMAC_SHA2_384/NTRU_192::YES
|
moon:: ipsec statusall 2> /dev/null::rw\[2]: IKE proposal: AES_CBC_192/HMAC_SHA2_384_192/PRF_HMAC_SHA2_384/NTRU_192::YES
|
||||||
moon:: ipsec status 2> /dev/null::rw\[1]: ESTABLISHED.*moon.strongswan.org.*[email protected]::YES
|
moon:: ipsec status 2> /dev/null::rw\[1]: ESTABLISHED.*moon.strongswan.org.*[email protected]::YES
|
||||||
|
|||||||
@@ -2,8 +2,8 @@ moon:: cat /var/log/daemon.log::authentication of '[email protected]' with pr
|
|||||||
moon:: cat /var/log/daemon.log::authentication of 'PH_IP_MOON' (myself) with pre-shared key::YES
|
moon:: cat /var/log/daemon.log::authentication of 'PH_IP_MOON' (myself) with pre-shared key::YES
|
||||||
moon:: ipsec status 2> /dev/null::rw-psk.*INSTALLED, TUNNEL::YES
|
moon:: ipsec status 2> /dev/null::rw-psk.*INSTALLED, TUNNEL::YES
|
||||||
carol::ipsec status 2> /dev/null::home.*ESTABLISHED.*[email protected].*\[PH_IP_MOON]::YES
|
carol::ipsec status 2> /dev/null::home.*ESTABLISHED.*[email protected].*\[PH_IP_MOON]::YES
|
||||||
moon:: cat /var/log/daemon.log::authentication of '[email protected]' with RSA signature successful::YES
|
moon:: cat /var/log/daemon.log::authentication of '[email protected]' with RSA.* successful::YES
|
||||||
moon:: cat /var/log/daemon.log::authentication of 'moon.strongswan.org' (myself) with RSA signature successful::YES
|
moon:: cat /var/log/daemon.log::authentication of 'moon.strongswan.org' (myself) with RSA.* successful::YES
|
||||||
moon:: ipsec status 2> /dev/null::rw-rsasig.*INSTALLED, TUNNEL::YES
|
moon:: ipsec status 2> /dev/null::rw-rsasig.*INSTALLED, TUNNEL::YES
|
||||||
dave:: ipsec status 2> /dev/null::home.*ESTABLISHED.*[email protected].*moon.strongswan.org::YES
|
dave:: ipsec status 2> /dev/null::home.*ESTABLISHED.*[email protected].*moon.strongswan.org::YES
|
||||||
carol::ping -c 1 PH_IP_ALICE::64 bytes from PH_IP_ALICE: icmp_req=1::YES
|
carol::ping -c 1 PH_IP_ALICE::64 bytes from PH_IP_ALICE: icmp_req=1::YES
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
moon:: cat /var/log/daemon.log::authentication of '[email protected]' with pre-shared key successful::YES
|
moon:: cat /var/log/daemon.log::authentication of '[email protected]' with pre-shared key successful::YES
|
||||||
moon:: cat /var/log/daemon.log::authentication of '[email protected]' with pre-shared key successful::YES
|
moon:: cat /var/log/daemon.log::authentication of '[email protected]' with pre-shared key successful::YES
|
||||||
moon:: cat /var/log/daemon.log::authentication of 'moon.strongswan.org' (myself) with RSA signature successful::YES
|
moon:: cat /var/log/daemon.log::authentication of 'moon.strongswan.org' (myself) with RSA.* successful::YES
|
||||||
carol::ipsec status 2> /dev/null::home.*ESTABLISHED.*[email protected].*moon.strongswan.org::YES
|
carol::ipsec status 2> /dev/null::home.*ESTABLISHED.*[email protected].*moon.strongswan.org::YES
|
||||||
dave:: ipsec status 2> /dev/null::home.*ESTABLISHED.*[email protected].*moon.strongswan.org::YES
|
dave:: ipsec status 2> /dev/null::home.*ESTABLISHED.*[email protected].*moon.strongswan.org::YES
|
||||||
moon:: ipsec status 2> /dev/null::rw\[1]: ESTABLISHED.*moon.strongswan.org.*[email protected]::YES
|
moon:: ipsec status 2> /dev/null::rw\[1]: ESTABLISHED.*moon.strongswan.org.*[email protected]::YES
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
carol::cat /var/log/daemon.log::authentication of .*moon.strongswan.org.* with RSA signature successful::YES
|
carol::cat /var/log/daemon.log::authentication of .*moon.strongswan.org.* with RSA.* successful::YES
|
||||||
moon:: cat /var/log/daemon.log::received EAP identity .*carol::YES
|
moon:: cat /var/log/daemon.log::received EAP identity .*carol::YES
|
||||||
carol::cat /var/log/daemon.log::server requested EAP_MD5 authentication::YES
|
carol::cat /var/log/daemon.log::server requested EAP_MD5 authentication::YES
|
||||||
carol::cat /var/log/daemon.log::authentication of .*moon.strongswan.org.* with EAP successful::YES
|
carol::cat /var/log/daemon.log::authentication of .*moon.strongswan.org.* with EAP successful::YES
|
||||||
|
|||||||
@@ -0,0 +1,10 @@
|
|||||||
|
The roadwarriors <b>carol</b> an <b>dave</b> set up a connection to gateway
|
||||||
|
<b>moon</b>. They authenticate themselves using <b>RSA signatures</b> but
|
||||||
|
they use different hash algorithms. <b>moon</b> uses signature scheme constraints
|
||||||
|
to only allow access to the <b>research</b> and <b>accounting</b> subnets if
|
||||||
|
specific algorithms are used. <b>Note:</b> Because the client certificate's are signed
|
||||||
|
with SHA-256 we have to accept that algorithm too because signature schemes in
|
||||||
|
<b>rightauth</b> are also used as constraints for the whole certificate chain.
|
||||||
|
Therefore, <b>carol</b> obtains access to the <b>research</b> subnet behind gateway
|
||||||
|
<b>moon</b> whereas <b>dave</b> has access to the <b>accounting</b> subnet, but not
|
||||||
|
vice-versa.
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
carol::cat /var/log/daemon.log::authentication of .*moon.strongswan.org.* with RSA.* successful::YES
|
||||||
|
moon ::cat /var/log/daemon.log::authentication of .*[email protected].* with RSA_EMSA_PKCS1_SHA384 successful::YES
|
||||||
|
moon ::ipsec status 2> /dev/null::research.*ESTABLISHED.*moon.strongswan.org.*PH_IP_CAROL::YES
|
||||||
|
carol::ipsec status 2> /dev/null::alice.*ESTABLISHED.*PH_IP_CAROL.*moon.strongswan.org::YES
|
||||||
|
moon ::ipsec status 2> /dev/null::research.*INSTALLED, TUNNEL::YES
|
||||||
|
carol::ipsec status 2> /dev/null::alice.*INSTALLED, TUNNEL::YES
|
||||||
|
carol::ipsec status 2> /dev/null::venus.*INSTALLED, TUNNEL::NO
|
||||||
|
dave ::cat /var/log/daemon.log::authentication of .*moon.strongswan.org.* with RSA.* successful::YES
|
||||||
|
moon ::cat /var/log/daemon.log::authentication of .*[email protected].* with RSA_EMSA_PKCS1_SHA512 successful::YES
|
||||||
|
moon ::ipsec status 2> /dev/null::accounting.*ESTABLISHED.*moon.strongswan.org.*PH_IP_DAVE::YES
|
||||||
|
dave ::ipsec status 2> /dev/null::alice.*ESTABLISHED.*PH_IP_DAVE.*moon.strongswan.org::YES
|
||||||
|
moon ::ipsec status 2> /dev/null::accounting.*INSTALLED, TUNNEL::YES
|
||||||
|
dave ::ipsec status 2> /dev/null::alice.*INSTALLED, TUNNEL::NO
|
||||||
|
dave ::ipsec status 2> /dev/null::venus.*INSTALLED, TUNNEL::YES
|
||||||
|
carol::ping -c 1 PH_IP_ALICE::64 bytes from PH_IP_ALICE: icmp_req=1::YES
|
||||||
|
dave::ping -c 1 PH_IP_VENUS::64 bytes from PH_IP_VENUS: icmp_req=1::YES
|
||||||
|
moon::tcpdump::IP carol.strongswan.org > moon.strongswan.org: ESP::YES
|
||||||
|
moon::tcpdump::IP moon.strongswan.org > carol.strongswan.org: ESP::YES
|
||||||
|
moon::tcpdump::IP dave.strongswan.org > moon.strongswan.org: ESP::YES
|
||||||
|
moon::tcpdump::IP moon.strongswan.org > dave.strongswan.org: ESP::YES
|
||||||
@@ -0,0 +1,29 @@
|
|||||||
|
# /etc/ipsec.conf - strongSwan IPsec configuration file
|
||||||
|
|
||||||
|
config setup
|
||||||
|
|
||||||
|
conn %default
|
||||||
|
ikelifetime=60m
|
||||||
|
keylife=20m
|
||||||
|
rekeymargin=3m
|
||||||
|
keyingtries=1
|
||||||
|
keyexchange=ikev2
|
||||||
|
|
||||||
|
conn alice
|
||||||
|
rightsubnet=10.1.0.10/32
|
||||||
|
also=home
|
||||||
|
auto=add
|
||||||
|
|
||||||
|
conn venus
|
||||||
|
rightsubnet=10.1.0.20/32
|
||||||
|
also=home
|
||||||
|
auto=add
|
||||||
|
|
||||||
|
conn home
|
||||||
|
left=%any
|
||||||
|
leftcert=carolCert.pem
|
||||||
|
leftauth=pubkey-sha384
|
||||||
|
leftfirewall=yes
|
||||||
|
right=PH_IP_MOON
|
||||||
|
[email protected]
|
||||||
|
rightauth=pubkey
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
# /etc/strongswan.conf - strongSwan configuration file
|
||||||
|
|
||||||
|
charon {
|
||||||
|
load = aes des sha1 sha2 md5 pem pkcs1 gmp random nonce x509 curl revocation hmac xcbc stroke kernel-netlink socket-default fips-prf updown
|
||||||
|
}
|
||||||
@@ -0,0 +1,29 @@
|
|||||||
|
# /etc/ipsec.conf - strongSwan IPsec configuration file
|
||||||
|
|
||||||
|
config setup
|
||||||
|
|
||||||
|
conn %default
|
||||||
|
ikelifetime=60m
|
||||||
|
keylife=20m
|
||||||
|
rekeymargin=3m
|
||||||
|
keyingtries=1
|
||||||
|
keyexchange=ikev2
|
||||||
|
|
||||||
|
conn alice
|
||||||
|
rightsubnet=10.1.0.10/32
|
||||||
|
also=home
|
||||||
|
auto=add
|
||||||
|
|
||||||
|
conn venus
|
||||||
|
rightsubnet=10.1.0.20/32
|
||||||
|
also=home
|
||||||
|
auto=add
|
||||||
|
|
||||||
|
conn home
|
||||||
|
left=%any
|
||||||
|
leftcert=daveCert.pem
|
||||||
|
leftauth=pubkey-sha512
|
||||||
|
leftfirewall=yes
|
||||||
|
right=PH_IP_MOON
|
||||||
|
[email protected]
|
||||||
|
rightauth=pubkey
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
# /etc/strongswan.conf - strongSwan configuration file
|
||||||
|
|
||||||
|
charon {
|
||||||
|
load = aes des sha1 sha2 md5 pem pkcs1 gmp random nonce x509 curl revocation hmac xcbc stroke kernel-netlink socket-default fips-prf updown
|
||||||
|
}
|
||||||
@@ -0,0 +1,30 @@
|
|||||||
|
# /etc/ipsec.conf - strongSwan IPsec configuration file
|
||||||
|
|
||||||
|
config setup
|
||||||
|
|
||||||
|
conn %default
|
||||||
|
ikelifetime=60m
|
||||||
|
keylife=20m
|
||||||
|
rekeymargin=3m
|
||||||
|
keyingtries=1
|
||||||
|
keyexchange=ikev2
|
||||||
|
|
||||||
|
conn research
|
||||||
|
rightauth=pubkey-sha384-sha256
|
||||||
|
leftsubnet=10.1.0.0/28
|
||||||
|
also=rw
|
||||||
|
auto=add
|
||||||
|
|
||||||
|
conn accounting
|
||||||
|
rightauth=pubkey-sha512-sha256
|
||||||
|
leftsubnet=10.1.0.16/28
|
||||||
|
also=rw
|
||||||
|
auto=add
|
||||||
|
|
||||||
|
conn rw
|
||||||
|
left=PH_IP_MOON
|
||||||
|
[email protected]
|
||||||
|
leftcert=moonCert.pem
|
||||||
|
leftauth=pubkey
|
||||||
|
leftfirewall=yes
|
||||||
|
right=%any
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
# /etc/ipsec.secrets - strongSwan IPsec secrets file
|
||||||
|
|
||||||
|
: RSA moonKey.pem
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
# /etc/strongswan.conf - strongSwan configuration file
|
||||||
|
|
||||||
|
charon {
|
||||||
|
load = aes des sha1 sha2 md5 pem pkcs1 gmp random nonce x509 curl revocation hmac xcbc stroke kernel-netlink socket-default fips-prf updown
|
||||||
|
}
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
moon::ipsec stop
|
||||||
|
carol::ipsec stop
|
||||||
|
dave::ipsec stop
|
||||||
|
moon::iptables-restore < /etc/iptables.flush
|
||||||
|
carol::iptables-restore < /etc/iptables.flush
|
||||||
|
dave::iptables-restore < /etc/iptables.flush
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
moon::iptables-restore < /etc/iptables.rules
|
||||||
|
carol::iptables-restore < /etc/iptables.rules
|
||||||
|
dave::iptables-restore < /etc/iptables.rules
|
||||||
|
moon::ipsec start
|
||||||
|
carol::ipsec start
|
||||||
|
dave::ipsec start
|
||||||
|
carol::sleep 1
|
||||||
|
carol::ipsec up alice
|
||||||
|
carol::ipsec up venus
|
||||||
|
dave::ipsec up alice
|
||||||
|
dave::ipsec up venus
|
||||||
|
dave::sleep 1
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
#
|
||||||
|
# This configuration file provides information on the
|
||||||
|
# guest instances used for this test
|
||||||
|
|
||||||
|
# All guest instances that are required for this test
|
||||||
|
#
|
||||||
|
VIRTHOSTS="alice venus moon carol winnetou moon"
|
||||||
|
|
||||||
|
# Corresponding block diagram
|
||||||
|
#
|
||||||
|
DIAGRAM="a-v-m-c-w-d.png"
|
||||||
|
|
||||||
|
# Guest instances on which tcpdump is to be started
|
||||||
|
#
|
||||||
|
TCPDUMPHOSTS="moon"
|
||||||
|
|
||||||
|
# Guest instances on which IPsec is started
|
||||||
|
# Used for IPsec logging purposes
|
||||||
|
#
|
||||||
|
IPSECHOSTS="moon carol dave"
|
||||||
|
|
||||||
|
# Guest instances on which FreeRadius is started
|
||||||
|
#
|
||||||
|
RADIUSHOSTS=""
|
||||||
|
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
moon:: cat /var/log/daemon.log::whitelist functionality was already enabled::YES
|
moon:: cat /var/log/daemon.log::whitelist functionality was already enabled::YES
|
||||||
moon:: cat /var/log/daemon.log::authentication of '[email protected]' with RSA signature successful::YES
|
moon:: cat /var/log/daemon.log::authentication of '[email protected]' with RSA.* successful::YES
|
||||||
moon:: cat /var/log/daemon.log::authentication of '[email protected]' with RSA signature successful::YES
|
moon:: cat /var/log/daemon.log::authentication of '[email protected]' with RSA.* successful::YES
|
||||||
moon:: cat /var/log/daemon.log::peer identity '[email protected]' not whitelisted::YES
|
moon:: cat /var/log/daemon.log::peer identity '[email protected]' not whitelisted::YES
|
||||||
carol::ipsec status 2> /dev/null::home.*INSTALLED, TUNNEL::YES
|
carol::ipsec status 2> /dev/null::home.*INSTALLED, TUNNEL::YES
|
||||||
carol::ping -c 1 PH_IP_ALICE::64 bytes from PH_IP_ALICE: icmp_req=1::YES
|
carol::ping -c 1 PH_IP_ALICE::64 bytes from PH_IP_ALICE: icmp_req=1::YES
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
carol::cat /var/log/daemon.log::openssl FIPS mode(2) - enabled::YES
|
carol::cat /var/log/daemon.log::openssl FIPS mode(2) - enabled::YES
|
||||||
dave:: cat /var/log/daemon.log::openssl FIPS mode(2) - enabled::YES
|
dave:: cat /var/log/daemon.log::openssl FIPS mode(2) - enabled::YES
|
||||||
moon:: cat /var/log/daemon.log::openssl FIPS mode(2) - enabled::YES
|
moon:: cat /var/log/daemon.log::openssl FIPS mode(2) - enabled::YES
|
||||||
moon:: cat /var/log/daemon.log::authentication of.*[email protected].*with ECDSA-256 signature successful::YES
|
moon:: cat /var/log/daemon.log::authentication of.*[email protected].*with ECDSA_WITH_SHA256_DER successful::YES
|
||||||
moon:: cat /var/log/daemon.log::authentication of.*[email protected].*with ECDSA-256 signature successful::YES
|
moon:: cat /var/log/daemon.log::authentication of.*[email protected].*with ECDSA_WITH_SHA256_DER successful::YES
|
||||||
carol::ipsec status 2> /dev/null::home.*ESTABLISHED.*[email protected].*moon.strongswan.org::YES
|
carol::ipsec status 2> /dev/null::home.*ESTABLISHED.*[email protected].*moon.strongswan.org::YES
|
||||||
dave:: ipsec status 2> /dev/null::home.*ESTABLISHED.*[email protected].*moon.strongswan.org::YES
|
dave:: ipsec status 2> /dev/null::home.*ESTABLISHED.*[email protected].*moon.strongswan.org::YES
|
||||||
moon:: ipsec status 2> /dev/null::rw\[1]: ESTABLISHED.*moon.strongswan.org.*[email protected]::YES
|
moon:: ipsec status 2> /dev/null::rw\[1]: ESTABLISHED.*moon.strongswan.org.*[email protected]::YES
|
||||||
|
|||||||
@@ -6,9 +6,9 @@ carol::ipsec status 2> /dev/null::home.*INSTALLED, TUNNEL::YES
|
|||||||
dave:: ipsec status 2> /dev/null::home.*INSTALLED, TUNNEL::YES
|
dave:: ipsec status 2> /dev/null::home.*INSTALLED, TUNNEL::YES
|
||||||
moon:: ipsec status 2> /dev/null::rw[{]1}.*INSTALLED, TUNNEL::YES
|
moon:: ipsec status 2> /dev/null::rw[{]1}.*INSTALLED, TUNNEL::YES
|
||||||
moon:: ipsec status 2> /dev/null::rw[{]2}.*INSTALLED, TUNNEL::YES
|
moon:: ipsec status 2> /dev/null::rw[{]2}.*INSTALLED, TUNNEL::YES
|
||||||
moon:: cat /var/log/daemon.log::authentication of.*[email protected].*with ECDSA-256 signature successful::YES
|
moon:: cat /var/log/daemon.log::authentication of.*[email protected].*with ECDSA_WITH_SHA256_DER successful::YES
|
||||||
moon:: cat /var/log/daemon.log::authentication of.*[email protected].*with ECDSA-384 signature successful::YES
|
moon:: cat /var/log/daemon.log::authentication of.*[email protected].*with ECDSA-384 signature successful::YES
|
||||||
carol::cat /var/log/daemon.log::authentication of.*moon.strongswan.org.*with ECDSA-521 signature successful::YES
|
carol::cat /var/log/daemon.log::authentication of.*moon.strongswan.org.*with ECDSA_WITH_SHA512_DER successful::YES
|
||||||
dave:: cat /var/log/daemon.log::authentication of.*moon.strongswan.org.*with ECDSA-521 signature successful::YES
|
dave:: cat /var/log/daemon.log::authentication of.*moon.strongswan.org.*with ECDSA-521 signature successful::YES
|
||||||
carol::ping -c 1 PH_IP_ALICE::64 bytes from PH_IP_ALICE: icmp_req=1::YES
|
carol::ping -c 1 PH_IP_ALICE::64 bytes from PH_IP_ALICE: icmp_req=1::YES
|
||||||
dave:: ping -c 1 PH_IP_ALICE::64 bytes from PH_IP_ALICE: icmp_req=1::YES
|
dave:: ping -c 1 PH_IP_ALICE::64 bytes from PH_IP_ALICE: icmp_req=1::YES
|
||||||
|
|||||||
@@ -2,4 +2,5 @@
|
|||||||
|
|
||||||
charon {
|
charon {
|
||||||
load = pem pkcs1 openssl curl revocation random nonce hmac stroke kernel-netlink socket-default updown
|
load = pem pkcs1 openssl curl revocation random nonce hmac stroke kernel-netlink socket-default updown
|
||||||
|
signature_authentication = no
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,10 +2,10 @@ carol::ipsec status 2> /dev/null::home.*ESTABLISHED.*[email protected].*moon.
|
|||||||
dave:: ipsec status 2> /dev/null::home.*ESTABLISHED.*[email protected].*moon.strongswan.org::YES
|
dave:: ipsec status 2> /dev/null::home.*ESTABLISHED.*[email protected].*moon.strongswan.org::YES
|
||||||
moon:: ipsec status 2> /dev/null::rw\[1]: ESTABLISHED.*moon.strongswan.org.*[email protected]::YES
|
moon:: ipsec status 2> /dev/null::rw\[1]: ESTABLISHED.*moon.strongswan.org.*[email protected]::YES
|
||||||
moon:: ipsec status 2> /dev/null::rw\[2]: ESTABLISHED.*moon.strongswan.org.*[email protected]::YES
|
moon:: ipsec status 2> /dev/null::rw\[2]: ESTABLISHED.*moon.strongswan.org.*[email protected]::YES
|
||||||
moon:: cat /var/log/daemon.log::authentication of.*[email protected].*with ECDSA-256 signature successful::YES
|
moon:: cat /var/log/daemon.log::authentication of.*[email protected].*with ECDSA_WITH_SHA256_DER successful::YES
|
||||||
moon:: cat /var/log/daemon.log::authentication of.*[email protected].*with ECDSA-384 signature successful::YES
|
moon:: cat /var/log/daemon.log::authentication of.*[email protected].*with ECDSA_WITH_SHA384_DER successful::YES
|
||||||
carol::cat /var/log/daemon.log::authentication of.*moon.strongswan.org.*with ECDSA-521 signature successful::YES
|
carol::cat /var/log/daemon.log::authentication of.*moon.strongswan.org.*with ECDSA_WITH_SHA512_DER successful::YES
|
||||||
dave:: cat /var/log/daemon.log::authentication of.*moon.strongswan.org.*with ECDSA-521 signature successful::YES
|
dave:: cat /var/log/daemon.log::authentication of.*moon.strongswan.org.*with ECDSA_WITH_SHA512_DER successful::YES
|
||||||
carol::ping -c 1 PH_IP_ALICE::64 bytes from PH_IP_ALICE: icmp_req=1::YES
|
carol::ping -c 1 PH_IP_ALICE::64 bytes from PH_IP_ALICE: icmp_req=1::YES
|
||||||
dave:: ping -c 1 PH_IP_ALICE::64 bytes from PH_IP_ALICE: icmp_req=1::YES
|
dave:: ping -c 1 PH_IP_ALICE::64 bytes from PH_IP_ALICE: icmp_req=1::YES
|
||||||
moon::tcpdump::IP carol.strongswan.org > moon.strongswan.org: ESP::YES
|
moon::tcpdump::IP carol.strongswan.org > moon.strongswan.org: ESP::YES
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
dave:: cat /var/log/daemon.log::establishing IKE_SA failed, peer not responding::YES
|
dave:: cat /var/log/daemon.log::establishing IKE_SA failed, peer not responding::YES
|
||||||
carol::cat /var/log/daemon.log::openssl FIPS mode(2) - enabled::YES
|
carol::cat /var/log/daemon.log::openssl FIPS mode(2) - enabled::YES
|
||||||
moon:: cat /var/log/daemon.log::openssl FIPS mode(2) - enabled::YES
|
moon:: cat /var/log/daemon.log::openssl FIPS mode(2) - enabled::YES
|
||||||
moon:: cat /var/log/daemon.log::authentication of.*[email protected].*with ECDSA-256 signature successful::YES
|
moon:: cat /var/log/daemon.log::authentication of.*[email protected].*with ECDSA_WITH_SHA256_DER successful::YES
|
||||||
carol::ipsec status 2> /dev/null::home.*ESTABLISHED.*[email protected].*moon.strongswan.org::YES
|
carol::ipsec status 2> /dev/null::home.*ESTABLISHED.*[email protected].*moon.strongswan.org::YES
|
||||||
moon:: ipsec status 2> /dev/null::rw\[1]: ESTABLISHED.*moon.strongswan.org.*[email protected]::YES
|
moon:: ipsec status 2> /dev/null::rw\[1]: ESTABLISHED.*moon.strongswan.org.*[email protected]::YES
|
||||||
carol::ipsec status 2> /dev/null::home.*INSTALLED, TUNNEL::YES
|
carol::ipsec status 2> /dev/null::home.*INSTALLED, TUNNEL::YES
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
dave:: cat /var/log/daemon.log::establishing IKE_SA failed, peer not responding::YES
|
dave:: cat /var/log/daemon.log::establishing IKE_SA failed, peer not responding::YES
|
||||||
carol::cat /var/log/daemon.log::openssl FIPS mode(2) - enabled::YES
|
carol::cat /var/log/daemon.log::openssl FIPS mode(2) - enabled::YES
|
||||||
moon:: cat /var/log/daemon.log::openssl FIPS mode(2) - enabled::YES
|
moon:: cat /var/log/daemon.log::openssl FIPS mode(2) - enabled::YES
|
||||||
moon:: cat /var/log/daemon.log::authentication of.*[email protected].*with ECDSA-384 signature successful::YES
|
moon:: cat /var/log/daemon.log::authentication of.*[email protected].*with ECDSA_WITH_SHA384_DER successful::YES
|
||||||
carol::ipsec status 2> /dev/null::home.*ESTABLISHED.*[email protected].*moon.strongswan.org::YES
|
carol::ipsec status 2> /dev/null::home.*ESTABLISHED.*[email protected].*moon.strongswan.org::YES
|
||||||
moon:: ipsec status 2> /dev/null::rw\[1]: ESTABLISHED.*moon.strongswan.org.*[email protected]::YES
|
moon:: ipsec status 2> /dev/null::rw\[1]: ESTABLISHED.*moon.strongswan.org.*[email protected]::YES
|
||||||
carol::ipsec status 2> /dev/null::home.*INSTALLED, TUNNEL::YES
|
carol::ipsec status 2> /dev/null::home.*INSTALLED, TUNNEL::YES
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
carol::cat /var/log/daemon.log::authentication of 'moon.strongswan.org' with RSA signature successful::YES
|
carol::cat /var/log/daemon.log::authentication of 'moon.strongswan.org' with RSA.* successful::YES
|
||||||
carol::cat /var/log/daemon.log::authentication of 'moon.strongswan.org' with EAP successful::YES
|
carol::cat /var/log/daemon.log::authentication of 'moon.strongswan.org' with EAP successful::YES
|
||||||
moon:: cat /var/log/daemon.log::authentication of '[email protected]' with EAP successful::YES
|
moon:: cat /var/log/daemon.log::authentication of '[email protected]' with EAP successful::YES
|
||||||
carol::ipsec status 2> /dev/null::home.*ESTABLISHED.*[email protected].*moon.strongswan.org::YES
|
carol::ipsec status 2> /dev/null::home.*ESTABLISHED.*[email protected].*moon.strongswan.org::YES
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
moon:: cat /var/log/daemon.log::authentication of '[email protected]' with pre-shared key successful::YES
|
moon:: cat /var/log/daemon.log::authentication of '[email protected]' with pre-shared key successful::YES
|
||||||
moon:: cat /var/log/daemon.log::authentication of '[email protected]' with pre-shared key successful::YES
|
moon:: cat /var/log/daemon.log::authentication of '[email protected]' with pre-shared key successful::YES
|
||||||
moon:: cat /var/log/daemon.log::authentication of 'moon.strongswan.org' (myself) with RSA signature successful::YES
|
moon:: cat /var/log/daemon.log::authentication of 'moon.strongswan.org' (myself) with RSA.* successful::YES
|
||||||
carol::ipsec status 2> /dev/null::home.*ESTABLISHED.*[email protected].*moon.strongswan.org::YES
|
carol::ipsec status 2> /dev/null::home.*ESTABLISHED.*[email protected].*moon.strongswan.org::YES
|
||||||
dave:: ipsec status 2> /dev/null::home.*ESTABLISHED.*[email protected].*moon.strongswan.org::YES
|
dave:: ipsec status 2> /dev/null::home.*ESTABLISHED.*[email protected].*moon.strongswan.org::YES
|
||||||
moon:: ipsec status 2> /dev/null::rw\[1]: ESTABLISHED.*moon.strongswan.org.*[email protected]::YES
|
moon:: ipsec status 2> /dev/null::rw\[1]: ESTABLISHED.*moon.strongswan.org.*[email protected]::YES
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
carol::cat /var/log/daemon.log::authentication of 'moon.strongswan.org' with RSA signature successful::YES
|
carol::cat /var/log/daemon.log::authentication of 'moon.strongswan.org' with RSA.* successful::YES
|
||||||
carol::cat /var/log/daemon.log::TNCCS-Recommendation.*allow::YES
|
carol::cat /var/log/daemon.log::TNCCS-Recommendation.*allow::YES
|
||||||
carol::cat /var/log/daemon.log::EAP method EAP_TTLS succeeded, MSK established::YES
|
carol::cat /var/log/daemon.log::EAP method EAP_TTLS succeeded, MSK established::YES
|
||||||
carol::cat /var/log/daemon.log::CHILD_SA home{1} established.*TS 192.168.0.100/32 === 10.1.0.0/16::YES
|
carol::cat /var/log/daemon.log::CHILD_SA home{1} established.*TS 192.168.0.100/32 === 10.1.0.0/16::YES
|
||||||
dave:: cat /var/log/daemon.log::authentication of 'moon.strongswan.org' with RSA signature successful::YES
|
dave:: cat /var/log/daemon.log::authentication of 'moon.strongswan.org' with RSA.* successful::YES
|
||||||
dave:: cat /var/log/daemon.log::TNCCS-Recommendation.*none::YES
|
dave:: cat /var/log/daemon.log::TNCCS-Recommendation.*none::YES
|
||||||
dave:: cat /var/log/daemon.log::received EAP_FAILURE, EAP authentication failed::YES
|
dave:: cat /var/log/daemon.log::received EAP_FAILURE, EAP authentication failed::YES
|
||||||
dave:: cat /var/log/daemon.log::CHILD_SA home{1} established.*TS 192.168.0.200/32 === 10.1.0.0/16::NO
|
dave:: cat /var/log/daemon.log::CHILD_SA home{1} established.*TS 192.168.0.200/32 === 10.1.0.0/16::NO
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
carol::cat /var/log/daemon.log::authentication of 'moon.strongswan.org' with RSA signature successful::YES
|
carol::cat /var/log/daemon.log::authentication of 'moon.strongswan.org' with RSA.* successful::YES
|
||||||
carol::cat /var/log/daemon.log::TNCCS-Recommendation.*allow::YES
|
carol::cat /var/log/daemon.log::TNCCS-Recommendation.*allow::YES
|
||||||
carol::cat /var/log/daemon.log::EAP method EAP_TTLS succeeded, MSK established::YES
|
carol::cat /var/log/daemon.log::EAP method EAP_TTLS succeeded, MSK established::YES
|
||||||
carol::cat /var/log/daemon.log::CHILD_SA home{1} established.*TS 192.168.0.100/32 === 10.1.0.0/28::YES
|
carol::cat /var/log/daemon.log::CHILD_SA home{1} established.*TS 192.168.0.100/32 === 10.1.0.0/28::YES
|
||||||
dave:: cat /var/log/daemon.log::authentication of 'moon.strongswan.org' with RSA signature successful::YES
|
dave:: cat /var/log/daemon.log::authentication of 'moon.strongswan.org' with RSA.* successful::YES
|
||||||
dave:: cat /var/log/daemon.log::TNCCS-Recommendation.*isolate::YES
|
dave:: cat /var/log/daemon.log::TNCCS-Recommendation.*isolate::YES
|
||||||
dave:: cat /var/log/daemon.log::EAP method EAP_TTLS succeeded, MSK established::YES
|
dave:: cat /var/log/daemon.log::EAP method EAP_TTLS succeeded, MSK established::YES
|
||||||
dave:: cat /var/log/daemon.log::CHILD_SA home{1} established.*TS 192.168.0.200/32 === 10.1.0.16/28::YES
|
dave:: cat /var/log/daemon.log::CHILD_SA home{1} established.*TS 192.168.0.200/32 === 10.1.0.16/28::YES
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
carol::cat /var/log/daemon.log::authentication of 'moon.strongswan.org' with RSA signature successful::YES
|
carol::cat /var/log/daemon.log::authentication of 'moon.strongswan.org' with RSA.* successful::YES
|
||||||
carol::cat /var/log/daemon.log::TNCCS-Recommendation.*allow::YES
|
carol::cat /var/log/daemon.log::TNCCS-Recommendation.*allow::YES
|
||||||
carol::cat /var/log/daemon.log::EAP method EAP_TTLS succeeded, MSK established::YES
|
carol::cat /var/log/daemon.log::EAP method EAP_TTLS succeeded, MSK established::YES
|
||||||
carol::cat /var/log/daemon.log::CHILD_SA home{1} established.*TS 192.168.0.100/32 === 10.1.0.0/28::YES
|
carol::cat /var/log/daemon.log::CHILD_SA home{1} established.*TS 192.168.0.100/32 === 10.1.0.0/28::YES
|
||||||
dave:: cat /var/log/daemon.log::authentication of 'moon.strongswan.org' with RSA signature successful::YES
|
dave:: cat /var/log/daemon.log::authentication of 'moon.strongswan.org' with RSA.* successful::YES
|
||||||
dave:: cat /var/log/daemon.log::TNCCS-Recommendation.*isolate::YES
|
dave:: cat /var/log/daemon.log::TNCCS-Recommendation.*isolate::YES
|
||||||
dave:: cat /var/log/daemon.log::EAP method EAP_TTLS succeeded, MSK established::YES
|
dave:: cat /var/log/daemon.log::EAP method EAP_TTLS succeeded, MSK established::YES
|
||||||
dave:: cat /var/log/daemon.log::CHILD_SA home{1} established.*TS 192.168.0.200/32 === 10.1.0.16/28::YES
|
dave:: cat /var/log/daemon.log::CHILD_SA home{1} established.*TS 192.168.0.200/32 === 10.1.0.16/28::YES
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
dave:: cat /var/log/daemon.log::authentication of 'moon.strongswan.org' with RSA signature successful::YES
|
dave:: cat /var/log/daemon.log::authentication of 'moon.strongswan.org' with RSA.* successful::YES
|
||||||
dave:: cat /var/log/daemon.log::PDP server.*aaa.strongswan.org.*is listening on port 271::YES
|
dave:: cat /var/log/daemon.log::PDP server.*aaa.strongswan.org.*is listening on port 271::YES
|
||||||
dave:: cat /var/log/daemon.log::collected ... SWID tags::YES
|
dave:: cat /var/log/daemon.log::collected ... SWID tags::YES
|
||||||
dave:: cat /var/log/daemon.log::PB-TNC access recommendation is .*Quarantined::YES
|
dave:: cat /var/log/daemon.log::PB-TNC access recommendation is .*Quarantined::YES
|
||||||
dave:: cat /var/log/daemon.log::EAP method EAP_TTLS succeeded, MSK established::YES
|
dave:: cat /var/log/daemon.log::EAP method EAP_TTLS succeeded, MSK established::YES
|
||||||
dave:: cat /var/log/daemon.log::CHILD_SA home{1} established.*TS 192.168.0.200/32 === 10.1.0.16/28::YES
|
dave:: cat /var/log/daemon.log::CHILD_SA home{1} established.*TS 192.168.0.200/32 === 10.1.0.16/28::YES
|
||||||
carol::cat /var/log/daemon.log::authentication of 'moon.strongswan.org' with RSA signature successful::YES
|
carol::cat /var/log/daemon.log::authentication of 'moon.strongswan.org' with RSA.* successful::YES
|
||||||
carol::cat /var/log/daemon.log::PDP server.*aaa.strongswan.org.*is listening on port 271::YES
|
carol::cat /var/log/daemon.log::PDP server.*aaa.strongswan.org.*is listening on port 271::YES
|
||||||
carol::cat /var/log/daemon.log::collected ... SWID tag IDs::YES
|
carol::cat /var/log/daemon.log::collected ... SWID tag IDs::YES
|
||||||
carol::cat /var/log/daemon.log::collected 1 SWID tag::YES
|
carol::cat /var/log/daemon.log::collected 1 SWID tag::YES
|
||||||
|
|||||||
Reference in New Issue
Block a user