381 wire authentication#402
Merged
NhoxxKienn merged 9 commits intohyperledger-labs:mainfrom Mar 11, 2024
Merged
Conversation
Signed-off-by: Minh Huy Tran <huy@perun.network>
…ple, update interface of wire.Account/Address to allow signing/verification Signed-off-by: Minh Huy Tran <huy@perun.network>
Signed-off-by: Minh Huy Tran <huy@perun.network>
…re implementations Signed-off-by: Minh Huy Tran <huy@perun.network>
Signed-off-by: Minh Huy, Tran <94397738+NhoxxKienn@users.noreply.github.com>
Signed-off-by: Minh Huy Tran <huy@perun.network>
Signed-off-by: Minh Huy Tran <huy@perun.network>
DragonDev1906
requested changes
Mar 6, 2024
Contributor
DragonDev1906
left a comment
There was a problem hiding this comment.
I don't fully get why we need a separate field for the signature size, which is already in the byte slice and is encoded in protobuf. We can do it that way, I just don't see why we need/want an extra field.
…hing Signed-off-by: Minh Huy Tran <huy@perun.network>
Signed-off-by: Minh Huy Tran <huy@perun.network>
DragonDev1906
approved these changes
Mar 8, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR serves to fix the #381 issue of Wire Authentication.
TLS Connection
Location:
wire/net/simpleIssue: currently using TCP without TLS for communication.
Solution: Implement a simple mutual TLS Dialer and TLS Listener in the
simplepackage, the default net wire forgo-perun.Bonus: A simple connection test has also been set up with self-signed Certificates in
dialer_internal_test.goWire identity authentication
Location:
wire/address.go,wire/account.go, andwire/net/exchange_addr.go,wire.protoIssue: While each message currently contains a sender and recipient wire address in its Envelope, those are not yet authenticated; there is no signature in the
wire.proto. This means anyone can send a message coming from SENDER, without needing the private key, thus allowing to spoof any wire identity.Solution: Add Signing and Verifying for Account and Address. Like Wallet, the Account is expected to hold the private key, and the Address serves as the Public Key. Wire Authentication can be achieved by including a signature signed by the account in the
AuthResponseMsg.Recipient can check the validity of this signature using the Sender Address (Public Key) to decrypt the signature.Wire Authentication Implementation
Location:
backend/sim/wireandwire/net/simpleDescription: A simple implementation for the integration of key-pair to be used for wire authentication has been implemented in the testing and default wire.
For
backend/sim/wire: This simple signing and verification of signature, independent from the given message.For
wire/net/simple: RSA-2048 Random-generated Key-Pair for (Account, Address), Signing of a given message by hashing and encrypting. Signature length: 256 Bits.An address exchange test has also been added to the package to test the authentication function.
Visualization