cryptography rework and beginning of tcp-chat-protocol
This commit is contained in:
10
src/network/tcp-chat-protocol/v1.c
Normal file
10
src/network/tcp-chat-protocol/v1.c
Normal file
@@ -0,0 +1,10 @@
|
||||
#include "v1.h"
|
||||
|
||||
Result(void) ClientHandshake_tryConstruct(ClientHandshake* ptr, Array(u8) session_key){
|
||||
Deferral(1);
|
||||
try_assert(session_key.size == AES_SESSION_KEY_SIZE);
|
||||
PacketHeader_construct(&ptr->header, PROTOCOL_VERSION, PacketType_ClientHandshake, session_key.size);
|
||||
memcpy(ptr->session_key, session_key.data, session_key.size);
|
||||
Return RESULT_VOID;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user