1
0
mirror of https://github.com/haiwen/seafile-server.git synced 2025-08-31 15:11:08 +00:00

Encrypted library version 3: use different salt for each library.

This commit is contained in:
Jonathan Xu
2019-03-19 17:42:36 +08:00
parent d4713418bb
commit 17ef884861
20 changed files with 243 additions and 88 deletions

View File

@@ -324,13 +324,13 @@ class SeafServerThreadedRpcClient(ccnet.RpcClientBase):
*args, **kwargs)
# repo manipulation
@searpc_func("string", ["string", "string", "string", "string"])
def seafile_create_repo(name, desc, owner_email, passwd):
@searpc_func("string", ["string", "string", "string", "string", "int"])
def seafile_create_repo(name, desc, owner_email, passwd, enc_version):
pass
create_repo = seafile_create_repo
@searpc_func("string", ["string", "string", "string", "string", "string", "string", "int"])
def seafile_create_enc_repo(repo_id, name, desc, owner_email, magic, random_key, enc_version):
@searpc_func("string", ["string", "string", "string", "string", "string", "string", "string", "int"])
def seafile_create_enc_repo(repo_id, name, desc, owner_email, magic, random_key, salt, enc_version):
pass
create_enc_repo = seafile_create_enc_repo
@@ -789,7 +789,7 @@ class SeafServerThreadedRpcClient(ccnet.RpcClientBase):
set_passwd = seafile_set_passwd
@searpc_func("int", ["string", "string"])
def seafile_unset_passwd(repo_id, user, passwd):
def seafile_unset_passwd(repo_id, user):
pass
unset_passwd = seafile_unset_passwd

View File

@@ -79,19 +79,19 @@ class SeafileAPI(object):
def set_passwd(self, repo_id, user, passwd):
return seafserv_threaded_rpc.set_passwd(repo_id, user, passwd)
def unset_passwd(self, repo_id, user, passwd):
return seafserv_threaded_rpc.unset_passwd(repo_id, user, passwd)
def unset_passwd(self, repo_id, user):
return seafserv_threaded_rpc.unset_passwd(repo_id, user)
def generate_magic_and_random_key(self, enc_version, repo_id, password):
return seafserv_threaded_rpc.generate_magic_and_random_key(enc_version, repo_id, password)
# repo manipulation
def create_repo(self, name, desc, username, passwd):
return seafserv_threaded_rpc.create_repo(name, desc, username, passwd)
def create_repo(self, name, desc, username, passwd, enc_version=2):
return seafserv_threaded_rpc.create_repo(name, desc, username, passwd, enc_version)
def create_enc_repo(self, repo_id, name, desc, username, magic, random_key, enc_version):
return seafserv_threaded_rpc.create_enc_repo(repo_id, name, desc, username, magic, random_key, enc_version)
def create_enc_repo(self, repo_id, name, desc, username, magic, random_key, salt, enc_version):
return seafserv_threaded_rpc.create_enc_repo(repo_id, name, desc, username, magic, random_key, salt, enc_version)
def get_repo(self, repo_id):
"""