Added test to Packets and more

This commit is contained in:
Pablu23
2023-12-06 17:13:37 +01:00
parent 38876f6577
commit 5ccd83c9da
7 changed files with 68 additions and 7 deletions

View File

@@ -2,7 +2,7 @@
// Handshake or encryption setup here
1. Client sends request for file
2. Server answers with error or FileSize (possibly also Packetsize)
2. Server answers with error or FileSize
3. Client ack
4. Server sends File Packets with Sync to keep track
5. Server sends Sync End Packet
@@ -13,8 +13,15 @@
8. If Client has all packets, or retries has exceeded limit. Client sends Ack Packet for last Sync
9. Client and Server "close" / forget the connection
## Header
4 Byte Header Length | 4 Byte Request Flag (Request, Pte, Ack, File, End, Resend) | 4 Byte Sync | 4 Byte Data Length | x Byte Data
### Secure Header | Unencrypted
1 Byte RSA Flag | 24 Byte Nonce | 8 Byte Session ID | 4 Byte Encrypted Data Length
### Packet Header | Encrypted
1 Byte Header Type Flag | 4 Byte Sync
### Packet Structure
37 Byte Secure Header | 5 Byte Packet Header | <= 446 Byte Data | 16 Byte chacha20poly1305 overhead
### Data