-
-
Notifications
You must be signed in to change notification settings - Fork 10
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
Fix Incorrect Unsigned Message Error When Using External Keys in decrypt Method #41
Comments
@boncossoftware thanks for this, going to prepare a PR |
Awesome @jerson, thanks! 🙏 Will the flutter-openpgp package also be updated? That is the package we are currently using that led me to find the issue here. |
yeah, is available in https://pub.dev/packages/openpgp/versions/3.8.1, take a look |
Ok great man. Thanks again! |
closing this, feel free to reopen if needed |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Issue Description
Current Behavior
In the
decrypt
method of theFastOpenPGP
struct, the code checks for theSignedBy
property to verify if a message is signed. However, this property is not set when the message is signed by keys that are not created with the library, causing issues when attempting to decrypt with a verification key.The test
TestFastOpenPGP_DecryptVerifyEntity
currently passes because the public key used to decrypt the message is the same public key of the private key used to decrypt the message. This does not trigger the issue described, as theSignedBy
property is correctly set in this specific scenario.Original Code
Problem
The
md.SignedBy
property is not set when the message is signed by keys not created with the library, which results in an error message indicating that the message is not signed, even though it is.Proposed Fix
Modified Code
Explanation
md.SignedBy
tomd.IsSigned
to accurately determine if a message is signed.md.IsSigned
is used to verify the signed status of the message, which resolves the issue when the message is signed by keys not created with the library.Impact
This change ensures that the
decrypt
method correctly identifies signed messages, even if they are signed by external keys, thus preventing false negatives when verifying signatures.Steps to Reproduce
decrypt
method.The text was updated successfully, but these errors were encountered: