summaryrefslogtreecommitdiff
path: root/client/gtk.c
diff options
context:
space:
mode:
authorSamuel Lidén Borell <samuel@slbdata.se>2010-01-01 14:56:21 +0100
committerSamuel Lidén Borell <samuel@slbdata.se>2010-01-02 22:30:15 +0100
commite46c8a8b247941adad7096f296cdb522e686e317 (patch)
tree5e7c5386c7f73414165a09e9041c77f54c80de31 /client/gtk.c
parent570a5dd1ae37292a2f80acf6021ba4aa8ea35106 (diff)
downloadfribid-e46c8a8b247941adad7096f296cdb522e686e317.tar.gz
fribid-e46c8a8b247941adad7096f296cdb522e686e317.tar.bz2
fribid-e46c8a8b247941adad7096f296cdb522e686e317.zip
Clear UCS2 passwords when they are freed
The password/passphrase is converted from UTF-8 to UCS2, because NSS expects passwords in UCS2 format.
Diffstat (limited to 'client/gtk.c')
-rw-r--r--client/gtk.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/client/gtk.c b/client/gtk.c
index a5b421e..138b5a9 100644
--- a/client/gtk.c
+++ b/client/gtk.c
@@ -1,6 +1,6 @@
/*
- Copyright (c) 2009 Samuel Lidén Borell <samuel@slbdata.se>
+ Copyright (c) 2009-2010 Samuel Lidén Borell <samuel@slbdata.se>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
@@ -373,6 +373,8 @@ bool platform_sign(char **signature, int *siglen, KeyfileSubject **person, char
free(filename);
}
+ // The contents of the text field is automatically cleared when the
+ // GtkEntry widget is destroyed, so the password won't stay in memory.
*password = strdup(gtk_entry_get_text(passwordEntry));
return true;