Skip to content

Commit

Permalink
Verify that the keypair is correct when signing
Browse files Browse the repository at this point in the history
  • Loading branch information
dtonon committed Dec 6, 2024
1 parent db2813d commit 0f1e350
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/signer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def sign(event)

event.pubkey = @public_key if event.pubkey.nil? || event.pubkey.empty?

# TODO Validate if the npub is correctly derivable from the private_key
raise ArgumentError, "Pubkey doesn't match the private key" unless event.pubkey == @public_key

if event.kind == Nostr::Kind::DIRECT_MESSAGE
puts "event.inspect => #{event.inspect}"
Expand Down

0 comments on commit 0f1e350

Please sign in to comment.