From 139e600b7901d51ac984376f99f988171655eea4 Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Wed, 18 Dec 2024 01:56:53 -0600 Subject: [PATCH] Switch to NIP-44 bunker encryption https://gitlab.com/soapbox-pub/ditto/-/issues/279 --- src/controllers/api/oauth.ts | 1 + src/signers/ConnectSigner.ts | 1 + 2 files changed, 2 insertions(+) diff --git a/src/controllers/api/oauth.ts b/src/controllers/api/oauth.ts index 334b4f0a..2804df60 100644 --- a/src/controllers/api/oauth.ts +++ b/src/controllers/api/oauth.ts @@ -119,6 +119,7 @@ async function getToken( const nip46Seckey = generateSecretKey(); const signer = new NConnectSigner({ + encryption: 'nip44', pubkey: bunkerPubkey, signer: new NSecSigner(nip46Seckey), relay: await Storages.pubsub(), // TODO: Use the relays from the request. diff --git a/src/signers/ConnectSigner.ts b/src/signers/ConnectSigner.ts index de1b5fc9..89c62679 100644 --- a/src/signers/ConnectSigner.ts +++ b/src/signers/ConnectSigner.ts @@ -25,6 +25,7 @@ export class ConnectSigner implements NostrSigner { async init(signer: NostrSigner): Promise { return new NConnectSigner({ + encryption: 'nip44', pubkey: this.opts.bunkerPubkey, // TODO: use a remote relay for `nprofile` signing (if present and `Conf.relay` isn't already in the list) relay: await Storages.pubsub(),