mirror of
https://github.com/gogs/gogs.git
synced 2025-12-24 01:00:00 +01:00
Configurable SSH cipher suite (#4109)
* Configurable SSH cipher suite * Maintain ordering
This commit is contained in:
@@ -148,8 +148,11 @@ func listen(config *ssh.ServerConfig, host string, port int) {
|
||||
}
|
||||
|
||||
// Listen starts a SSH server listens on given port.
|
||||
func Listen(host string, port int) {
|
||||
func Listen(host string, port int, ciphers []string) {
|
||||
config := &ssh.ServerConfig{
|
||||
Config: ssh.Config{
|
||||
Ciphers: ciphers,
|
||||
},
|
||||
PublicKeyCallback: func(conn ssh.ConnMetadata, key ssh.PublicKey) (*ssh.Permissions, error) {
|
||||
pkey, err := models.SearchPublicKeyByContent(strings.TrimSpace(string(ssh.MarshalAuthorizedKey(key))))
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user