1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-28 03:07:35 +00:00

Everywhere: Remove a bunch of redundant 'AK::' namespace prefixes

This is basically just for consistency, it's quite strange to see
multiple AK container types next to each other, some with and some
without the namespace prefix - we're 'using AK::Foo;' a lot and should
leverage that. :^)
This commit is contained in:
Linus Groh 2021-02-25 21:10:47 +01:00 committed by Andreas Kling
parent be9df404fd
commit e265054c12
73 changed files with 111 additions and 110 deletions

View file

@ -251,12 +251,12 @@ void TLSv12::build_random(PacketBuilder& builder)
u8 random_bytes[48];
size_t bytes = 48;
AK::fill_with_random(random_bytes, bytes);
fill_with_random(random_bytes, bytes);
// remove zeros from the random bytes
for (size_t i = 0; i < bytes; ++i) {
if (!random_bytes[i])
random_bytes[i--] = AK::get_random<u8>();
random_bytes[i--] = get_random<u8>();
}
if (m_context.is_server) {

View file

@ -33,7 +33,7 @@ namespace TLS {
ByteBuffer TLSv12::build_hello()
{
AK::fill_with_random(&m_context.local_random, 32);
fill_with_random(&m_context.local_random, 32);
auto packet_version = (u16)m_context.version;
auto version = (u16)m_context.version;

View file

@ -127,7 +127,7 @@ void TLSv12::update_packet(ByteBuffer& packet)
u8 iv[16];
Bytes iv_bytes { iv, 16 };
Bytes { m_context.crypto.local_aead_iv, 4 }.copy_to(iv_bytes);
AK::fill_with_random(iv_bytes.offset(4), 8);
fill_with_random(iv_bytes.offset(4), 8);
memset(iv_bytes.offset(12), 0, 4);
// write the random part of the iv out
@ -164,7 +164,7 @@ void TLSv12::update_packet(ByteBuffer& packet)
VERIFY(buffer_position == buffer.size());
auto iv = ByteBuffer::create_uninitialized(iv_size);
AK::fill_with_random(iv.data(), iv.size());
fill_with_random(iv.data(), iv.size());
// write it into the ciphertext portion of the message
ct.overwrite(header_size, iv.data(), iv.size());