Skip to content

Commit

Permalink
nip46: dynamic signer sessions were missing nip44 conversation key.
Browse files Browse the repository at this point in the history
  • Loading branch information
fiatjaf committed Oct 26, 2024
1 parent ab52b3e commit d439989
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions nip46/dynamic-signer.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit d439989

Please sign in to comment.