mirror of
https://github.com/Mezeporta/Erupe.git
synced 2026-03-22 07:32:32 +01:00
test: fix issues in tests with cryptography
This commit is contained in:
@@ -10,6 +10,16 @@ import (
|
||||
"net"
|
||||
)
|
||||
|
||||
// Conn defines the interface for a packet-based connection.
|
||||
// This interface allows for mocking of connections in tests.
|
||||
type Conn interface {
|
||||
// ReadPacket reads and decrypts a packet from the connection
|
||||
ReadPacket() ([]byte, error)
|
||||
|
||||
// SendPacket encrypts and sends a packet on the connection
|
||||
SendPacket(data []byte) error
|
||||
}
|
||||
|
||||
// CryptConn represents a MHF encrypted two-way connection,
|
||||
// it automatically handles encryption, decryption, and key rotation via it's methods.
|
||||
type CryptConn struct {
|
||||
|
||||
Reference in New Issue
Block a user