diff options
Diffstat (limited to 'src/libstrongswan/plugins/blowfish')
-rw-r--r-- | src/libstrongswan/plugins/blowfish/blowfish_crypter.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/libstrongswan/plugins/blowfish/blowfish_crypter.c b/src/libstrongswan/plugins/blowfish/blowfish_crypter.c index b70ea22c1..01e6cf513 100644 --- a/src/libstrongswan/plugins/blowfish/blowfish_crypter.c +++ b/src/libstrongswan/plugins/blowfish/blowfish_crypter.c @@ -109,8 +109,11 @@ static void decrypt(private_blowfish_crypter_t *this, chunk_t data, chunk_t iv, out = data.ptr; } in = data.ptr; + iv = chunk_clone(iv); - BF_cbc_encrypt(in, out, data.len, &this->schedule, iv.ptr, 0); + BF_cbc_encrypt(in, out, data.len, &this->schedule, iv.ptr, 0); + + free(iv.ptr); } /** @@ -131,8 +134,11 @@ static void encrypt (private_blowfish_crypter_t *this, chunk_t data, chunk_t iv, out = data.ptr; } in = data.ptr; + iv = chunk_clone(iv); + + BF_cbc_encrypt(in, out, data.len, &this->schedule, iv.ptr, 1); - BF_cbc_encrypt(in, out, data.len, &this->schedule, iv.ptr, 1); + free(iv.ptr); } /** |