fix(WebDav, GoogleDrive): Use new encryption
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
This commit is contained in:
Родитель
af25b7098f
Коммит
943c25abd9
|
@ -305,7 +305,9 @@ export default class GoogleDriveAdapter extends CachingAdapter {
|
|||
let xbel = createXBEL(this.bookmarksCache, this.highestId)
|
||||
|
||||
if (this.server.password) {
|
||||
xbel = await Crypto.encryptAES(this.server.password, xbel, this.server.bookmark_file)
|
||||
const salt = Crypto.bufferToHexstr(Crypto.getRandomBytes(64))
|
||||
const ciphertext = await Crypto.encryptAES(this.server.password, xbel, salt)
|
||||
xbel = JSON.stringify({ciphertext, salt})
|
||||
}
|
||||
|
||||
if (!this.fileId) {
|
||||
|
|
|
@ -324,7 +324,9 @@ export default class WebDavAdapter extends CachingAdapter {
|
|||
const fullUrl = this.getBookmarkURL()
|
||||
let xbel = this.server.bookmark_file_type === 'xbel' ? createXBEL(this.bookmarksCache, this.highestId) : createHTML(this.bookmarksCache, this.highestId)
|
||||
if (this.server.passphrase) {
|
||||
xbel = await Crypto.encryptAES(this.server.passphrase, xbel, this.server.bookmark_file)
|
||||
const salt = Crypto.bufferToHexstr(Crypto.getRandomBytes(64))
|
||||
const ciphertext = await Crypto.encryptAES(this.server.passphrase, xbel, salt)
|
||||
xbel = JSON.stringify({ciphertext, salt})
|
||||
}
|
||||
await this.uploadFile(fullUrl, this.server.bookmark_file_type === 'xbel' ? 'application/xml' : 'text/html', xbel)
|
||||
} else {
|
||||
|
|
Загрузка…
Ссылка в новой задаче