diff options
Diffstat (limited to 'libsylph/ssl.c')
| -rw-r--r-- | libsylph/ssl.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/libsylph/ssl.c b/libsylph/ssl.c index 21686e1..5042f74 100644 --- a/libsylph/ssl.c +++ b/libsylph/ssl.c | |||
| @@ -794,7 +794,7 @@ gint generate_password_hash(gchar **password_hash, | |||
| 794 | 794 | ||
| 795 | if (salt == NULL) { | 795 | if (salt == NULL) { |
| 796 | if (RAND_bytes(lsalt, SALT_SIZE) != 1) { | 796 | if (RAND_bytes(lsalt, SALT_SIZE) != 1) { |
| 797 | g_fprintf(stderr, "Random problems...\n"); | 797 | debug_print("Random problems...\n"); |
| 798 | return RC_ERROR; | 798 | return RC_ERROR; |
| 799 | } | 799 | } |
| 800 | } else { | 800 | } else { |
| @@ -850,18 +850,18 @@ gint check_password(const gchar *password, const gchar *password_hash) { | |||
| 850 | } | 850 | } |
| 851 | 851 | ||
| 852 | if (token_counter != 4) { | 852 | if (token_counter != 4) { |
| 853 | g_fprintf(stderr, "Invalid password hash...\n"); | 853 | debug_print("Invalid password hash...\n"); |
| 854 | goto cleanup; | 854 | goto cleanup; |
| 855 | } | 855 | } |
| 856 | 856 | ||
| 857 | salt = g_base64_decode(*(tokens + 2), &salt_length); | 857 | salt = g_base64_decode(*(tokens + 2), &salt_length); |
| 858 | if (salt_length != SALT_SIZE) { | 858 | if (salt_length != SALT_SIZE) { |
| 859 | g_fprintf(stderr, "Salt size does not match\n"); | 859 | debug_print("Salt size does not match\n"); |
| 860 | goto cleanup; | 860 | goto cleanup; |
| 861 | } | 861 | } |
| 862 | 862 | ||
| 863 | if (generate_password_hash(&new_hash, password, salt) != RC_OK) { | 863 | if (generate_password_hash(&new_hash, password, salt) != RC_OK) { |
| 864 | g_fprintf(stderr, "Password hash generation failed\n"); | 864 | debug_print("Password hash generation failed\n"); |
| 865 | goto cleanup; | 865 | goto cleanup; |
| 866 | } | 866 | } |
| 867 | 867 | ||
