blackmwk commented on code in PR #2584:
URL: https://github.com/apache/iceberg-rust/pull/2584#discussion_r3585362389
##########
crates/iceberg/src/encryption/key_metadata.rs:
##########
@@ -97,7 +97,17 @@ impl StandardKeyMetadata {
/// Decodes from Java-compatible format.
pub fn decode(bytes: &[u8]) -> Result<Self> {
- _serde::StandardKeyMetadataV1::decode(bytes).map(Self::from)
+ let metadata =
_serde::StandardKeyMetadataV1::decode(bytes).map(Self::from)?;
+ // Validate the DEK is a usable AES key (16/24/32 bytes) up front, so a
+ // malformed key surfaces a clear error.
+ SecureKey::new(metadata.encryption_key.as_bytes()).map_err(|e| {
Review Comment:
I think we should add it since as a library the boundary should be api, and
it would be difficult to predicate how users may use it. I'm fine with doing it
in a follow up issue.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]