1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 10:28:10 +00:00

AK: Add Endian.h header to replace NetworkOrdered.h.

This commit is contained in:
asynts 2020-08-25 15:11:15 +02:00 committed by Andreas Kling
parent ecf6cbbd02
commit 10c6f062b3
20 changed files with 195 additions and 106 deletions

View file

@ -24,6 +24,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include <AK/Endian.h>
#include <LibCore/DateTime.h>
#include <LibCore/Timer.h>
#include <LibCrypto/ASN1/DER.h>
@ -539,7 +540,7 @@ void TLSv12::consume(const ByteBuffer& record)
dbg() << "message buffer length " << buffer_length;
#endif
while (buffer_length >= 5) {
auto length = convert_between_host_and_network(*(u16*)m_context.message_buffer.offset_pointer(index + size_offset)) + header_size;
auto length = AK::convert_between_host_and_network_endian(*(u16*)m_context.message_buffer.offset_pointer(index + size_offset)) + header_size;
if (length > buffer_length) {
#ifdef TLS_DEBUG
dbg() << "Need more data: " << length << " | " << buffer_length;