aws / aws-nitro-enclaves-nsm-api

This provides a library for interacting with the Nitro Secure Module, which provides Nitro Enclaves with attestation capability.
Apache License 2.0
62 stars 43 forks source link

driver: wrap fd returned from nsm_init in Option #54

Open crawford opened 10 months ago

crawford commented 10 months ago

Returning an Option instead of the raw file descriptor makes it easier for the caller to ensure that the file was opened successfully. It also forces them to handle any errors instead of allowing them to assume that it was successful, only to be met with "InternalError" when nsm_process_request is later used.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.