xanderbailey commented on code in PR #3781:
URL: https://github.com/apache/iceberg-rust/pull/3781#discussion_r4721101750


##########
crates/iceberg/src/encryption/crypto.rs:
##########
@@ -112,7 +113,7 @@ impl SecureKey {
     /// Generates a new random key for the specified key size.
     pub fn generate(key_size: AesKeySize) -> Self {
         let mut key = vec![0u8; key_size.key_length()];
-        OsRng.fill_bytes(&mut key);
+        OsRng.unwrap_err().fill_bytes(&mut key);

Review Comment:
   Choosing not to make a larger break to the API to change this to `Result` 
since it would touch a number of methods up the stack like 
`generate_key_metadata` and the parquet writer. Seemingly, this only panics if 
the OS RNG itself fails, e.g. a seccomp policy blocking `getrandom` or an 
unseeded RNG early in boot, which the old `aead::OsRng` also panicked on.



-- 
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]

Reply via email to