aboutsummaryrefslogtreecommitdiffstats
path: root/p2p/crypto.go
Commit message (Collapse)AuthorAgeFilesLines
* p2p: disable encryption handshakeFelix Lange2015-02-191-363/+0
| | | | | | The diff is a bit bigger than expected because the protocol handshake logic has moved out of Peer. This is necessary because the protocol handshake will have custom framing in the final protocol.
* Moved ECIES to repo & added secondary title for webviewobscuren2015-02-141-1/+1
| | | | | * ECIES moved from obscuren to ethereum * Added html META[name=badge] to reflect menuItem.secondaryTitle
* p2p: integrate p2p/discoverFelix Lange2015-02-061-235/+194
| | | | | | | | | | | | Overview of changes: - ClientIdentity has been removed, use discover.NodeID - Server now requires a private key to be set (instead of public key) - Server performs the encryption handshake before launching Peer - Dial logic takes peers from discover table - Encryption handshake code has been cleaned up a bit - baseProtocol is gone because we don't exchange peers anymore - Some parts of baseProtocol have moved into Peer instead
* key generation abstracted out, for testing with deterministic keyszelig2015-02-061-5/+36
|
* make crypto handshake calls package level, store privateKey on peer + tests okzelig2015-02-061-64/+23
|
* apply handshake related improvements from p2p.crypto branchzelig2015-02-061-21/+23
|
* add temporary forced session token generationzelig2015-02-061-0/+3
|
* peer-level integration test for crypto handshakezelig2015-02-061-6/+47
| | | | | | | | | - add const length params for handshake messages - add length check to fail early - add debug logs to help interop testing (!ABSOLUTELY SHOULD BE DELETED LATER) - wrap connection read/writes in error check - add cryptoReady channel in peer to signal when secure session setup is finished - wait for cryptoReady or timeout in TestPeersHandshake
* chop first byte when cryptoid.PubKeyS is set from identity.Pubkey() since ↵zelig2015-02-061-1/+11
| | | | this is directly copied in the auth message
* add code documentationzelig2015-02-061-15/+47
|
* changes that fix it all:zelig2015-02-061-50/+61
| | | | | | | | | | | - set proper public key serialisation length in pubLen = 64 - reset all sizes and offsets - rename from DER to S (we are not using DER encoding) - add remoteInitRandomPubKey as return value to respondToHandshake - add ImportPublicKey with error return to read both EC golang.elliptic style 65 byte encoding and 64 byte one - add ExportPublicKey falling back to go-ethereum/crypto.FromECDSAPub() chopping off the first byte - add Import - Export tests - all tests pass
* first stab at integrating crypto in our p2pzelig2015-02-061-15/+38
| | | | | | | - abstract the entire handshake logic in cryptoId.Run() taking session-relevant parameters - changes in peer to accomodate how the encryption layer would be switched on - modify arguments of handshake components - fixed test getting the wrong pubkey but it till crashes on DH in newSession()
* integrate cryptoId into peer and connection lifecyclezelig2015-02-061-0/+15
|
* completed the test. FAIL now. it crashes at diffie-hellman. ECIES -> ↵zelig2015-02-061-16/+29
| | | | secp256k1-go panics
* handshake test to cryptozelig2015-02-061-2/+0
|
* fix crashzelig2015-02-061-22/+29
| | | | | | - add session token check and fallback to shared secret in responder call too - use explicit length for the types of new messages - fix typo resp[resLen-1] = tokenFlag
* rewrite to comply with latest speczelig2015-02-061-53/+138
| | | | | | | | - correct sizes for the blocks : sec signature 65, ecies sklen 16, keylength 32 - added allocation to Xor (should be optimized later) - no pubkey reader needed, just do with copy - restructuring now into INITIATE, RESPOND, COMPLETE -> newSession initialises the encryption/authentication layer - crypto identity can be part of client identity, some initialisation when server created
* add crypto auth logic to p2pzelig2015-02-061-0/+174