mirror of
https://github.com/shazow/ssh-chat.git
synced 2025-06-15 23:02:07 +03:00
Fixed key storage.
This commit is contained in:
parent
d5626b7514
commit
11e92b5718
@ -27,7 +27,7 @@ func MakeAuth(auth Auth) *ssh.ServerConfig {
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
perm := &ssh.Permissions{Extensions: map[string]string{
|
perm := &ssh.Permissions{Extensions: map[string]string{
|
||||||
"pubkey": string(ssh.MarshalAuthorizedKey(key)),
|
"pubkey": string(key.Marshal()),
|
||||||
}}
|
}}
|
||||||
return perm, nil
|
return perm, nil
|
||||||
},
|
},
|
||||||
@ -50,7 +50,7 @@ func MakeNoAuth() *ssh.ServerConfig {
|
|||||||
// Auth-related things should be constant-time to avoid timing attacks.
|
// Auth-related things should be constant-time to avoid timing attacks.
|
||||||
PublicKeyCallback: func(conn ssh.ConnMetadata, key ssh.PublicKey) (*ssh.Permissions, error) {
|
PublicKeyCallback: func(conn ssh.ConnMetadata, key ssh.PublicKey) (*ssh.Permissions, error) {
|
||||||
perm := &ssh.Permissions{Extensions: map[string]string{
|
perm := &ssh.Permissions{Extensions: map[string]string{
|
||||||
"pubkey": string(ssh.MarshalAuthorizedKey(key)),
|
"pubkey": string(key.Marshal()),
|
||||||
}}
|
}}
|
||||||
return perm, nil
|
return perm, nil
|
||||||
},
|
},
|
||||||
|
Loading…
x
Reference in New Issue
Block a user