-
Notifications
You must be signed in to change notification settings - Fork 814
Add support for private keys which include public (sub)key packets #1787
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
Draft
larabr
wants to merge
4
commits into
openpgpjs:main
Choose a base branch
from
larabr:v6_secret_subkeys_under_public_key
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
twiss
reviewed
Aug 16, 2024
| for (let i = 0; i < keyIndex.length; i++) { | ||
| if (packetlist[keyIndex[i]].constructor.tag === enums.packet.publicKey) { | ||
| const firstPrivateKeyList = packetlist.slice(keyIndex[i], keyIndex[i + 1]); | ||
| if (packetlist[keyIndex[i]].constructor.tag === enums.packet.publicKey && !firstPrivateKeyList.findPacket(enums.packet.secretSubkey)) { |
Member
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very nitpicky, but since you have it anyway..
Suggested change
| if (packetlist[keyIndex[i]].constructor.tag === enums.packet.publicKey && !firstPrivateKeyList.findPacket(enums.packet.secretSubkey)) { | |
| if (firstPrivateKeyList[0].constructor.tag === enums.packet.publicKey && !firstPrivateKeyList.findPacket(enums.packet.secretSubkey)) { |
| for (let i = 0; i < keyIndex.length; i++) { | ||
| if (packetlist[keyIndex[i]].constructor.tag === enums.packet.publicKey) { | ||
| const oneKeyList = packetlist.slice(keyIndex[i], keyIndex[i + 1]); | ||
| if (packetlist[keyIndex[i]].constructor.tag === enums.packet.publicKey && !oneKeyList.findPacket(enums.packet.secretSubkey)) { |
Member
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggested change
| if (packetlist[keyIndex[i]].constructor.tag === enums.packet.publicKey && !oneKeyList.findPacket(enums.packet.secretSubkey)) { | |
| if (oneKeyList[0].constructor.tag === enums.packet.publicKey && !oneKeyList.findPacket(enums.packet.secretSubkey)) { |
9805782 to
9799ff9
Compare
twiss
reviewed
Aug 21, 2024
9799ff9 to
36b5a3f
Compare
1baf741 to
a3839f6
Compare
…ic key and public subkeys
If dummy or public (sub)key packets are present alongside secret ones, the latter are now selected first, regardless of creation date.
36b5a3f to
366d2c8
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
As per crypto-refresh, a key is to considered private as long as it includes at least one secret (sub)key packet.
Previously, a
PrivateKeycould only include secret (sub)key packets.TODO: