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

Use *ring* for header protection (fixes #196) #200

Merged
merged 1 commit into from Jan 16, 2019
Merged

Use *ring* for header protection (fixes #196) #200

merged 1 commit into from Jan 16, 2019

Conversation

djc
Copy link
Collaborator

@djc djc commented Jan 16, 2019

No description provided.

@djc
Copy link
Collaborator Author

djc commented Jan 16, 2019

As usual, ring doesn't offer access to private key bytes. Should we create a separate stage in our API to to enable tests for their correctness? I think we have sufficient coverage through full header encryption/decryption.

@codecov
Copy link

codecov bot commented Jan 16, 2019

Codecov Report

Merging #200 into master will increase coverage by 0.03%.
The diff coverage is 85%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #200      +/-   ##
==========================================
+ Coverage    74.2%   74.24%   +0.03%     
==========================================
  Files          24       24              
  Lines        5905     5870      -35     
==========================================
- Hits         4382     4358      -24     
+ Misses       1523     1512      -11
Impacted Files Coverage Δ
quinn-proto/src/crypto.rs 91.46% <85%> (+2.44%) ⬆️
quinn-proto/src/packet.rs 82.16% <0%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e4c51ba...4b4a77e. Read the comment docs.

@codecov
Copy link

codecov bot commented Jan 16, 2019

Codecov Report

Merging #200 into master will increase coverage by 0.02%.
The diff coverage is 76.19%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #200      +/-   ##
==========================================
+ Coverage    74.2%   74.23%   +0.02%     
==========================================
  Files          24       24              
  Lines        5905     5873      -32     
==========================================
- Hits         4382     4360      -22     
+ Misses       1523     1513      -10
Impacted Files Coverage Δ
quinn-proto/src/crypto.rs 90.87% <76.19%> (+1.85%) ⬆️
quinn-proto/src/packet.rs 82.36% <0%> (+0.2%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e4c51ba...2dd416b. Read the comment docs.

Ralith
Ralith previously approved these changes Jan 16, 2019
Copy link
Collaborator

@Ralith Ralith left a comment

Choose a reason for hiding this comment

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

We could factor out the hkdf_expand call into its own trivial method, but I agree that the full-packet test vectors constitute adequate coverage already. Maybe just nuke the commented-out asserts?

@djc
Copy link
Collaborator Author

djc commented Jan 16, 2019

Nuked the commented-out stuff. Re-approve?

@djc djc merged commit dadb0b4 into master Jan 16, 2019
@delete-merged-branch delete-merged-branch bot deleted the ring-hp branch January 16, 2019 09:16
@briansmith
Copy link

As usual, ring doesn't offer access to private key bytes. Should we create a separate stage in our API to to enable tests for their correctness? I think we have sufficient coverage through full header encryption/decryption.

Check out https://github.com/briansmith/ring/blob/master/tests/quic_tests.rs, which shows how to test these kinds of things.

In this case, your old test was like this:

assert_eq!(
            client_header_key,	            client_header_key,
            HeaderKey::AesEcb128(hex!("0edd982a6ac527f2eddcbb7348dea5d7"))	            HeaderKey::AesEcb128(hex!("0edd982a6ac527f2eddcbb7348dea5d7"))

Instead of testing that the key is equal to some value, test that the result of using the key on a particular input has a particular output.

@djc
Copy link
Collaborator Author

djc commented Jan 16, 2019

We already have tests like that. 👍

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.

None yet

3 participants