Skip to content

Commit 85bd3fb

Browse files
committed
Expanded minimum RSA Keylength to 3072
German Federal Office for Information Security requests in its technical guideline BSI TR-02102-1 RSA Keylength not shorter than 3000bits starting 2024, in the year 2023 3000bits as a recommendation. Gitea should request longer RSA Keys by default in favor of security and drop old clients which do not support shorter keys.
1 parent ead52dd commit 85bd3fb

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

custom/conf/app.example.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1339,7 +1339,7 @@ LEVEL = Info
13391339
;; Define allowed algorithms and their minimum key length (use -1 to disable a type)
13401340
;ED25519 = 256
13411341
;ECDSA = 256
1342-
;RSA = 2047 ; we allow 2047 here because an otherwise valid 2048 bit RSA key can be reported as having 2047 bit length
1342+
;RSA = 3071 ; we allow 3071 here because an otherwise valid 3072 bit RSA key can be reported as having 3071 bit length
13431343
;DSA = -1 ; set to 1024 to switch on
13441344

13451345
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

docs/content/administration/config-cheat-sheet.en-us.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -681,7 +681,7 @@ Define allowed algorithms and their minimum key length (use -1 to disable a type
681681

682682
- `ED25519`: **256**
683683
- `ECDSA`: **256**
684-
- `RSA`: **2047**: We set 2047 here because an otherwise valid 2048 RSA key can be reported as 2047 length.
684+
- `RSA`: **3071**: We set 3071 here because an otherwise valid 3072 RSA key can be reported as 3071 length.
685685
- `DSA`: **-1**: DSA is now disabled by default. Set to **1024** to re-enable but ensure you may need to reconfigure your SSHD provider
686686

687687
## Webhook (`webhook`)

docs/content/administration/config-cheat-sheet.zh-cn.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -648,7 +648,7 @@ Gitea 创建以下非唯一队列:
648648

649649
- `ED25519`**256**
650650
- `ECDSA`**256**
651-
- `RSA`**2047**:我们在这里设置为2047,因为一个其他方面有效的2048 RSA密钥可能被报告为2047长度
651+
- `RSA`**3071**:我们在这里设置为2047,因为一个其他方面有效的3072 RSA密钥可能被报告为3071长度
652652
- `DSA`**-1**:默认情况下禁用DSA。设置为**1024**以重新启用,但请注意可能需要重新配置您的SSHD提供者
653653

654654
## Webhook (`webhook`)

modules/setting/ssh.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ var SSH = struct {
6060
ServerMACs: []string{"[email protected]", "hmac-sha2-256", "hmac-sha1"},
6161
KeygenPath: "",
6262
MinimumKeySizeCheck: true,
63-
MinimumKeySizes: map[string]int{"ed25519": 256, "ed25519-sk": 256, "ecdsa": 256, "ecdsa-sk": 256, "rsa": 2047},
63+
MinimumKeySizes: map[string]int{"ed25519": 256, "ed25519-sk": 256, "ecdsa": 256, "ecdsa-sk": 256, "rsa": 3071},
6464
ServerHostKeys: []string{"ssh/gitea.rsa", "ssh/gogs.rsa"},
6565
AuthorizedKeysCommandTemplate: "{{.AppPath}} --config={{.CustomConf}} serv key-{{.Key.ID}}",
6666
PerWriteTimeout: PerWriteTimeout,

0 commit comments

Comments
 (0)