Open addd45 opened 1 week ago
It does seem like this was implemented incorrectly :(.
To set expectations, we probably won't be prioritizing any fixes or improvements in this repo until we have a need to update the SGX bindings.
Fair enough :).
If you prefer, and if I get some time, I could open up a PR to take out the registration part of code. I presume it would not break anything but want to be safe.
I'll need to spin back up on the what and why that I did there.
It seems like it should fail to link if one doesn't specify a get random function so doesn't seem like the force failure should be needed
So yes if you happen to get to creating a PR prior to I would be keen to reviewing it
I am unable to compile my library project which depends on mc-sgx-core-types when using a build target where os = none.
in mc-sgx-core-types lib.rs file, there is a call to register a custom getrandom method -
This is not the correct way to register a custom getrandom per the documentation for
register_custom_getrandom
, per the doc (and bolding relevant part):Thus, when adding
mc-sgx-core-sys-types
as a dependency and compiling with a target whereos=none
indeed a linker error occurs.By reading the comments I understand the goal is to default to an error scenario if no suitable get random implementation is available, but this should be something that is handled "down the line" where it is up to the users of the library to decide how they want to use getrandom. For example, my use case is to use rdrand which is something that can just be enabled with the "rdrand" feature for getrandom, but since mc-sgx-core-types enforces the "custom" feature (and the issues mentioned already), I am not able to use this library with my current build target