diff options
author | Nikos Mavrogiannopoulos <nmav@redhat.com> | 2017-07-03 10:06:22 +0200 |
---|---|---|
committer | Nikos Mavrogiannopoulos <nmav@redhat.com> | 2017-07-13 14:48:08 +0200 |
commit | 485f2551e68d1b4ee70be2960f0a241b4a2b9fb9 (patch) | |
tree | fa52b31a40673ab258eeb8d4b7cbb24129484da7 | |
parent | ed49ef7dea1198d27aff9b8b9cb399e2f77d7671 (diff) | |
download | gnutls-485f2551e68d1b4ee70be2960f0a241b4a2b9fb9.tar.gz |
tls sessions will not fail of insecure algorithms which are explicitly enabled
That is, if DSA-SHA1 is allowed, do not propagate errors from
gnutls_pubkey_verify_data2() due to SHA1 considered insecure, but rather
ignore such errors.
Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
-rw-r--r-- | lib/tls-sig.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/lib/tls-sig.c b/lib/tls-sig.c index 5c1e53a21f..6425c508c7 100644 --- a/lib/tls-sig.c +++ b/lib/tls-sig.c @@ -286,7 +286,10 @@ _gnutls_handshake_verify_data12(gnutls_session_t session, memcpy(dconcat.data+GNUTLS_RANDOM_SIZE, session->security_parameters.server_random, GNUTLS_RANDOM_SIZE); memcpy(dconcat.data+GNUTLS_RANDOM_SIZE*2, params->data, params->size); - ret = gnutls_pubkey_verify_data2(cert->pubkey, sign_algo, verify_flags, + /* Here we intentionally enable flag GNUTLS_VERIFY_ALLOW_BROKEN + * because we have checked whether the currently used signature + * algorithm is allowed in the session. */ + ret = gnutls_pubkey_verify_data2(cert->pubkey, sign_algo, verify_flags|GNUTLS_VERIFY_ALLOW_BROKEN, &dconcat, signature); if (ret < 0) gnutls_assert(); @@ -350,7 +353,10 @@ _gnutls_handshake_verify_crt_vrfy12(gnutls_session_t session, dconcat.data = session->internals.handshake_hash_buffer.data; dconcat.size = session->internals.handshake_hash_buffer_prev_len; - ret = gnutls_pubkey_verify_data2(cert->pubkey, sign_algo, verify_flags, + /* Here we intentionally enable flag GNUTLS_VERIFY_ALLOW_BROKEN + * because we have checked whether the currently used signature + * algorithm is allowed in the session. */ + ret = gnutls_pubkey_verify_data2(cert->pubkey, sign_algo, verify_flags|GNUTLS_VERIFY_ALLOW_BROKEN, &dconcat, signature); if (ret < 0) gnutls_assert(); |