To answer the question for useful test cases, there are several "levels" of possible complexity.
Simple
Create test cases that ensure correct basic packet parsing.
Are lengths handled correctly?
What if the length prefix is too big?
What if the length prefix is too short
Can I extract the expected information correctly from my payload
Cases for valid packets
Cases for packets where the length part of the lenght-value encoding gives a false length (too long, too short)
Cases with maximum bytes of padding
Cases with no necessary padding
Cases with a "normal" amount of padding like, 7 bytes
These cases should be implementable without mocking etc.
Intermediate
Leverage the krach-test tool to create an integration test which successfully connects and authenticates.
More complex
These are test cases which verify the state of the handshake state maching. They most likely require quite advanced mocking.
"Turn" the handshake state machine step by step with known values (including potentially random generated ones) and verify it's expected state after each turn
Verify the "primitive" functions like MixKey, MixHash etc. with normal, extreme and invalid values
To answer the question for useful test cases, there are several "levels" of possible complexity.
Simple
Create test cases that ensure correct basic packet parsing.
Intermediate
Leverage the
krach-test
tool to create an integration test which successfully connects and authenticates.More complex
These are test cases which verify the state of the handshake state maching. They most likely require quite advanced mocking.
MixKey
,MixHash
etc. with normal, extreme and invalid values