Check pwd hash and add crypt header (#2844)

Co-authored-by: yangheran <heran.yang@seafile.com>
This commit is contained in:
feiniks 2024-10-30 11:11:39 +08:00 committed by GitHub
parent 9a149a6129
commit 8d16c1782a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 6 additions and 1 deletions

View File

@ -6,6 +6,8 @@
#include "password-hash.h"
#include "seafile-crypt.h"
#include <openssl/rand.h>
#include <openssl/aes.h>
#include <openssl/evp.h>
#include "utils.h"
#include "log.h"

View File

@ -1387,7 +1387,10 @@ seaf_clone_manager_add_download_task (SeafCloneManager *mgr,
json_decref (object);
}
if (passwd &&
if (passwd && algo &&
!check_pwd_hash_encryption_args (pwd_hash, enc_version, random_key, repo_salt, error)) {
goto out;
} else if (passwd &&
!check_encryption_args (magic, enc_version, random_key, repo_salt, error)) {
goto out;
}