summaryrefslogtreecommitdiffstats
path: root/openpgp/src/crypto/ecdh.rs
diff options
context:
space:
mode:
Diffstat (limited to 'openpgp/src/crypto/ecdh.rs')
-rw-r--r--openpgp/src/crypto/ecdh.rs3
1 files changed, 2 insertions, 1 deletions
diff --git a/openpgp/src/crypto/ecdh.rs b/openpgp/src/crypto/ecdh.rs
index d16de842..15228f59 100644
--- a/openpgp/src/crypto/ecdh.rs
+++ b/openpgp/src/crypto/ecdh.rs
@@ -1,5 +1,6 @@
//! Elliptic Curve Diffie-Hellman.
+use crate::vec_truncate;
use crate::Error;
use crate::packet::{
Key,
@@ -426,7 +427,7 @@ pub fn pkcs5_unpad(sk: Protected, target_len: usize) -> Result<Protected> {
}
if good {
- buf.truncate(target_len);
+ vec_truncate(&mut buf, target_len);
Ok(buf.into())
} else {
let sk: Protected = buf.into();