| 1 | /* |
| 2 | * gnome-keyring |
| 3 | * |
| 4 | * Copyright (C) 2008 Stefan Walter |
| 5 | * |
| 6 | * This program is free software; you can redistribute it and/or modify |
| 7 | * it under the terms of the GNU Lesser General Public License as |
| 8 | * published by the Free Software Foundation; either version 2.1 of |
| 9 | * the License, or (at your option) any later version. |
| 10 | * |
| 11 | * This program is distributed in the hope that it will be useful, but |
| 12 | * WITHOUT ANY WARRANTY; without even the implied warranty of |
| 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 14 | * Lesser General Public License for more details. |
| 15 | * |
| 16 | * You should have received a copy of the GNU Lesser General Public |
| 17 | * License along with this program; if not, see <http://www.gnu.org/licenses/>. |
| 18 | */ |
| 19 | |
| 20 | #include "config.h"cxx . . $ `<file>/build/config.h`/ |
| 21 | |
| 22 | #include "gcr/gcr-icons.h"cxx . . $ `<file>/gcr/gcr-icons.h`/ |
| 23 | |
| 24 | #include "gcr-dialog-util.h"cxx . . $ `<file>/ui/gcr-dialog-util.h`/ |
| 25 | #include "gcr-secure-entry-buffer.h"cxx . . $ `<file>/ui/gcr-secure-entry-buffer.h`/ |
| 26 | #include "gcr-pkcs11-import-dialog.h"cxx . . $ `<file>/ui/gcr-pkcs11-import-dialog.h`/ |
| 27 | |
| 28 | #include "egg/egg-secure-memory.h"cxx . . $ `<file>/egg/egg-secure-memory.h`/ |
| 29 | |
| 30 | #include <gtk/gtk.h> |
| 31 | |
| 32 | #include <glib/gi18n-lib.h> |
| 33 | |
| 34 | EGG_SECURE_DECLAREcxx . . $ `egg/egg-secure-memory.h:76:9`! (import_dialog); |
| 35 | |
| 36 | enumcxx . . $ $anonymous_type_8b8eb7035a6e4819_0# { |
| 37 | PROP_0cxx . . $ PROP_0., |
| 38 | PROP_IMPORTERcxx . . $ PROP_IMPORTER. |
| 39 | }; |
| 40 | |
| 41 | struct _GcrPkcs11ImportDialogcxx . . $ _GcrPkcs11ImportDialog# { |
| 42 | GtkDialogcxx . . $ GtkDialog# parentcxx . . $ _GcrPkcs11ImportDialog#parent.; |
| 43 | GtkBuildercxx . . $ GtkBuilder# *buildercxx . . $ _GcrPkcs11ImportDialog#builder.; |
| 44 | GtkWidgetcxx . . $ GtkWidget# *password_areacxx . . $ _GcrPkcs11ImportDialog#password_area.; |
| 45 | GtkLabelcxx . . $ GtkLabel# *token_labelcxx . . $ _GcrPkcs11ImportDialog#token_label.; |
| 46 | GtkImagecxx . . $ GtkImage# *token_imagecxx . . $ _GcrPkcs11ImportDialog#token_image.; |
| 47 | GtkEntrycxx . . $ GtkEntry# *password_entrycxx . . $ _GcrPkcs11ImportDialog#password_entry.; |
| 48 | GtkEntrycxx . . $ GtkEntry# *label_entrycxx . . $ _GcrPkcs11ImportDialog#label_entry.; |
| 49 | gbooleancxx . . $ gboolean# label_changedcxx . . $ _GcrPkcs11ImportDialog#label_changed.; |
| 50 | }; |
| 51 | |
| 52 | G_DEFINE_TYPEcxx . . $ `<external>/9567554376676449156/gtype.h:1834:9`! (GcrPkcs11ImportDialog, _gcr_pkcs11_import_dialog, GTK_TYPE_DIALOGcxx . . $ `<external>/3867786087843934573/gtkdialog.h:89:9`!); |
| 53 | |
| 54 | static void |
| 55 | on_label_changedcxx . . $ on_label_changed(b6f270af3e5b8733). (GtkEditablecxx . . $ GtkEditable# *editable, |
| 56 | gpointercxx . . $ gpointer# user_data) |
| 57 | { |
| 58 | GcrPkcs11ImportDialogcxx . . $ GcrPkcs11ImportDialog# *self = GCR_PKCS11_IMPORT_DIALOGcxx . . $ GCR_PKCS11_IMPORT_DIALOG(7ffe5cdf8dc0f035). (user_data); |
| 59 | self->label_changedcxx . . $ _GcrPkcs11ImportDialog#label_changed. = TRUEcxx . . $ `<external>/12741050725406041920/gmacros.h:971:9`!; |
| 60 | } |
| 61 | |
| 62 | static void |
| 63 | _gcr_pkcs11_import_dialog_constructedcxx . . $ _gcr_pkcs11_import_dialog_constructed(6087475fa43034d3). (GObjectcxx . . $ GObject# *obj) |
| 64 | { |
| 65 | GcrPkcs11ImportDialogcxx . . $ GcrPkcs11ImportDialog# *self = GCR_PKCS11_IMPORT_DIALOGcxx . . $ GCR_PKCS11_IMPORT_DIALOG(7ffe5cdf8dc0f035). (obj); |
| 66 | GErrorcxx . . $ GError# *error = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 67 | GtkEntryBuffercxx . . $ GtkEntryBuffer# *buffer; |
| 68 | GtkWidgetcxx . . $ GtkWidget# *widget; |
| 69 | GtkBoxcxx . . $ GtkBox# *contents; |
| 70 | GtkWidgetcxx . . $ GtkWidget# *button; |
| 71 | |
| 72 | G_OBJECT_CLASScxx . . $ `<external>/1341695927569185362/gobject.h:61:9`! (_gcr_pkcs11_import_dialog_parent_class)->constructedcxx . . $ _GObjectClass#constructed. (obj); |
| 73 | |
| 74 | if (!gtk_builder_add_from_resourcecxx . . $ gtk_builder_add_from_resource(2513bc4cd9f803e2). (self->buildercxx . . $ _GcrPkcs11ImportDialog#builder., "/org/gnome/gcr/ui/gcr-pkcs11-import-dialog.ui", &error)) { |
| 75 | g_warningcxx . . $ `<external>/5169755362661750954/gmessages.h:365:9`! ("couldn't load ui builder file: %s", error->message); |
| 76 | return; |
| 77 | } |
| 78 | |
| 79 | /* Fill in the dialog from builder */ |
| 80 | widget = GTK_WIDGETcxx . . $ `<external>/6031079988677191796/gtkwidget.h:58:9`! (gtk_builder_get_object (self->builder, "pkcs11-import-dialog")); |
| 81 | contents = GTK_BOXcxx . . $ `<external>/14176280485027674556/gtkbox.h:40:9`! (gtk_dialog_get_content_area (GTK_DIALOGcxx . . $ `<external>/3867786087843934573/gtkdialog.h:90:9`! (self))); |
| 82 | gtk_box_pack_startcxx . . $ gtk_box_pack_start(e6ae6b264cb15f6b). (contents, widget, TRUEcxx . . $ `<external>/12741050725406041920/gmacros.h:971:9`!, TRUEcxx . . $ `<external>/12741050725406041920/gmacros.h:971:9`!, 0); |
| 83 | |
| 84 | /* The password area */ |
| 85 | self->password_areacxx . . $ _GcrPkcs11ImportDialog#password_area. = GTK_WIDGETcxx . . $ `<external>/6031079988677191796/gtkwidget.h:58:9`! (gtk_builder_get_object (self->builder, "unlock-area")); |
| 86 | gtk_widget_hidecxx . . $ gtk_widget_hide(d7cf858254b37903). (self->password_areacxx . . $ _GcrPkcs11ImportDialog#password_area.); |
| 87 | |
| 88 | /* Add a secure entry */ |
| 89 | buffer = gcr_secure_entry_buffer_newcxx . . $ gcr_secure_entry_buffer_new(b1a2cf5c5d4eccb6). (); |
| 90 | self->password_entrycxx . . $ _GcrPkcs11ImportDialog#password_entry. = GTK_ENTRYcxx . . $ `<external>/10768811112622010133/gtkentry.h:49:9`! (gtk_builder_get_object (self->builder, "password-entry")); |
| 91 | gtk_entry_set_buffercxx . . $ gtk_entry_set_buffer(fe50f028a98cf297). (self->password_entrycxx . . $ _GcrPkcs11ImportDialog#password_entry., buffer); |
| 92 | gtk_entry_set_activates_defaultcxx . . $ gtk_entry_set_activates_default(71e6cb16516f1bad). (self->password_entrycxx . . $ _GcrPkcs11ImportDialog#password_entry., TRUEcxx . . $ `<external>/12741050725406041920/gmacros.h:971:9`!); |
| 93 | g_object_unrefcxx . . $ g_object_unref(5d22bdacc48458e8). (buffer); |
| 94 | |
| 95 | self->token_labelcxx . . $ _GcrPkcs11ImportDialog#token_label. = GTK_LABELcxx . . $ `<external>/2142028111988326349/gtklabel.h:39:9`! (gtk_builder_get_object (self->builder, "token-description")); |
| 96 | self->token_imagecxx . . $ _GcrPkcs11ImportDialog#token_image. = GTK_IMAGEcxx . . $ `<external>/531743274554195362/gtkimage.h:40:9`! (gtk_builder_get_object (self->builder, "token-image")); |
| 97 | |
| 98 | /* Setup the label */ |
| 99 | self->label_entrycxx . . $ _GcrPkcs11ImportDialog#label_entry. = GTK_ENTRYcxx . . $ `<external>/10768811112622010133/gtkentry.h:49:9`! (gtk_builder_get_object (self->builder, "label-entry")); |
| 100 | g_signal_connectcxx . . $ `<external>/15952772511652638895/gsignal.h:548:9`! (self->label_entry, "changed", G_CALLBACKcxx . . $ `<external>/16473872192229286895/gclosure.h:73:9`! (on_label_changed), self); |
| 101 | gtk_entry_set_activates_defaultcxx . . $ gtk_entry_set_activates_default(71e6cb16516f1bad). (self->label_entrycxx . . $ _GcrPkcs11ImportDialog#label_entry., TRUEcxx . . $ `<external>/12741050725406041920/gmacros.h:971:9`!); |
| 102 | |
| 103 | /* Add our various buttons */ |
| 104 | button = gtk_dialog_add_buttoncxx . . $ gtk_dialog_add_button(d3209ef02c66779a). (GTK_DIALOGcxx . . $ `<external>/3867786087843934573/gtkdialog.h:90:9`! (self), _cxx . . $ `<external>/16453136837583379545/gi18n-lib.h:32:10`!("_Cancel"), GTK_RESPONSE_CANCELcxx . . $ GTK_RESPONSE_CANCEL.); |
| 105 | gtk_button_set_use_underlinecxx . . $ gtk_button_set_use_underline(72b6f5ca16c9f0b6). (GTK_BUTTONcxx . . $ `<external>/6931860716604248467/gtkbutton.h:40:9`! (button), TRUEcxx . . $ `<external>/12741050725406041920/gmacros.h:971:9`!); |
| 106 | button = gtk_dialog_add_buttoncxx . . $ gtk_dialog_add_button(d3209ef02c66779a). (GTK_DIALOGcxx . . $ `<external>/3867786087843934573/gtkdialog.h:90:9`! (self), _cxx . . $ `<external>/16453136837583379545/gi18n-lib.h:32:10`!("_OK"), GTK_RESPONSE_OKcxx . . $ GTK_RESPONSE_OK.); |
| 107 | gtk_button_set_use_underlinecxx . . $ gtk_button_set_use_underline(72b6f5ca16c9f0b6). (GTK_BUTTONcxx . . $ `<external>/6931860716604248467/gtkbutton.h:40:9`! (button), TRUEcxx . . $ `<external>/12741050725406041920/gmacros.h:971:9`!); |
| 108 | gtk_dialog_set_default_responsecxx . . $ gtk_dialog_set_default_response(9587d6cf9a0d72b5). (GTK_DIALOGcxx . . $ `<external>/3867786087843934573/gtkdialog.h:90:9`! (self), GTK_RESPONSE_OKcxx . . $ GTK_RESPONSE_OK.); |
| 109 | |
| 110 | gtk_window_set_modalcxx . . $ gtk_window_set_modal(3adb53e0a0f76453). (GTK_WINDOWcxx . . $ `<external>/3777575239456597881/gtkwindow.h:40:9`! (self), TRUEcxx . . $ `<external>/12741050725406041920/gmacros.h:971:9`!); |
| 111 | } |
| 112 | |
| 113 | static void |
| 114 | _gcr_pkcs11_import_dialog_initcxx . . $ _gcr_pkcs11_import_dialog_init(23293845267c5834). (GcrPkcs11ImportDialogcxx . . $ GcrPkcs11ImportDialog# *self) |
| 115 | { |
| 116 | self->buildercxx . . $ _GcrPkcs11ImportDialog#builder. = gtk_builder_newcxx . . $ gtk_builder_new(1dded1615442d61d). (); |
| 117 | } |
| 118 | |
| 119 | static void |
| 120 | _gcr_pkcs11_import_dialog_finalizecxx . . $ _gcr_pkcs11_import_dialog_finalize(6087475fa43034d3). (GObjectcxx . . $ GObject# *obj) |
| 121 | { |
| 122 | GcrPkcs11ImportDialogcxx . . $ GcrPkcs11ImportDialog# *self = GCR_PKCS11_IMPORT_DIALOGcxx . . $ GCR_PKCS11_IMPORT_DIALOG(7ffe5cdf8dc0f035). (obj); |
| 123 | |
| 124 | g_object_unrefcxx . . $ g_object_unref(5d22bdacc48458e8). (self->buildercxx . . $ _GcrPkcs11ImportDialog#builder.); |
| 125 | |
| 126 | G_OBJECT_CLASScxx . . $ `<external>/1341695927569185362/gobject.h:61:9`! (_gcr_pkcs11_import_dialog_parent_class)->finalizecxx . . $ _GObjectClass#finalize. (obj); |
| 127 | } |
| 128 | |
| 129 | static void |
| 130 | _gcr_pkcs11_import_dialog_class_initcxx . . $ _gcr_pkcs11_import_dialog_class_init(1e4789d0a41ce727). (GcrPkcs11ImportDialogClasscxx . . $ GcrPkcs11ImportDialogClass# *klass) |
| 131 | { |
| 132 | GObjectClasscxx . . $ GObjectClass# *gobject_class = G_OBJECT_CLASScxx . . $ `<external>/1341695927569185362/gobject.h:61:9`! (klass); |
| 133 | |
| 134 | gobject_class->constructedcxx . . $ _GObjectClass#constructed. = _gcr_pkcs11_import_dialog_constructedcxx . . $ _gcr_pkcs11_import_dialog_constructed(6087475fa43034d3).; |
| 135 | gobject_class->finalizecxx . . $ _GObjectClass#finalize. = _gcr_pkcs11_import_dialog_finalizecxx . . $ _gcr_pkcs11_import_dialog_finalize(6087475fa43034d3).; |
| 136 | } |
| 137 | |
| 138 | GcrPkcs11ImportDialogcxx . . $ GcrPkcs11ImportDialog# * |
| 139 | _gcr_pkcs11_import_dialog_newcxx . . $ _gcr_pkcs11_import_dialog_new(65c7d88c7d8d6707). (GtkWindowcxx . . $ GtkWindow# *parent) |
| 140 | { |
| 141 | GcrPkcs11ImportDialogcxx . . $ GcrPkcs11ImportDialog# *dialog; |
| 142 | |
| 143 | g_return_val_if_failcxx . . $ `<external>/5169755362661750954/gmessages.h:665:9`! (parent == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`! || GTK_IS_WINDOWcxx . . $ `<external>/3777575239456597881/gtkwindow.h:42:9`! (parent), NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 144 | |
| 145 | dialog = g_object_newcxx . . $ g_object_new(8485fe61b4be4c78). (GCR_TYPE_PKCS11_IMPORT_DIALOGcxx . . $ `ui/gcr-pkcs11-import-dialog.h:32:9`!, |
| 146 | "transient-for", parent, |
| 147 | NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 148 | |
| 149 | return g_object_ref_sinkcxx . . $ `<external>/1341695927569185362/gobject.h:534:9`! (dialog); |
| 150 | } |
| 151 | |
| 152 | void |
| 153 | _gcr_pkcs11_import_dialog_get_supplementscxx . . $ _gcr_pkcs11_import_dialog_get_supplements(69e9aad1f7fa148). (GcrPkcs11ImportDialogcxx . . $ GcrPkcs11ImportDialog# *self, |
| 154 | GckBuildercxx . . $ GckBuilder# *builder) |
| 155 | { |
| 156 | const gcharcxx . . $ gchar# *label; |
| 157 | |
| 158 | g_return_if_failcxx . . $ `<external>/5169755362661750954/gmessages.h:652:9`! (GCR_IS_PKCS11_IMPORT_DIALOG (self)); |
| 159 | g_return_if_failcxx . . $ `<external>/5169755362661750954/gmessages.h:652:9`! (builder != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 160 | |
| 161 | label = gtk_entry_get_textcxx . . $ gtk_entry_get_text(95764e6467c01685). (self->label_entrycxx . . $ _GcrPkcs11ImportDialog#label_entry.); |
| 162 | if (self->label_changedcxx . . $ _GcrPkcs11ImportDialog#label_changed. && label != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`! && label[0]) |
| 163 | gck_builder_set_stringcxx . . $ gck_builder_set_string(5cd367c3b7c1c00). (builder, CKA_LABELcxx . . $ `<external>/10342940016925085653/pkcs11.h:437:9`!, label); |
| 164 | } |
| 165 | |
| 166 | void |
| 167 | _gcr_pkcs11_import_dialog_set_supplementscxx . . $ _gcr_pkcs11_import_dialog_set_supplements(69e9aad1f7fa148). (GcrPkcs11ImportDialogcxx . . $ GcrPkcs11ImportDialog# *self, |
| 168 | GckBuildercxx . . $ GckBuilder# *builder) |
| 169 | { |
| 170 | gcharcxx . . $ gchar# *label; |
| 171 | |
| 172 | g_return_if_failcxx . . $ `<external>/5169755362661750954/gmessages.h:652:9`! (GCR_IS_PKCS11_IMPORT_DIALOG (self)); |
| 173 | g_return_if_failcxx . . $ `<external>/5169755362661750954/gmessages.h:652:9`! (builder != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 174 | |
| 175 | if (!gck_builder_find_stringcxx . . $ gck_builder_find_string(6223a427f73d94f7). (builder, CKA_LABELcxx . . $ `<external>/10342940016925085653/pkcs11.h:437:9`!, &label)) |
| 176 | label = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 177 | |
| 178 | if (label == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) |
| 179 | gtk_entry_set_placeholder_textcxx . . $ gtk_entry_set_placeholder_text(f242b09048803a29). (self->label_entrycxx . . $ _GcrPkcs11ImportDialog#label_entry., _cxx . . $ `<external>/16453136837583379545/gi18n-lib.h:32:10`!("Automatically chosen")); |
| 180 | gtk_entry_set_textcxx . . $ gtk_entry_set_text(f242b09048803a29). (self->label_entrycxx . . $ _GcrPkcs11ImportDialog#label_entry., label == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`! ? "" : label); |
| 181 | g_freecxx . . $ g_free(5d22bdacc48458e8). (label); |
| 182 | |
| 183 | self->label_changedcxx . . $ _GcrPkcs11ImportDialog#label_changed. = FALSEcxx . . $ `<external>/12741050725406041920/gmacros.h:967:9`!; |
| 184 | } |
| 185 | |
| 186 | gbooleancxx . . $ gboolean# |
| 187 | _gcr_pkcs11_import_dialog_runcxx . . $ _gcr_pkcs11_import_dialog_run(1da988fc83ed4a89). (GcrPkcs11ImportDialogcxx . . $ GcrPkcs11ImportDialog# *self) |
| 188 | { |
| 189 | gbooleancxx . . $ gboolean# ret = FALSEcxx . . $ `<external>/12741050725406041920/gmacros.h:967:9`!; |
| 190 | |
| 191 | g_return_val_if_failcxx . . $ `<external>/5169755362661750954/gmessages.h:665:9`! (GCR_IS_PKCS11_IMPORT_DIALOG (self), FALSEcxx . . $ `<external>/12741050725406041920/gmacros.h:967:9`!); |
| 192 | |
| 193 | if (gtk_dialog_runcxx . . $ gtk_dialog_run(cf1e4a10f928f20a). (GTK_DIALOGcxx . . $ `<external>/3867786087843934573/gtkdialog.h:90:9`! (self)) == GTK_RESPONSE_OKcxx . . $ GTK_RESPONSE_OK.) { |
| 194 | ret = TRUEcxx . . $ `<external>/12741050725406041920/gmacros.h:971:9`!; |
| 195 | } |
| 196 | |
| 197 | gtk_widget_hidecxx . . $ gtk_widget_hide(d7cf858254b37903). (GTK_WIDGETcxx . . $ `<external>/6031079988677191796/gtkwidget.h:58:9`! (self)); |
| 198 | |
| 199 | return ret; |
| 200 | } |
| 201 | |
| 202 | void |
| 203 | _gcr_pkcs11_import_dialog_run_asynccxx . . $ _gcr_pkcs11_import_dialog_run_async(5f0d912cc788b045). (GcrPkcs11ImportDialogcxx . . $ GcrPkcs11ImportDialog# *self, |
| 204 | GCancellablecxx . . $ GCancellable# *cancellable, |
| 205 | GAsyncReadyCallbackcxx . . $ GAsyncReadyCallback# callback, |
| 206 | gpointercxx . . $ gpointer# user_data) |
| 207 | { |
| 208 | g_return_if_failcxx . . $ `<external>/5169755362661750954/gmessages.h:652:9`! (GCR_IS_PKCS11_IMPORT_DIALOG (self)); |
| 209 | |
| 210 | _gcr_dialog_util_run_asynccxx . . $ _gcr_dialog_util_run_async(fe2efda115ebea68). (GTK_DIALOGcxx . . $ `<external>/3867786087843934573/gtkdialog.h:90:9`! (self), cancellable, callback, user_data); |
| 211 | } |
| 212 | |
| 213 | gbooleancxx . . $ gboolean# |
| 214 | _gcr_pkcs11_import_dialog_run_finishcxx . . $ _gcr_pkcs11_import_dialog_run_finish(dc53d53e52f6532b). (GcrPkcs11ImportDialogcxx . . $ GcrPkcs11ImportDialog# *self, |
| 215 | GAsyncResultcxx . . $ GAsyncResult# *result) |
| 216 | { |
| 217 | gintcxx . . $ gint# response; |
| 218 | |
| 219 | g_return_val_if_failcxx . . $ `<external>/5169755362661750954/gmessages.h:665:9`! (GCR_IS_PKCS11_IMPORT_DIALOG (self), FALSEcxx . . $ `<external>/12741050725406041920/gmacros.h:967:9`!); |
| 220 | |
| 221 | response = _gcr_dialog_util_run_finishcxx . . $ _gcr_dialog_util_run_finish(d7c8d3d6580353af). (GTK_DIALOGcxx . . $ `<external>/3867786087843934573/gtkdialog.h:90:9`! (self), result); |
| 222 | |
| 223 | gtk_widget_hidecxx . . $ gtk_widget_hide(d7cf858254b37903). (GTK_WIDGETcxx . . $ `<external>/6031079988677191796/gtkwidget.h:58:9`! (self)); |
| 224 | |
| 225 | return (response == GTK_RESPONSE_OKcxx . . $ GTK_RESPONSE_OK.) ? TRUEcxx . . $ `<external>/12741050725406041920/gmacros.h:971:9`! : FALSEcxx . . $ `<external>/12741050725406041920/gmacros.h:967:9`!; |
| 226 | } |
| 227 | |
| 228 | GTlsInteractionResultcxx . . $ GTlsInteractionResult# |
| 229 | _gcr_pkcs11_import_dialog_run_ask_passwordcxx . . $ _gcr_pkcs11_import_dialog_run_ask_password(465f9bff6b06331a). (GcrPkcs11ImportDialogcxx . . $ GcrPkcs11ImportDialog# *self, |
| 230 | GTlsPasswordcxx . . $ GTlsPassword# *password, |
| 231 | GCancellablecxx . . $ GCancellable# *cancellable, |
| 232 | GErrorcxx . . $ GError# **error) |
| 233 | { |
| 234 | GckTokenInfocxx . . $ GckTokenInfo# *token_info; |
| 235 | const gcharcxx . . $ gchar# *value; |
| 236 | GckSlotcxx . . $ GckSlot# *slot; |
| 237 | GIconcxx . . $ GIcon# *icon; |
| 238 | gbooleancxx . . $ gboolean# ret; |
| 239 | |
| 240 | g_return_val_if_failcxx . . $ `<external>/5169755362661750954/gmessages.h:665:9`! (GCR_IS_PKCS11_IMPORT_DIALOG (self), G_TLS_INTERACTION_UNHANDLED); |
| 241 | g_return_val_if_failcxx . . $ `<external>/5169755362661750954/gmessages.h:665:9`! (G_IS_TLS_PASSWORDcxx . . $ `<external>/17799220888998972637/gtlspassword.h:37:9`! (password), G_TLS_INTERACTION_UNHANDLED); |
| 242 | g_return_val_if_failcxx . . $ `<external>/5169755362661750954/gmessages.h:665:9`! (error == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`! || *error == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, G_TLS_INTERACTION_UNHANDLED); |
| 243 | |
| 244 | if (GCK_IS_PASSWORDcxx . . $ `gck/gck.h:1503:9`! (password)) { |
| 245 | slot = gck_password_get_tokencxx . . $ gck_password_get_token(34aa8c82daca6604). (GCK_PASSWORDcxx . . $ `gck/gck.h:1501:9`! (password)); |
| 246 | token_info = gck_slot_get_token_infocxx . . $ gck_slot_get_token_info(e63935d7d7deee29). (slot); |
| 247 | icon = gcr_icon_for_tokencxx . . $ gcr_icon_for_token(1bf321e0c00065e4). (token_info); |
| 248 | gtk_image_set_from_giconcxx . . $ gtk_image_set_from_gicon(c173cc120bd22613). (self->token_imagecxx . . $ _GcrPkcs11ImportDialog#token_image., icon, GTK_ICON_SIZE_BUTTONcxx . . $ GTK_ICON_SIZE_BUTTON.); |
| 249 | gck_token_info_freecxx . . $ gck_token_info_free(8a2423ab92e3c75f). (token_info); |
| 250 | g_object_unrefcxx . . $ g_object_unref(5d22bdacc48458e8). (icon); |
| 251 | } |
| 252 | |
| 253 | gtk_label_set_textcxx . . $ gtk_label_set_text(3d016a7109913fca). (self->token_labelcxx . . $ _GcrPkcs11ImportDialog#token_label., g_tls_password_get_descriptioncxx . . $ g_tls_password_get_description(a3e41866419f90c1). (password)); |
| 254 | |
| 255 | gtk_widget_showcxx . . $ gtk_widget_show(d7cf858254b37903). (self->password_areacxx . . $ _GcrPkcs11ImportDialog#password_area.); |
| 256 | |
| 257 | ret = _gcr_pkcs11_import_dialog_runcxx . . $ _gcr_pkcs11_import_dialog_run(1da988fc83ed4a89). (self); |
| 258 | |
| 259 | gtk_widget_hidecxx . . $ gtk_widget_hide(d7cf858254b37903). (self->password_areacxx . . $ _GcrPkcs11ImportDialog#password_area.); |
| 260 | |
| 261 | if (!ret) { |
| 262 | g_set_errorcxx . . $ g_set_error(ca0c191bc68fc328). (error, G_IO_ERRORcxx . . $ `<external>/13894955190784973534/gioerror.h:42:9`!, G_IO_ERROR_CANCELLEDcxx . . $ G_IO_ERROR_CANCELLED., |
| 263 | _cxx . . $ `<external>/16453136837583379545/gi18n-lib.h:32:10`!("The user cancelled the operation")); |
| 264 | return G_TLS_INTERACTION_FAILEDcxx . . $ G_TLS_INTERACTION_FAILED.; |
| 265 | } |
| 266 | |
| 267 | value = gtk_entry_get_textcxx . . $ gtk_entry_get_text(95764e6467c01685). (self->password_entrycxx . . $ _GcrPkcs11ImportDialog#password_entry.); |
| 268 | g_tls_password_set_value_fullcxx . . $ g_tls_password_set_value_full(8e26feb7fec6957). (password, egg_secure_strdupcxx . . $ egg_secure_strdup(42228c1987407501). (value), |
| 269 | -1, egg_secure_freecxx . . $ egg_secure_free(5d22bdacc48458e8).); |
| 270 | return G_TLS_INTERACTION_HANDLEDcxx . . $ G_TLS_INTERACTION_HANDLED.; |
| 271 | } |