mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 18:47:44 +00:00
LibTLS + LibCrypto: Suppress unobserved Optoinal<T> return values.
This commit is contained in:
parent
125eab998f
commit
9572c95152
3 changed files with 4 additions and 4 deletions
|
@ -129,7 +129,7 @@ public:
|
||||||
virtual void decrypt(const ByteBuffer& in, ByteBuffer& out, Optional<ByteBuffer> ivec = {}) override
|
virtual void decrypt(const ByteBuffer& in, ByteBuffer& out, Optional<ByteBuffer> ivec = {}) override
|
||||||
{
|
{
|
||||||
// XOR (and thus CTR) is the most symmetric mode.
|
// XOR (and thus CTR) is the most symmetric mode.
|
||||||
this->encrypt(in, out, ivec);
|
(void)this->encrypt(in, out, ivec);
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
|
@ -117,7 +117,7 @@ void TLSv12::update_packet(ByteBuffer& packet)
|
||||||
auto view = ct.slice_view(header_size + iv_size, length);
|
auto view = ct.slice_view(header_size + iv_size, length);
|
||||||
|
|
||||||
// encrypt the message
|
// encrypt the message
|
||||||
m_aes_local->encrypt(buffer, view, iv);
|
(void)m_aes_local->encrypt(buffer, view, iv);
|
||||||
|
|
||||||
// store the correct ciphertext length into the packet
|
// store the correct ciphertext length into the packet
|
||||||
u16 ct_length = (u16)ct.size() - header_size;
|
u16 ct_length = (u16)ct.size() - header_size;
|
||||||
|
|
|
@ -197,7 +197,7 @@ void aes_cbc(const char* message, size_t len)
|
||||||
Crypto::Cipher::AESCipher::CBCMode cipher(ByteBuffer::wrap(secret_key, strlen(secret_key)), key_bits, Crypto::Cipher::Intent::Encryption);
|
Crypto::Cipher::AESCipher::CBCMode cipher(ByteBuffer::wrap(secret_key, strlen(secret_key)), key_bits, Crypto::Cipher::Intent::Encryption);
|
||||||
|
|
||||||
auto enc = cipher.create_aligned_buffer(buffer.size());
|
auto enc = cipher.create_aligned_buffer(buffer.size());
|
||||||
cipher.encrypt(buffer, enc, iv);
|
(void)cipher.encrypt(buffer, enc, iv);
|
||||||
|
|
||||||
if (binary)
|
if (binary)
|
||||||
printf("%.*s", (int)enc.size(), enc.data());
|
printf("%.*s", (int)enc.size(), enc.data());
|
||||||
|
@ -579,7 +579,7 @@ void aes_cbc_test_encrypt()
|
||||||
auto in = "This is a test! This is another test!"_b;
|
auto in = "This is a test! This is another test!"_b;
|
||||||
auto out = cipher.create_aligned_buffer(in.size());
|
auto out = cipher.create_aligned_buffer(in.size());
|
||||||
auto iv = ByteBuffer::create_zeroed(Crypto::Cipher::AESCipher::block_size());
|
auto iv = ByteBuffer::create_zeroed(Crypto::Cipher::AESCipher::block_size());
|
||||||
cipher.encrypt(in, out, iv);
|
(void)cipher.encrypt(in, out, iv);
|
||||||
if (out.size() != sizeof(result))
|
if (out.size() != sizeof(result))
|
||||||
FAIL(size mismatch);
|
FAIL(size mismatch);
|
||||||
else if (memcmp(out.data(), result, out.size()) != 0) {
|
else if (memcmp(out.data(), result, out.size()) != 0) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue