go-gitea / gitea

Git with a cup of tea! Painless self-hosted all-in-one software development service, including Git hosting, code review, team collaboration, package registry and CI/CD
https://gitea.com
MIT License
43.79k stars 5.38k forks source link

Test_SSHParsePublicKey & Test_calcFingerprint failing with v1.22.1 #31624

Open Antiz96 opened 1 month ago

Antiz96 commented 1 month ago

Description

Hello,

I'm trying to build Gitea v1.22.1 on Arch-Linux using this PKGBUILD (which contains the build and test instructions) but the Test_SSHParsePublicKey & Test_calcFingerprint tests are failing during make test with the following error:

--- FAIL: Test_SSHParsePublicKey (0.02s)
    --- FAIL: Test_SSHParsePublicKey/dsa-1024 (0.01s)
        --- FAIL: Test_SSHParsePublicKey/dsa-1024/SSHKeygen (0.01s)
            ssh_key_test.go:54:
                        Error Trace:    /build/gitea/src/gitea/models/asymkey/ssh_key_test.go:54
                        Error:          %v
                        Test:           Test_SSHParsePublicKey/dsa-1024/SSHKeygen
                        Messages:       fail to parse public key: exec(6690e23b-34:SSHKeyGenParsePublicKey) failed: exit status 255(<nil>) stdout:  stderr: /tmp/gitea_keytest1623655349 is not a public key file.
                                         - /tmp/gitea_keytest1623655349 is not a public key file.
--- FAIL: Test_calcFingerprint (0.01s)
    --- FAIL: Test_calcFingerprint/dsa-1024 (0.00s)
        --- FAIL: Test_calcFingerprint/dsa-1024/SSHKeygen (0.00s)
            ssh_key_test.go:194:
                        Error Trace:    /build/gitea/src/gitea/models/asymkey/ssh_key_test.go:194
                        Error:          Received unexpected error:
                                        Unable to verify key content [result: /tmp/gitea_keytest3103963148 is not a public key file.
                                        ]
                        Test:           Test_calcFingerprint/dsa-1024/SSHKeygen
            ssh_key_test.go:195:
                        Error Trace:    /build/gitea/src/gitea/models/asymkey/ssh_key_test.go:195
                        Error:          Not equal:
                                        expected: "SHA256:fSIHQlpKMDsGPVAXI8BPYfRp+e2sfvSt1sMrPsFiXrc"
                                        actual  : ""

                                        Diff:
                                        --- Expected
                                        +++ Actual
                                        @@ -1 +1 @@
                                        -SHA256:fSIHQlpKMDsGPVAXI8BPYfRp+e2sfvSt1sMrPsFiXrc
                                        +
                        Test:           Test_calcFingerprint/dsa-1024/SSHKeygen
FAIL

Full test logs are available in the Log Gist below.

I remain available if you need any additional information :)

Gitea Version

v1.22.1

Can you reproduce the bug on the Gitea demo site?

No

Log Gist

https://gist.github.com/Antiz96/075b96710a491e1df2d4510955a52abf#file-check-logs

Screenshots

No response

Git Version

2.45.2

Operating System

Arch Linux

How are you running Gitea?

NA

Database

None

techknowlogick commented 1 month ago

Thanks for the report @Antiz96. I'm wondering since those keys that are being tested are DSA-1024 and they shouldn't really be used that on newer versions of ssh-keygen being used have those disabled (or hidden behind some flag). I think we should probably stop testing against them (by either disabling the test or by testing against different, stronger, keys), as they are already below our default minimum.

Antiz96 commented 2 weeks ago

Alright, thanks for the info! Makes sense.

I disabled those two tests on Arch side for now.