mirror of
https://github.com/aljazceru/plugins.git
synced 2025-12-23 08:04:20 +01:00
noise: Implement signature verification of chat messages
Since we don't pass the public key we just rely on the pubkey recovery and the `checkmessage` interface to tell us whether it is a publicly known `node_id` or not.
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
from pyln.testing.fixtures import *
|
||||
from pyln.testing.utils import wait_for
|
||||
from pprint import pprint
|
||||
import zbase32
|
||||
|
||||
|
||||
plugin = os.path.join(os.path.dirname(__file__), 'noise.py')
|
||||
|
||||
@@ -20,6 +22,9 @@ def test_sendmsg_success(node_factory, executor):
|
||||
# They should be the same :-)
|
||||
assert(m1 == m2)
|
||||
|
||||
assert(m2['sender'] == l1.info['id'])
|
||||
assert(m2['verified'] == True)
|
||||
|
||||
|
||||
def test_sendmsg_retry(node_factory, executor):
|
||||
opts = [{'plugin': plugin}, {}, {'fee-base': 10000}, {'plugin': plugin}]
|
||||
@@ -52,3 +57,10 @@ def test_sendmsg_retry(node_factory, executor):
|
||||
print(recv.result(10))
|
||||
|
||||
msg = l4.rpc.recvmsg(last_id=-1)
|
||||
|
||||
|
||||
def test_zbase32():
|
||||
zb32 = b'd75qtmgijm79rpooshmgzjwji9gj7dsdat8remuskyjp9oq1ugkaoj6orbxzhuo4njtyh96e3aq84p1tiuz77nchgxa1s4ka4carnbiy'
|
||||
b = zbase32.decode(zb32)
|
||||
enc = zbase32.encode(b)
|
||||
assert(enc == zb32)
|
||||
|
||||
Reference in New Issue
Block a user