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

Add delegated credentials, as seen in #26 #28

Merged
merged 1 commit into from
Mar 3, 2021

Conversation

claucece
Copy link
Contributor

@claucece claucece commented Aug 5, 2020

For #26

@armfazh armfazh added the pqxp PostQuantum Experimentation label Aug 5, 2020
Copy link
Contributor

@armfazh armfazh left a comment

Choose a reason for hiding this comment

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

Some general comments. @claucece

src/crypto/tls/delegated_credentials.go Outdated Show resolved Hide resolved
src/crypto/tls/delegated_credentials.go Outdated Show resolved Hide resolved
src/crypto/tls/delegated_credentials.go Outdated Show resolved Hide resolved
src/crypto/tls/delegated_credentials.go Show resolved Hide resolved
src/crypto/tls/delegated_credentials.go Outdated Show resolved Hide resolved
src/crypto/tls/delegated_credentials.go Outdated Show resolved Hide resolved
src/crypto/tls/delegated_credentials_test.go Show resolved Hide resolved
src/crypto/tls/delegated_credentials.go Outdated Show resolved Hide resolved
src/crypto/tls/handshake_server_tls13.go Outdated Show resolved Hide resolved
src/crypto/tls/handshake_server_tls13.go Outdated Show resolved Hide resolved
@claucece
Copy link
Contributor Author

claucece commented Aug 6, 2020

thanks @armfazh for the review! This is still WIP and has still some todos, so there is lots of errors. I'll assign you and @bwesterb once it is ready for review ;)

@claucece claucece marked this pull request as draft August 6, 2020 13:15
@armfazh
Copy link
Contributor

armfazh commented Aug 6, 2020

This is still WIP and has still some todos, so there is lots of errors.

Yes, we are iterating in this codebase, and happy to review as many times as needed.

@claucece
Copy link
Contributor Author

claucece commented Aug 6, 2020

Yes, we are iterating in this codebase, and happy to review as many times as needed.

Oh, perfect! Every now and then when I finish a task of the issue, I'll mark it for review ;) Thanks so much!

@thomwiggers
Copy link
Contributor

this should probably be rebased on the cf branch, because right now the diff is enormous

@claucece
Copy link
Contributor Author

claucece commented Aug 18, 2020

@thomwiggers the idea to have a separate branch is to be able to integrate to golang (which won't integrate probably the KEM TLS exp): that is why it differs from the cf branch.

@claucece claucece marked this pull request as ready for review August 19, 2020 11:57
@claucece claucece changed the base branch from cf to go-master August 19, 2020 12:37
@claucece claucece marked this pull request as draft August 19, 2020 13:48
@claucece claucece marked this pull request as ready for review August 19, 2020 14:56
@claucece
Copy link
Contributor Author

@bwesterb @armfazh @chris-wood ready for review as a first version. I might add some refactors and other ideas in the mean time; but should we good now. Sorry for opening and closing it as a draft but I had some conflicts with go1.15

@claucece
Copy link
Contributor Author

@bwesterb @armfazh Please, review until commit 8946da6

I'll add some more refactors, and some more functionality for the client; but I wanted you to check the overall work until that point ;)

Copy link
Contributor

@armfazh armfazh left a comment

Choose a reason for hiding this comment

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

few comments

src/crypto/tls/delegated_credentials_test.go Outdated Show resolved Hide resolved
src/crypto/tls/delegated_credentials_test.go Outdated Show resolved Hide resolved
src/crypto/tls/delegated_credentials_test.go Outdated Show resolved Hide resolved
src/crypto/tls/delegated_credentials.go Outdated Show resolved Hide resolved
src/crypto/tls/delegated_credentials.go Show resolved Hide resolved
src/crypto/tls/delegated_credentials.go Outdated Show resolved Hide resolved
src/crypto/tls/delegated_credentials.go Outdated Show resolved Hide resolved
src/crypto/tls/delegated_credentials.go Outdated Show resolved Hide resolved
src/crypto/x509/x509.go Outdated Show resolved Hide resolved
src/crypto/tls/handshake_client_tls13.go Outdated Show resolved Hide resolved
Copy link
Member

@bwesterb bwesterb left a comment

Choose a reason for hiding this comment

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

I'm not intimately familiar with the Go Tls implementation nor with delegated credentials, so this "approve" should be read as a "I didn't see anything fishy". Looks good, well documented.

src/crypto/tls/common.go Outdated Show resolved Hide resolved
src/crypto/tls/delegated_credentials.go Outdated Show resolved Hide resolved
src/crypto/tls/delegated_credentials.go Outdated Show resolved Hide resolved
Copy link
Contributor

@Lekensteyn Lekensteyn left a comment

Choose a reason for hiding this comment

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

Initial (partial) review, I have yet to look at delegated_credentials.go and delegated_credentials_test.go

src/crypto/tls/common.go Outdated Show resolved Hide resolved
src/crypto/tls/common.go Outdated Show resolved Hide resolved
src/crypto/tls/common.go Outdated Show resolved Hide resolved
src/crypto/tls/conn.go Outdated Show resolved Hide resolved
src/crypto/tls/generate_cert.go Outdated Show resolved Hide resolved
src/crypto/tls/handshake_client.go Outdated Show resolved Hide resolved
src/crypto/tls/handshake_client_tls13.go Outdated Show resolved Hide resolved
src/crypto/tls/handshake_client_tls13.go Outdated Show resolved Hide resolved
src/crypto/tls/handshake_messages.go Outdated Show resolved Hide resolved
src/crypto/tls/handshake_server_tls13.go Outdated Show resolved Hide resolved
Copy link
Contributor

@chris-wood chris-wood left a comment

Choose a reason for hiding this comment

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

This is looking good! I left some comments for areas and things that might warrant further investigation. Please let me know if anything is not clear. :-)

src/crypto/tls/common.go Outdated Show resolved Hide resolved
src/crypto/tls/delegated_credentials.go Outdated Show resolved Hide resolved
src/crypto/tls/handshake_client_tls13.go Outdated Show resolved Hide resolved
src/crypto/tls/handshake_client_tls13.go Outdated Show resolved Hide resolved
src/crypto/tls/handshake_client_tls13.go Outdated Show resolved Hide resolved
src/crypto/tls/delegated_credentials.go Outdated Show resolved Hide resolved
src/crypto/tls/delegated_credentials.go Outdated Show resolved Hide resolved
src/crypto/tls/delegated_credentials.go Show resolved Hide resolved
src/crypto/tls/delegated_credentials.go Outdated Show resolved Hide resolved
src/crypto/tls/delegated_credentials.go Outdated Show resolved Hide resolved
Copy link
Contributor

@cjpatton cjpatton left a comment

Choose a reason for hiding this comment

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

First round! Some high level things:

  1. Unless there's a good reason to keep it, I think the GetDelegatedCredential callback should be replaced with a list of DCs. See inline comment for details.
  2. Can you modify the package comment at the top of tls.go to document the fact that this package implements draft-ietf-tls-subcerts-09?
  3. Please make sure all comments are wrapped at 80 characters.
  4. For data serialization, use "golang.org/x/crypto/cryptobyte". This make the code much easier to read and verify.
  5. Please remove any empty lines you added and add back any you removed. One of our goals for this repo is to minimize differences with upstream Go wherever possible

src/crypto/tls/common.go Show resolved Hide resolved
src/crypto/tls/auth.go Show resolved Hide resolved
src/crypto/tls/common.go Outdated Show resolved Hide resolved
src/crypto/tls/common.go Show resolved Hide resolved
src/crypto/tls/common.go Outdated Show resolved Hide resolved
src/crypto/tls/handshake_messages.go Outdated Show resolved Hide resolved
src/crypto/tls/handshake_messages.go Show resolved Hide resolved
src/crypto/tls/handshake_server_tls13.go Outdated Show resolved Hide resolved
src/crypto/tls/handshake_server_tls13.go Outdated Show resolved Hide resolved
src/crypto/tls/handshake_server_tls13.go Outdated Show resolved Hide resolved
@claucece
Copy link
Contributor Author

claucece commented Jan 6, 2021

Hi @cjpatton ! Thanks for this! I'll only solve this week the small comments, as any large change will likely break the code of kem-tls needed for Friday. Thanks!

@cjpatton
Copy link
Contributor

Rebased.

@claucece claucece force-pushed the cf-delegated-credentials branch 2 times, most recently from 8237cce to 3cd5592 Compare February 26, 2021 17:55
Copy link

@wbl wbl left a comment

Choose a reason for hiding this comment

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

A few comments that need addressing first

src/crypto/tls/tls_test.go Show resolved Hide resolved
src/crypto/x509/verify_test.go Show resolved Hide resolved
src/crypto/x509/x509.go Outdated Show resolved Hide resolved
Copy link
Contributor

@cjpatton cjpatton left a comment

Choose a reason for hiding this comment

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

Last round for me. Just minor comments left.

src/crypto/tls/auth.go Outdated Show resolved Hide resolved
src/crypto/tls/auth.go Outdated Show resolved Hide resolved
src/crypto/tls/delegated_credentials.go Outdated Show resolved Hide resolved
src/crypto/tls/delegated_credentials.go Outdated Show resolved Hide resolved
src/crypto/tls/delegated_credentials.go Outdated Show resolved Hide resolved
// with TLS 1.3. If this is nil, then the server will not offer
// a DelegatedCredential. If the call returns nil, the server is also
// not offering a DelegatedCredential.
GetDelegatedCredential func(*ClientHelloInfo, *CertificateRequestInfo) (*DelegatedCredential, crypto.PrivateKey, error)
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm good with whichever way you land here. (Consider this comment non-blocking.)

src/crypto/tls/handshake_messages.go Outdated Show resolved Hide resolved
src/crypto/tls/handshake_messages.go Outdated Show resolved Hide resolved
src/crypto/tls/handshake_messages.go Outdated Show resolved Hide resolved
src/crypto/tls/tls.go Outdated Show resolved Hide resolved
Copy link
Contributor

@cjpatton cjpatton left a comment

Choose a reason for hiding this comment

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

Unrequesting changes in order to unblock merge :)

@cjpatton cjpatton self-requested a review March 1, 2021 18:53
@claucece
Copy link
Contributor Author

claucece commented Mar 1, 2021

Closing this, as it will only be experimental.

@claucece claucece closed this Mar 1, 2021
@wbl wbl reopened this Mar 2, 2021
@cjpatton
Copy link
Contributor

cjpatton commented Mar 3, 2021

Rebased. Merging as-is, with existing approvals. Note that future changes to crypto/tls and crypto/x509 will need approval from the respective codeowners.

@cjpatton cjpatton changed the base branch from cf to cf1.16 March 3, 2021 16:59
@cjpatton cjpatton merged commit d7473e7 into cf1.16 Mar 3, 2021
@cjpatton cjpatton deleted the cf-delegated-credentials branch March 3, 2021 17:47
@cjpatton cjpatton restored the cf-delegated-credentials branch March 3, 2021 17:47
@bwesterb bwesterb deleted the cf-delegated-credentials branch August 4, 2022 10:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pqxp PostQuantum Experimentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants