*subject_name_constraint,
*subject_alt_name_constraint;
- success = moonshot_get_identity ("user1@foo.baz",
- "",
+ success = moonshot_get_identity ("",
"",
+ "imap@project-moonshot.org",
&nai,
&password,
&server_certificate_hash,
if (success)
g_debug ("Got id: %s %s\n", nai, password);
+
moonshot_free (nai);
moonshot_free (password);
moonshot_free (server_certificate_hash);
model.get (iter,
Columns.IDCARD_COL, out id_card);
+
if (id_card == null)
return false;
-
- foreach (IdCard candidate in candidates)
+
+ if (candidates != null)
{
- debug ("candidates -- %s", candidate.display_name);
- if (candidate != id_card)
- return true;
+ bool is_candidate = false;
+ foreach (IdCard candidate in candidates)
+ {
+ if (candidate == id_card)
+ is_candidate = true;
+ }
+ if (!is_candidate)
+ return false;
}
string entry_text = search_entry.get_text ();
{
if (!match_service_pattern (request.service, rule.pattern))
continue;
-
+
candidates.append (id);
if (rule.always_confirm == "true")
confirm = true;
}
else
+ {
identity = candidates.nth_data (0);
+ confirm = false;
+ }
+ /* TODO: If candidate list empty return fail */
if (confirm)
{
if (reset_password)
identity.password = null;
- candidates = new SList<IdCard>();
+ candidates = null;
}
private void label_make_bold (Label label)
<always-confirm>true</always-confirm>
</rule>
<rule>
- <rule>
<pattern>imap@*moonshot.org</pattern>
<always-confirm>false</always-confirm>
</rule>
- </rule>
</selection-rules>
<trust-anchor>
<ca-cert>ABCDEFGHIJKLMNOPQRSTUVWXYZ123455678910</ca-cert>