We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9e092c1 commit 4eb070fCopy full SHA for 4eb070f
core/storage/encryption.rs
@@ -94,11 +94,15 @@ impl EncryptionKey {
94
95
match bytes.len() {
96
16 => {
97
- let key: [u8; 16] = bytes.try_into().unwrap();
+ let key: [u8; 16] = bytes.try_into().map_err(|_| {
98
+ LimboError::Corrupt("Failed to convert bytes to 16-byte key".into())
99
+ })?;
100
Ok(Self::Key128(key))
101
}
102
32 => {
- let key: [u8; 32] = bytes.try_into().unwrap();
103
+ let key: [u8; 32] = bytes.try_into().map_err(|_| {
104
+ LimboError::Corrupt("Failed to convert bytes to 32-byte key".into())
105
106
Ok(Self::Key256(key))
107
108
_ => Err(LimboError::InvalidArgument(format!(
0 commit comments