Skip to content

Conversation

@mikbras
Copy link

@mikbras mikbras commented Dec 13, 2019

This PR extends Open Enclave to load and measure .oeblob ELF sections if present. Once loaded, enclaves can access the blob with the following functions:

extern const void* __oe_get_blob_base(void);
extern size_t __oe_get_blob_size(void);

Blob sections can be added to enclave image files with the objcopy command as shown in the following example.

$ objcopy --add-section .oeblob=blob.txt --set-section-flags .oeblob=noload,readonly blob_enc blob_enc_with_blob

The blob test (tests/blob) shows how to use the feature end-to-end.

Copy link

@jhand2 jhand2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good from a technical perspective. I just have some questions about interfacing with this feature externally.

If we do intend for this feature to be used by callers other than OE internal code, we should add some documentation about what its for.

@@ -0,0 +1,88 @@
# Copyright (c) Microsoft Corporation. All rights reserved.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What are the constaints about what the blob can/should contain? It seems like comments are legal. Is it just up to enclave writer to throw whatever they want in here and use it as they wish or should OE expect some format?

unsigned char* data;
size_t size;

if (elf64_find_section(elf, ".oeblob", &data, &size) == 0)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should there be tooling in OE to add the oeblob section? Seems like an odd developer experience to tell people to add a section to their binary as they wish.

**==============================================================================
*/

const void* __oe_get_blob_base()
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are these intended to be public functions called by enclave developers (it seems no because its in an internal header)? If enclave writers are expected to be able to use this feature it probably makes sense to provide a public API and a reasoning for why one would use it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants