mirror of
https://github.com/nbd-wtf/go-nostr.git
synced 2025-09-17 19:13:56 +02:00
nip46: dynamic signer sessions were missing nip44 conversation key.
This commit is contained in:
@@ -10,6 +10,7 @@ import (
|
|||||||
"github.com/mailru/easyjson"
|
"github.com/mailru/easyjson"
|
||||||
"github.com/nbd-wtf/go-nostr"
|
"github.com/nbd-wtf/go-nostr"
|
||||||
"github.com/nbd-wtf/go-nostr/nip04"
|
"github.com/nbd-wtf/go-nostr/nip04"
|
||||||
|
"github.com/nbd-wtf/go-nostr/nip44"
|
||||||
)
|
)
|
||||||
|
|
||||||
var _ Signer = (*DynamicSigner)(nil)
|
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)
|
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)
|
session.PublicKey, err = userKeyer.GetPublicKey(ctx)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return req, resp, eventResponse, fmt.Errorf("failed to get public key: %w", err)
|
return req, resp, eventResponse, fmt.Errorf("failed to get public key: %w", err)
|
||||||
|
Reference in New Issue
Block a user