Skip to content
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

rlp, p2p, p2p/discover: EIP-8 changes #2091

Merged
merged 12 commits into from
Feb 19, 2016
Merged

rlp, p2p, p2p/discover: EIP-8 changes #2091

merged 12 commits into from
Feb 19, 2016

Conversation

fjl
Copy link
Contributor

@fjl fjl commented Dec 24, 2015

Implements ethereum/EIPs#49

@fjl fjl added the network label Dec 24, 2015
@fjl fjl added this to the Homestead milestone Dec 24, 2015
@robotally
Copy link

Vote Count Reviewers
👍 2 @karalabe @obscuren
👎 0

Updated: Fri Feb 19 10:01:31 UTC 2016

@codecov-io
Copy link

Current coverage is 48.19%

Merging #2091 into develop will increase coverage by +0.31% as of 506e27e

Powered by Codecov. Updated on successful CI builds.

The s2 parameter was not actually written to the MAC.
@fjl
Copy link
Contributor Author

fjl commented Feb 12, 2016

@obscuren @karalabe @Gustav-Simonsson please review

@obscuren obscuren modified the milestones: Homestead, 1.3.4 Feb 15, 2016
@@ -192,11 +192,9 @@ func concatKDF(hash hash.Hash, z, s1 []byte, kdLen int) (k []byte, err error) {
// messageTag computes the MAC of a message (called the tag) as per
// SEC 1, 3.5.
func messageTag(hash func() hash.Hash, km, msg, shared []byte) []byte {
if shared == nil {
shared = make([]byte, 0)
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was this shared thing never used until now? Why is it only added to the hash now?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We didn't use it until now.

etypeinfo, err := cachedTypeInfo1(typ.Elem(), tags{})
if err != nil {
return nil, err
}
writer := func(val reflect.Value, w *encbuf) error {
lh := w.list()
if !ts.dotdot {
defer w.listEnd(w.list())
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@karalabe here. w.list() is executed prior to the rest of the code.

EDIT: nifty pattern BTW :-D cool trick!

@obscuren
Copy link
Contributor

As discussed on gitter change the .. to tail to make it more descriptive what the tag does.

@@ -460,6 +468,29 @@ func isTemporaryError(err error) bool {
return ok && tempErr.Temporary() || isPacketTooBig(err)
}

func encodePacket1(priv *ecdsa.PrivateKey, ptype byte, req interface{}, additional []byte) ([]byte, error) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does this method do? I don't see it used in any of the code.

@karalabe
Copy link
Member

Code looks solid to me. The crypto aspects I cannot verify, but given the thorough tests + the cross client interop experiments, I guess those parts are correct. Please address the issues I've raised and the it's a Go from my part.

@fjl
Copy link
Contributor Author

fjl commented Feb 19, 2016

PTAL. will squash when you're done reviewing.

@karalabe
Copy link
Member

LGTM 👍

@obscuren
Copy link
Contributor

👍

@karalabe
Copy link
Member

@fjl Please squash.

@obscuren obscuren merged this pull request into ethereum:develop Feb 19, 2016
@obscuren obscuren removed the review label Feb 19, 2016
@obscuren
Copy link
Contributor

@fjl please re-open.

@fjl fjl removed this from the 1.3.4 milestone Feb 24, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants