-
Notifications
You must be signed in to change notification settings - Fork 20.1k
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
Conversation
Current coverage is
|
7517539
to
dde5bb3
Compare
The s2 parameter was not actually written to the MAC.
@obscuren @karalabe @Gustav-Simonsson please review |
@@ -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) | |||
} |
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.
Was this shared
thing never used until now? Why is it only added to the hash now?
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.
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()) |
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.
@karalabe here. w.list()
is executed prior to the rest of the code.
EDIT: nifty pattern BTW :-D cool trick!
As discussed on gitter change the |
@@ -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) { |
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.
What does this method do? I don't see it used in any of the code.
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. |
PTAL. will squash when you're done reviewing. |
LGTM 👍 |
👍 |
@fjl Please squash. |
@fjl please re-open. |
Implements ethereum/EIPs#49