Avoid enumerating certificates with non-matching key type
[strongswan.git] / src / libcharon / plugins / stroke / stroke_ca.c
index 0432ee5..2c0df8f 100644 (file)
@@ -208,6 +208,11 @@ CALLBACK(certs_filter, bool,
                                        return TRUE;
                                }
                        }
                                        return TRUE;
                                }
                        }
+                       else
+                       {
+                               public->destroy(public);
+                               continue;
+                       }
                        public->destroy(public);
                }
                else if (data->key != KEY_ANY)
                        public->destroy(public);
                }
                else if (data->key != KEY_ANY)