Skip to content

Commit

Permalink
review changes
Browse files Browse the repository at this point in the history
  • Loading branch information
aditijannu committed Nov 29, 2024
1 parent 028f982 commit 4b5ed71
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion api-model/src/converter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -309,4 +309,4 @@ impl Default for DsmConfiguration {
dsm_url: "https://apps.amer.smartkey.io/".to_string(),
}
}
}
}
2 changes: 1 addition & 1 deletion api-model/src/enclave.rs
Original file line number Diff line number Diff line change
Expand Up @@ -155,4 +155,4 @@ impl Default for CcmBackendUrl {
port: 443,
}
}
}
}
2 changes: 1 addition & 1 deletion tools/container-converter/src/image_builder/enclave.rs
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ impl EnclaveSettings {
is_debug: converter_options.debug.unwrap_or(false),
enable_overlay_filesystem_persistence: converter_options.enable_overlay_filesystem_persistence.unwrap_or(false),
ccm_backend_url: CcmBackendUrl::new(converter_options.ccm_configuration.clone().unwrap_or_default().ccm_url.as_str()).unwrap_or_default(),
dsm_configuration: converter_options.dsm_configuration.clone().unwrap_or_default()
dsm_configuration: converter_options.dsm_configuration.clone().unwrap_or_default(),
}
}
}
Expand Down
8 changes: 4 additions & 4 deletions vsock-proxy/enclave/src/dsm_key_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@ struct ClientWithKey {
}

/// Information needed to connect to DSM as a client
pub struct ClientConnectionInfo<'a> {
pub fs_api_key: Option<String>,
pub auth_cert: Option<&'a mut CertificateResult>,
pub dsm_url: String,
pub(crate) struct ClientConnectionInfo<'a> {
pub(crate) fs_api_key: Option<String>,
pub(crate) auth_cert: Option<&'a mut CertificateResult>,
pub(crate) dsm_url: String,
}

fn dsm_create_client(conn_info: ClientConnectionInfo) -> Result<SdkmsClient, String> {
Expand Down
8 changes: 4 additions & 4 deletions vsock-proxy/enclave/src/file_system.rs
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ async fn get_key_file(
let dsm_url = conn_info.dsm_url.clone();
info!("Accessing DSM to store passkey in luks2 token");
let enc_resp = dsm_enc_with_overlayfs_key(conn_info, passkey)?;
create_luks2_token_input(TOKEN_IN_FILE, dsm_url, enc_resp)?;
create_luks2_token_input(TOKEN_IN_FILE, &dsm_url, enc_resp)?;

info!("Adding token object to the RW device");
update_luks_token(device_path, TOKEN_IN_FILE, TokenOp::Import).await?;
Expand All @@ -270,7 +270,7 @@ async fn get_key_file(
/// Generate the luks2 token object and write the same to
/// the json file which will be used to add a luks2 header
/// to the RW blockfile
fn create_luks2_token_input(token_path: &str, dsm_url: String, enc_resp: EncryptResponse) -> Result<(), String> {
fn create_luks2_token_input(token_path: &str, dsm_url: &String, enc_resp: EncryptResponse) -> Result<(), String> {
info!("Creating Luks2 token object");
let iv = enc_resp
.iv
Expand All @@ -283,7 +283,7 @@ fn create_luks2_token_input(token_path: &str, dsm_url: String, enc_resp: Encrypt
let token_object = LuksToken {
token_type: "Fortanix-sealing-key".to_string(),
key_slots: vec!["0".to_string()],
endpoint: dsm_url,
endpoint: dsm_url.into(),
isvsvn: None,
tag,
enc_key: enc_resp.cipher,
Expand Down Expand Up @@ -526,4 +526,4 @@ async fn generate_volume_passkey() -> Result<Blob, String> {

// Return key material as a blob
Ok(Blob::from(key_blob))
}
}

0 comments on commit 4b5ed71

Please sign in to comment.