Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
SUSE:SLE-12-SP1:GA
gnutls
0001-dummy_wait-correctly-account-the-length-fi...
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 0001-dummy_wait-correctly-account-the-length-field-in-SHA.patch of Package gnutls
From 2c439321fc2970f8f1b20e8d9d8e96e76c331c6e Mon Sep 17 00:00:00 2001 From: Anderson Toshiyuki Sasaki <ansasaki@redhat.com> Date: Wed, 20 Jun 2018 10:42:09 +0200 Subject: [PATCH 1/4] dummy_wait: correctly account the length field in SHA384 HMAC The existing lucky13 attack count-measures did not work correctly for SHA384 HMAC. The overall impact of that should not be significant as SHA384 is prioritized lower than SHA256 or SHA1 and thus it is not typically negotiated, unless a client prioritizes a SHA384 MAC, or a server only supports SHA384, and in both cases the vulnerability is only present if Encrypt-then-MAC (RFC7366) is unsupported by the peer. Relates #455 --- lib/algorithms/mac.c | 4 ++-- lib/gnutls_cipher.c | 15 +++++++++------ 2 files changed, 11 insertions(+), 8 deletions(-) Index: gnutls-3.2.15/lib/algorithms/mac.c =================================================================== --- gnutls-3.2.15.orig/lib/algorithms/mac.c 2018-08-27 13:29:11.880635018 +0200 +++ gnutls-3.2.15/lib/algorithms/mac.c 2018-08-27 13:53:10.794707547 +0200 @@ -31,9 +31,9 @@ static const mac_entry_st hash_algorithm {"SHA256", HASH_OID_SHA256, GNUTLS_MAC_SHA256, 32, 32, 0, 0, 1, 64}, {"SHA384", HASH_OID_SHA384, GNUTLS_MAC_SHA384, 48, 48, 0, 0, 1, - 64}, + 128}, {"SHA512", HASH_OID_SHA512, GNUTLS_MAC_SHA512, 64, 64, 0, 0, 1, - 64}, + 128}, {"SHA224", HASH_OID_SHA224, GNUTLS_MAC_SHA224, 28, 28, 0, 0, 1, 64}, {"UMAC-96", NULL, GNUTLS_MAC_UMAC_96, 12, 16, 8, 0, 1, 0}, Index: gnutls-3.2.15/lib/gnutls_cipher.c =================================================================== --- gnutls-3.2.15.orig/lib/gnutls_cipher.c 2018-08-27 13:29:10.588626307 +0200 +++ gnutls-3.2.15/lib/gnutls_cipher.c 2018-08-27 13:29:11.928635343 +0200 @@ -665,7 +665,7 @@ static void dummy_wait(record_parameters { /* this hack is only needed on CBC ciphers */ if (_gnutls_cipher_is_block(params->cipher) == CIPHER_BLOCK) { - unsigned len; + unsigned len, v; /* force an additional hash compression function evaluation to prevent timing * attacks that distinguish between wrong-mac + correct pad, from wrong-mac + incorrect pad. @@ -673,11 +673,14 @@ static void dummy_wait(record_parameters if (pad_failed == 0 && pad > 0) { len = _gnutls_mac_block_size(params->mac); if (len > 0) { - /* This is really specific to the current hash functions. - * It should be removed once a protocol fix is in place. - */ - if ((pad + total) % len > len - 9 - && total % len <= len - 9) { + if (params->mac && params->mac->id == GNUTLS_MAC_SHA384) + /* v = 1 for the hash function padding + 16 for message length */ + v = 17; + else /* v = 1 for the hash function padding + 8 for message length */ + v = 9; + + if ((pad + total) % len > len - v + && total % len <= len - v) { if (len < plaintext->size) _gnutls_auth_cipher_add_auth (¶ms->read.
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor