Skip to content

Commit 67686ba

Browse files
committed
fix:
- Correct cipher suite identifier for TLS_AES_256_GCM_SHA384, {0x13, 0x02} should correspond to TLS_AES_256_GCM_SHA384.Ref: https://datatracker.ietf.org/doc/html/rfc8446#appendix-B.4 - remove the repeat check - use correct number N instead of this->n - move allochdl in list move operations
1 parent b8e070a commit 67686ba

File tree

5 files changed

+9
-12
lines changed

5 files changed

+9
-12
lines changed

include/fast_io_crypto/tls/cipher_suite.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ rfc
7878
*/
7979

8080
inline constexpr cipher_suite_type tls_aes_128_gcm_sha256{{::std::byte(0x13), ::std::byte(0x01)}};
81-
inline constexpr cipher_suite_type tls_aes_256_gcm_sha256{{::std::byte(0x13), ::std::byte(0x02)}};
81+
inline constexpr cipher_suite_type tls_aes_256_gcm_sha384{{::std::byte(0x13), ::std::byte(0x02)}};
8282
inline constexpr cipher_suite_type tls_chacha20_poly1305_sha256{{::std::byte(0x13), ::std::byte(0x03)}};
8383
inline constexpr cipher_suite_type tls_aes_128_ccm_sha256{{::std::byte(0x13), ::std::byte(0x04)}};
8484
inline constexpr cipher_suite_type tls_aes_128_ccm_8_sha256{{::std::byte(0x13), ::std::byte(0x05)}};
@@ -214,9 +214,9 @@ inline constexpr void print_define(output &outp, cipher_suite_type const &e)
214214
{
215215
print_freestanding(outp, u8"TLS_AES_128_GCM_SHA256{0x13,0x01}");
216216
}
217-
else if (e == tls_aes_256_gcm_sha256)
217+
else if (e == tls_aes_256_gcm_sha384)
218218
{
219-
print_freestanding(outp, u8"TLS_AES_256_GCM_SHA256{0x13,0x02}");
219+
print_freestanding(outp, u8"TLS_AES_256_GCM_SHA384{0x13,0x02}");
220220
}
221221
else if (e == tls_chacha20_poly1305_sha256)
222222
{

include/fast_io_crypto/tls/client_hello.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ struct client_hello
1313
::std::uint_least8_t session_id_length{32};
1414
::fast_io::freestanding::array<::std::uint_least8_t, 32> session_id{};
1515
::fast_io::freestanding::array<::std::uint_least8_t, 2> cipher_suite_length = {0x00, 0x02};
16-
cipher_suite::cipher_suite_type cipher_suite{cipher_suite::tls_aes_256_gcm_sha256};
16+
cipher_suite::cipher_suite_type cipher_suite{cipher_suite::tls_aes_256_gcm_sha384};
1717
::std::uint_least8_t number_of_compression_length = {0x01};
1818
::std::uint_least8_t compression_method = {};
1919
};

include/fast_io_dsal/array.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,6 @@
44
#error "You must be using a C++ compiler"
55
#endif
66

7-
#if !defined(__cplusplus)
8-
#error "You must be using a C++ compiler"
9-
#endif
10-
117
#include "../fast_io_core.h"
128
#include "impl/misc/push_macros.h"
139
#include "impl/misc/push_warnings.h"

include/fast_io_dsal/impl/index_span.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -273,11 +273,11 @@ class index_span
273273
#endif
274274
inline constexpr span_type subspan(size_type pos, size_type count = ::fast_io::containers::npos) const noexcept
275275
{
276-
if (this->n < pos) [[unlikely]]
276+
if (N < pos) [[unlikely]]
277277
{
278278
::fast_io::fast_terminate();
279279
}
280-
size_type const val{this->n - pos};
280+
size_type const val{N - pos};
281281
if (val < count)
282282
{
283283
if (count != ::fast_io::containers::npos) [[unlikely]]
@@ -295,7 +295,7 @@ class index_span
295295
#endif
296296
inline constexpr span_type subspan_unchecked(size_type pos, size_type count = ::fast_io::containers::npos) const noexcept
297297
{
298-
size_type const val{this->n - pos};
298+
size_type const val{N - pos};
299299
if (count == ::fast_io::containers::npos)
300300
{
301301
count = val;

include/fast_io_dsal/impl/list.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -907,7 +907,7 @@ class list
907907
}
908908

909909
inline constexpr list(list &&other) noexcept
910-
: imp(other.imp)
910+
: imp(other.imp), allochdl(std::move(other.allochdl))
911911
{
912912
auto prev = static_cast<::fast_io::containers::details::list_node_common *>(imp.prev);
913913
auto next = static_cast<::fast_io::containers::details::list_node_common *>(imp.next);
@@ -921,6 +921,7 @@ class list
921921
{
922922
this->destroy();
923923
imp = other.imp;
924+
allochdl = ::std::move(other.allochdl);
924925
auto prev = static_cast<::fast_io::containers::details::list_node_common *>(imp.prev);
925926
auto next = static_cast<::fast_io::containers::details::list_node_common *>(imp.next);
926927
next->prev = prev->next = __builtin_addressof(imp);

0 commit comments

Comments
 (0)