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

Support compressed octets format in agreement::agree_ephemeral() #252

Closed
wants to merge 1 commit into from

Conversation

hansonchar
Copy link
Contributor

@hansonchar hansonchar commented Oct 21, 2023

Issues:

Addresses #1255

Description of changes:

  • Current behavior: agreement::agree_ephemeral() supports the peer public key in uncompressed octets format, but rejects if the peer public key is in compressed octets format.
  • Behavior after code change: supports the peer public key in either uncompressed or compressed octets format.
  • Added method compute_public_key_compressed to EphemeralPrivateKey so that users can retrieve the EC public key in compressed format when applicable.

Call-outs:

I've changed the test cases that used to disallow peer public key in compressed format to now allow them.

Testing:

cargo test

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license and the ISC license.

@hansonchar hansonchar requested a review from a team as a code owner October 21, 2023 16:07
@hansonchar hansonchar changed the title Support compresssed octets format in agreement::agree_ephemeral() #1255 Support compresssed octets format in agreement::agree_ephemeral() Oct 21, 2023
@hansonchar hansonchar changed the title Support compresssed octets format in agreement::agree_ephemeral() Support compressed octets format in agreement::agree_ephemeral() Oct 21, 2023
@codecov-commenter
Copy link

codecov-commenter commented Oct 24, 2023

Codecov Report

Attention: 3 lines in your changes are missing coverage. Please review.

Comparison is base (f6fd8a4) 95.65% compared to head (b83cbca) 95.67%.

Files Patch % Lines
aws-lc-rs/src/agreement.rs 96.22% 2 Missing ⚠️
aws-lc-rs/src/ec.rs 96.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #252      +/-   ##
==========================================
+ Coverage   95.65%   95.67%   +0.01%     
==========================================
  Files          57       57              
  Lines        7759     7818      +59     
==========================================
+ Hits         7422     7480      +58     
- Misses        337      338       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

+ Add EphemeralPrivateKey.compute_public_key_compressed()
+ Fix test cases for public keys in compressed format
@skmcgrail
Copy link
Member

I've stashed this PR contents at https://github.com/aws/aws-lc-rs/tree/hansonchar/main until we have time to review this work as part of the broader service teams' requirements.

@skmcgrail skmcgrail closed this Feb 13, 2024
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.

3 participants