Merge branch 'cert-chain-fixes'
This fixes several issues that came up via BSI's Certification Path
Validation Test Tool (CPT):
1) In compliance with RFC 4945, section 5.1.3.2, we now enforce that a
certificate used for IKE authentication either does not contain a keyUsage
extension (like the ones produced by pki --issue) or that they include
digitalSignature or nonRepudiation.
2) CRLs that are not yet valid are now rejected as that could be a
problem in scenarios where expired certificates are removed from CRLs and
the clock on the host doing the revocation check is trailing behind that
of the host issuing CRLs.
3) Results other than revocation (e.g. a skipped check because the CRL
couldn't be fetched) are now stored also for intermediate CA certificates
and not only for end-entity certificates, so a strict CRL policy can be
enforced in such cases.
This commit is contained in:
@@ -18,6 +18,7 @@
|
||||
#include <daemon.h>
|
||||
#include <sa/ikev1/keymat_v1.h>
|
||||
#include <encoding/payloads/hash_payload.h>
|
||||
#include <credentials/certificates/x509.h>
|
||||
|
||||
typedef struct private_pubkey_v1_authenticator_t private_pubkey_v1_authenticator_t;
|
||||
|
||||
@@ -130,6 +131,29 @@ METHOD(authenticator_t, build, status_t,
|
||||
return status;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if the end-entity certificate, if any, is compliant with RFC 4945
|
||||
*/
|
||||
static bool is_compliant_cert(auth_cfg_t *auth)
|
||||
{
|
||||
certificate_t *cert;
|
||||
x509_t *x509;
|
||||
|
||||
cert = auth->get(auth, AUTH_RULE_SUBJECT_CERT);
|
||||
if (!cert || cert->get_type(cert) != CERT_X509)
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
x509 = (x509_t*)cert;
|
||||
if (x509->get_flags(x509) & X509_IKE_COMPLIANT)
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
DBG1(DBG_IKE, "rejecting certificate without digitalSignature or "
|
||||
"nonRepudiation keyUsage flags");
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
METHOD(authenticator_t, process, status_t,
|
||||
private_pubkey_v1_authenticator_t *this, message_t *message)
|
||||
{
|
||||
@@ -176,7 +200,8 @@ METHOD(authenticator_t, process, status_t,
|
||||
id, auth, TRUE);
|
||||
while (enumerator->enumerate(enumerator, &public, ¤t_auth))
|
||||
{
|
||||
if (public->verify(public, scheme, NULL, hash, sig))
|
||||
if (public->verify(public, scheme, NULL, hash, sig) &&
|
||||
is_compliant_cert(current_auth))
|
||||
{
|
||||
DBG1(DBG_IKE, "authentication of '%Y' with %N successful",
|
||||
id, signature_scheme_names, scheme);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2008-2017 Tobias Brunner
|
||||
* Copyright (C) 2008-2018 Tobias Brunner
|
||||
* Copyright (C) 2005-2009 Martin Willi
|
||||
* Copyright (C) 2005 Jan Hutter
|
||||
* HSR Hochschule fuer Technik Rapperswil
|
||||
@@ -23,6 +23,7 @@
|
||||
#include <asn1/asn1.h>
|
||||
#include <asn1/oid.h>
|
||||
#include <collections/array.h>
|
||||
#include <credentials/certificates/x509.h>
|
||||
|
||||
typedef struct private_pubkey_authenticator_t private_pubkey_authenticator_t;
|
||||
|
||||
@@ -414,6 +415,29 @@ METHOD(authenticator_t, build, status_t,
|
||||
return status;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if the end-entity certificate, if any, is compliant with RFC 4945
|
||||
*/
|
||||
static bool is_compliant_cert(auth_cfg_t *auth)
|
||||
{
|
||||
certificate_t *cert;
|
||||
x509_t *x509;
|
||||
|
||||
cert = auth->get(auth, AUTH_RULE_SUBJECT_CERT);
|
||||
if (!cert || cert->get_type(cert) != CERT_X509)
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
x509 = (x509_t*)cert;
|
||||
if (x509->get_flags(x509) & X509_IKE_COMPLIANT)
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
DBG1(DBG_IKE, "rejecting certificate without digitalSignature or "
|
||||
"nonRepudiation keyUsage flags");
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
METHOD(authenticator_t, process, status_t,
|
||||
private_pubkey_authenticator_t *this, message_t *message)
|
||||
{
|
||||
@@ -479,7 +503,8 @@ METHOD(authenticator_t, process, status_t,
|
||||
while (enumerator->enumerate(enumerator, &public, ¤t_auth))
|
||||
{
|
||||
if (public->verify(public, params->scheme, params->params, octets,
|
||||
auth_data))
|
||||
auth_data) &&
|
||||
is_compliant_cert(current_auth))
|
||||
{
|
||||
if (auth_method != AUTH_DS)
|
||||
{
|
||||
|
||||
@@ -62,6 +62,9 @@ enum x509_flag_t {
|
||||
X509_IKE_INTERMEDIATE = (1<<8),
|
||||
/** cert has Microsoft Smartcard Logon usage */
|
||||
X509_MS_SMARTCARD_LOGON = (1<<9),
|
||||
/** cert either lacks keyUsage bits, or includes either digitalSignature
|
||||
* or nonRepudiation as per RFC 4945, section 5.1.3.2. */
|
||||
X509_IKE_COMPLIANT = (1<<10),
|
||||
};
|
||||
|
||||
extern enum_name_t *x509_flag_names;
|
||||
|
||||
@@ -358,7 +358,7 @@ METHOD(certificate_t, get_validity, bool,
|
||||
{
|
||||
*not_after = this->nextUpdate;
|
||||
}
|
||||
return t <= this->nextUpdate;
|
||||
return (t >= this->thisUpdate && t <= this->nextUpdate);
|
||||
}
|
||||
|
||||
METHOD(certificate_t, get_encoding, bool,
|
||||
|
||||
@@ -668,6 +668,9 @@ static bool parse_keyUsage_ext(private_openssl_x509_t *this,
|
||||
{
|
||||
ASN1_BIT_STRING *usage;
|
||||
|
||||
/* to be compliant with RFC 4945 specific KUs have to be included */
|
||||
this->flags &= ~X509_IKE_COMPLIANT;
|
||||
|
||||
usage = X509V3_EXT_d2i(ext);
|
||||
if (usage)
|
||||
{
|
||||
@@ -682,6 +685,11 @@ static bool parse_keyUsage_ext(private_openssl_x509_t *this,
|
||||
{
|
||||
this->flags |= X509_CRL_SIGN;
|
||||
}
|
||||
if (flags & X509v3_KU_DIGITAL_SIGNATURE ||
|
||||
flags & X509v3_KU_NON_REPUDIATION)
|
||||
{
|
||||
this->flags |= X509_IKE_COMPLIANT;
|
||||
}
|
||||
if (flags & X509v3_KU_KEY_CERT_SIGN)
|
||||
{
|
||||
/* we use the caBasicContraint, MUST be set */
|
||||
@@ -988,6 +996,9 @@ static bool parse_extensions(private_openssl_x509_t *this)
|
||||
STACK_OF(X509_EXTENSION) *extensions;
|
||||
int i, num;
|
||||
|
||||
/* unless we see a keyUsage extension we are compliant with RFC 4945 */
|
||||
this->flags |= X509_IKE_COMPLIANT;
|
||||
|
||||
extensions = X509_get0_extensions(this->x509);
|
||||
if (extensions)
|
||||
{
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
/*
|
||||
* Copyright (C) 2015-2018 Tobias Brunner
|
||||
* Copyright (C) 2010 Martin Willi
|
||||
* Copyright (C) 2010 revosec AG
|
||||
* Copyright (C) 2009 Andreas Steffen
|
||||
* Hochschule fuer Technik Rapperswil
|
||||
* HSR 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
|
||||
@@ -15,6 +16,8 @@
|
||||
* for more details.
|
||||
*/
|
||||
|
||||
#include <time.h>
|
||||
|
||||
#include "revocation_validator.h"
|
||||
|
||||
#include <utils/debug.h>
|
||||
@@ -56,7 +59,7 @@ static certificate_t *fetch_ocsp(char *url, certificate_t *subject,
|
||||
certificate_t *issuer)
|
||||
{
|
||||
certificate_t *request, *response;
|
||||
chunk_t send, receive;
|
||||
chunk_t send, receive = chunk_empty;
|
||||
|
||||
/* TODO: requestor name, signature */
|
||||
request = lib->creds->create(lib->creds,
|
||||
@@ -84,6 +87,7 @@ static certificate_t *fetch_ocsp(char *url, certificate_t *subject,
|
||||
FETCH_END) != SUCCESS)
|
||||
{
|
||||
DBG1(DBG_CFG, "ocsp request to %s failed", url);
|
||||
chunk_free(&receive);
|
||||
chunk_free(&send);
|
||||
return NULL;
|
||||
}
|
||||
@@ -351,13 +355,10 @@ static cert_validation_t check_ocsp(x509_t *subject, x509_t *issuer,
|
||||
{
|
||||
valid = VALIDATION_FAILED;
|
||||
}
|
||||
if (auth)
|
||||
{
|
||||
auth->add(auth, AUTH_RULE_OCSP_VALIDATION, valid);
|
||||
if (valid == VALIDATION_GOOD)
|
||||
{ /* successful OCSP check fulfills also CRL constraint */
|
||||
auth->add(auth, AUTH_RULE_CRL_VALIDATION, VALIDATION_GOOD);
|
||||
}
|
||||
auth->add(auth, AUTH_RULE_OCSP_VALIDATION, valid);
|
||||
if (valid == VALIDATION_GOOD)
|
||||
{ /* successful OCSP check fulfills also CRL constraint */
|
||||
auth->add(auth, AUTH_RULE_CRL_VALIDATION, VALIDATION_GOOD);
|
||||
}
|
||||
DESTROY_IF(best);
|
||||
return valid;
|
||||
@@ -369,12 +370,13 @@ static cert_validation_t check_ocsp(x509_t *subject, x509_t *issuer,
|
||||
static certificate_t* fetch_crl(char *url)
|
||||
{
|
||||
certificate_t *crl;
|
||||
chunk_t chunk;
|
||||
chunk_t chunk = chunk_empty;
|
||||
|
||||
DBG1(DBG_CFG, " fetching crl from '%s' ...", url);
|
||||
if (lib->fetcher->fetch(lib->fetcher, url, &chunk, FETCH_END) != SUCCESS)
|
||||
{
|
||||
DBG1(DBG_CFG, "crl fetching failed");
|
||||
chunk_free(&chunk);
|
||||
return NULL;
|
||||
}
|
||||
crl = lib->creds->create(lib->creds, CRED_CERTIFICATE, CERT_X509_CRL,
|
||||
@@ -417,11 +419,11 @@ static bool verify_crl(certificate_t *crl)
|
||||
/**
|
||||
* Report the given CRL's validity and cache it if valid and requested
|
||||
*/
|
||||
static bool is_crl_valid(certificate_t *crl, bool cache)
|
||||
static bool is_crl_valid(certificate_t *crl, time_t now, bool cache)
|
||||
{
|
||||
time_t valid_until;
|
||||
|
||||
if (crl->get_validity(crl, NULL, NULL, &valid_until))
|
||||
if (crl->get_validity(crl, &now, NULL, &valid_until))
|
||||
{
|
||||
DBG1(DBG_CFG, " crl is valid: until %T", &valid_until, FALSE);
|
||||
if (cache)
|
||||
@@ -434,6 +436,25 @@ static bool is_crl_valid(certificate_t *crl, bool cache)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if the CRL should be used yet
|
||||
*/
|
||||
static bool is_crl_not_valid_yet(certificate_t *crl, time_t now)
|
||||
{
|
||||
time_t this_update;
|
||||
|
||||
if (!crl->get_validity(crl, &now, &this_update, NULL))
|
||||
{
|
||||
if (this_update > now)
|
||||
{
|
||||
DBG1(DBG_CFG, " crl is not valid: until %T", &this_update, FALSE);
|
||||
return TRUE;
|
||||
}
|
||||
/* we accept stale CRLs */
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the better of two CRLs, and check for usable CRL info
|
||||
*/
|
||||
@@ -442,7 +463,7 @@ static certificate_t *get_better_crl(certificate_t *cand, certificate_t *best,
|
||||
bool cache, crl_t *base)
|
||||
{
|
||||
enumerator_t *enumerator;
|
||||
time_t revocation;
|
||||
time_t now, revocation;
|
||||
crl_reason_t reason;
|
||||
chunk_t subject_serial, serial;
|
||||
crl_t *crl = (crl_t*)cand;
|
||||
@@ -472,6 +493,12 @@ static certificate_t *get_better_crl(certificate_t *cand, certificate_t *best,
|
||||
cand->destroy(cand);
|
||||
return best;
|
||||
}
|
||||
now = time(NULL);
|
||||
if (is_crl_not_valid_yet(cand, now))
|
||||
{
|
||||
cand->destroy(cand);
|
||||
return best;
|
||||
}
|
||||
|
||||
subject_serial = chunk_skip_zero(subject->get_serial(subject));
|
||||
enumerator = crl->create_enumerator(crl);
|
||||
@@ -488,7 +515,7 @@ static certificate_t *get_better_crl(certificate_t *cand, certificate_t *best,
|
||||
/* if the cert is on hold, a newer CRL might not contain it */
|
||||
*valid = VALIDATION_ON_HOLD;
|
||||
}
|
||||
is_crl_valid(cand, cache);
|
||||
is_crl_valid(cand, now, cache);
|
||||
DBG1(DBG_CFG, "certificate was revoked on %T, reason: %N",
|
||||
&revocation, TRUE, crl_reason_names, reason);
|
||||
enumerator->destroy(enumerator);
|
||||
@@ -503,7 +530,7 @@ static certificate_t *get_better_crl(certificate_t *cand, certificate_t *best,
|
||||
{
|
||||
DESTROY_IF(best);
|
||||
best = cand;
|
||||
if (is_crl_valid(best, cache))
|
||||
if (is_crl_valid(best, now, cache))
|
||||
{
|
||||
*valid = VALIDATION_GOOD;
|
||||
}
|
||||
@@ -749,18 +776,15 @@ static cert_validation_t check_crl(x509_t *subject, x509_t *issuer,
|
||||
{
|
||||
valid = VALIDATION_FAILED;
|
||||
}
|
||||
if (auth)
|
||||
if (valid == VALIDATION_SKIPPED)
|
||||
{ /* if we skipped CRL validation, we use the result of OCSP for
|
||||
* constraint checking */
|
||||
auth->add(auth, AUTH_RULE_CRL_VALIDATION,
|
||||
auth->get(auth, AUTH_RULE_OCSP_VALIDATION));
|
||||
}
|
||||
else
|
||||
{
|
||||
if (valid == VALIDATION_SKIPPED)
|
||||
{ /* if we skipped CRL validation, we use the result of OCSP for
|
||||
* constraint checking */
|
||||
auth->add(auth, AUTH_RULE_CRL_VALIDATION,
|
||||
auth->get(auth, AUTH_RULE_OCSP_VALIDATION));
|
||||
}
|
||||
else
|
||||
{
|
||||
auth->add(auth, AUTH_RULE_CRL_VALIDATION, valid);
|
||||
}
|
||||
auth->add(auth, AUTH_RULE_CRL_VALIDATION, valid);
|
||||
}
|
||||
DESTROY_IF(best);
|
||||
return valid;
|
||||
@@ -780,8 +804,7 @@ METHOD(cert_validator_t, validate, bool,
|
||||
|
||||
if (this->enable_ocsp)
|
||||
{
|
||||
switch (check_ocsp((x509_t*)subject, (x509_t*)issuer,
|
||||
pathlen ? NULL : auth))
|
||||
switch (check_ocsp((x509_t*)subject, (x509_t*)issuer, auth))
|
||||
{
|
||||
case VALIDATION_GOOD:
|
||||
DBG1(DBG_CFG, "certificate status is good");
|
||||
@@ -803,11 +826,14 @@ METHOD(cert_validator_t, validate, bool,
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
auth->add(auth, AUTH_RULE_OCSP_VALIDATION, VALIDATION_SKIPPED);
|
||||
}
|
||||
|
||||
if (this->enable_crl)
|
||||
{
|
||||
switch (check_crl((x509_t*)subject, (x509_t*)issuer,
|
||||
pathlen ? NULL : auth))
|
||||
switch (check_crl((x509_t*)subject, (x509_t*)issuer, auth))
|
||||
{
|
||||
case VALIDATION_GOOD:
|
||||
DBG1(DBG_CFG, "certificate status is good");
|
||||
@@ -827,6 +853,11 @@ METHOD(cert_validator_t, validate, bool,
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
auth->add(auth, AUTH_RULE_CRL_VALIDATION,
|
||||
auth->get(auth, AUTH_RULE_OCSP_VALIDATION));
|
||||
}
|
||||
|
||||
lib->credmgr->call_hook(lib->credmgr, CRED_HOOK_VALIDATION_FAILED,
|
||||
subject);
|
||||
|
||||
@@ -704,6 +704,9 @@ static void parse_keyUsage(chunk_t blob, private_x509_cert_t *this)
|
||||
KU_DECIPHER_ONLY = 8,
|
||||
};
|
||||
|
||||
/* to be compliant with RFC 4945 specific KUs have to be included */
|
||||
this->flags &= ~X509_IKE_COMPLIANT;
|
||||
|
||||
if (asn1_unwrap(&blob, &blob) == ASN1_BIT_STRING && blob.len)
|
||||
{
|
||||
int bit, byte, unused = blob.ptr[0];
|
||||
@@ -724,10 +727,12 @@ static void parse_keyUsage(chunk_t blob, private_x509_cert_t *this)
|
||||
case KU_CRL_SIGN:
|
||||
this->flags |= X509_CRL_SIGN;
|
||||
break;
|
||||
case KU_KEY_CERT_SIGN:
|
||||
/* we use the caBasicConstraint, MUST be set */
|
||||
case KU_DIGITAL_SIGNATURE:
|
||||
case KU_NON_REPUDIATION:
|
||||
this->flags |= X509_IKE_COMPLIANT;
|
||||
break;
|
||||
case KU_KEY_CERT_SIGN:
|
||||
/* we use the caBasicConstraint, MUST be set */
|
||||
case KU_KEY_ENCIPHERMENT:
|
||||
case KU_DATA_ENCIPHERMENT:
|
||||
case KU_KEY_AGREEMENT:
|
||||
@@ -1381,6 +1386,9 @@ static bool parse_certificate(private_x509_cert_t *this)
|
||||
|
||||
parser = asn1_parser_create(certObjects, this->encoding);
|
||||
|
||||
/* unless we see a keyUsage extension we are compliant with RFC 4945 */
|
||||
this->flags |= X509_IKE_COMPLIANT;
|
||||
|
||||
while (parser->iterate(parser, &objectID, &object))
|
||||
{
|
||||
u_int level = parser->get_level(parser)+1;
|
||||
|
||||
@@ -546,7 +546,7 @@ METHOD(certificate_t, get_validity, bool,
|
||||
{
|
||||
*not_after = this->nextUpdate;
|
||||
}
|
||||
return (t <= this->nextUpdate);
|
||||
return (t >= this->thisUpdate && t <= this->nextUpdate);
|
||||
}
|
||||
|
||||
METHOD(certificate_t, get_encoding, bool,
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
The roadwarrior <b>carol</b> possesses a certificate issued by the Research CA.
|
||||
The CRL for the root CA can't be fetched and thus the status of the certificate
|
||||
of the Research CA is unknown and the authentication is rejected due to the
|
||||
strict CRL policy enforced by the gateway <b>moon</b>.
|
||||
@@ -0,0 +1,4 @@
|
||||
moon:: cat /var/log/daemon.log::constraint check failed: RULE_CRL_VALIDATION is FAILED, but requires at least GOOD::YES
|
||||
carol::cat /var/log/daemon.log::received AUTHENTICATION_FAILED notify error::YES
|
||||
moon:: ipsec status 2> /dev/null::alice.*ESTABLISHED::NO
|
||||
carol::ipsec status 2> /dev/null::home.*INSTALLED::NO
|
||||
@@ -0,0 +1,21 @@
|
||||
# /etc/ipsec.conf - strongSwan IPsec configuration file
|
||||
|
||||
config setup
|
||||
strictcrlpolicy=yes
|
||||
|
||||
conn %default
|
||||
ikelifetime=60m
|
||||
keylife=20m
|
||||
rekeymargin=3m
|
||||
keyingtries=1
|
||||
keyexchange=ikev2
|
||||
|
||||
conn home
|
||||
left=PH_IP_CAROL
|
||||
leftcert=carolCert.pem
|
||||
[email protected]
|
||||
right=PH_IP_MOON
|
||||
rightsubnet=10.1.0.0/16
|
||||
[email protected]
|
||||
rightca="C=CH, O=Linux strongSwan, CN=strongSwan Root CA"
|
||||
auto=add
|
||||
+25
@@ -0,0 +1,25 @@
|
||||
-----BEGIN CERTIFICATE-----
|
||||
MIIELDCCAxSgA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uLm9yZzA3BgNVHR8EMDAuMCygKqAohiZodHRwOi8vY3Js
|
||||
LnN0cm9uZ3N3YW4ub3JnL3Jlc2VhcmNoLmNybDANBgkqhkiG9w0BAQsFAAOCAQEA
|
||||
TgUJbXL83e11Fzo+XGMQ24FfxdUvlex9IcnnNZnjsy4cYaUhofdI1AIkOhdh7R4i
|
||||
9dtdfbFLLQR3qc2jmL9ubdQP83FiZZQOXX55XV5/Gb4E4g2T2ZU8ahby+ZzQsEcI
|
||||
jGeot7fRfbxUrcjnIKxZd7JsQSaR45rMrNcUOQpFT212urojUngrEoAeaC5USEiX
|
||||
sF11P654UejR8DCczwLi4QBvjRTH3bcMC57FjsWt1n/KCB08dS0ojD+T+6lN7/1K
|
||||
yLreeRNynXzc1GAln5G03Ivwm9STFT1mYjkBMOCY+3ihEOpzlR9pWCWl9p728db3
|
||||
mk0VsDm1jdOf3PK1Xd2PJw==
|
||||
-----END CERTIFICATE-----
|
||||
+27
@@ -0,0 +1,27 @@
|
||||
-----BEGIN RSA PRIVATE KEY-----
|
||||
MIIEpAIBAAKCAQEAq6m4epRSpK5+wS2NJNkSRMWxMZZdCTBmgtsA82Vng9XQPHWO
|
||||
7fFG9W2NAc3dOzHoiwHUk7eT90wTHC21t4EDwcqgpjD4IUbz7pdZRT60FPnGXBrm
|
||||
x1VQcijw6fXHtFvez5EOEnb9i8J/8fXdo62ob4vtfK3s7BFBk3HgbHrSyBTZmGv1
|
||||
awyyVYlB5L3a9rpSIZg3hzqpE3KtL3NNkQnTKJu1+WF3TsstyDP6MeoJ1Rw8riDz
|
||||
5MfwcK16TSfZBG7ch9sQz6LoRpmNQmrWSnqT0cAiApHjyv0dWTfMGxYkGjqzFSfz
|
||||
9q8Uzni93APw0AKU2f3GhsRew7ePAaWNzmZvjQIDAQABAoIBAEJqa+GhOUhV6ty6
|
||||
zv0Ory7EfgX9cwl3HHJMYVXKSf6L3wFFSoNs8lNKi1/DUnDwolQF5UUxpaHsYQhp
|
||||
9wCEffugd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h43WgwjbeRyReyT6OWuPiLUiKQYN8W5od
|
||||
pZ51zorvFxu6iEMjAzXs0k1zbM4/EaQwwatTEZF0ZQMYMvm46f0ndhN3fY0O0ENY
|
||||
zZES5DrfCgboPlmrWoVexU3xEDCWO8hO0fLmwqIK8F4EU8ByOVsHcg==
|
||||
-----END RSA PRIVATE KEY-----
|
||||
@@ -0,0 +1,3 @@
|
||||
# /etc/ipsec.secrets - strongSwan IPsec secrets file
|
||||
|
||||
: RSA carolKey.pem
|
||||
@@ -0,0 +1,5 @@
|
||||
# /etc/strongswan.conf - strongSwan configuration file
|
||||
|
||||
charon {
|
||||
load = random nonce aes sha1 sha2 pem pkcs1 curve25519 gmp x509 curl revocation hmac stroke kernel-netlink socket-default
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
# /etc/ipsec.conf - strongSwan IPsec configuration file
|
||||
|
||||
config setup
|
||||
strictcrlpolicy=yes
|
||||
|
||||
ca strongswan
|
||||
cacert=strongswanCert.pem
|
||||
crluri=http://crl.strongswan.org/not-available.crl
|
||||
auto=add
|
||||
|
||||
conn %default
|
||||
ikelifetime=60m
|
||||
keylife=20m
|
||||
rekeymargin=3m
|
||||
keyingtries=1
|
||||
keyexchange=ikev2
|
||||
left=PH_IP_MOON
|
||||
leftcert=moonCert.pem
|
||||
[email protected]
|
||||
|
||||
conn alice
|
||||
leftsubnet=PH_IP_ALICE/32
|
||||
right=%any
|
||||
rightca="C=CH, O=Linux strongSwan, OU=Research, CN=Research CA"
|
||||
auto=add
|
||||
+23
@@ -0,0 +1,23 @@
|
||||
-----BEGIN CERTIFICATE-----
|
||||
MIIDwTCCAqmgAwIBAgIBKDANBgkqhkiG9w0BAQsFADBFMQswCQYDVQQGEwJDSDEZ
|
||||
MBcGA1UEChMQTGludXggc3Ryb25nU3dhbjEbMBkGA1UEAxMSc3Ryb25nU3dhbiBS
|
||||
b290IENBMB4XDTE0MDMyMjEzNTYyMloXDTE5MDMyMTEzNTYyMlowUTELMAkGA1UE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Kr0d5/WZowOUX7G8LUaa5kjoCS7MJONeEX2D/wtsx7Zw3f7GjFDdJfdi+CbAwBN
|
||||
d8kt2l7yt7oEW9AfOcMQ7+HZOqihNrV8mCErk39p9f6zcZtYHnjM5fJlNRmc+EXC
|
||||
mk13kTA=
|
||||
-----END CERTIFICATE-----
|
||||
@@ -0,0 +1,5 @@
|
||||
# /etc/strongswan.conf - strongSwan configuration file
|
||||
|
||||
charon {
|
||||
load = random nonce aes sha1 sha2 pem pkcs1 curve25519 gmp x509 curl revocation hmac stroke kernel-netlink socket-default
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
moon::ipsec stop
|
||||
carol::ipsec stop
|
||||
moon::rm /etc/ipsec.d/cacerts/*
|
||||
@@ -0,0 +1,5 @@
|
||||
moon::ipsec start
|
||||
carol::ipsec start
|
||||
moon::expect-connection alice
|
||||
carol::expect-connection home
|
||||
carol::ipsec up home
|
||||
@@ -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="moon carol winnetou"
|
||||
|
||||
# Corresponding block diagram
|
||||
#
|
||||
DIAGRAM="m-c-w.png"
|
||||
|
||||
# Guest instances on which tcpdump is to be started
|
||||
#
|
||||
TCPDUMPHOSTS=""
|
||||
|
||||
# Guest instances on which IPsec is started
|
||||
# Used for IPsec logging purposes
|
||||
#
|
||||
IPSECHOSTS="moon carol"
|
||||
Reference in New Issue
Block a user