X-Git-Url: http://www.project-moonshot.org/gitweb/?p=moonshot-ui.git;a=blobdiff_plain;f=src%2Fmoonshot-identity-management-view.vala;h=6620ac041abc7d5e0588de21fd386b29dd07c639;hp=cea963bcb45d06a48079bb0254a1c0510bf90ce5;hb=e32b9690270bbb4c4152ce9672db5d11a81f98e1;hpb=e9560299e59bf0845693d3b0c79b4deb4c7a9a68 diff --git a/src/moonshot-identity-management-view.vala b/src/moonshot-identity-management-view.vala index cea963b..6620ac0 100644 --- a/src/moonshot-identity-management-view.vala +++ b/src/moonshot-identity-management-view.vala @@ -542,14 +542,19 @@ public class IdentityManagerView : Window { private void send_identity_cb(IdCard id) { - send_button.set_sensitive(false); - - IdCard identity = id; return_if_fail(request_queue.length > 0); - candidates = null; + if (!check_and_confirm_trust_anchor(id)) { + // Allow user to pick again + return; + } + var request = this.request_queue.pop_head(); - identity = check_add_password(identity, request, identities_manager); + var identity = check_add_password(id, request, identities_manager); + send_button.set_sensitive(false); + + candidates = null; + if (this.request_queue.is_empty()) { candidates = null; @@ -578,6 +583,34 @@ public class IdentityManagerView : Window { remember_identity_binding.hide(); } + private bool check_and_confirm_trust_anchor(IdCard id) + { + if (!id.trust_anchor.is_empty() && id.trust_anchor.get_anchor_type() == TrustAnchor.TYPE_ENTERPRISE) { + if (get_string_setting("TrustAnchors", id.nai) != id.trust_anchor.server_cert) { + + bool ret = false; + int result = ResponseType.CANCEL; + var dialog = new TrustAnchorDialog(id, this); + while (!dialog.complete) + result = dialog.run(); + + switch (result) { + case ResponseType.OK: + set_string_setting("TrustAnchors", id.nai, id.trust_anchor.server_cert); + ret = true; + break; + default: + break; + } + + dialog.destroy(); + return ret; + } + } + return true; + } + + // private void label_make_bold(Label label) // { // var font_desc = new Pango.FontDescription();