-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
381 wire authentication #402
Merged
NhoxxKienn
merged 9 commits into
hyperledger-labs:main
from
perun-network:381_wire_authentication
Mar 11, 2024
Merged
381 wire authentication #402
NhoxxKienn
merged 9 commits into
hyperledger-labs:main
from
perun-network:381_wire_authentication
Mar 11, 2024
Conversation
This file contains 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
Signed-off-by: Minh Huy Tran <[email protected]>
…ple, update interface of wire.Account/Address to allow signing/verification Signed-off-by: Minh Huy Tran <[email protected]>
Signed-off-by: Minh Huy Tran <[email protected]>
…re implementations Signed-off-by: Minh Huy Tran <[email protected]>
Signed-off-by: Minh Huy, Tran <[email protected]>
Signed-off-by: Minh Huy Tran <[email protected]>
Signed-off-by: Minh Huy Tran <[email protected]>
DragonDev1906
requested changes
Mar 6, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 <[email protected]>
Signed-off-by: Minh Huy Tran <[email protected]>
DragonDev1906
approved these changes
Mar 8, 2024
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/simple
Issue: currently using TCP without TLS for communication.
Solution: Implement a simple mutual TLS Dialer and TLS Listener in the
simple
package, the default net wire forgo-perun
.Bonus: A simple connection test has also been set up with self-signed Certificates in
dialer_internal_test.go
Wire identity authentication
Location:
wire/address.go
,wire/account.go
, andwire/net/exchange_addr.go
,wire.proto
Issue: 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/wire
andwire/net/simple
Description: 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