aboutsummaryrefslogtreecommitdiffstats
path: root/src/libcharon/plugins/stroke
diff options
context:
space:
mode:
authorMartin Willi <martin@revosec.ch>2010-07-19 16:25:26 +0200
committerMartin Willi <martin@revosec.ch>2010-08-04 09:26:21 +0200
commit0d08ebe7acb8ea892e6c57e78bd648c0a04df92f (patch)
treee02ac3a320c9124a015b68f4a433df251c9eae31 /src/libcharon/plugins/stroke
parentaf007ed68ac066076f860608127488ab8ee30313 (diff)
downloadstrongswan-0d08ebe7acb8ea892e6c57e78bd648c0a04df92f.tar.bz2
strongswan-0d08ebe7acb8ea892e6c57e78bd648c0a04df92f.tar.xz
Pass type of requested key in the callback credential set
Diffstat (limited to 'src/libcharon/plugins/stroke')
-rw-r--r--src/libcharon/plugins/stroke/stroke_cred.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/libcharon/plugins/stroke/stroke_cred.c b/src/libcharon/plugins/stroke/stroke_cred.c
index 69e2054f8..16fc844ec 100644
--- a/src/libcharon/plugins/stroke/stroke_cred.c
+++ b/src/libcharon/plugins/stroke/stroke_cred.c
@@ -689,12 +689,18 @@ typedef struct {
* Callback function to receive Passphrases
*/
static shared_key_t* passphrase_cb(passphrase_cb_data_t *data,
+ shared_key_type_t type,
identification_t *me, identification_t *other,
id_match_t *match_me, id_match_t *match_other)
{
chunk_t secret;
char buf[256];
+ if (type != SHARED_ANY && type != SHARED_PRIVATE_KEY_PASS)
+ {
+ return NULL;
+ }
+
if (data->try > 1)
{
if (data->try > 5)
@@ -744,13 +750,18 @@ typedef struct {
/**
* Callback function to receive PINs
*/
-static shared_key_t* pin_cb(pin_cb_data_t *data,
+static shared_key_t* pin_cb(pin_cb_data_t *data, shared_key_type_t type,
identification_t *me, identification_t *other,
id_match_t *match_me, id_match_t *match_other)
{
chunk_t secret;
char buf[256];
+ if (type != SHARED_ANY && type != SHARED_PIN)
+ {
+ return NULL;
+ }
+
if (!me || !chunk_equals(me->get_encoding(me), data->keyid))
{
return NULL;