summaryrefslogtreecommitdiff
path: root/keyDerivation.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'keyDerivation.cpp')
-rw-r--r--keyDerivation.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/keyDerivation.cpp b/keyDerivation.cpp
index 4ed87ad..dbef123 100644
--- a/keyDerivation.cpp
+++ b/keyDerivation.cpp
@@ -133,7 +133,9 @@ void KeyDerivation::generate(satp_prf_label label, seq_nr_t seq_nr, Buffer& key,
if( err )
cLog.msg(Log::PRIO_ERR) << "KeyDerivation::generate: Failed to reset cipher: " << gpg_strerror( err );
- err = gcry_cipher_setiv( cipher_ , iv.getBuf(16), 16);
+ u_int8_t *iv_buf = iv.getNewBuf(16);
+ err = gcry_cipher_setiv( cipher_ , iv_buf, 16);
+ delete[] iv_buf;
if( err )
cLog.msg(Log::PRIO_ERR) << "KeyDerivation::generate: Failed to set IV: " << gpg_strerror( err );