summaryrefslogtreecommitdiff
path: root/client/gtk.c
diff options
context:
space:
mode:
authorSamuel Lidén Borell <samuel@slbdata.se>2012-04-06 14:33:36 +0200
committerSamuel Lidén Borell <samuel@slbdata.se>2012-04-06 14:33:36 +0200
commite34b199417a86b72041c42bd1d0192844daff85e (patch)
treeb2747f6fbae514d923a516dead43a069c17d9b72 /client/gtk.c
parent9370e00a6813c5e6580422cf1909229cf4b5c7fd (diff)
downloadfribid-e34b199417a86b72041c42bd1d0192844daff85e.tar.gz
fribid-e34b199417a86b72041c42bd1d0192844daff85e.tar.bz2
fribid-e34b199417a86b72041c42bd1d0192844daff85e.zip
Print and display error messages from OpenSSL and libp11
Diffstat (limited to 'client/gtk.c')
-rw-r--r--client/gtk.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/client/gtk.c b/client/gtk.c
index bd2f043..c9f020c 100644
--- a/client/gtk.c
+++ b/client/gtk.c
@@ -42,6 +42,7 @@
#include "bankid.h"
#include "platform.h"
#include "misc.h"
+#include "certutil.h"
#define _(string) gettext(string)
#define translatable(string) (string)
@@ -496,6 +497,7 @@ static void selectExternalFile() {
removeTokenFile(filename);
// Add an item to the token list and select it
+ certutil_clearErrorString();
error = addTokenFile(filename);
g_free(filename);
@@ -517,6 +519,7 @@ static void selectExternalFile() {
*/
bool platform_sign(Token **token, char *password, int password_maxlen) {
guint response;
+ certutil_clearErrorString();
// Restrict the password to the length of the preallocated
// password buffer
@@ -686,7 +689,13 @@ void platform_showError(TokenError error) {
g_free(longText);
break;
default:
- showMessage(GTK_MESSAGE_ERROR, text);
+ if (certutil_getErrorString()) {
+ longText = rasprintf("%s\n\n%s", text, certutil_getErrorString());
+ showMessage(GTK_MESSAGE_ERROR, longText);
+ g_free(longText);
+ } else {
+ showMessage(GTK_MESSAGE_ERROR, text);
+ }
break;
}
}