aboutsummaryrefslogtreecommitdiffstats
path: root/src/libstrongswan/plugins/gmp/gmp_rsa_private_key.c
diff options
context:
space:
mode:
authorMartin Willi <martin@revosec.ch>2010-08-10 14:38:44 +0200
committerMartin Willi <martin@revosec.ch>2010-08-10 18:46:30 +0200
commit33ddaaabec136e358bf38a6aeb7855f466603007 (patch)
tree859a922eddbf0810e7e8917afdbde1a7a8de22b7 /src/libstrongswan/plugins/gmp/gmp_rsa_private_key.c
parent3547a9b87de314d31f88adb8a0098a885cdf7c5d (diff)
downloadstrongswan-33ddaaabec136e358bf38a6aeb7855f466603007.tar.bz2
strongswan-33ddaaabec136e358bf38a6aeb7855f466603007.tar.xz
Added support for different encryption schemes to private/public keys
Diffstat (limited to 'src/libstrongswan/plugins/gmp/gmp_rsa_private_key.c')
-rw-r--r--src/libstrongswan/plugins/gmp/gmp_rsa_private_key.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/libstrongswan/plugins/gmp/gmp_rsa_private_key.c b/src/libstrongswan/plugins/gmp/gmp_rsa_private_key.c
index a07ace296..e21e7131d 100644
--- a/src/libstrongswan/plugins/gmp/gmp_rsa_private_key.c
+++ b/src/libstrongswan/plugins/gmp/gmp_rsa_private_key.c
@@ -314,11 +314,18 @@ METHOD(private_key_t, sign, bool,
}
METHOD(private_key_t, decrypt, bool,
- private_gmp_rsa_private_key_t *this, chunk_t crypto, chunk_t *plain)
+ private_gmp_rsa_private_key_t *this, encryption_scheme_t scheme,
+ chunk_t crypto, chunk_t *plain)
{
chunk_t em, stripped;
bool success = FALSE;
+ if (scheme != ENCRYPT_RSA_PKCS1)
+ {
+ DBG1(DBG_LIB, "encryption scheme %N not supported",
+ encryption_scheme_names, scheme);
+ return FALSE;
+ }
/* rsa decryption using PKCS#1 RSADP */
stripped = em = rsadp(this, crypto);