private bool name_is_owned;
private bool show_requested;
public bool use_flat_file_store {public get; private set;}
+ public bool headless {public get; private set;}
#if OS_MACOS
public OSXApplication osxApp;
#endif
public IdentityManagerApp(bool headless, bool use_flat_file_store) {
+ this.headless = headless;
+
use_flat_file_store |= UserForcesFlatFileStore();
this.use_flat_file_store = use_flat_file_store;
IdentityManagerApp parent_app;
string userid;
string realm;
- string ca_hash;
+ string fingerprint;
public bool confirmed = false;
TrustAnchorConfirmationCallback callback = null;
public TrustAnchorConfirmationRequest(IdentityManagerApp parent_app,
string userid,
string realm,
- string ca_hash)
+ string fingerprint)
{
this.parent_app = parent_app;
this.userid = userid;
this.realm = realm;
- this.ca_hash = ca_hash;
+ this.fingerprint = fingerprint;
}
public void set_callback(owned TrustAnchorConfirmationCallback cb)
return false;
}
- if (card.trust_anchor.server_cert == ca_hash) {
+ logger.trace("execute: expected cert='%s'; fingerprint='%s'".printf(card.trust_anchor.server_cert, fingerprint));
+ if (card.trust_anchor.server_cert == fingerprint) {
logger.trace(@"execute: Fingerprint for $nai matches stored value; returning true.");
return_confirmation(true);
return false;
}
- var dialog = new TrustAnchorDialog(card, userid, realm, ca_hash);
+ if (parent_app.headless) {
+ logger.trace(@"execute: Running in headless mode; returning false.");
+ return_confirmation(false);
+ return false;
+ }
+
+ var dialog = new TrustAnchorDialog(card, userid, realm, fingerprint);
var response = dialog.run();
dialog.destroy();
bool is_confirmed = (response == ResponseType.OK);
if (is_confirmed) {
logger.trace(@"execute: Fingerprint confirmed; updating stored value.");
- card.trust_anchor.update_server_fingerprint(ca_hash);
+ card.trust_anchor.update_server_fingerprint(fingerprint);
parent_app.model.update_card(card);
}
public TrustAnchorDialog(IdCard card,
string userid,
string realm,
- string ca_hash)
+ string fingerprint)
{
string server_ta_label_text = _("Server’s trust anchor certificate (SHA-256 fingerprint):");
confirm_label.set_line_wrap(true);
confirm_label.set_width_chars(60);
- var trust_anchor_display = make_ta_fingerprint_widget(ca_hash, server_ta_label_text);
+ var trust_anchor_display = make_ta_fingerprint_widget(fingerprint, server_ta_label_text);
var vbox = new VBox(false, 0);
vbox.set_border_width(6);