share public ip as info

This commit is contained in:
Zack Scholl 2019-05-01 17:44:09 -06:00
parent b109b419de
commit 359dc4549b
1 changed files with 12 additions and 8 deletions

View File

@ -61,7 +61,7 @@ type Client struct {
Options Options Options Options
Pake *pake.Pake Pake *pake.Pake
Key crypt.Encryption Key crypt.Encryption
ExternalIP string ExternalIP, ExternalIPConnected string
// steps involved in forming relationship // steps involved in forming relationship
Step1ChannelSecured bool Step1ChannelSecured bool
@ -431,6 +431,7 @@ func (c *Client) processMessage(payload []byte) (done bool, err error) {
err = message.Send(c.conn[0], c.Key, message.Message{ err = message.Send(c.conn[0], c.Key, message.Message{
Type: "salt", Type: "salt",
Bytes: salt, Bytes: salt,
Message: c.ExternalIP,
}) })
if err != nil { if err != nil {
return return
@ -468,6 +469,7 @@ func (c *Client) processMessage(payload []byte) (done bool, err error) {
err = message.Send(c.conn[0], c.Key, message.Message{ err = message.Send(c.conn[0], c.Key, message.Message{
Type: "salt", Type: "salt",
Bytes: m.Bytes, Bytes: m.Bytes,
Message: c.ExternalIP,
}) })
} }
log.Debugf("session key is verified, generating encryption with salt: %x", m.Bytes) log.Debugf("session key is verified, generating encryption with salt: %x", m.Bytes)
@ -479,6 +481,8 @@ func (c *Client) processMessage(payload []byte) (done bool, err error) {
if err != nil { if err != nil {
return true, err return true, err
} }
c.ExternalIPConnected = m.Message
log.Debugf("connected as %s -> %s", c.ExternalIP, c.ExternalIPConnected)
c.Step1ChannelSecured = true c.Step1ChannelSecured = true
case "error": case "error":
// c.spinner.Stop() // c.spinner.Stop()