Skip to content

Commit 5af804a

Browse files
committed
do not ignore fingerprint calc error
1 parent 64729ae commit 5af804a

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

services/asymkey/commit.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -400,14 +400,14 @@ func ParseCommitWithSSHSignature(ctx context.Context, c *git.Commit, committer *
400400
}
401401
// Trust more than one key for every User
402402
for _, k := range setting.Repository.Signing.TrustedSSHKeys {
403-
fingerprint, _ := asymkey_model.CalcFingerprint(k)
404-
commitVerification := verifySSHCommitVerification(c.Signature.Signature, c.Signature.Payload, &asymkey_model.PublicKey{
403+
if fingerprint, err := asymkey_model.CalcFingerprint(k); err != nil {
404+
log.Error("Error calculating the fingerprint public key: %s %v", k, err)
405+
} else if commitVerification := verifySSHCommitVerification(c.Signature.Signature, c.Signature.Payload, &asymkey_model.PublicKey{
405406
Verified: true,
406407
Content: k,
407408
Fingerprint: fingerprint,
408409
HasUsed: true,
409-
}, committer, committer, c.Committer.Email)
410-
if commitVerification != nil {
410+
}, committer, committer, c.Committer.Email); commitVerification != nil {
411411
return commitVerification
412412
}
413413
}

0 commit comments

Comments
 (0)