From 7ff369a0a26cfd9803d58eeb0206204890779b79 Mon Sep 17 00:00:00 2001 From: Jack Lloyd Date: Tue, 28 Nov 2017 14:17:40 -0500 Subject: Tighten up checks on signature key exchange message An empty extension is not allowed, but was previously accepted. --- src/lib/tls/tls_extensions.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/lib') diff --git a/src/lib/tls/tls_extensions.cpp b/src/lib/tls/tls_extensions.cpp index 8f13b2c6d..d521f6bf8 100644 --- a/src/lib/tls/tls_extensions.cpp +++ b/src/lib/tls/tls_extensions.cpp @@ -586,7 +586,7 @@ Signature_Algorithms::Signature_Algorithms(TLS_Data_Reader& reader, { uint16_t len = reader.get_uint16_t(); - if(len + 2 != extension_size) + if(len + 2 != extension_size || len % 2 == 1 || len == 0) throw Decoding_Error("Bad encoding on signature algorithms extension"); while(len) -- cgit v1.2.3