Skip to content

Commit

Permalink
Merge pull request #571 from csaf-poc/fingerprint-no-breaking
Browse files Browse the repository at this point in the history
Improve PGP fingerprint handling
  • Loading branch information
JanHoefelmeyer authored Sep 9, 2024
2 parents 108c2f5 + 5231b33 commit 464e88b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions cmd/csaf_checker/processor.go
Original file line number Diff line number Diff line change
Expand Up @@ -1447,9 +1447,9 @@ func (p *processor) checkWellknownSecurityDNS(domain string) error {
}

// checkPGPKeys checks if the OpenPGP keys are available and valid, fetches
// the the remotely keys and compares the fingerprints.
// As a result of these a respective error messages are passed to badPGP method
// in case of errors. It returns nil if all checks are passed.
// the remote pubkeys and compares the fingerprints.
// As a result of these checks respective error messages are passed
// to badPGP methods. It returns nil if all checks are passed.
func (p *processor) checkPGPKeys(_ string) error {

p.badPGPs.use()
Expand Down Expand Up @@ -1517,7 +1517,7 @@ func (p *processor) checkPGPKeys(_ string) error {
}

if !strings.EqualFold(ckey.GetFingerprint(), string(key.Fingerprint)) {
p.badPGPs.error("Fingerprint of public OpenPGP key %s does not match remotely loaded.", u)
p.badPGPs.error("Given Fingerprint (%q) of public OpenPGP key %q does not match remotely loaded (%q).", string(key.Fingerprint), u, ckey.GetFingerprint())
continue
}
if p.keys == nil {
Expand Down
2 changes: 1 addition & 1 deletion cmd/csaf_downloader/downloader.go
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ func (d *downloader) loadOpenPGPKeys(
if !strings.EqualFold(ckey.GetFingerprint(), string(key.Fingerprint)) {
slog.Warn(
"Fingerprint of public OpenPGP key does not match remotely loaded",
"url", u)
"url", u, "fingerprint", key.Fingerprint, "remote-fingerprint", ckey.GetFingerprint())
continue
}
if d.keys == nil {
Expand Down

0 comments on commit 464e88b

Please sign in to comment.