From d4399892eecd154ff2fc0f21eb745f25875a7757 Mon Sep 17 00:00:00 2001 From: fiatjaf Date: Sat, 26 Oct 2024 19:26:20 -0300 Subject: [PATCH] nip46: dynamic signer sessions were missing nip44 conversation key. --- nip46/dynamic-signer.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/nip46/dynamic-signer.go b/nip46/dynamic-signer.go index 7791524..9dda28a 100644 --- a/nip46/dynamic-signer.go +++ b/nip46/dynamic-signer.go @@ -10,6 +10,7 @@ import ( "github.com/mailru/easyjson" "github.com/nbd-wtf/go-nostr" "github.com/nbd-wtf/go-nostr/nip04" + "github.com/nbd-wtf/go-nostr/nip44" ) var _ Signer = (*DynamicSigner)(nil) @@ -121,6 +122,11 @@ func (p *DynamicSigner) HandleRequest(ctx context.Context, event *nostr.Event) ( return req, resp, eventResponse, fmt.Errorf("failed to compute shared secret: %w", err) } + session.ConversationKey, err = nip44.GenerateConversationKey(event.PubKey, handlerSecret) + if err != nil { + return req, resp, eventResponse, fmt.Errorf("failed to compute shared secret: %w", err) + } + session.PublicKey, err = userKeyer.GetPublicKey(ctx) if err != nil { return req, resp, eventResponse, fmt.Errorf("failed to get public key: %w", err)