introduced libstrongswan.x509.enforce_critical parameter
This commit is contained in:
@@ -460,6 +460,9 @@ Check daemon, libstrongswan and plugin integrity at startup
|
|||||||
.TP
|
.TP
|
||||||
.BR libstrongswan.leak_detective.detailed " [yes]"
|
.BR libstrongswan.leak_detective.detailed " [yes]"
|
||||||
Includes source file names and line numbers in leak detective output
|
Includes source file names and line numbers in leak detective output
|
||||||
|
.TP
|
||||||
|
.BR libstrongswan.x509.enforce_critical " [yes]"
|
||||||
|
Discard certificates with unsupported or unknown critical extensions
|
||||||
.SS libstrongswan.plugins subsection
|
.SS libstrongswan.plugins subsection
|
||||||
.TP
|
.TP
|
||||||
.BR libstrongswan.plugins.attr-sql.database
|
.BR libstrongswan.plugins.attr-sql.database
|
||||||
@@ -475,13 +478,8 @@ Use faster random numbers in gcrypt; for testing only, produces weak keys!
|
|||||||
ENGINE ID to use in the OpenSSL plugin
|
ENGINE ID to use in the OpenSSL plugin
|
||||||
.TP
|
.TP
|
||||||
.BR libstrongswan.plugins.pkcs11.modules
|
.BR libstrongswan.plugins.pkcs11.modules
|
||||||
|
|
||||||
.TP
|
.TP
|
||||||
.BR libstrongswan.plugins.pkcs11.use_hasher " [no]"
|
.BR libstrongswan.plugins.pkcs11.use_hasher " [no]"
|
||||||
|
|
||||||
.TP
|
|
||||||
.BR libstrongswan.plugins.x509.enforce_critical " [no]"
|
|
||||||
Discard certificates with unsupported or unknown critical extensions
|
|
||||||
.SS libtls section
|
.SS libtls section
|
||||||
.TP
|
.TP
|
||||||
.BR libtls.cipher
|
.BR libtls.cipher
|
||||||
|
|||||||
@@ -460,7 +460,9 @@ static bool parse_extensions(private_openssl_crl_t *this)
|
|||||||
ok = parse_crlNumber_ext(this, ext);
|
ok = parse_crlNumber_ext(this, ext);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
ok = X509_EXTENSION_get_critical(ext) != 0;
|
ok = X509_EXTENSION_get_critical(ext) == 0 ||
|
||||||
|
!lib->settings->get_bool(lib->settings,
|
||||||
|
"libstrongswan.x509.enforce_critical", TRUE);
|
||||||
if (!ok)
|
if (!ok)
|
||||||
{
|
{
|
||||||
DBG1(DBG_LIB, "found unsupported critical X.509 "
|
DBG1(DBG_LIB, "found unsupported critical X.509 "
|
||||||
|
|||||||
@@ -804,7 +804,9 @@ static bool parse_extensions(private_openssl_x509_t *this)
|
|||||||
ok = parse_crlDistributionPoints_ext(this, ext);
|
ok = parse_crlDistributionPoints_ext(this, ext);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
ok = X509_EXTENSION_get_critical(ext) == 0;
|
ok = X509_EXTENSION_get_critical(ext) == 0 ||
|
||||||
|
!lib->settings->get_bool(lib->settings,
|
||||||
|
"libstrongswan.x509.enforce_critical", TRUE);
|
||||||
if (!ok)
|
if (!ok)
|
||||||
{
|
{
|
||||||
DBG1(DBG_LIB, "found unsupported critical X.509 extension");
|
DBG1(DBG_LIB, "found unsupported critical X.509 extension");
|
||||||
@@ -916,7 +918,7 @@ static bool parse_certificate(private_openssl_x509_t *this)
|
|||||||
|
|
||||||
if (!parse_extensions(this))
|
if (!parse_extensions(this))
|
||||||
{
|
{
|
||||||
return TRUE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
parse_extKeyUsage(this);
|
parse_extKeyUsage(this);
|
||||||
|
|
||||||
|
|||||||
@@ -1443,9 +1443,9 @@ static bool parse_certificate(private_x509_cert_t *this)
|
|||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
if (critical && lib->settings->get_bool(lib->settings,
|
if (critical && lib->settings->get_bool(lib->settings,
|
||||||
"libstrongswan.plugins.x509.enforce_critical", FALSE))
|
"libstrongswan.x509.enforce_critical", TRUE))
|
||||||
{
|
{
|
||||||
DBG1(DBG_LIB, "critical %s extension not supported",
|
DBG1(DBG_LIB, "critical '%s' extension not supported",
|
||||||
(extn_oid == OID_UNKNOWN) ? "unknown" :
|
(extn_oid == OID_UNKNOWN) ? "unknown" :
|
||||||
(char*)oid_names[extn_oid].name);
|
(char*)oid_names[extn_oid].name);
|
||||||
goto end;
|
goto end;
|
||||||
|
|||||||
@@ -322,9 +322,9 @@ static bool parse(private_x509_crl_t *this)
|
|||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
if (critical && lib->settings->get_bool(lib->settings,
|
if (critical && lib->settings->get_bool(lib->settings,
|
||||||
"libstrongswan.plugins.x509.enforce_critical", FALSE))
|
"libstrongswan.x509.enforce_critical", TRUE))
|
||||||
{
|
{
|
||||||
DBG1(DBG_LIB, "critical %s extension not supported",
|
DBG1(DBG_LIB, "critical '%s' extension not supported",
|
||||||
(extn_oid == OID_UNKNOWN) ? "unknown" :
|
(extn_oid == OID_UNKNOWN) ? "unknown" :
|
||||||
(char*)oid_names[extn_oid].name);
|
(char*)oid_names[extn_oid].name);
|
||||||
goto end;
|
goto end;
|
||||||
|
|||||||
Reference in New Issue
Block a user