diff options
author | lash <nolash@users.noreply.github.com> | 2018-12-18 22:23:32 +0800 |
---|---|---|
committer | Anton Evangelatov <anton.evangelatov@gmail.com> | 2018-12-18 22:23:32 +0800 |
commit | b01cfce36276379a95deb1001a6f1b6a048609de (patch) | |
tree | a0a604810266ba8c8a28982e6dfd582afa09fd84 /swarm/pss/handshake.go | |
parent | de4265fa028f2b0eb96a21e295028e0d19426adb (diff) | |
download | dexon-b01cfce36276379a95deb1001a6f1b6a048609de.tar dexon-b01cfce36276379a95deb1001a6f1b6a048609de.tar.gz dexon-b01cfce36276379a95deb1001a6f1b6a048609de.tar.bz2 dexon-b01cfce36276379a95deb1001a6f1b6a048609de.tar.lz dexon-b01cfce36276379a95deb1001a6f1b6a048609de.tar.xz dexon-b01cfce36276379a95deb1001a6f1b6a048609de.tar.zst dexon-b01cfce36276379a95deb1001a6f1b6a048609de.zip |
swarm/pss: Reduce input vulnerabilities (#18304)
Diffstat (limited to 'swarm/pss/handshake.go')
-rw-r--r-- | swarm/pss/handshake.go | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/swarm/pss/handshake.go b/swarm/pss/handshake.go index 5486abafa..bb67b5156 100644 --- a/swarm/pss/handshake.go +++ b/swarm/pss/handshake.go @@ -321,9 +321,7 @@ func (ctl *HandshakeController) handleKeys(pubkeyid string, keymsg *handshakeMsg for _, key := range keymsg.Keys { sendsymkey := make([]byte, len(key)) copy(sendsymkey, key) - var address PssAddress - copy(address[:], keymsg.From) - sendsymkeyid, err := ctl.pss.setSymmetricKey(sendsymkey, keymsg.Topic, &address, false, false) + sendsymkeyid, err := ctl.pss.setSymmetricKey(sendsymkey, keymsg.Topic, PssAddress(keymsg.From), false, false) if err != nil { return err } @@ -356,7 +354,7 @@ func (ctl *HandshakeController) handleKeys(pubkeyid string, keymsg *handshakeMsg func (ctl *HandshakeController) sendKey(pubkeyid string, topic *Topic, keycount uint8) ([]string, error) { var requestcount uint8 - to := &PssAddress{} + to := PssAddress{} if _, ok := ctl.pss.pubKeyPool[pubkeyid]; !ok { return []string{}, errors.New("Invalid public key") } else if psp, ok := ctl.pss.pubKeyPool[pubkeyid][*topic]; ok { @@ -564,5 +562,5 @@ func (api *HandshakeAPI) SendSym(symkeyid string, topic Topic, msg hexutil.Bytes api.ctrl.symKeyIndex[symkeyid].count++ log.Trace("increment symkey send use", "symkeyid", symkeyid, "count", api.ctrl.symKeyIndex[symkeyid].count, "limit", api.ctrl.symKeyIndex[symkeyid].limit, "receiver", common.ToHex(crypto.FromECDSAPub(api.ctrl.pss.PublicKey()))) } - return + return err } |