]> git.ipfire.org Git - thirdparty/strongswan.git/commitdiff
Passing other as NULL should not always result in a match if me matches
authorMartin Willi <martin@strongswan.org>
Thu, 29 Oct 2009 16:37:36 +0000 (17:37 +0100)
committerMartin Willi <martin@strongswan.org>
Thu, 12 Nov 2009 09:34:01 +0000 (10:34 +0100)
src/charon/plugins/stroke/stroke_cred.c

index fbf4507c47cffcbb52af07b84aed96090ab185c4..627418bd36cd64921329af384ecf819043dd2c33 100644 (file)
@@ -220,7 +220,7 @@ static bool shared_filter(shared_data_t *data,
                                                  void **unused1, id_match_t *me,
                                                  void **unused2, id_match_t *other)
 {
-       id_match_t my_match = ID_MATCH_ANY, other_match = ID_MATCH_ANY;
+       id_match_t my_match = ID_MATCH_NONE, other_match = ID_MATCH_NONE;
        stroke_shared_key_t *stroke = *in;
        shared_key_t *shared = &stroke->shared;
 
@@ -237,7 +237,7 @@ static bool shared_filter(shared_data_t *data,
        {
                other_match = stroke->has_owner(stroke, data->other);
        }
-       if (!my_match && !other_match)
+       if ((data->me || data->other) && (!my_match && !other_match))
        {
                return FALSE;
        }