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 support for unencrypted private crypt4gh keys #121

Merged
merged 3 commits into from
Feb 27, 2024

Conversation

pontus
Copy link
Contributor

@pontus pontus commented Feb 22, 2024

This fixes support for unencrypted private crypt4gh keys. Support essentially existed but due to a logic error wasn't usable (KDF was checked against a list of actual KDFs, not including none, which is used for the unencrypted case) and failed if no match was found.

This moves the unencrypted case up a bit and lets the following code be a little simpler, also adds a testcase for an unencrypted key.

@blankdots
Copy link
Contributor

i think we can go with version 1.9.1 as the way i read it it is a bug fix
change version https://github.com/neicnordic/crypt4gh/blob/master/internal/version/version.go#L10

@blankdots blankdots requested a review from a team February 23, 2024 16:38
Copy link
Contributor

@blankdots blankdots left a comment

Choose a reason for hiding this comment

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

how about we also add a test for decrypting with unprotected key, just in case

@blankdots blankdots requested a review from a team February 26, 2024 12:41
Copy link
Contributor

@dbampalikis dbampalikis left a comment

Choose a reason for hiding this comment

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

Apart for the test mentioned by Stefan, it looks good. Also tested it with the pipeline

@codecov-commenter
Copy link

Codecov Report

Attention: Patch coverage is 60.00000% with 10 lines in your changes are missing coverage. Please review.

Project coverage is 69.75%. Comparing base (88c2108) to head (9060c4f).
Report is 4 commits behind head on master.

Files Patch % Lines
keys/keys.go 60.00% 5 Missing and 5 partials ⚠️

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #121      +/-   ##
==========================================
+ Coverage   69.72%   69.75%   +0.03%     
==========================================
  Files           6        6              
  Lines         862      873      +11     
==========================================
+ Hits          601      609       +8     
  Misses        141      141              
- Partials      120      123       +3     
Flag Coverage Δ
unittests 69.75% <60.00%> (+0.03%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

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

@blankdots blankdots merged commit c088dab into master Feb 27, 2024
6 checks passed
@blankdots blankdots deleted the bugfix/unencrypted_private_key branch February 27, 2024 08:38
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.

4 participants