Add support for private keys which include public (sub)key packets#1787
Draft
larabr wants to merge 4 commits intoopenpgpjs:mainfrom
Draft
Add support for private keys which include public (sub)key packets#1787larabr wants to merge 4 commits intoopenpgpjs:mainfrom
larabr wants to merge 4 commits intoopenpgpjs:mainfrom
Conversation
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.
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.
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
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
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: