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

Refactor pgp_key_t methods for noexcept and fix few coverity issues. #2265

Merged
merged 5 commits into from
Sep 5, 2024

Conversation

ni4
Copy link
Contributor

@ni4 ni4 commented Aug 28, 2024

...also return key material from pgp_key_t by pointer instead of references.

Copy link

codecov bot commented Aug 28, 2024

Codecov Report

Attention: Patch coverage is 98.36066% with 1 line in your changes missing coverage. Please review.

Project coverage is 84.00%. Comparing base (08e277d) to head (3c4cc4b).
Report is 5 commits behind head on main.

Files with missing lines Patch % Lines
src/lib/rnp.cpp 90.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2265      +/-   ##
==========================================
+ Coverage   83.90%   84.00%   +0.09%     
==========================================
  Files         113      113              
  Lines       23092    23066      -26     
==========================================
+ Hits        19376    19377       +1     
+ Misses       3716     3689      -27     

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

@ni4 ni4 force-pushed the ni4-fix-coverity-1559701 branch from 3012047 to 28194c7 Compare August 28, 2024 14:36
@ni4 ni4 marked this pull request as ready for review August 28, 2024 15:49
@@ -1596,7 +1590,9 @@ pgp_key_t::lock()
return true;
}

material().clear_secret();
if (material()) {
Copy link
Contributor

Choose a reason for hiding this comment

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

maybe it will be good to add assert not null here

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks, addressed this and the next comments.

@@ -1687,7 +1683,9 @@ pgp_key_t::unprotect(const pgp_password_provider_t &password_provider,
}
pkt_ = std::move(*decrypted_seckey);
/* current logic is that unprotected key should be additionally unlocked */
material().clear_secret();
if (material()) {
Copy link
Contributor

Choose a reason for hiding this comment

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

maybe it will be good to add assert not null here

@ni4 ni4 force-pushed the ni4-fix-coverity-1559701 branch from 28194c7 to 23830bf Compare August 29, 2024 11:42
Copy link
Member

@maxirmx maxirmx Aug 30, 2024

Choose a reason for hiding this comment

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

I believe the root cause is here: #2150
We have to use bash shell instead of setting up MSVC development environment (somthing like https://github.com/ilammy/msvc-dev-cmd)

@ni4 ni4 force-pushed the ni4-fix-coverity-1559701 branch from 36dad54 to e7bd36d Compare September 3, 2024 09:41
@ni4 ni4 force-pushed the ni4-fix-coverity-1559701 branch from 12b03b4 to cf9e812 Compare September 4, 2024 12:51
@ni4 ni4 force-pushed the ni4-fix-coverity-1559701 branch from cf9e812 to 3c4cc4b Compare September 4, 2024 18:53
@ni4
Copy link
Contributor Author

ni4 commented Sep 5, 2024

Having approvals and green CI - let's merge it. Thanks all!

@ni4 ni4 merged commit 3d45a6b into main Sep 5, 2024
123 checks passed
@ni4 ni4 deleted the ni4-fix-coverity-1559701 branch September 5, 2024 07:50
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