mirror of https://github.com/keeweb/keeweb.git
Merge branch 'master' into release-1.16
This commit is contained in:
commit
7c2b7a09f8
|
@ -1,23 +0,0 @@
|
||||||
name: Deploy
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches: [ 'gh-pages' ]
|
|
||||||
jobs:
|
|
||||||
publish:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- name: Checkout
|
|
||||||
uses: actions/checkout@v2
|
|
||||||
with:
|
|
||||||
fetch-depth: 0
|
|
||||||
ref: 'gh-pages'
|
|
||||||
- name: Setup GCloud
|
|
||||||
uses: google-github-actions/setup-gcloud@master
|
|
||||||
with:
|
|
||||||
version: '285.0.0'
|
|
||||||
service_account_key: ${{ secrets.GCP_SA_KEY }}
|
|
||||||
export_default_credentials: true
|
|
||||||
- name: Restore git mtime
|
|
||||||
run: curl -Ss https://raw.githubusercontent.com/MestreLion/git-tools/f3cc70b73200154d027554714c354f35a08680ed/git-restore-mtime | python3
|
|
||||||
- name: Sync
|
|
||||||
run: gsutil -m rsync -r -d -x "^\.|^[a-f\d-]{36}$|^README\.md$" . gs://app.keeweb.info/
|
|
|
@ -83,7 +83,8 @@ Object.defineProperty(SecureInput.prototype, 'value', {
|
||||||
let ch;
|
let ch;
|
||||||
let bytes;
|
let bytes;
|
||||||
for (let i = 0; i < len; i++) {
|
for (let i = 0; i < len; i++) {
|
||||||
ch = String.fromCharCode(pseudoValue.charCodeAt(i) ^ salt[i]);
|
const pseudoCharCode = pseudoValue.charCodeAt(i);
|
||||||
|
ch = String.fromCharCode(salt[i] ^ pseudoCharCode);
|
||||||
bytes = kdbxweb.ByteUtils.stringToBytes(ch);
|
bytes = kdbxweb.ByteUtils.stringToBytes(ch);
|
||||||
for (let j = 0; j < bytes.length; j++) {
|
for (let j = 0; j < bytes.length; j++) {
|
||||||
valueBytes[byteLength] = bytes[j] ^ saltBytes[byteLength];
|
valueBytes[byteLength] = bytes[j] ^ saltBytes[byteLength];
|
||||||
|
|
|
@ -260,12 +260,7 @@ class StorageWebDav extends StorageBase {
|
||||||
if (opts.password) {
|
if (opts.password) {
|
||||||
const fileId = file.uuid;
|
const fileId = file.uuid;
|
||||||
const password = opts.password;
|
const password = opts.password;
|
||||||
let encpass = '';
|
const encpass = this._xorString(password, fileId);
|
||||||
for (let i = 0; i < password.length; i++) {
|
|
||||||
encpass += String.fromCharCode(
|
|
||||||
password.charCodeAt(i) ^ fileId.charCodeAt(i % fileId.length)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
result.encpass = btoa(encpass);
|
result.encpass = btoa(encpass);
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
|
@ -276,13 +271,19 @@ class StorageWebDav extends StorageBase {
|
||||||
if (opts.encpass) {
|
if (opts.encpass) {
|
||||||
const fileId = file.uuid;
|
const fileId = file.uuid;
|
||||||
const encpass = atob(opts.encpass);
|
const encpass = atob(opts.encpass);
|
||||||
let password = '';
|
result.password = this._xorString(encpass, fileId);
|
||||||
for (let i = 0; i < encpass.length; i++) {
|
}
|
||||||
password += String.fromCharCode(
|
return result;
|
||||||
encpass.charCodeAt(i) ^ fileId.charCodeAt(i % fileId.length)
|
}
|
||||||
);
|
|
||||||
}
|
_xorString(str, another) {
|
||||||
result.password = password;
|
let result = '';
|
||||||
|
for (let i = 0; i < str.length; i++) {
|
||||||
|
const strCharCode = str.charCodeAt(i);
|
||||||
|
const anotherIx = i % another.length;
|
||||||
|
const anotherCharCode = another.charCodeAt(anotherIx);
|
||||||
|
const resultCharCode = strCharCode ^ anotherCharCode;
|
||||||
|
result += String.fromCharCode(resultCharCode);
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue