AUDIT changes
This commit is contained in:
@@ -29,8 +29,8 @@ type Packet struct {
|
||||
Signed []byte // Raw signed message for verification (incoming packet).
|
||||
}
|
||||
|
||||
// Marshal the packet into a buffer with prefixed signature.
|
||||
func (p Packet) Marshal(buf []byte, signKey *[64]byte) []byte {
|
||||
// marshal the packet into a buffer with prefixed signature.
|
||||
func (p Packet) marshal(buf []byte, signKey *[64]byte) []byte {
|
||||
buf[0] = p.PeerIP
|
||||
copy(buf[1:33], p.WGPubKey[:])
|
||||
binary.BigEndian.PutUint16(buf[33:35], p.WGPort)
|
||||
@@ -43,7 +43,7 @@ func (p Packet) Verify(buf []byte, pubKey *[32]byte) bool {
|
||||
return ok
|
||||
}
|
||||
|
||||
func Unmarshal(signed []byte) (p Packet) {
|
||||
func unmarshal(signed []byte) (p Packet) {
|
||||
buf := signed[signSize:]
|
||||
p.PeerIP = buf[0]
|
||||
copy(p.WGPubKey[:], buf[1:33])
|
||||
|
||||
Reference in New Issue
Block a user