mirror of
https://0xacab.org/liberate/trees.git
synced 2024-09-18 21:23:01 +02:00
Merge branch 'error-reporting' into 'master'
improved error reporting for incorrect pwhash algo values: previously -1 was... See merge request liberate/trees!15
This commit is contained in:
commit
af7354f80e
@ -135,7 +135,7 @@ static int
|
||||
trees_get_private_key(struct mail_user *user,
|
||||
struct trees_user *suser)
|
||||
{
|
||||
int have_salt; int pwhash_alg;
|
||||
int have_salt; int pwhash_alg; int pwhash_alg_set;
|
||||
unsigned long long opslimit, memlimit;
|
||||
unsigned char pw_salt[crypto_pwhash_SALTBYTES];
|
||||
unsigned char sk_nonce[crypto_secretbox_NONCEBYTES];
|
||||
@ -186,10 +186,10 @@ trees_get_private_key(struct mail_user *user,
|
||||
|
||||
/* Get the pwhash value from database and then map it. After this, the
|
||||
* pwhash_alg should be used with libsodium API. */
|
||||
pwhash_alg = trees_get_integer_setting(user, "trees_pwhash_algo");
|
||||
pwhash_alg = trees_pluging_pwhash_map(pwhash_alg);
|
||||
pwhash_alg_set = trees_get_integer_setting(user, "trees_pwhash_algo");
|
||||
pwhash_alg = trees_pluging_pwhash_map(pwhash_alg_set);
|
||||
if (pwhash_alg == -1) {
|
||||
i_error("[trees] Unknown pwhash algorithm value: %d.", pwhash_alg);
|
||||
i_error("[trees] Unknown pwhash algorithm value: %d.", pwhash_alg_set);
|
||||
goto error;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user