summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibTLS/Handshake.cpp
diff options
context:
space:
mode:
authorMichiel Visser <opensource@webmichiel.nl>2022-02-18 10:58:56 +0100
committerAli Mohammad Pur <Ali.mpfard@gmail.com>2022-02-23 13:20:28 +0330
commit898be38517286c5df4dd827bbad278246282e768 (patch)
treec7abae87301b30bd9296497c3d29b6fb402fc90e /Userland/Libraries/LibTLS/Handshake.cpp
parentbe138474c5d4b8aaa77cc710104c032d11dfd273 (diff)
downloadserenity-898be38517286c5df4dd827bbad278246282e768.zip
LibTLS: Add signature verification for DHE and ECDHE key exchange
This will verify that the signature of the ephemeral key used in the DHE and ECDHE key exchanges is actually generated by the server. This verification is done using the first certificate provided by the server, however the validity of this certificate is not checked here. Instead this code expects the validity to be checked earlier by `TLSv12::handle_certificate`.
Diffstat (limited to 'Userland/Libraries/LibTLS/Handshake.cpp')
-rw-r--r--Userland/Libraries/LibTLS/Handshake.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/Userland/Libraries/LibTLS/Handshake.cpp b/Userland/Libraries/LibTLS/Handshake.cpp
index 51fab9ddee..6a7c160546 100644
--- a/Userland/Libraries/LibTLS/Handshake.cpp
+++ b/Userland/Libraries/LibTLS/Handshake.cpp
@@ -489,6 +489,11 @@ ssize_t TLSv12::handle_handshake_payload(ReadonlyBytes vbuffer)
write_packet(packet);
break;
}
+ case Error::NotSafe: {
+ auto packet = build_alert(true, (u8)AlertDescription::DecryptError);
+ write_packet(packet);
+ break;
+ }
case Error::NeedMoreData:
// Ignore this, as it's not an "error"
dbgln_if(TLS_DEBUG, "More data needed");