Commit Graph

3000 Commits

Author SHA1 Message Date
Felix Lange 028775a086 cmd/ethereum, cmd/mist: add flag for discovery bootstrap nodes 2015-02-07 00:52:49 +01:00
Felix Lange 2cf4fed11b cmd/mist, eth, javascript, p2p: use Node URLs for peer suggestions 2015-02-07 00:46:56 +01:00
Felix Lange e34d134102 p2p: fixes for actual connections
The unit test hooks were turned on 'in production'.
2015-02-07 00:43:52 +01:00
Felix Lange 8564eb9f7e p2p/discover: add node URL functions, distinguish TCP/UDP ports
The discovery RPC protocol does not yet distinguish TCP and UDP ports.
But it can't hurt to do so in our internal model.
2015-02-07 00:12:23 +01:00
Felix Lange 56f777b2fc cmd/ethereum, cmd/mist, core, eth, javascript, xeth: fixes for new p2p API 2015-02-06 00:03:59 +01:00
Felix Lange 8e8ec8f5f8 cmd/peerserver: is gone
Will be back soon. Maybe.
2015-02-06 00:00:36 +01:00
Felix Lange 5bdc115943 p2p: integrate p2p/discover
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
2015-02-06 00:00:36 +01:00
Felix Lange 739066ec56 p2p/discover: add some helper functions 2015-02-06 00:00:36 +01:00
Felix Lange 12224c7f59 p2p/discover: new package implementing the Node Discovery Protocol 2015-02-06 00:00:36 +01:00
Felix Lange 8c3095faf0 rlp: fix encoding of arrays with byte element type 2015-02-06 00:00:36 +01:00
Felix Lange 410b35e913 crypto: make it easier to run Sha3 on multiple inputs
crypto.Sha3(append(foo, bar)) --> crypto.Sha3(foo, bar)
crypto.Sha3([]byte{}) --> crypto.Sha3()
2015-02-06 00:00:36 +01:00
zelig 2e48d39fc7 key generation abstracted out, for testing with deterministic keys 2015-02-06 00:00:36 +01:00
zelig 488a042736 fix clientidentity test after privkey removed 2015-02-06 00:00:36 +01:00
zelig 71765957e4 get rid of Private Key in ClientIdentity 2015-02-06 00:00:36 +01:00
zelig 68205dec9f make crypto handshake calls package level, store privateKey on peer + tests ok 2015-02-06 00:00:36 +01:00
zelig 4499743522 apply handshake related improvements from p2p.crypto branch 2015-02-06 00:00:35 +01:00
zelig 54252ede31 add temporary forced session token generation 2015-02-06 00:00:35 +01:00
zelig faa069a126 peer-level integration test for crypto handshake
- 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
2015-02-06 00:00:35 +01:00
zelig 20aade56c3 chop first byte when cryptoid.PubKeyS is set from identity.Pubkey() since this is directly copied in the auth message 2015-02-06 00:00:35 +01:00
zelig 1f2adb05b5 add initial peer level test (failing) 2015-02-06 00:00:35 +01:00
zelig 4afde4e738 add code documentation 2015-02-06 00:00:35 +01:00
zelig 364b783281 changes that fix it all:
- 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
2015-02-06 00:00:35 +01:00
zelig 58fc2c679b important fix for peer pubkey. when taken from identity, chop first format byte! 2015-02-06 00:00:35 +01:00
zelig 923504ce3d add equality check for nonce and remote nonce 2015-02-06 00:00:35 +01:00
zelig 2e868566d7 add minor comments to the test 2015-02-06 00:00:35 +01:00
zelig e252c634cb first stab at integrating crypto in our p2p
- 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()
2015-02-06 00:00:35 +01:00
zelig 1803c65e40 integrate cryptoId into peer and connection lifecycle 2015-02-06 00:00:35 +01:00
zelig 489d956283 completed the test. FAIL now. it crashes at diffie-hellman. ECIES -> secp256k1-go panics 2015-02-06 00:00:35 +01:00
zelig 076c382a74 handshake test to crypto 2015-02-06 00:00:35 +01:00
zelig 3b6385b146 handshake test to crypto 2015-02-06 00:00:34 +01:00
zelig 714b955d6e fix crash
- 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
2015-02-06 00:00:34 +01:00
zelig b855f671a5 rewrite to comply with latest spec
- 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
2015-02-06 00:00:34 +01:00
zelig 4e52adb84a add crypto auth logic to p2p 2015-02-06 00:00:34 +01:00
zelig d227f6184e fix protocol to accomodate privkey 2015-02-06 00:00:34 +01:00
zelig 88167f39a6 add privkey to clientIdentity + tests 2015-02-06 00:00:34 +01:00
zelig c8a8aa0d43 initial hook for crypto handshake (void, off by default) 2015-02-06 00:00:34 +01:00
obscuren 6b5f25802e Merge branch 'develop' of github.com-obscure:ethereum/go-ethereum into develop 2015-02-05 14:42:22 -08:00
obscuren f8c1eb157d Undone fix. Will re-enable once chain resets 2015-02-05 14:42:12 -08:00
Taylor Gerring 59665ade85 Pin Travis go version to 1.4.1 2015-02-05 16:27:54 -06:00
Taylor Gerring c1f6e259a9 Only submit on coverage report success 2015-02-05 16:04:42 -06:00
Taylor Gerring 03b89ab712 Only download missing deps, not build 2015-02-05 16:03:29 -06:00
Taylor Gerring ae3e9d4881 Don't reference by $GOROOT 2015-02-05 16:02:15 -06:00
obscuren cad53fa191 Merge branch 'develop' of github.com-obscure:ethereum/go-ethereum into develop
Conflicts:
	README.md
2015-02-05 12:36:30 -08:00
obscuren 0e682d936d Updated readme 2015-02-05 12:35:46 -08:00
obscuren cec30e23b2 Updated readme 2015-02-05 12:34:47 -08:00
Jeffrey Wilcke 47129428fe Merge pull request #290 from Gustav-Simonsson/correct_block_parent_timestamp_check
Correct block parent timestamp check and typos
2015-02-05 12:23:56 -08:00
obscuren 2f30a27b2b Merge branch 'develop' of github.com-obscure:ethereum/go-ethereum into develop 2015-02-05 12:22:44 -08:00
obscuren 8be1d134aa updated home 2015-02-05 12:22:35 -08:00
obscuren 7e0799ff21 Merge commit '9d84609b3faf797f4a611587abdda3d6b3b07917' into develop 2015-02-05 12:07:36 -08:00
Marek Kotewicz 9d84609b3f Merge branch 'master' of https://github.com/ethereum/ethereum.js 2015-02-05 21:06:50 +01:00