aws-nitro-enclaves-nsm-api icon indicating copy to clipboard operation
aws-nitro-enclaves-nsm-api copied to clipboard

The v0.2.0 release is unusable from crates.io

Open dreemkiller opened this issue 2 years ago • 0 comments

As the project is currently structured, the v0.2.0 release appears to be unusable when pulling from crates.io

As the code is currently structured/written, the only way to reasonably read a random number is using the nsm_lib::nsm_get_random. However, the nsm_lib code is unreachable when pulling the dependency from crates.io as follows in a Cargo.toml file:

aws-nitro-enclaves-nsm-api = "0.2.1"

since the nsm_lib library is placed as a sub-crate within the aws-nitro-enclaves-nsm-api crate, and cargo does not appear to have a way to reference crates this way.

This means that users wanting to pull random numbers from NSM need to specify the dependency as pulling from a tag on github as follows in a Cargo.toml file:

nsm_lib = { git = "https://github.com/aws/aws-nitro-enclaves-nsm-api.git/", tag = "v0.2.0", package = "nsm-lib", optional = true }

which is fine, but the aws-nitro-enclaves-nsm-api has been published to crates.io, so it was apparently your intention that this be possible.

There is evidence that there is work in progress to add accessor functions in aws-nitro-enclave-nsm-api for the nsm-lib functions (perhaps preventing us from having to use unsafe), but this work appears to be incomplete.

dreemkiller avatar Apr 20 '22 15:04 dreemkiller