summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNikos Mavrogiannopoulos <nmav@gnutls.org>2013-03-27 18:50:11 +0100
committerNikos Mavrogiannopoulos <nmav@gnutls.org>2013-03-27 18:55:42 +0100
commit6a28be921c99c1e79d62522e926cdd85c5602af1 (patch)
tree7f64f86268ff2c397cba38260160d40f3d398086
parentf02e06292c2f83b92f8dd4f31c0e781a885ed5f3 (diff)
downloadgnutls-6a28be921c99c1e79d62522e926cdd85c5602af1.tar.gz
When in compatibility mode allow for a wrong version in the RSA PMS.
-rw-r--r--lib/auth/rsa.c7
-rw-r--r--lib/gnutls_int.h2
-rw-r--r--lib/gnutls_priority.c1
-rw-r--r--lib/gnutls_record.c2
4 files changed, 8 insertions, 4 deletions
diff --git a/lib/auth/rsa.c b/lib/auth/rsa.c
index e985776f4c..690fb5206f 100644
--- a/lib/auth/rsa.c
+++ b/lib/auth/rsa.c
@@ -185,8 +185,9 @@ proc_rsa_client_kx (gnutls_session_t session, uint8_t * data,
/* If the secret was properly formatted, then
* check the version number.
*/
- if (_gnutls_get_adv_version_major (session) != plaintext.data[0]
- || _gnutls_get_adv_version_minor (session) != plaintext.data[1])
+ if (_gnutls_get_adv_version_major (session) != plaintext.data[0] ||
+ (session->internals.priorities.allow_wrong_pms == 0 &&
+ _gnutls_get_adv_version_minor (session) != plaintext.data[1]))
{
/* No error is returned here, if the version number check
* fails. We proceed normally.
@@ -196,7 +197,7 @@ proc_rsa_client_kx (gnutls_session_t session, uint8_t * data,
*/
gnutls_assert ();
_gnutls_audit_log
- (session, "auth_rsa: Possible PKCS #1 version check format attack\n");
+ (session, "auth_rsa: Possible PKCS #1 version check format attack\n");
}
}
diff --git a/lib/gnutls_int.h b/lib/gnutls_int.h
index 437da73452..4058a804ea 100644
--- a/lib/gnutls_int.h
+++ b/lib/gnutls_int.h
@@ -585,12 +585,12 @@ struct gnutls_priority_st
safe_renegotiation_t sr;
unsigned int ssl3_record_version:1;
unsigned int server_precedence:1;
+ unsigned int allow_wrong_pms:1;
/* Whether stateless compression will be used */
unsigned int stateless_compression:1;
unsigned int additional_verify_flags;
};
-
/* DH and RSA parameters types.
*/
typedef struct gnutls_dh_params_int
diff --git a/lib/gnutls_priority.c b/lib/gnutls_priority.c
index 77d75a744a..178a49df00 100644
--- a/lib/gnutls_priority.c
+++ b/lib/gnutls_priority.c
@@ -915,6 +915,7 @@ gnutls_priority_init (gnutls_priority_t * priority_cache,
{
(*priority_cache)->no_padding = 1;
(*priority_cache)->allow_large_records = 1;
+ (*priority_cache)->allow_wrong_pms = 1;
}
else if (strcasecmp (&broken_list[i][1], "NO_EXTENSIONS") == 0)
{
diff --git a/lib/gnutls_record.c b/lib/gnutls_record.c
index e2542bac94..5331a87437 100644
--- a/lib/gnutls_record.c
+++ b/lib/gnutls_record.c
@@ -78,6 +78,8 @@ void
gnutls_record_disable_padding (gnutls_session_t session)
{
session->internals.priorities.no_padding = 1;
+ session->internals.priorities.allow_wrong_pms = 1;
+ session->internals.priorities.allow_large_records = 1;
}
/**