AC_PREREQ([2.63])
AC_INIT([Moonshot-ui],
- [1.0.3],
+ [1.0.4],
[moonshot-community@jiscmail.ac.uk],
[moonshot-ui],
[http://www.project-moonshot.org/])
Name: @PACKAGE@
Version: @VERSION@
-Release: 2%{?dist}
+Release: 1%{?dist}
Summary: Moonshot Federated Identity User Interface
Group: Security Tools
cert.chomp();
uchar[] binary = Base64.decode(cert);
- IdCard.logger.trace("get_expiration_date: encoded length=%d; decoded length=%d".printf(cert.length, binary.length));
+ IdCard.logger.trace("get_expiration_date: encoded length=%ld; decoded length=%d".printf(cert.length, binary.length));
char buf[64];
string err = (string) get_cert_valid_before(binary, binary.length, buf, 64);
{
// Export the certificate in PEM format.
- const string CERT_HEADER = "-----BEGIN CERTIFICATE-----\n";
- const string CERT_FOOTER = "\n-----END CERTIFICATE-----\n";
+ // const string CERT_HEADER = "-----BEGIN CERTIFICATE-----\n";
+ // const string CERT_FOOTER = "\n-----END CERTIFICATE-----\n";
+ string CERT_HEADER = "-----BEGIN CERTIFICATE-----\n";
+ string CERT_FOOTER = "\n-----END CERTIFICATE-----\n";
// Strip any embedded newlines in the certificate...
string cert = id.trust_anchor.ca_cert.replace("\n", "");
string filename = dialog.get_filename();
var file = File.new_for_path(filename);
var stream = file.replace(null, false, FileCreateFlags.PRIVATE);
+#if VALA_0_12
+ // Not sure if this works in 12; it definitely doesn't work in 10.
stream.write(newcert.data);
-
+#else
+ stream.write(newcert.data, newcert.length);
+#endif
// Save the parent directory to use as default for next save
export_directory = file.get_parent().get_path();
}
Columns.PASSWORD_COL, id_card.password);
}
- private IdCardWidget add_id_card_widget(IdCard id_card)
+ private void add_id_card_widget(IdCard id_card)
{
if (id_card == null) {
logger.trace("add_id_card_widget: id_card == null; returning.");
- return null;
+ return;
}
logger.trace("add_id_card_widget: id_card.nai='%s'; selected nai='%s'"
// at preventing duplicate NAIs.
this.selected_card = id_card;
}
- return id_card_widget;
}
private void widget_selected_cb(IdCardWidget id_card_widget)
}
#elif IPC_DBUS_GLIB
private void init_ipc_server() {
+ DBus.Connection? conn = null;
try {
- var conn = DBus.Bus.get(DBus.BusType.SESSION);
+ conn = DBus.Bus.get(DBus.BusType.SESSION);
dynamic DBus.Object bus = conn.get_object("org.freedesktop.DBus",
"/org/freedesktop/DBus",
"org.freedesktop.DBus");
private void init_ipc_server() {
this.ipc_server = new MoonshotServer(this);
bool shown = false;
- var our_name = "org.janet.Moonshot";
+ var our_name = "org.janet.Moonshot";
GLib.Bus.own_name(GLib.BusType.SESSION,
our_name,
GLib.BusNameOwnerFlags.NONE,
// Name acquired callback:
(conn, name) => {
logger.trace(@"init_ipc_server: name_acquired_closure; show_requested=$show_requested; conn="
- + (conn==null?"null":"non-null; name='" + name + "'"));
+ + (conn==null?"null":"non-null; name='" + name + "'"));
name_is_owned = true;
File dest = null;
// Make the directory if it doesn't already exist; ignore errors.
- try {
- File dir = File.new_for_path(config_dir);
+ try {
+ File dir = File.new_for_path(config_dir);
dest = dir.get_child(KEY_FILE_NAME);
- dir.make_directory_with_parents();
- } catch (Error e) {
+ dir.make_directory_with_parents();
+ } catch (Error e) {
logger().trace("save_keyfile: make_directory_with_parents threw error (this is usually ignorable) : " + e.message);
- }
+ }
// It would be nice to use key_file.save_to_file, but the binding doesn't exist
// in earlier versions of valac
// var ds = new DataOutputStream(s);
// ds.put_string(data);
string new_etag;
- dest.replace_contents(data.data, null, false, FileCreateFlags.REPLACE_DESTINATION | FileCreateFlags.PRIVATE, out new_etag);
+ dest.replace_contents(data, data.length, null, false, FileCreateFlags.REPLACE_DESTINATION | FileCreateFlags.PRIVATE, out new_etag);
}
catch(Error e) {
logger().error("save_keyfile: error when writing to file: " + e.message);
public void set_callback(owned TrustAnchorConfirmationCallback cb)
{
-// #if VALA_0_12
+#if VALA_0_12
this.callback = ((owned) cb);
-// #else
-// this.callback = ((IdCard) => cb(IdCard));
-// #endif
+#else
+ this.callback = ((IdCard) => cb(IdCard));
+#endif
}
public bool execute() {
random_chars[len] = 0;
string r = (string) random_chars;
var buf = entry.get_buffer();
+#if VALA_0_12
+ // Not sure if this works in 12; it definitely doesn't work in 10.
buf.set_text(r.data);
// Now delete the data
buf.delete_text(0, len);
+#else
+ string[] a = new string[1];
+ a[0] = r;
+ buf.set_text(a);
+
+ // Now delete the data
+ buf.delete_text(0, (int) len);
+#endif
}
static Gdk.Color white;