Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Szegoo committed Sep 12, 2023
1 parent ba62110 commit 80e8cd8
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/utils/identityKey.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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(':');
Expand All @@ -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;
Expand Down

0 comments on commit 80e8cd8

Please sign in to comment.