From a016809161eb92b96730a704dce97349ffcf8fbf Mon Sep 17 00:00:00 2001 From: Dawid Urbas Date: Mon, 15 Jul 2024 20:36:46 +0200 Subject: [PATCH] Fix signature issue --- holo-key-manager-extension/scripts/helpers.ts | 4 ++-- holo-key-manager-extension/src/lib/const/index.ts | 1 + .../src/lib/queries/applicationQueries.ts | 2 +- holo-key-manager-extension/static/manifest.json | 2 +- shared/const/app.ts | 1 - 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/holo-key-manager-extension/scripts/helpers.ts b/holo-key-manager-extension/scripts/helpers.ts index a1e255c..79edde3 100644 --- a/holo-key-manager-extension/scripts/helpers.ts +++ b/holo-key-manager-extension/scripts/helpers.ts @@ -4,7 +4,7 @@ import { seedBundleReady, UnlockedSeedBundle } from '@holochain/hc-seed-bundle'; -import { AUTHENTICATED_APPS_LIST, DEEP_KEY_AGENT_OFFSET, KEY_INDEX, SESSION } from '@shared/const'; +import { AUTHENTICATED_APPS_LIST, KEY_INDEX, SESSION } from '@shared/const'; import { base64ToUint8Array, uint8ArrayToBase64 } from '@shared/helpers'; import { getDeviceKey, storageService } from '@shared/services'; import { @@ -41,7 +41,7 @@ export const signMessageLogic = async ({ message, happId, session }: SignMessage const pw = new TextEncoder().encode(session); const keyUnlocked = cipherList[0].unlock(parseSecret(pw)); - const agent = keyUnlocked.derive(index + DEEP_KEY_AGENT_OFFSET); + const agent = keyUnlocked.derive(index); const appKey = agent.derive(KEY_INDEX); const uIntArrayMessage = base64ToUint8Array(message); diff --git a/holo-key-manager-extension/src/lib/const/index.ts b/holo-key-manager-extension/src/lib/const/index.ts index c9fa73e..24defb0 100644 --- a/holo-key-manager-extension/src/lib/const/index.ts +++ b/holo-key-manager-extension/src/lib/const/index.ts @@ -1 +1,2 @@ export const DEEP_KEY_INDEX = 0; +export const DEEP_KEY_AGENT_OFFSET = 1; diff --git a/holo-key-manager-extension/src/lib/queries/applicationQueries.ts b/holo-key-manager-extension/src/lib/queries/applicationQueries.ts index a76974e..edb431e 100644 --- a/holo-key-manager-extension/src/lib/queries/applicationQueries.ts +++ b/holo-key-manager-extension/src/lib/queries/applicationQueries.ts @@ -1,5 +1,6 @@ import { createMutation, createQuery, QueryClient } from '@tanstack/svelte-query'; +import { DEEP_KEY_AGENT_OFFSET } from '$const'; import { deriveSignPubKey, deriveSignPubKeyWithExternalEncoding, @@ -11,7 +12,6 @@ import { signWithDeepKeyAgent } from '$helpers'; import { createRegisterKeyBody, registerKey } from '$services'; -import { DEEP_KEY_AGENT_OFFSET } from '$shared/const'; import { APPLICATION_KEYS, APPLICATION_SIGNED_IN_KEY, diff --git a/holo-key-manager-extension/static/manifest.json b/holo-key-manager-extension/static/manifest.json index 422313e..4f51600 100644 --- a/holo-key-manager-extension/static/manifest.json +++ b/holo-key-manager-extension/static/manifest.json @@ -1,7 +1,7 @@ { "name": "Holo key manager", "description": "A browser extension to manage holo keys", - "version": "0.0.71", + "version": "0.0.72", "key": "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAiAtKvbHNTN3O2BLRZH7RkLczaMLenSeZu+YP+KomPQPZ18nt4DY9boIN/+GWts7gCzEeQq59l8edGdF2P7xAbsRxYR88+zFEbxMtIyfyqJZIlzXwnvPJkwGu/S6arNtX48K7q1+xnJEE7VyeYSj6/i2LR+LmPigCzY9JCP7+SmWVeYbdm3kZmReK0ecfh15RXSNjZpXJUgrbea/RVxweggYKnmhhOUBmuJSCLoWTXIuJPBMwGQK1O2GKBqHOq94bPVSF7j+4WzSpPan70ZZJX/reFsOFE/idfFN6wbizjR1Ne50Po03kudEmfQgoqUhVpd0wP8A3YbqE7ODdZcCPPwIDAQAB", "manifest_version": 3, "action": { diff --git a/shared/const/app.ts b/shared/const/app.ts index fd13921..45807c7 100644 --- a/shared/const/app.ts +++ b/shared/const/app.ts @@ -3,7 +3,6 @@ export const HOLO_KEY_MANAGER_APP_ID = 'holo-key-manager'; export const SENDER_WEBAPP = 'webapp'; export const SENDER_EXTENSION = 'extension'; export const SENDER_BACKGROUND_SCRIPT = 'background-script'; -export const DEEP_KEY_AGENT_OFFSET = 1; export const KEY_INDEX = 0; export const HOLO_KEY_MANAGER_EXTENSION_MARKER_ID = 'user-holo-key-manager-extension-marker';