encrypt external ip

This commit is contained in:
Zack Scholl 2020-02-28 13:02:23 -08:00
parent 5fce2a2e27
commit c3adc2981f
1 changed files with 3 additions and 1 deletions

View File

@ -24,7 +24,6 @@ func (m Message) String() string {
// Send will send out
func Send(c *comm.Comm, key []byte, m Message) (err error) {
log.Debugf("writing %s message", m.Type)
mSend, err := Encode(key, m)
if err != nil {
return
@ -41,7 +40,10 @@ func Encode(key []byte, m Message) (b []byte, err error) {
}
b = compress.Compress(b)
if key != nil {
log.Debugf("writing %s message (encrypted)", m.Type)
b, err = crypt.Encrypt(b, key)
} else {
log.Debugf("writing %s message", m.Type)
}
return
}