Have CreateReplies() check for mismatched server#59
Merged
Conversation
Replace the sequence of nonces with the sequence of `Request` structures that encapsulate them.
The same certificate is used for all requests, so we expect each client to indicate the same server.
lukevalenta
reviewed
Aug 8, 2024
| for _, ver := range allVersions { | ||
| t.Run(ver.String(), func(t *testing.T) { | ||
| nonce1, _, _, err := CreateRequest([]Version{ver}, rand.Reader, nil, rootPublicKeyA) | ||
| _, _, req1Bytes, err := CreateRequest([]Version{ver}, rand.Reader, nil, rootPublicKeyA) |
Contributor
There was a problem hiding this comment.
I suppose it's a little redundant to have CreateRequest return the nonce, given that it can be parsed from the request bytes, but no harm in keeping it for convenience.
Contributor
Author
There was a problem hiding this comment.
Hmm, if we dropped this then the client would have to parse the nonce from the request in order to verify the response.
A nicer alternative might be to return an actual *Request that the client encodes itself. I suggest we address this in a future PR since it's not related to this one.
lukevalenta
approved these changes
Aug 8, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The same certificate is used for all requests, so we expect each client to indicate the same server.
This entails a bit of refactoring: instead of passing a list of nonces to
CreateReplies(), pass the requests themselves.