diff options
Diffstat (limited to 'openpgp/src/crypto/mod.rs')
-rw-r--r-- | openpgp/src/crypto/mod.rs | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/openpgp/src/crypto/mod.rs b/openpgp/src/crypto/mod.rs index 33f27078..9dfec48e 100644 --- a/openpgp/src/crypto/mod.rs +++ b/openpgp/src/crypto/mod.rs @@ -1,7 +1,7 @@ //! Cryptographic primitives. use std::io::Read; -use std::ops::Deref; +use std::ops::{Deref, DerefMut}; use std::fmt; use std::cmp::Ordering; @@ -54,6 +54,12 @@ impl Deref for SessionKey { } } +impl DerefMut for SessionKey { + fn deref_mut(&mut self) -> &mut [u8] { + &mut self.0 + } +} + impl From<Vec<u8>> for SessionKey { fn from(v: Vec<u8>) -> Self { SessionKey(v.into_boxed_slice()) |