mirror of
https://github.com/haiwen/seafile-server.git
synced 2025-09-14 14:22:34 +00:00
Support argon2id password hash algo (#637)
* Support argon2id password hash algo * CI install argon2 deps * Go support argonid algo * RPC add pwd_hash_algo and pwd_hash_params * Support password hash algo * Don't set magic when pwd_hash is set * Fix ci error --------- Co-authored-by: 杨赫然 <heran.yang@seafile.com>
This commit is contained in:
@@ -122,6 +122,8 @@ seafile_session_new(const char *central_config_dir,
|
||||
char *notif_server = NULL;
|
||||
int notif_port = 8083;
|
||||
char *private_key = NULL;
|
||||
char *pwd_hash_algo = NULL;
|
||||
char *pwd_hash_params = NULL;
|
||||
|
||||
abs_ccnet_dir = ccnet_expand_path (ccnet_dir);
|
||||
abs_seafile_dir = ccnet_expand_path (seafile_dir);
|
||||
@@ -208,6 +210,17 @@ seafile_session_new(const char *central_config_dir,
|
||||
session->private_key = private_key;
|
||||
}
|
||||
|
||||
pwd_hash_algo = g_key_file_get_string (config,
|
||||
"password_hash", "pwd_hash_algo",
|
||||
NULL);
|
||||
|
||||
pwd_hash_params = g_key_file_get_string (config,
|
||||
"password_hash", "pwd_hash_params",
|
||||
NULL);
|
||||
seafile_crypt_init (pwd_hash_algo, pwd_hash_params);
|
||||
g_free (pwd_hash_algo);
|
||||
g_free (pwd_hash_params);
|
||||
|
||||
if (load_database_config (session) < 0) {
|
||||
seaf_warning ("Failed to load database config.\n");
|
||||
goto onerror;
|
||||
@@ -309,6 +322,8 @@ onerror:
|
||||
free (abs_seafile_dir);
|
||||
free (abs_ccnet_dir);
|
||||
g_free (tmp_file_dir);
|
||||
g_free (pwd_hash_algo);
|
||||
g_free (pwd_hash_params);
|
||||
g_free (session);
|
||||
return NULL;
|
||||
}
|
||||
|
Reference in New Issue
Block a user