File size: 566 Bytes
6f72289
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
"""Bind a complete restricted reference installation without exposing private source to the actor."""
from pathlib import Path
from drb import load,require,sha,within
def check_verifier(task,root):
    record=load(task/"oracle/authorized_installation.json")
    private=within(root,record["directory"])
    for item in record["files"]:
        path=within(private,item["path"])
        require(path.is_file() and path.stat().st_size==item["bytes"] and sha(path)==item["sha256"],
                "Frozen private reference changed: "+item["path"])
    return private