mcginty / snow

A Rust implementation of the Noise Protocol Framework
Apache License 2.0
886 stars 119 forks source link

How to accept multiple public keys? #67

Open vifino opened 4 years ago

vifino commented 4 years ago

Hey. I've been wondering how to properly accept multiple public keys instead of just a single one. Does simply not providing a remote_public_key(&pubkey) and checking HandshakeState.get_remote_static() work? Using a psk works, but it's not ideal.

fogti commented 4 years ago

~It could be really useful to check against a list of allowed public keys instead of just allowing a single one.~ I think simply not providing a remote_public_key and checking HandshakeState.get_remote_static() should work.

mcginty commented 4 years ago

@vifino sorry for not getting back to you. @zserik is correct - using the X pattern (static key for sender is transmitted) will allow you to receive a static key and then verify it in whatever way you'd like.