diff options
Diffstat (limited to 'libsylph/masterpassword.c')
| -rw-r--r-- | libsylph/masterpassword.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/libsylph/masterpassword.c b/libsylph/masterpassword.c index bac49c4..3d7af94 100644 --- a/libsylph/masterpassword.c +++ b/libsylph/masterpassword.c | |||
| @@ -50,6 +50,7 @@ void cleanse_buffer(void *buf, size_t len) { | |||
| 50 | 50 | ||
| 51 | void unload_master_password(void) { | 51 | void unload_master_password(void) { |
| 52 | 52 | ||
| 53 | debug_print("Unloading master password\n"); | ||
| 53 | if (master_password == NULL) { | 54 | if (master_password == NULL) { |
| 54 | /* not loaded / already unloaded */ | 55 | /* not loaded / already unloaded */ |
| 55 | return; | 56 | return; |
| @@ -57,6 +58,7 @@ void unload_master_password(void) { | |||
| 57 | cleanse_buffer(master_password, strlen(master_password)); | 58 | cleanse_buffer(master_password, strlen(master_password)); |
| 58 | g_free(master_password); | 59 | g_free(master_password); |
| 59 | master_password = NULL; | 60 | master_password = NULL; |
| 61 | debug_print("Master password unloaded\n"); | ||
| 60 | 62 | ||
| 61 | } | 63 | } |
| 62 | 64 | ||
| @@ -105,7 +107,7 @@ gchar *decrypt_with_master_password(const gchar *str) { | |||
| 105 | if (decrypt_data(&new_str, | 107 | if (decrypt_data(&new_str, |
| 106 | str + str_prefix, | 108 | str + str_prefix, |
| 107 | master_password, | 109 | master_password, |
| 108 | strlen(str) - str_prefix) != MP_RC_OK) { | 110 | strlen(str) + 1 - str_prefix) != MP_RC_OK) { |
| 109 | OPENSSL_cleanse(new_str, strlen(new_str)); | 111 | OPENSSL_cleanse(new_str, strlen(new_str)); |
| 110 | g_free(new_str); | 112 | g_free(new_str); |
| 111 | return g_strdup(str); | 113 | return g_strdup(str); |
| @@ -136,7 +138,7 @@ gchar *encrypt_with_master_password(const gchar *str) { | |||
| 136 | &length_encrypted, | 138 | &length_encrypted, |
| 137 | str, | 139 | str, |
| 138 | master_password, | 140 | master_password, |
| 139 | strlen(str), | 141 | strlen(str) + 1, |
| 140 | prefs_common.encrypted_password_min_length, | 142 | prefs_common.encrypted_password_min_length, |
| 141 | TRUE) != MP_RC_OK) { | 143 | TRUE) != MP_RC_OK) { |
| 142 | g_free(new_str); | 144 | g_free(new_str); |
