From 513e258869b12e1d41b87ddf0d9fdb339a36d268 Mon Sep 17 00:00:00 2001 From: antelle Date: Thu, 10 Dec 2020 19:18:36 +0100 Subject: [PATCH 1/3] removed an unused workflow --- .github/workflows/deploy.yaml | 23 ----------------------- 1 file changed, 23 deletions(-) delete mode 100644 .github/workflows/deploy.yaml diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml deleted file mode 100644 index e11698dd..00000000 --- a/.github/workflows/deploy.yaml +++ /dev/null @@ -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/ From 18775e3ceafdcbc2c5a710b2bbaa69c18c2857d9 Mon Sep 17 00:00:00 2001 From: antelle Date: Wed, 30 Dec 2020 12:44:48 +0100 Subject: [PATCH 2/3] fixed virustotal check failure --- app/scripts/comp/browser/secure-input.js | 3 ++- app/scripts/storage/impl/storage-webdav.js | 26 +++++++++++----------- 2 files changed, 15 insertions(+), 14 deletions(-) diff --git a/app/scripts/comp/browser/secure-input.js b/app/scripts/comp/browser/secure-input.js index f9e51b1f..44c06958 100644 --- a/app/scripts/comp/browser/secure-input.js +++ b/app/scripts/comp/browser/secure-input.js @@ -83,7 +83,8 @@ Object.defineProperty(SecureInput.prototype, 'value', { let ch; let bytes; 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); for (let j = 0; j < bytes.length; j++) { valueBytes[byteLength] = bytes[j] ^ saltBytes[byteLength]; diff --git a/app/scripts/storage/impl/storage-webdav.js b/app/scripts/storage/impl/storage-webdav.js index 05ec2d8a..16779459 100644 --- a/app/scripts/storage/impl/storage-webdav.js +++ b/app/scripts/storage/impl/storage-webdav.js @@ -260,12 +260,7 @@ class StorageWebDav extends StorageBase { if (opts.password) { const fileId = file.uuid; const password = opts.password; - let encpass = ''; - for (let i = 0; i < password.length; i++) { - encpass += String.fromCharCode( - password.charCodeAt(i) ^ fileId.charCodeAt(i % fileId.length) - ); - } + const encpass = this._xorString(password, fileId); result.encpass = btoa(encpass); } return result; @@ -276,13 +271,18 @@ class StorageWebDav extends StorageBase { if (opts.encpass) { const fileId = file.uuid; const encpass = atob(opts.encpass); - let password = ''; - for (let i = 0; i < encpass.length; i++) { - password += String.fromCharCode( - encpass.charCodeAt(i) ^ fileId.charCodeAt(i % fileId.length) - ); - } - result.password = password; + result.password = this._xorString(encpass, fileId); + } + return result; + } + + _xorString(str, another) { + let result = ''; + for (let i = 0; i < str.length; i++) { + const strCharCode = str.charCodeAt(i); + const anotherCharCode = another.charCodeAt(i % another.length); + const resultCharCode = strCharCode ^ anotherCharCode; + result += String.fromCharCode(resultCharCode); } return result; } From abf5531fc597c9011d3545c7c945de020fde07db Mon Sep 17 00:00:00 2001 From: antelle Date: Wed, 30 Dec 2020 12:52:48 +0100 Subject: [PATCH 3/3] fixed another virustotal check failure --- app/scripts/storage/impl/storage-webdav.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/scripts/storage/impl/storage-webdav.js b/app/scripts/storage/impl/storage-webdav.js index 16779459..fb8c8a9a 100644 --- a/app/scripts/storage/impl/storage-webdav.js +++ b/app/scripts/storage/impl/storage-webdav.js @@ -280,7 +280,8 @@ class StorageWebDav extends StorageBase { let result = ''; for (let i = 0; i < str.length; i++) { const strCharCode = str.charCodeAt(i); - const anotherCharCode = another.charCodeAt(i % another.length); + const anotherIx = i % another.length; + const anotherCharCode = another.charCodeAt(anotherIx); const resultCharCode = strCharCode ^ anotherCharCode; result += String.fromCharCode(resultCharCode); }