-
Notifications
You must be signed in to change notification settings - Fork 98
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
Unclear TODO: "Self-sigs verification is not yet working because self-sigs are not parsed!!!" #457
Comments
It is dead code because if we allow it execution, then it won't work and cause breakage. So for now we just print a warning in a hope someone finishes it. The present dead code is mostly a memo on what we are going to do. |
What specifically won't work? the codepaths exist that should populate the "hope someone finishes it" doesn't sound like a great plan, especially if there are no open bug reports about what is broken. I'll try to remove it and make sure the test suites pass, but if you have any specific guidance about what you think specifically needs to be fixed, i'd appreciate it. |
OK, i did a bit more debugging, which i've posted to my There are at least three ways that i think these verifications are broken:
In the So, we can't remove that code because there's a recursive loop. |
I am not a professional cryptographer, so I just whitelisted those of the supported curves that had a green tick for them on https://safecurves.cr.yp.to/ . I have no opinion about the validity of the criteria listed there, I'm neither a mathematician nor a cryptographer. |
|
Thanks for catching this. I haven't tested that case. My use case was centered around keys and signatures generated by gpg and PGPy used only for verification. When I saw the self-sigs were not parsed, since I had no time to spend on digging and debugging the parser, I just disabled the code path verifying the self-sigs. |
It is likely that |
There are a lot of similar-sounding user-facing functions here, and it's hard to imagine a user knowing when they should call one or the other. In PGPKey alone, i'm seeing (ignoring the ones that are prefixed with an
Seems to me like there should just be a single user-facing function or property that indicates that the key itself is not inherently broken. What "broken" means is of course different depending on how the user might want to use a given key (e.g. encrypt, decrypt, sign, or verify), but we can defer to the These functions were all added between 0.5.4 and 0.6.0. So i'm proposing that we remove them all, and leave only a single property like |
I apologize for the bad quality of my PRs, they really don't represent a finished and stable set of functionality and I have never expected them to be merged without a proper review. I think that the functions structure the code and document its behavior, and also provide the points to override the behaviour in subclasses if anyone needs it, so I think that it is preferred to just keep them just prefixed. My vision is that the checks should be done automatically when either keys are imported or used, and calling the certain methods is when a user wants to check certain properties of keys without checking the rest. But feel free to do everything you consider as right, including just reverting my changes completely. |
in b8c28c5, @KOLANICH introduced
PGPKey.self_verified
, which contains the warning mentioned in the subject here:This is pretty odd. The caching part of the function, which appears to actually call the expected verification, is effectively dead code because of the early
return SecurityIssues.OK
.I recommend dropping the first two lines of this function.
The text was updated successfully, but these errors were encountered: