Skip to content

Commit

Permalink
fix validation error
Browse files Browse the repository at this point in the history
Signed-off-by: Asra Ali <asraa@google.com>
  • Loading branch information
asraa committed Nov 19, 2021
1 parent 57b3fef commit 55e78f8
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions pkg/types/hashedrekord/v0.0.1/entry.go
Original file line number Diff line number Diff line change
Expand Up @@ -158,16 +158,15 @@ func (v *V001Entry) validate() error {
}
v.sigObj, err = artifactFactory.NewSignature(bytes.NewReader(sig.Content))
if err != nil {
return errors.Wrap(err, "creating new signature object")
}
return types.ValidationError(err)

key := sig.PublicKey
if key == nil {
return types.ValidationError(errors.New("missing public key"))
}
v.keyObj, err = artifactFactory.NewPublicKey(bytes.NewReader(key.Content))
if err != nil {
return errors.Wrap(err, "creating new public key object")
return types.ValidationError(err)
}

data := v.HashedRekordObj.Data
Expand Down

0 comments on commit 55e78f8

Please sign in to comment.