Skip to content

Commit ff2b628

Browse files
sarcasticadminFR4NK-W
authored andcommitted
provide better output for spkiCertVerify
1 parent 88e8553 commit ff2b628

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

fetcher/scion_cppki_verify.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,8 @@ func verifyTopologySignature(cfg *config.Config) error {
7070

7171
// verify the AS certificate chain (but not the payload signature) back to the TRCs of the ISD follows the
7272
// SCION CP PKI rules about cert type, key usage:
73-
if err = spkiCertVerify(ctx, sortedTRCsPaths, asCertChainPath); err != nil {
74-
return fmt.Errorf("unable to validate certificate chain: %w", err)
73+
if stdoutStderr, err := spkiCertVerify(ctx, sortedTRCsPaths, asCertChainPath); err != nil {
74+
return fmt.Errorf("unable to validate certificate chain: %s %w", stdoutStderr, err)
7575
}
7676

7777
var unvalidatedTopologyPath string

fetcher/scion_pki_tool_cmds.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ func spkiTRCExtractCerts(ctx context.Context, trustAnchorTRC, rootCertsBundlePat
1616

1717
// spkiCertVerify verifies the AS certificate asCertChainPath
1818
// against the sorted TRCs in the update chain trcsUpdateChain.
19-
func spkiCertVerify(ctx context.Context, trcsUpdateChain []string, asCertChainPath string) error {
19+
func spkiCertVerify(ctx context.Context, trcsUpdateChain []string, asCertChainPath string) ([]byte, error) {
2020
return exec.CommandContext(ctx, "scion-pki", "certificate", "verify",
21-
"--trc", strings.Join(trcsUpdateChain, ","), asCertChainPath).Run()
21+
"--trc", strings.Join(trcsUpdateChain, ","), asCertChainPath).CombinedOutput()
2222
}
2323

2424
// spkiTRCVerify verifies the TRC update chain for candidateTRCPath anchored in the TRCs trcUpdateChainPaths

0 commit comments

Comments
 (0)