mirror of
https://github.com/clearlinux/graphene.git
synced 2026-09-07 06:14:02 +00:00
[Pal/Linux-SGX] Add debug print of token and secs::miscselect
Signed-off-by: Isaku Yamahata <isaku.yamahata@gmail.com>
This commit is contained in:
committed by
Michał Kowalczyk
parent
5243cf1d95
commit
769cb6e1c1
@@ -52,6 +52,14 @@ int read_enclave_token(int token_file, sgx_arch_token_t * token)
|
||||
if (IS_ERR(bytes))
|
||||
return -ERRNO(bytes);
|
||||
|
||||
SGX_DBG(DBG_I, "read token:\n");
|
||||
SGX_DBG(DBG_I, " valid: 0x%08x\n", token->valid);
|
||||
SGX_DBG(DBG_I, " attr: 0x%016lx\n", token->attributes.flags);
|
||||
SGX_DBG(DBG_I, " xfrm: 0x%016lx\n", token->attributes.xfrm);
|
||||
SGX_DBG(DBG_I, " miscmask: 0x%08x\n", token->miscselect_mask);
|
||||
SGX_DBG(DBG_I, " attr_mask: 0x%016lx\n", token->attribute_mask.flags);
|
||||
SGX_DBG(DBG_I, " xfrm_mask: 0x%016lx\n", token->attribute_mask.xfrm);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -203,6 +211,7 @@ int create_enclave(sgx_arch_secs_t * secs,
|
||||
SGX_DBG(DBG_I, "enclave created:\n");
|
||||
SGX_DBG(DBG_I, " base: 0x%016lx\n", secs->baseaddr);
|
||||
SGX_DBG(DBG_I, " size: 0x%016lx\n", secs->size);
|
||||
SGX_DBG(DBG_I, " miscselect: 0x%08x\n", secs->miscselect);
|
||||
SGX_DBG(DBG_I, " attr: 0x%016lx\n", secs->attributes.flags);
|
||||
SGX_DBG(DBG_I, " xfrm: 0x%016lx\n", secs->attributes.xfrm);
|
||||
SGX_DBG(DBG_I, " ssaframesize: %ld\n", secs->ssaframesize);
|
||||
|
||||
@@ -764,6 +764,7 @@ static int load_enclave (struct pal_enclave * enclave,
|
||||
uri);
|
||||
return -EINVAL;
|
||||
}
|
||||
SGX_DBG(DBG_I, "token file: %s\n", uri);
|
||||
|
||||
/* Initialize the enclave */
|
||||
ret = initialize_enclave(enclave);
|
||||
|
||||
@@ -180,6 +180,7 @@ if __name__ == "__main__":
|
||||
print >>sys.stderr, " flags: %016x" % (bytes_to_int(attr['flags']))
|
||||
print >>sys.stderr, " xfrms: %016x" % (bytes_to_int(attr['xfrms']))
|
||||
print >>sys.stderr, " miscs: %08x" % (bytes_to_int(attr['miscs']))
|
||||
print >>sys.stderr, " miscmask: %08x" % (bytes_to_int(attr['miscmask']))
|
||||
print >>sys.stderr, " modulus: %s..." % (attr['modulus'].encode('hex')[:32])
|
||||
print >>sys.stderr, " exponent: %d" % (attr['exponent'])
|
||||
print >>sys.stderr, " signature: %s..." % (attr['signature'].encode('hex')[:32])
|
||||
|
||||
Reference in New Issue
Block a user