mirror of
https://github.com/moul/sshportal.git
synced 2025-01-11 01:47:46 +08:00
Merge pull request #124 from welderpb/master
[fix] unable to use encrypted ssh private keys
This commit is contained in:
commit
883bad2ee5
1 changed files with 3 additions and 3 deletions
|
@ -190,6 +190,9 @@ func ChannelHandler(srv *ssh.Server, conn *gossh.ServerConn, newChan gossh.NewCh
|
|||
func bastionClientConfig(ctx ssh.Context, host *dbmodels.Host) (*gossh.ClientConfig, error) {
|
||||
actx := ctx.Value(authContextKey).(*authContext)
|
||||
|
||||
crypto.HostDecrypt(actx.aesKey, host)
|
||||
crypto.SSHKeyDecrypt(actx.aesKey, host.SSHKey)
|
||||
|
||||
clientConfig, err := host.ClientConfig(dynamicHostKey(actx.db, host))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
@ -208,9 +211,6 @@ func bastionClientConfig(ctx ssh.Context, host *dbmodels.Host) (*gossh.ClientCon
|
|||
return nil, err2
|
||||
}
|
||||
|
||||
crypto.HostDecrypt(actx.aesKey, host)
|
||||
crypto.SSHKeyDecrypt(actx.aesKey, host.SSHKey)
|
||||
|
||||
switch action {
|
||||
case string(dbmodels.ACLActionAllow):
|
||||
case string(dbmodels.ACLActionDeny):
|
||||
|
|
Loading…
Reference in a new issue