summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibTLS/HandshakeServer.cpp
diff options
context:
space:
mode:
authorMichiel Visser <opensource@webmichiel.nl>2022-03-18 10:39:34 +0100
committerAli Mohammad Pur <Ali.mpfard@gmail.com>2022-03-20 00:51:50 +0330
commit66d99c83d93252d0bebe51d80d0da8967d18f542 (patch)
treed6492a471b30926d3b223f838edff238dcccdd55 /Userland/Libraries/LibTLS/HandshakeServer.cpp
parentc1b041e761b99679a3998dbd81821febdecd2df9 (diff)
downloadserenity-66d99c83d93252d0bebe51d80d0da8967d18f542.zip
LibCrypto+LibTLS: Add SECP256r1 support to LibTLS
Add the required methods to SECP256r1 to conform to the EllipticCurve virtual base class. Using this updated version of SECP256r1, support in LibTLS is implemented.
Diffstat (limited to 'Userland/Libraries/LibTLS/HandshakeServer.cpp')
-rw-r--r--Userland/Libraries/LibTLS/HandshakeServer.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/Userland/Libraries/LibTLS/HandshakeServer.cpp b/Userland/Libraries/LibTLS/HandshakeServer.cpp
index 1e0866bcec..e263d82d4d 100644
--- a/Userland/Libraries/LibTLS/HandshakeServer.cpp
+++ b/Userland/Libraries/LibTLS/HandshakeServer.cpp
@@ -12,6 +12,7 @@
#include <LibCore/Timer.h>
#include <LibCrypto/ASN1/DER.h>
#include <LibCrypto/Curves/EllipticCurve.h>
+#include <LibCrypto/Curves/SECP256r1.h>
#include <LibCrypto/Curves/X25519.h>
#include <LibCrypto/Curves/X448.h>
#include <LibCrypto/PK/Code/EMSA_PKCS1_V1_5.h>
@@ -311,6 +312,9 @@ ssize_t TLSv12::handle_ecdhe_rsa_server_key_exchange(ReadonlyBytes buffer)
case NamedCurve::x448:
m_context.server_key_exchange_curve = make<Crypto::Curves::X448>();
break;
+ case NamedCurve::secp256r1:
+ m_context.server_key_exchange_curve = make<Crypto::Curves::SECP256r1>();
+ break;
default:
return (i8)Error::NotUnderstood;
}