aboutsummaryrefslogtreecommitdiffstats
path: root/src/libstrongswan/plugins/pem
diff options
context:
space:
mode:
authorMartin Willi <martin@revosec.ch>2012-07-06 16:11:15 +0200
committerMartin Willi <martin@revosec.ch>2012-07-16 14:53:38 +0200
commit3b96189a2afa4949e1d9cdf7c9fa8244d8d817f0 (patch)
tree16564618b94304c2bca7e925fc9e6693b6226161 /src/libstrongswan/plugins/pem
parente35abbe588636c5ca73d8aaa9082314289346bd9 (diff)
downloadstrongswan-3b96189a2afa4949e1d9cdf7c9fa8244d8d817f0.tar.bz2
strongswan-3b96189a2afa4949e1d9cdf7c9fa8244d8d817f0.tar.xz
Add a return value to crypter_t.decrypt()
Diffstat (limited to 'src/libstrongswan/plugins/pem')
-rw-r--r--src/libstrongswan/plugins/pem/pem_builder.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/libstrongswan/plugins/pem/pem_builder.c b/src/libstrongswan/plugins/pem/pem_builder.c
index c5d96be47..c1ce5c809 100644
--- a/src/libstrongswan/plugins/pem/pem_builder.c
+++ b/src/libstrongswan/plugins/pem/pem_builder.c
@@ -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);