mirror of
https://github.com/ultravioletrs/cocos.git
synced 2026-06-23 04:10:25 +00:00
Fixed according to comments
This commit is contained in:
@@ -125,6 +125,9 @@ func (v *verifier) VerifyWithCoRIM(report []byte, manifest *corim.UnsignedCorim)
|
||||
if err := json.Unmarshal(resp.ClaimsJSON, &deviceClaims); err != nil {
|
||||
return fmt.Errorf("gpu: failed to parse claims JSON: %w", err)
|
||||
}
|
||||
if len(deviceClaims) == 0 {
|
||||
return fmt.Errorf("gpu: verifier response contained no device claims")
|
||||
}
|
||||
|
||||
return appraiseGPUClaims(deviceClaims, manifest)
|
||||
}
|
||||
|
||||
@@ -77,6 +77,9 @@ func TestGPUVerifierHelperProcess(t *testing.T) {
|
||||
case "verifier-invalid-claims-format":
|
||||
fmt.Fprintln(os.Stdout, `{"claims_json":[1,2,3]}`)
|
||||
os.Exit(0)
|
||||
case "verifier-empty-device-claims":
|
||||
fmt.Fprintln(os.Stdout, `{"claims_json":{}}`)
|
||||
os.Exit(0)
|
||||
default:
|
||||
var req helperRequest
|
||||
if err := json.NewDecoder(os.Stdin).Decode(&req); err != nil {
|
||||
@@ -196,6 +199,12 @@ func TestVerifierVerifyWithCoRIMErrors(t *testing.T) {
|
||||
report: []byte(`[{"nonce":"aabbcc"}]`),
|
||||
wantError: "gpu: failed to parse claims JSON",
|
||||
},
|
||||
{
|
||||
name: "empty device claims",
|
||||
binary: "verifier-empty-device-claims",
|
||||
report: []byte(`[{"nonce":"aabbcc"}]`),
|
||||
wantError: "gpu: verifier response contained no device claims",
|
||||
},
|
||||
}
|
||||
|
||||
for _, tt := range tests {
|
||||
|
||||
Reference in New Issue
Block a user