SetAttestationSignatureCheck sets the passed and result.message fields of the AttestationSignatureCheck to the given values.
(err error)
| 140 | |
| 141 | // SetAttestationSignatureCheck sets the passed and result.message fields of the AttestationSignatureCheck to the given values. |
| 142 | func (o *Output) SetAttestationSignatureCheckFromError(err error) { |
| 143 | metadata := map[string]interface{}{ |
| 144 | "code": "builtin.attestation.signature_check", |
| 145 | "title": "Attestation signature check passed", |
| 146 | "description": "The attestation signature matches available signing materials.", |
| 147 | } |
| 148 | var message string |
| 149 | |
| 150 | if err == nil { |
| 151 | o.AttestationSignatureCheck.Passed = true |
| 152 | message = "Pass" |
| 153 | log.Debug("Attestation signature check passed") |
| 154 | } else { |
| 155 | o.AttestationSignatureCheck.Passed = false |
| 156 | message = wrapCosignErrorMessage(err, "attestation", o.Policy) |
| 157 | log.Debug(message) |
| 158 | } |
| 159 | result := &evaluator.Result{Message: message, Metadata: metadata} |
| 160 | if !o.Detailed { |
| 161 | keepSomeMetadataSingle(*result) |
| 162 | } |
| 163 | o.AttestationSignatureCheck.Result = result |
| 164 | } |
| 165 | |
| 166 | // SetAttestationSyntaxCheck sets the passed and result.message fields of the AttestationSyntaxCheck to the given values. |
| 167 | func (o *Output) SetAttestationSyntaxCheckFromError(err error) { |