Fix AllowedEncryptionPublicKeys so that it works in incoming connections and not outgoing ones

This commit is contained in:
Neil Alexander 2019-03-12 15:01:27 +00:00
parent 43643e0307
commit 229de91a3a
No known key found for this signature in database
GPG Key ID: A02A2019A2BB0944

View File

@ -175,7 +175,7 @@ func (intf *linkInterface) handler() error {
return errors.New("failed to connect: wrong version")
}
// Check if we're authorized to connect to this key / IP
if !intf.incoming && !intf.force && !intf.link.core.peers.isAllowedEncryptionPublicKey(&meta.box) {
if intf.incoming && !intf.force && !intf.link.core.peers.isAllowedEncryptionPublicKey(&meta.box) {
intf.link.core.log.Warnf("%s connection to %s forbidden: AllowedEncryptionPublicKeys does not contain key %s",
strings.ToUpper(intf.info.linkType), intf.info.remote, hex.EncodeToString(meta.box[:]))
intf.msgIO.close()