From 1f18d92f7aceff2f15ebf29535324310d4b2638a Mon Sep 17 00:00:00 2001 From: Isaiah Inuwa Date: Sat, 8 Nov 2025 21:19:26 -0600 Subject: [PATCH] Remove some unnecessary logs --- .../services/fido2/credential-id-utils.ts | 6 +---- .../fido2/fido2-authenticator.service.ts | 25 ++----------------- 2 files changed, 3 insertions(+), 28 deletions(-) diff --git a/libs/common/src/platform/services/fido2/credential-id-utils.ts b/libs/common/src/platform/services/fido2/credential-id-utils.ts index f595f48914d..08ea33114f5 100644 --- a/libs/common/src/platform/services/fido2/credential-id-utils.ts +++ b/libs/common/src/platform/services/fido2/credential-id-utils.ts @@ -9,9 +9,7 @@ export function parseCredentialId(encodedCredentialId: string): ArrayBuffer { return Fido2Utils.stringToBuffer(encodedCredentialId.slice(4)); } - let arr = guidToRawFormat(encodedCredentialId); - console.log("guidToRawFormat output:", arr) - return arr.buffer; + return guidToRawFormat(encodedCredentialId).buffer; } catch { return undefined; } @@ -21,14 +19,12 @@ export function parseCredentialId(encodedCredentialId: string): ArrayBuffer { * Compares two credential IDs for equality. */ export function compareCredentialIds(a: ArrayBuffer, b: ArrayBuffer): boolean { - console.log("compareCredentialIds:", a, b) if (a.byteLength !== b.byteLength) { return false; } const viewA = new Uint8Array(a); const viewB = new Uint8Array(b); - console.log("Comparing credential IDs:", viewA, viewB) for (let i = 0; i < viewA.length; i++) { if (viewA[i] !== viewB[i]) { diff --git a/libs/common/src/platform/services/fido2/fido2-authenticator.service.ts b/libs/common/src/platform/services/fido2/fido2-authenticator.service.ts index 6888ed8d6f5..447e10555e5 100644 --- a/libs/common/src/platform/services/fido2/fido2-authenticator.service.ts +++ b/libs/common/src/platform/services/fido2/fido2-authenticator.service.ts @@ -32,7 +32,6 @@ import { compareCredentialIds, parseCredentialId } from "./credential-id-utils"; import { p1363ToDer } from "./ecdsa-utils"; import { Fido2Utils } from "./fido2-utils"; import { guidToStandardFormat } from "./guid-utils"; -import { PrimarySecondaryStorageService } from "../../storage/primary-secondary-storage.service"; // AAGUID: d548826e-79b4-db40-a3d8-11116f7e8349 export const AAGUID = new Uint8Array([ @@ -63,15 +62,12 @@ export class Fido2AuthenticatorService window: ParentWindowReference, abortController?: AbortController, ): Promise { - this.logService.debug("[Fido2AuthenticatorService] makeCredential") - this.logService.debug("[Fido2AuthenticatorService] create new session") const userInterfaceSession = await this.userInterface.newSession( params.fallbackSupported, window, abortController, ); - this.logService.debug("[Fido2AuthenticatorService] try create new credential") try { if (params.credTypesAndPubKeyAlgs.every((p) => p.alg !== Fido2AlgorithmIdentifier.ES256)) { const requestedAlgorithms = params.credTypesAndPubKeyAlgs.map((p) => p.alg).join(", "); @@ -105,7 +101,6 @@ export class Fido2AuthenticatorService throw new Fido2AuthenticatorError(Fido2AuthenticatorErrorCode.Unknown); } - this.logService.debug("Ensuring unlocked vault before creating credential") await userInterfaceSession.ensureUnlockedVault(); // Avoid syncing if we did it reasonably soon as the only reason for syncing is to validate excludeCredentials @@ -134,7 +129,6 @@ export class Fido2AuthenticatorService let credentialId: string; let pubKeyDer: ArrayBuffer; - this.logService.debug("[Fido2AuthenticatorService] Prompting user to confirm creating credential") const response = await userInterfaceSession.confirmNewCredential({ credentialName: params.rpEntity.name, userName: params.userEntity.name, @@ -442,29 +436,15 @@ export class Fido2AuthenticatorService credentials: PublicKeyCredentialDescriptor[], rpId: string, ): Promise { - this.logService.debug("[findCredentialsById]:", credentials, rpId) if (credentials.length === 0) { return []; } const activeUserId = await firstValueFrom(this.accountService.activeAccount$.pipe(getUserId)); const ciphers = await this.cipherService.getAllDecrypted(activeUserId); - this.logService.debug("[findCredentialsById] ciphers:", ciphers) return ciphers.filter( - (cipher) => { - this.logService.debug(cipher.id, - !cipher.isDeleted, - cipher.type === CipherType.Login, - cipher.login.hasFido2Credentials, - cipher.login.fido2Credentials[0].rpId === rpId, - credentials.some((credential) => { - let credId = cipher.login.fido2Credentials[0].credentialId - let parsedCredId = parseCredentialId(credId) - this.logService.debug(credential.id, credential.id.byteLength, typeof(credential.id), credId, parsedCredId, parsedCredId.byteLength, typeof(parsedCredId)) - return compareCredentialIds(credential.id, parsedCredId) - }), - ) - return !cipher.isDeleted && + (cipher) => + !cipher.isDeleted && cipher.type === CipherType.Login && cipher.login.hasFido2Credentials && cipher.login.fido2Credentials[0].rpId === rpId && @@ -474,7 +454,6 @@ export class Fido2AuthenticatorService parseCredentialId(cipher.login.fido2Credentials[0].credentialId), ), ) - } ); }