mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-06 16:19:23 +00:00
LibTLS: Implement build_alert()
This commit is contained in:
parent
adab43987d
commit
0da07c284e
Notes:
sideshowbarker
2024-07-19 07:03:55 +09:00
Author: https://github.com/alimpfard
Commit: 0da07c284e
Pull-request: https://github.com/SerenityOS/serenity/pull/1661
Reviewed-by: https://github.com/Dexesttp
Reviewed-by: https://github.com/awesomekling
Reviewed-by: https://github.com/itamar8910
2 changed files with 19 additions and 6 deletions
|
@ -129,10 +129,17 @@ ByteBuffer TLSv12::build_hello()
|
|||
|
||||
ByteBuffer TLSv12::build_alert(bool critical, u8 code)
|
||||
{
|
||||
dbg() << "FIXME: build_alert";
|
||||
(void)critical;
|
||||
(void)code;
|
||||
return {};
|
||||
PacketBuilder builder(MessageType::Alert, (u16)m_context.version);
|
||||
builder.append((u8)(critical ? AlertLevel::Critical : AlertLevel::Warning));
|
||||
builder.append(code);
|
||||
|
||||
if (critical)
|
||||
m_context.critical_error = code;
|
||||
|
||||
auto packet = builder.build();
|
||||
update_packet(packet);
|
||||
|
||||
return packet;
|
||||
}
|
||||
|
||||
ByteBuffer TLSv12::build_finished()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue