284 lines
14 KiB
Diff
284 lines
14 KiB
Diff
|
From c2409e479df41620bceac314c76cabb1d35a4075 Mon Sep 17 00:00:00 2001
|
||
|
From: Daiki Ueno <ueno@gnu.org>
|
||
|
Date: Mon, 3 May 2021 16:35:43 +0200
|
||
|
Subject: [PATCH] x509/verify: treat SHA-1 signed CA in the trusted set
|
||
|
differently
|
||
|
MIME-Version: 1.0
|
||
|
Content-Type: text/plain; charset=UTF-8
|
||
|
Content-Transfer-Encoding: 8bit
|
||
|
|
||
|
Suppose there is a certificate chain ending with an intermediate CA:
|
||
|
EE → ICA1 → ICA2. If the system trust store contains a root CA
|
||
|
generated with the same key as ICA2 but signed with a prohibited
|
||
|
algorithm, such as SHA-1, the library previously reported a
|
||
|
verification failure, though the situation is not uncommon during a
|
||
|
transition period of root CA.
|
||
|
|
||
|
This changes the library behavior such that the check on signature
|
||
|
algorithm will be skipped when examining the trusted root CA.
|
||
|
|
||
|
Signed-off-by: Daiki Ueno <ueno@gnu.org>
|
||
|
---
|
||
|
lib/x509/verify.c | 26 ++++---
|
||
|
tests/test-chains.h | 165 ++++++++++++++++++++++++++++++++++++++++++++
|
||
|
2 files changed, 182 insertions(+), 9 deletions(-)
|
||
|
|
||
|
diff --git a/lib/x509/verify.c b/lib/x509/verify.c
|
||
|
index fd7c6a164..a50b5ea44 100644
|
||
|
--- a/lib/x509/verify.c
|
||
|
+++ b/lib/x509/verify.c
|
||
|
@@ -415,14 +415,19 @@ unsigned _gnutls_is_broken_sig_allowed(const gnutls_sign_entry_st *se, unsigned
|
||
|
#define CASE_SEC_PARAM(profile, level) \
|
||
|
case profile: \
|
||
|
sym_bits = gnutls_sec_param_to_symmetric_bits(level); \
|
||
|
- hash = gnutls_sign_get_hash_algorithm(sigalg); \
|
||
|
- entry = mac_to_entry(hash); \
|
||
|
- if (hash <= 0 || entry == NULL) { \
|
||
|
+ se = _gnutls_sign_to_entry(sigalg); \
|
||
|
+ if (unlikely(se == NULL)) { \
|
||
|
+ _gnutls_cert_log("cert", crt); \
|
||
|
+ _gnutls_debug_log(#level": certificate's signature algorithm is unknown\n"); \
|
||
|
+ return gnutls_assert_val(0); \
|
||
|
+ } \
|
||
|
+ if (unlikely(se->hash == GNUTLS_DIG_UNKNOWN)) { \
|
||
|
_gnutls_cert_log("cert", crt); \
|
||
|
_gnutls_debug_log(#level": certificate's signature hash is unknown\n"); \
|
||
|
return gnutls_assert_val(0); \
|
||
|
} \
|
||
|
- if (_gnutls_sign_get_hash_strength(sigalg) < sym_bits) { \
|
||
|
+ if (!trusted && \
|
||
|
+ _gnutls_sign_get_hash_strength(sigalg) < sym_bits) { \
|
||
|
_gnutls_cert_log("cert", crt); \
|
||
|
_gnutls_debug_log(#level": certificate's signature hash strength is unacceptable (is %u bits, needed %u)\n", _gnutls_sign_get_hash_strength(sigalg), sym_bits); \
|
||
|
return gnutls_assert_val(0); \
|
||
|
@@ -449,19 +454,22 @@ unsigned _gnutls_is_broken_sig_allowed(const gnutls_sign_entry_st *se, unsigned
|
||
|
* @crt: a certificate
|
||
|
* @issuer: the certificates issuer (allowed to be NULL)
|
||
|
* @sigalg: the signature algorithm used
|
||
|
+ * @trusted: whether @crt is treated as trusted (e.g., present in the system
|
||
|
+ * trust list); if it is true, the check on signature algorithm will
|
||
|
+ * be skipped
|
||
|
* @flags: the specified verification flags
|
||
|
*/
|
||
|
static unsigned is_level_acceptable(
|
||
|
gnutls_x509_crt_t crt, gnutls_x509_crt_t issuer,
|
||
|
- gnutls_sign_algorithm_t sigalg, unsigned flags)
|
||
|
+ gnutls_sign_algorithm_t sigalg, bool trusted,
|
||
|
+ unsigned flags)
|
||
|
{
|
||
|
gnutls_certificate_verification_profiles_t profile = GNUTLS_VFLAGS_TO_PROFILE(flags);
|
||
|
- const mac_entry_st *entry;
|
||
|
int issuer_pkalg = 0, pkalg, ret;
|
||
|
unsigned bits = 0, issuer_bits = 0, sym_bits = 0;
|
||
|
gnutls_pk_params_st params;
|
||
|
gnutls_sec_param_t sp;
|
||
|
- int hash;
|
||
|
+ const gnutls_sign_entry_st *se;
|
||
|
gnutls_certificate_verification_profiles_t min_profile;
|
||
|
|
||
|
min_profile = _gnutls_get_system_wide_verification_profile();
|
||
|
@@ -798,7 +806,7 @@ verify_crt(gnutls_x509_crt_t cert,
|
||
|
}
|
||
|
|
||
|
if (sigalg >= 0 && se) {
|
||
|
- if (is_level_acceptable(cert, issuer, sigalg, flags) == 0) {
|
||
|
+ if (is_level_acceptable(cert, issuer, sigalg, false, flags) == 0) {
|
||
|
MARK_INVALID(GNUTLS_CERT_INSECURE_ALGORITHM);
|
||
|
}
|
||
|
|
||
|
@@ -893,7 +901,7 @@ unsigned check_ca_sanity(const gnutls_x509_crt_t issuer,
|
||
|
|
||
|
/* we explicitly allow CAs which we do not support their self-algorithms
|
||
|
* to pass. */
|
||
|
- if (ret >= 0 && !is_level_acceptable(issuer, NULL, sigalg, flags)) {
|
||
|
+ if (ret >= 0 && !is_level_acceptable(issuer, NULL, sigalg, true, flags)) {
|
||
|
status |= GNUTLS_CERT_INSECURE_ALGORITHM|GNUTLS_CERT_INVALID;
|
||
|
}
|
||
|
|
||
|
diff --git a/tests/test-chains.h b/tests/test-chains.h
|
||
|
index 9b06b85f5..64f50fabf 100644
|
||
|
--- a/tests/test-chains.h
|
||
|
+++ b/tests/test-chains.h
|
||
|
@@ -4106,6 +4106,163 @@ static const char *superseding_ca[] = {
|
||
|
NULL
|
||
|
};
|
||
|
|
||
|
+static const char *rsa_sha1_in_trusted[] = {
|
||
|
+ "-----BEGIN CERTIFICATE-----\n"
|
||
|
+ "MIID0jCCAoqgAwIBAgIUezaBB7f4TW75oc3UV57oJvXmbBYwDQYJKoZIhvcNAQEL\n"
|
||
|
+ "BQAwGTEXMBUGA1UEAxMOR251VExTIHRlc3QgQ0EwHhcNMjEwNTAzMTQyNzIxWhcN\n"
|
||
|
+ "MjIwNTAzMTQyNzIxWjA3MRgwFgYDVQQDEw90ZXN0LmdudXRscy5vcmcxGzAZBgNV\n"
|
||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VTUGWEGHWSeoxGei9Gkm6u+ASj8f+i0jxdD2qXsewID\n"
|
||
|
+ "AQABo2QwYjAPBgNVHRMBAf8EBTADAQH/MA8GA1UdDwEB/wQFAwMHBAAwHQYDVR0O\n"
|
||
|
+ "BBYEFB53I21nMR+RB5uWL+z8yEb+jOEDMB8GA1UdIwQYMBaAFCApU0Q1pxZL+AW3\n"
|
||
|
+ "GctysPWxl+SfMA0GCSqGSIb3DQEBCwUAA4IBgQBbboeDr/rLT1tZWrdHq8FvflGm\n"
|
||
|
+ "EpxZIRU4DdDD/SUCWSPQvjBq0MvuKxs5FfJCKrDf2kS2qlZ1rO0AuWwREoDeTOEc\n"
|
||
|
+ "arjFoCry+JQ+USqS5F4gsp4XlYvli27iMp3dlnhFXEQQy7/y+gM5c9wnMi8v/LUz\n"
|
||
|
+ "AV6QHX0fkb4XeazeJ+Nq0EkjqiYxylN6mP+5LAEMBG/wGviAoviQ5tN9zdoQs/nT\n"
|
||
|
+ "3jTw3cOauuPjdcOTfo71+/MtBzhPchgNIyQo4aB40XVWsLAoruL/3CFFlTniihtd\n"
|
||
|
+ "zA2zA7JvbuuKx6BOv2IbWOUweb732ZpYbDgEcXp/6Cj/SIUGxidpEgdCJGqyqdC7\n"
|
||
|
+ "b58ujxclC6QTcicw+SX5LBox8WGLfj+x+V3uVBz9+EK608xphTj4kLh9peII9v3n\n"
|
||
|
+ "vBUoZRTiUTCvH4AJJgAfa3mYrSxzueuqBOwXcvZ+8OJ0J1CP21pmK5nxR7f1nm9Q\n"
|
||
|
+ "sYA1VHfC2dtyAYlByeF5iHl5hFR6vy1jJyzxg2M=\n"
|
||
|
+ "-----END CERTIFICATE-----\n",
|
||
|
+ NULL
|
||
|
+};
|
||
|
+
|
||
|
+static const char *rsa_sha1_in_trusted_ca[] = {
|
||
|
+ /* This CA is generated with the same key as rsa_sha1_in_trusted[1], but
|
||
|
+ * self-signed using SHA-1.
|
||
|
+ */
|
||
|
+ "-----BEGIN CERTIFICATE-----\n"
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\n"
|
||
|
+ "nxKPlpeImhLN9nGl9sOeW2m4mnA5r0h1vgML4v/MWL4TQhXallc31uFNj5HyFaTh\n"
|
||
|
+ "6Mr0g3GeQgN0jpT+aIOiKuW9fLts54+Ntj1NN40slqi3Y+/Yd6xhj+NgmbRvybZu\n"
|
||
|
+ "tnYFXKC0Q+QUf38horqG2Mc3/uh8MOm0eYUXwGJOdXYD\n"
|
||
|
+ "-----END CERTIFICATE-----\n",
|
||
|
+ NULL
|
||
|
+};
|
||
|
+
|
||
|
#if defined __clang__ || __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5)
|
||
|
# pragma GCC diagnostic push
|
||
|
# pragma GCC diagnostic ignored "-Wunused-variable"
|
||
|
@@ -4275,6 +4432,14 @@ static struct
|
||
|
{ "ed448 - ok", ed448, &ed448[0], GNUTLS_PROFILE_TO_VFLAGS(GNUTLS_PROFILE_ULTRA),
|
||
|
0, NULL, 1584352960, 1},
|
||
|
{ "superseding - ok", superseding, superseding_ca, 0, 0, 0, 1590928011 },
|
||
|
+ { "rsa-sha1 in trusted - ok",
|
||
|
+ rsa_sha1_in_trusted, rsa_sha1_in_trusted_ca,
|
||
|
+ GNUTLS_PROFILE_TO_VFLAGS(GNUTLS_PROFILE_MEDIUM),
|
||
|
+ 0, NULL, 1620052390, 1},
|
||
|
+ { "rsa-sha1 not in trusted - not ok",
|
||
|
+ rsa_sha1_not_in_trusted, rsa_sha1_not_in_trusted_ca,
|
||
|
+ GNUTLS_PROFILE_TO_VFLAGS(GNUTLS_PROFILE_MEDIUM),
|
||
|
+ GNUTLS_CERT_INSECURE_ALGORITHM | GNUTLS_CERT_INVALID, NULL, 1620118136, 1},
|
||
|
{ NULL, NULL, NULL, 0, 0}
|
||
|
};
|
||
|
|
||
|
--
|
||
|
2.31.1
|
||
|
|