Add a return value to crypter_t.decrypt()

This commit is contained in:
Martin Willi
2012-07-16 14:53:38 +02:00
parent e35abbe588
commit 3b96189a2a
17 changed files with 72 additions and 35 deletions
+5 -1
View File
@@ -134,7 +134,11 @@ static status_t pem_decrypt(chunk_t *blob, encryption_algorithm_t alg,
DBG1(DBG_ASN, " data size is not multiple of block size");
return PARSE_ERROR;
}
crypter->decrypt(crypter, *blob, iv, &decrypted);
if (!crypter->decrypt(crypter, *blob, iv, &decrypted))
{
crypter->destroy(crypter);
return FAILED;
}
crypter->destroy(crypter);
memcpy(blob->ptr, decrypted.ptr, blob->len);
chunk_free(&decrypted);