Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Paramerterize shared library values #489

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions dcap/ql/src/quote_enclave.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,13 @@ pub struct PathInitializer;

static PATH_INITIALIZER: Lazy<Mutex<Option<PathInitializer>>> = Lazy::new(|| Mutex::new(None));

const QUOTING_ENCLAVE: &str = "/usr/lib/x86_64-linux-gnu/libsgx_qe3.signed.so.1";
Copy link
Collaborator

Choose a reason for hiding this comment

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

I read the following from the motivation

Library names should not be hardcoded. The paths are not universal across Linux distributions.

but I'm not quite seeing how this address that. The paths are still hardcoded and aren't handling the different linux distributions.

I'm not advocating for logic to handle the different linux distributions here either. As it currently stands, it may be difficult to find the time to review a change such as that.


const PROVISIONING_CERTIFICATE_ENCLAVE: &str = "/usr/lib/x86_64-linux-gnu/libsgx_pce.signed.so.1";


const ID_ENCLAVE: &str = "/usr/lib/x86_64-linux-gnu/libsgx_id_enclave.signed.so.1";

impl PathInitializer {
/// Try to initialize the paths to the default for the system
///
Expand All @@ -52,10 +59,10 @@ impl PathInitializer {
/// * [`Error::QuoteLibrary`] if any of the default paths don't exist on the system.
pub fn try_default() -> Result<()> {
Self::with_paths(
"/usr/lib/x86_64-linux-gnu/libsgx_qe3.signed.so.1",
"/usr/lib/x86_64-linux-gnu/libsgx_pce.signed.so.1",
QUOTING_ENCLAVE,
PROVISIONING_CERTIFICATE_ENCLAVE,
None::<&Path>,
"/usr/lib/x86_64-linux-gnu/libsgx_id_enclave.signed.so.1",
ID_ENCLAVE,
)
}

Expand Down