aboutsummaryrefslogtreecommitdiffstats
path: root/p2p/crypto_test.go
Commit message (Collapse)AuthorAgeFilesLines
* p2p: integrate p2p/discoverFelix Lange2015-02-061-126/+45
| | | | | | | | | | | | 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-7/+56
|
* make crypto handshake calls package level, store privateKey on peer + tests okzelig2015-02-061-15/+10
|
* apply handshake related improvements from p2p.crypto branchzelig2015-02-061-7/+7
|
* peer-level integration test for crypto handshakezelig2015-02-061-0/+11
| | | | | | | | | - 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
* add initial peer level test (failing)zelig2015-02-061-1/+52
|
* changes that fix it all:zelig2015-02-061-7/+85
| | | | | | | | | | | - 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
* add equality check for nonce and remote noncezelig2015-02-061-0/+6
|
* add minor comments to the testzelig2015-02-061-0/+4
|
* first stab at integrating crypto in our p2pzelig2015-02-061-20/+19
| | | | | | | - 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()
* completed the test. FAIL now. it crashes at diffie-hellman. ECIES -> ↵zelig2015-02-061-27/+28
| | | | secp256k1-go panics
* handshake test to cryptozelig2015-02-061-1/+1
|
* handshake test to cryptozelig2015-02-061-0/+54