mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-10-30 01:27:31 +08:00
refactor: address panics due to indexing and slicing (#3233)
Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com>
This commit is contained in:
@ -279,7 +279,10 @@ impl DecodeMessage for GcmAes256 {
|
||||
.change_context(errors::CryptoError::DecodingFailed)?;
|
||||
|
||||
let nonce_sequence = NonceSequence::from_bytes(
|
||||
msg[..ring::aead::NONCE_LEN]
|
||||
msg.get(..ring::aead::NONCE_LEN)
|
||||
.ok_or(errors::CryptoError::DecodingFailed)
|
||||
.into_report()
|
||||
.attach_printable("Failed to read the nonce form the encrypted ciphertext")?
|
||||
.try_into()
|
||||
.into_report()
|
||||
.change_context(errors::CryptoError::DecodingFailed)?,
|
||||
|
||||
Reference in New Issue
Block a user