feat(crypt): customize filename_encoding (#5148)

close #5109
close #5080
This commit is contained in:
Sean
2023-09-03 18:06:44 +08:00
committed by GitHub
parent e7c0d94b44
commit 37dffd0fce
3 changed files with 17 additions and 10 deletions

View File

@ -54,6 +54,8 @@ func (d *Crypt) Init(ctx context.Context) error {
if !isCryptExt(d.EncryptedSuffix) {
return fmt.Errorf("EncryptedSuffix is Illegal")
}
d.FileNameEncoding = utils.GetNoneEmpty(d.FileNameEncoding, "base64")
d.EncryptedSuffix = utils.GetNoneEmpty(d.EncryptedSuffix, ".bin")
op.MustSaveDriverStorage(d)
@ -71,7 +73,7 @@ func (d *Crypt) Init(ctx context.Context) error {
"password2": p2,
"filename_encryption": d.FileNameEnc,
"directory_name_encryption": d.DirNameEnc,
"filename_encoding": "base64",
"filename_encoding": d.FileNameEncoding,
"suffix": d.EncryptedSuffix,
"pass_bad_blocks": "",
}