charon-cmd: match_me/match_other are optional in callback credentials
authorTobias Brunner <tobias@strongswan.org>
Fri, 12 Apr 2013 17:32:01 +0000 (19:32 +0200)
committerTobias Brunner <tobias@strongswan.org>
Wed, 8 May 2013 13:02:40 +0000 (15:02 +0200)
src/charon-cmd/cmd/cmd_creds.c

index 9a37edf..4626c6d 100644 (file)
@@ -96,7 +96,14 @@ static shared_key_t* callback_shared(private_cmd_creds_t *this,
                return NULL;
        }
        this->prompted = TRUE;
-       *match_me = *match_other = ID_MATCH_PERFECT;
+       if (match_me)
+       {
+               *match_me = ID_MATCH_PERFECT;
+       }
+       if (match_other)
+       {
+               *match_other = ID_MATCH_PERFECT;
+       }
        return shared_key_create(type, chunk_clone(chunk_from_str(pwd)));
 }