crypto: fix signature verification for initial commit #242

merged
opened by oppi.li targeting master from push-rqzvvtnzkzvq

initial commit does not have a parent commit and should be excluded from the signature check.

Signed-off-by: oppiliappan me@oppi.li

Changed files
+4 -2
crypto
+3 -1
crypto/verify.go
···
payload := strings.Builder{}
fmt.Fprintf(&payload, "tree %s\n", commit.Commit.Tree)
-
fmt.Fprintf(&payload, "parent %s\n", commit.Commit.Parent)
+
if commit.Commit.Parent != "" {
+
fmt.Fprintf(&payload, "parent %s\n", commit.Commit.Parent)
+
}
fmt.Fprintf(&payload, "author %s\n", author.String())
fmt.Fprintf(&payload, "committer %s\n", committer.String())
if commit.Commit.ChangedId != "" {
+1 -1
flake.nix
···
inherit (gitignore.lib) gitignoreSource;
in {
overlays.default = final: prev: let
-
goModHash = "sha256-ZckpIPqFk7/XBiEJUbmrAzdjAxV62hv896xqAXF2aZs=";
+
goModHash = "sha256-QPyeKKr7YMblwicQNemu3OamXwg7fVie6/IY10vQCl4=";
appviewDeps = {
inherit htmx-src lucide-src inter-fonts-src ibm-plex-mono-src goModHash gitignoreSource;
};