conformance: 97 rules of 9 verifiers, 206 vectors; verify-layer and agents refuse a classical key under an ML-DSA-65 name; market-settlement reads the notarization time from the certified read; proof-of-ai README in English
This commit is contained in:
1 parent
c9f2932e04
commit
c9798a0013
111 files changed
+15871
-292
No files matched your search
@@ -94,6 +94,11 @@ def verdict(artifact, failed_by_level, reasons, passed, partial=None):
|
||||
|
||||
def judge_envelope(inp):
|
||||
env = inp.get('envelope')
|
||||
if isinstance(inp.get('raw'), str): # the text of a file, in place of the envelope: it may not be JSON at all
|
||||
try:
|
||||
env = json.loads(inp['raw'])
|
||||
except ValueError:
|
||||
return verdict('envelope', {'integrity': ['envelope.form']}, ['the file is not JSON'], {})
|
||||
ok_form = isinstance(env, dict) and isinstance(env.get('statement'), dict) and isinstance(env.get('statementHash'), str) and bool(H64.match(env['statementHash']))
|
||||
if not ok_form:
|
||||
return verdict('envelope', {'integrity': ['envelope.form']}, ['the envelope lacks a statement (object) and a statementHash (0x + 64 hex)'], {})
|
||||
|
||||
Reference in new issue
Block a user