Use IV length of a crypter instead of block size for IV calculations

This commit is contained in:
Martin Willi
2010-08-13 17:11:53 +02:00
parent f7c04c5b37
commit 3102d8669d
10 changed files with 48 additions and 38 deletions
+2 -2
View File
@@ -127,8 +127,8 @@ static status_t pem_decrypt(chunk_t *blob, encryption_algorithm_t alg,
}
crypter->set_key(crypter, key);
if (iv.len != crypter->get_block_size(crypter) ||
blob->len % iv.len)
if (iv.len != crypter->get_iv_size(crypter) ||
blob->len % crypter->get_block_size(crypter))
{
crypter->destroy(crypter);
DBG1(DBG_LIB, " data size is not multiple of block size");