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

Decode key used for image decryption #402

Closed
wants to merge 1 commit into from

Conversation

chendave
Copy link
Member

@chendave chendave commented Dec 7, 2023

The key should be base64 encoded if it's from a kbs repository, KMS or file system instead of plain text.

This align with other KBC module, suh as offline_fs_kbc.

let encoded_keys: HashMap<String, String> =
serde_json::from_str(&keys_json).map_err(|_| anyhow!("Failed to parse keys JSON file"))?;
encoded_keys
.iter()
.map(
|(k, v)| match base64::engine::general_purpose::STANDARD.decode(v) {
Ok(key) => Ok((k.clone(), key)),
Err(_) => Err(anyhow!("Failed to decode key")),
},
)

@chendave chendave requested a review from jialez0 as a code owner December 7, 2023 08:28
The key should be base64 encoded if it's from a kbs repository, KMS or
file system instead of plain text.

This align with other KBC module, such as `offline_fs_kbc`.

Signed-off-by: Dave Chen <[email protected]>
@chendave
Copy link
Member Author

chendave commented Dec 8, 2023

talked with @Xynnn007 , this is expected, the key is not base64 encoded.

@chendave chendave closed this Dec 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant