From 8305a49c3f7d5331d662c72e9956219fcfe37eae Mon Sep 17 00:00:00 2001 From: Aryan Bhosale <36108149+aryanbhosale@users.noreply.github.com> Date: Mon, 26 Aug 2024 21:28:29 +0530 Subject: [PATCH] "offline" verification using the bundle of attestations without any additional handling of the file (#9523) --- pkg/cmd/attestation/verification/attestation.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pkg/cmd/attestation/verification/attestation.go b/pkg/cmd/attestation/verification/attestation.go index 5feca47ea..c780e247c 100644 --- a/pkg/cmd/attestation/verification/attestation.go +++ b/pkg/cmd/attestation/verification/attestation.go @@ -2,6 +2,7 @@ package verification import ( "bufio" + "bytes" "encoding/json" "errors" "fmt" @@ -88,6 +89,10 @@ func loadBundlesFromJSONLinesFile(path string) ([]*api.Attestation, error) { var line []byte line, err = reader.ReadBytes('\n') for err == nil { + if len(bytes.TrimSpace(line)) == 0 { + line, err = reader.ReadBytes('\n') + continue + } var bundle bundle.ProtobufBundle bundle.Bundle = new(protobundle.Bundle) err = bundle.UnmarshalJSON(line)