fix ineffassign
This commit is contained in:
parent
b2bb1c2529
commit
c972543c77
2 changed files with 10 additions and 4 deletions
|
|
@ -246,6 +246,10 @@ func NewSSHPiperConn(conn net.Conn, piper *SSHPiperConfig) (pipe *SSHPiperConn,
|
|||
if isQuery {
|
||||
// reply for query msg
|
||||
msg, err = p.validAndAck(mappedUser, upKey, downKey)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
} else {
|
||||
|
||||
ok, err := p.checkPublicKey(msg, downKey, sig)
|
||||
|
|
@ -259,10 +263,9 @@ func NewSSHPiperConn(conn net.Conn, piper *SSHPiperConfig) (pipe *SSHPiperConn,
|
|||
}
|
||||
|
||||
msg, err = p.signAgain(mappedUser, msg, signer, downKey)
|
||||
}
|
||||
|
||||
if err != nil {
|
||||
return nil, err
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
|
||||
return msg, nil
|
||||
|
|
|
|||
|
|
@ -320,6 +320,9 @@ func TestMapPublicKeyFromUserfile(t *testing.T) {
|
|||
}
|
||||
|
||||
signer, err = mapPublicKeyFromUserfile(stubConnMetadata{user}, privateKey.PublicKey())
|
||||
if err != nil {
|
||||
t.Fatalf("cant mapping key: %v", err)
|
||||
}
|
||||
if signer != nil {
|
||||
t.Fatalf("should not map private key when public key not in UserAuthorizedKeysFile")
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue