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

Modified Signature checks #4

Merged
merged 1 commit into from
Jul 3, 2023

Conversation

jschpp
Copy link
Contributor

@jschpp jschpp commented May 23, 2023

This adds signature checks via the use of status-fd

Notes:

  • This will probably obsololte the checking of different output stream since status-fd will specify which one to check
  • The use of [...].Matches.Groups[1].Value shouldn't cause an error. (Or at least it didn't in my testing) it would be possible to rewrite this to handle strange edge case which could cause a null index error

WARNING:
this may break Signature Checking for keys which aren't already within the current keystore.

The correct way to handle that should be to import said key before checking the signature.

This could maybe be handled within this module but that would probably fall out of the scope of this PR.

fixes #3

This adds signature checks via the use of `status-fd`

Notes:
* This will probably obsololte the checking of different output stream
  since status-fd will specify which one to check
* The use of `[...].Matches.Groups[1].Value` shouldn't cause an error.
  (Or at least it didn't in my testing) it would be possible to rewrite
  this to handle strange edge case which could cause a null index error

WARNING:
this may break Signature Checking for keys which aren't already within
the current keystore.

The `correct` way to handle that should be to import said key before
checking the signature.

This could maybe be handled within this module but that would _probably_
fall out of the scope of this PR.
@jschpp
Copy link
Contributor Author

jschpp commented May 25, 2023

I've tried to think of something else... But I'm not quite happy either way...
So I'll mark this up ready for review

@jschpp jschpp marked this pull request as ready for review May 25, 2023 09:31
rhymeswithmogul added a commit that referenced this pull request Jul 3, 2023
Thank you for your hard work on this pull request. In the context
of this module, I consider a "good" signature to be one that is
valid, regardless of whether or not the key is in GPG's keyring.
This is in contrast to what GPG calls a "good" signature.

I've corrected your code to comply with my different definition,
and I've also enabled it to properly report bad signatures, too.
I will add documentation notes when I can.
rhymeswithmogul added a commit that referenced this pull request Jul 3, 2023
This is an improved version of the pull request originally submitted.

Signed-off-by: Colin Cogle <colin@colincogle.name>
@rhymeswithmogul rhymeswithmogul merged commit 2d7d823 into rhymeswithmogul:main Jul 3, 2023
@rhymeswithmogul
Copy link
Owner

Sorry that it took me so long to sit down and review this one, but it looks good! I didn't know that the --status-fd switch would have made my life a lot easier.

I made some minor changes to your PR because SecurityTxtToolkit and GnuPG disagree on what a "good" signature is.

@rhymeswithmogul rhymeswithmogul self-requested a review July 3, 2023 02:13
@rhymeswithmogul rhymeswithmogul self-assigned this Jul 3, 2023
@rhymeswithmogul rhymeswithmogul added enhancement New feature or request good first issue Good for newcomers documentation Improvements or additions to documentation labels Jul 3, 2023
@rhymeswithmogul rhymeswithmogul added this to the v1.4.0 milestone Jul 3, 2023
rhymeswithmogul added a commit that referenced this pull request Jul 3, 2023
I accidentally used PowerShell 7.1's new operators (??= and ?[])
when finishing that last pull request.  This, for obvious reasons,
would have made the script fail to run on Windows PowerShell 5.1.
The code has been refactored to remove those.
@jschpp jschpp deleted the fix-language-issues branch July 7, 2023 07:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Language Specific Code
2 participants