diff options
author | Martin Willi <martin@revosec.ch> | 2010-08-13 12:20:25 +0200 |
---|---|---|
committer | Martin Willi <martin@revosec.ch> | 2010-08-13 17:11:53 +0200 |
commit | 3102d8669d3f39a138b954a6519c767b6c6c913e (patch) | |
tree | 108fd778ea7a9198e5cf2b02727c420ea0a28453 /src/libstrongswan/crypto | |
parent | f7c04c5b377ebb8274f2534b58676d20a153d73d (diff) | |
download | strongswan-3102d8669d3f39a138b954a6519c767b6c6c913e.tar.bz2 strongswan-3102d8669d3f39a138b954a6519c767b6c6c913e.tar.xz |
Use IV length of a crypter instead of block size for IV calculations
Diffstat (limited to 'src/libstrongswan/crypto')
-rw-r--r-- | src/libstrongswan/crypto/crypto_tester.c | 2 | ||||
-rw-r--r-- | src/libstrongswan/crypto/pkcs7.c | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/src/libstrongswan/crypto/crypto_tester.c b/src/libstrongswan/crypto/crypto_tester.c index 6d3521a25..77750cd71 100644 --- a/src/libstrongswan/crypto/crypto_tester.c +++ b/src/libstrongswan/crypto/crypto_tester.c @@ -121,7 +121,7 @@ static bool test_crypter(private_crypto_tester_t *this, key = chunk_create(vector->key, crypter->get_key_size(crypter)); crypter->set_key(crypter, key); - iv = chunk_create(vector->iv, crypter->get_block_size(crypter)); + iv = chunk_create(vector->iv, crypter->get_iv_size(crypter)); /* allocated encryption */ plain = chunk_create(vector->plain, vector->len); diff --git a/src/libstrongswan/crypto/pkcs7.c b/src/libstrongswan/crypto/pkcs7.c index 81416bc20..a4e0b952c 100644 --- a/src/libstrongswan/crypto/pkcs7.c +++ b/src/libstrongswan/crypto/pkcs7.c @@ -559,7 +559,7 @@ static bool parse_envelopedData(private_pkcs7_t *this, chunk_t serialNumber, DBG1(DBG_LIB, "IV could not be parsed"); goto end; } - if (iv.len != crypter->get_block_size(crypter)) + if (iv.len != crypter->get_iv_size(crypter)) { DBG1(DBG_LIB, "IV has wrong length"); goto end; @@ -752,7 +752,7 @@ bool build_envelopedData(private_pkcs7_t *this, x509_t *cert, rng->destroy(rng); rng = lib->crypto->create_rng(lib->crypto, RNG_WEAK); - rng->allocate_bytes(rng, crypter->get_block_size(crypter), &iv); + rng->allocate_bytes(rng, crypter->get_iv_size(crypter), &iv); DBG4(DBG_LIB, " initialization vector: %B", &iv); rng->destroy(rng); } |