aboutsummaryrefslogtreecommitdiffstats
path: root/src/tls/tlsv1_common.c
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2014-06-29 17:18:00 (GMT)
committerJouni Malinen <j@w1.fi>2014-07-02 09:38:47 (GMT)
commit2049a3c8749a66b302fcb105760997cc66805bbd (patch)
treea3db259d601d8fa707b3cfe419a0f2887bc7e21f /src/tls/tlsv1_common.c
parenta79aea531e695b2a35170feb37643dbfa3b6e1bb (diff)
downloadhostap-2049a3c8749a66b302fcb105760997cc66805bbd.zip
hostap-2049a3c8749a66b302fcb105760997cc66805bbd.tar.gz
hostap-2049a3c8749a66b302fcb105760997cc66805bbd.tar.bz2
TLS: Use os_memcmp_const() for hash/password comparisons
This makes the implementation less likely to provide useful timing information to potential attackers from comparisons of information received from a remote device and private material known only by the authorized devices. Signed-off-by: Jouni Malinen <j@w1.fi>
Diffstat (limited to 'src/tls/tlsv1_common.c')
-rw-r--r--src/tls/tlsv1_common.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/tls/tlsv1_common.c b/src/tls/tlsv1_common.c
index 8a4645b..ced28cf 100644
--- a/src/tls/tlsv1_common.c
+++ b/src/tls/tlsv1_common.c
@@ -481,7 +481,8 @@ int tls_verify_signature(u16 tls_version, struct crypto_public_key *pk,
}
#endif /* CONFIG_TLSV12 */
- if (buflen != data_len || os_memcmp(decrypted, data, data_len) != 0) {
+ if (buflen != data_len ||
+ os_memcmp_const(decrypted, data, data_len) != 0) {
wpa_printf(MSG_DEBUG, "TLSv1: Invalid Signature in CertificateVerify - did not match calculated hash");
os_free(buf);
*alert = TLS_ALERT_DECRYPT_ERROR;