From 80e8cd8f9f7b8bd652344c4ed4e2f916f630338d Mon Sep 17 00:00:00 2001 From: Sergej Sakac Date: Tue, 12 Sep 2023 09:14:14 +0200 Subject: [PATCH] fix --- src/utils/identityKey.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/utils/identityKey.ts b/src/utils/identityKey.ts index 2702812..e83b0e2 100644 --- a/src/utils/identityKey.ts +++ b/src/utils/identityKey.ts @@ -21,7 +21,8 @@ class IdentityKey { while (result) { const separatorIndex = key.indexOf(';') - if (separatorIndex + 1 === key.length) { + console.log(key); + if (separatorIndex === -1) { break; } const colonIndex = key.indexOf(':'); @@ -31,12 +32,13 @@ class IdentityKey { } const cipher = Buffer.from(key.substring(colonIndex + 1, separatorIndex - 1), "base64"); - if (cipher.length !== 32) { + console.log(cipher); + if (cipher.length !== 16) { result = false; break; } - key.substring(separatorIndex + 1); + key = key.substring(separatorIndex + 1); } return result;