key length is not enough: got 2048, needs 3071 when adding a new ssh key #12331

Closed
opened 2025-11-02 10:05:53 -06:00 by GiteaMirror · 3 comments
Owner

Originally created by @laplantePierre on GitHub (Jan 12, 2024).

Description

I got this bug when adding a ssh key generated by ssh-keygen -t rsa

Gitea Version

Gitea version 1.22.0+dev-535-g34a068439 built with GNU Make 4.3, go1.21.5 : bindata, sqlite, sqlite_unlock_notify

Can you reproduce the bug on the Gitea demo site?

No

Log Gist

No response

Screenshots

Capture d’écran, le 2024-01-12 à 13 13 08

Git Version

git version 2.39.3

Operating System

nux eris.plcb.ca 5.14.0-362.13.1.el9_3.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Dec 21 07:12:43 EST 2023 x86_64 x86_64 x86_64 GNU/Linux

How are you running Gitea?

wget -O gitea https://dl.gitea.com/gitea/main/gitea-main-nightly-linux-amd64

Database

MySQL/MariaDB

Originally created by @laplantePierre on GitHub (Jan 12, 2024). ### Description I got this bug when adding a ssh key generated by ssh-keygen -t rsa ### Gitea Version Gitea version 1.22.0+dev-535-g34a068439 built with GNU Make 4.3, go1.21.5 : bindata, sqlite, sqlite_unlock_notify ### Can you reproduce the bug on the Gitea demo site? No ### Log Gist _No response_ ### Screenshots <img width="1047" alt="Capture d’écran, le 2024-01-12 à 13 13 08" src="https://github.com/go-gitea/gitea/assets/145718980/0b8427a1-4e14-4736-be84-7c1127df4213"> ### Git Version git version 2.39.3 ### Operating System nux eris.plcb.ca 5.14.0-362.13.1.el9_3.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Dec 21 07:12:43 EST 2023 x86_64 x86_64 x86_64 GNU/Linux ### How are you running Gitea? wget -O gitea https://dl.gitea.com/gitea/main/gitea-main-nightly-linux-amd64 ### Database MySQL/MariaDB
GiteaMirror added the type/bug label 2025-11-02 10:05:53 -06:00
Author
Owner

@wxiaoguang commented on GitHub (Jan 13, 2024):

ssh-keygen -b 4096 -t rsa ....

@wxiaoguang commented on GitHub (Jan 13, 2024): `ssh-keygen -b 4096 -t rsa ....`
Author
Owner

@laplantePierre commented on GitHub (Jan 13, 2024):

This is not a good solution. I will have to change my key evrywhere for your application. Is there a way to change that ?

@laplantePierre commented on GitHub (Jan 13, 2024): This is not a good solution. I will have to change my key evrywhere for your application. Is there a way to change that ?
Author
Owner

@wxiaoguang commented on GitHub (Jan 13, 2024):

See the app.example.ini

https://github.com/go-gitea/gitea/blob/main/custom/conf/app.example.ini#L1361

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;[ssh.minimum_key_sizes]
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;; Define allowed algorithms and their minimum key length (use -1 to disable a type)
;RSA = 3071 ; we allow 3071 here because an otherwise valid 3072 bit RSA key can be reported as having 3071 bit length

and

https://github.com/go-gitea/gitea/blob/main/custom/conf/app.example.ini#L234

;; Indicate whether to check minimum key size with corresponding type
;MINIMUM_KEY_SIZE_CHECK = false
@wxiaoguang commented on GitHub (Jan 13, 2024): See the app.example.ini https://github.com/go-gitea/gitea/blob/main/custom/conf/app.example.ini#L1361 ``` ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;[ssh.minimum_key_sizes] ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; Define allowed algorithms and their minimum key length (use -1 to disable a type) ;RSA = 3071 ; we allow 3071 here because an otherwise valid 3072 bit RSA key can be reported as having 3071 bit length ``` and https://github.com/go-gitea/gitea/blob/main/custom/conf/app.example.ini#L234 ``` ;; Indicate whether to check minimum key size with corresponding type ;MINIMUM_KEY_SIZE_CHECK = false ```
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#12331