30 #include "passwdstore_p.h"
33 #include <gwenhywfar/gui.h>
34 #include <gwenhywfar/db.h>
35 #include <gwenhywfar/directory.h>
36 #include <gwenhywfar/fslock.h>
37 #include <gwenhywfar/mdigest.h>
38 #include <gwenhywfar/text.h>
39 #include <gwenhywfar/debug.h>
40 #include <gwenhywfar/smalltresor.h>
51 sto->fileName=strdup(fname);
52 sto->dbPasswords=
NULL;
61 memset(sto->pw, 0,
sizeof(sto->pw));
62 if (sto->dbPasswords) {
65 sto->dbPasswords=
NULL;
76 memset(sto->pw, 0, GWEN_PASSWDSTORE_PWLEN);
77 if (sto->dbPasswords) {
80 sto->dbPasswords=
NULL;
103 if (s==(ssize_t)-1) {
106 fname, strerror(errno));
126 fname, strerror(errno));
142 s=fwrite(p, 1, l, f);
143 if (s==(ssize_t)-1 || s==0) {
158 static int writeFile(
const char *fname,
const char *p,
int len) {
161 f=fopen(fname,
"wb");
178 fname, strerror(errno));
243 if (sto->dbPasswords) {
246 sto->dbPasswords=
NULL;
282 I18N(
"Enter Password"),
283 I18N(
"Please enter the password for the password store.\n"
285 "Please enter the password for the <b>password store</b>.</br>"
305 GWEN_PASSWDSTORE_PW_ITERATIONS,
306 GWEN_PASSWDSTORE_CRYPT_ITERATIONS);
311 memset(sto->pw, 0,
sizeof(sto->pw));
359 DBG_ERROR(0,
"Looking for [%s]", sto->fileName);
374 I18N(
"Create New Password Store"),
376 "You are about to create a new password store.\n"
377 "Passwords you store here will be encrypted with a passphrase\n"
378 "which you must enter now.\n"
381 "Later you will only need to remember the passphrase for the\n"
382 "password store, not all the individuell passwords.\n"
384 "WARNING: Storing your passwords in the password store\n"
385 "can be considered a security risk, especially if the passphrase protecting it\n"
386 "is not strong enough!\n"
388 "You can safely abort this step, in which case your passwords will not be stored.\n"
390 "Please enter the passphrase for the password store to be created or abort.\n"
392 "<p>You are about to create a new <b>password store</b>.</p>"
394 "<p>Passwords you store here will be encrypted with a passphrase "
395 "which you must enter now.</p>"
396 "<p>Later you will only need to remember the passphrase for the "
397 "password store, not all the individuell passwords.<p>"
398 "<p><font color=\"red\">"
399 "<b>Warning:</b> Storing your passwords in the password store "
400 "can be considered a <b>security risk</b>, especially if the passphrase protecting it "
401 "is not strong enough!"
403 "<p><b>You can safely abort this step</b>, in which case your passwords will not be stored.</p>"
405 "<p>Please enter the passphrase for the password store to be created or abort.</p>"
415 I18N(
"Enter Password"),
416 I18N(
"Please enter the password for the password store.\n"
418 "Please enter the password for the <b>password store</b>.</br>"
454 GWEN_PASSWDSTORE_PW_ITERATIONS,
455 GWEN_PASSWDSTORE_CRYPT_ITERATIONS);
520 if (sto->dbPasswords) {
589 if (i>=minLen && i < maxLen) {
590 memmove(buffer, s, i+1);
633 if (sto->dbPasswords==
NULL) {