Skip to content

Commit b34ee73

Browse files
authored
feat(ssh): support dynamic list of algorithms (gogs#7345)
1 parent 92f66c9 commit b34ee73

File tree

11 files changed

+134
-44
lines changed

11 files changed

+134
-44
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ All notable changes to Gogs are documented in this file.
1212
- New configuration option `[git.timeout] DIFF` for customizing operation timeout of `git diff`. [#6315](https://github.com/gogs/gogs/issues/6315)
1313
- New configuration option `[server] SSH_SERVER_MACS` for setting list of accepted MACs for connections to builtin SSH server. [#6434](https://github.com/gogs/gogs/issues/6434)
1414
- New configuration option `[repository] DEFAULT_BRANCH` for setting default branch name for new repositories. [#7291](https://github.com/gogs/gogs/issues/7291)
15+
- New configuration option `[server] SSH_SERVER_ALGORITHMS` for specifying the list of accepted key exchange algorithms for connections to builtin SSH server. [#7345](https://github.com/gogs/gogs/pull/7345)
1516
- Support specifying custom schema for PostgreSQL. [#6695](https://github.com/gogs/gogs/pull/6695)
1617
- Support rendering Mermaid diagrams in Markdown. [#6776](https://github.com/gogs/gogs/pull/6776)
1718
- Docker: Allow passing extra arguments to the `backup` command. [#7060](https://github.com/gogs/gogs/pull/7060)

conf/app.ini

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,8 @@ SSH_LISTEN_PORT = %(SSH_PORT)s
8383
SSH_SERVER_CIPHERS = aes128-ctr, aes192-ctr, aes256-ctr, aes128-gcm@openssh.com, arcfour256, arcfour128
8484
; The list of accepted MACs for connections to builtin SSH server.
8585
SSH_SERVER_MACS = hmac-sha2-256-etm@openssh.com, hmac-sha2-256, hmac-sha1
86+
; The list of accepted key exchange algorithms for connections to builtin SSH server.
87+
SSH_SERVER_ALGORITHMS = rsa, ecdsa, ed25519
8688

8789
; Define allowed algorithms and their minimum key length (use -1 to disable a type).
8890
[ssh.minimum_key_sizes]

conf/locale/locale_en-US.ini

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1209,6 +1209,7 @@ config.ssh.listen_host = Listen host
12091209
config.ssh.listen_port = Listen port
12101210
config.ssh.server_ciphers = Server ciphers
12111211
config.ssh.server_macs = Server MACs
1212+
config.ssh.server_algorithms = Server algorithms
12121213

12131214
config.repo_config = Repository configuration
12141215
config.repo.root_path = Root path

go.mod

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ require (
3636
github.com/russross/blackfriday v1.6.0
3737
github.com/satori/go.uuid v1.2.0
3838
github.com/sergi/go-diff v1.3.1
39+
github.com/sourcegraph/run v0.12.0
3940
github.com/stretchr/testify v1.8.1
4041
github.com/unknwon/cae v1.0.2
4142
github.com/unknwon/com v1.0.1
@@ -62,6 +63,7 @@ require (
6263
)
6364

6465
require (
66+
bitbucket.org/creachadair/shell v0.0.7 // indirect
6567
github.com/Azure/go-ntlmssp v0.0.0-20220621081337-cb9428e4ac1e // indirect
6668
github.com/aymerick/douceur v0.2.0 // indirect
6769
github.com/beorn7/perks v1.0.1 // indirect
@@ -72,9 +74,13 @@ require (
7274
github.com/cpuguy83/go-md2man/v2 v2.0.2 // indirect
7375
github.com/davecgh/go-spew v1.1.1 // indirect
7476
github.com/denisenkom/go-mssqldb v0.12.0 // indirect
77+
github.com/djherbis/buffer v1.2.0 // indirect
78+
github.com/djherbis/nio/v3 v3.0.1 // indirect
7579
github.com/dustin/go-humanize v1.0.0 // indirect
76-
github.com/fatih/color v1.9.0 // indirect
80+
github.com/fatih/color v1.13.0 // indirect
7781
github.com/go-asn1-ber/asn1-ber v1.5.4 // indirect
82+
github.com/go-logr/logr v1.2.3 // indirect
83+
github.com/go-logr/stdr v1.2.2 // indirect
7884
github.com/go-macaron/inject v0.0.0-20160627170012-d8a0b8677191 // indirect
7985
github.com/go-sql-driver/mysql v1.6.0 // indirect
8086
github.com/golang-sql/civil v0.0.0-20220223132316-b832511892a9 // indirect
@@ -85,6 +91,8 @@ require (
8591
github.com/gorilla/css v1.0.0 // indirect
8692
github.com/hashicorp/errwrap v1.0.0 // indirect
8793
github.com/hashicorp/go-multierror v1.1.1 // indirect
94+
github.com/itchyny/gojq v0.12.11 // indirect
95+
github.com/itchyny/timefmt-go v0.1.5 // indirect
8896
github.com/jackc/pgpassfile v1.0.0 // indirect
8997
github.com/jackc/pgservicefile v0.0.0-20221227161230-091c0ba34f0a // indirect
9098
github.com/jackc/pgx/v5 v5.2.0 // indirect
@@ -94,9 +102,9 @@ require (
94102
github.com/klauspost/compress v1.8.6 // indirect
95103
github.com/klauspost/cpuid v1.2.1 // indirect
96104
github.com/lib/pq v1.10.2 // indirect
97-
github.com/mattn/go-colorable v0.1.6 // indirect
105+
github.com/mattn/go-colorable v0.1.13 // indirect
98106
github.com/mattn/go-isatty v0.0.16 // indirect
99-
github.com/mattn/go-runewidth v0.0.9 // indirect
107+
github.com/mattn/go-runewidth v0.0.14 // indirect
100108
github.com/mattn/go-sqlite3 v2.0.3+incompatible // indirect
101109
github.com/matttproud/golang_protobuf_extensions v1.0.1 // indirect
102110
github.com/mcuadros/go-version v0.0.0-20190830083331-035f6764e8d2 // indirect
@@ -108,12 +116,16 @@ require (
108116
github.com/prometheus/common v0.37.0 // indirect
109117
github.com/prometheus/procfs v0.8.0 // indirect
110118
github.com/remyoudompheng/bigfft v0.0.0-20200410134404-eec4a21b6bb0 // indirect
119+
github.com/rivo/uniseg v0.2.0 // indirect
111120
github.com/russross/blackfriday/v2 v2.1.0 // indirect
112121
github.com/saintfish/chardet v0.0.0-20120816061221-3af4cd4741ca // indirect
113122
github.com/ssor/bom v0.0.0-20170718123548-6386211fdfcf // indirect
114-
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4 // indirect
123+
go.bobheadxi.dev/streamline v1.2.1 // indirect
124+
go.opentelemetry.io/otel v1.11.0 // indirect
125+
go.opentelemetry.io/otel/trace v1.11.0 // indirect
126+
golang.org/x/mod v0.7.0 // indirect
115127
golang.org/x/sys v0.4.0 // indirect
116-
golang.org/x/tools v0.1.12 // indirect
128+
golang.org/x/tools v0.4.0 // indirect
117129
google.golang.org/protobuf v1.28.1 // indirect
118130
gopkg.in/alexcesaro/quotedprintable.v3 v3.0.0-20150716171945-2caba252f4dc // indirect
119131
gopkg.in/bufio.v1 v1.0.0-20140618132640-567b2bfa514e // indirect

0 commit comments

Comments
 (0)