Skip to content

Signature Packet format fixes - #2078

Closed
vanitasvitae wants to merge 3 commits into
bcgit:mainfrom
pgpainless:signaturePacketFormat
Closed

Signature Packet format fixes#2078
vanitasvitae wants to merge 3 commits into
bcgit:mainfrom
pgpainless:signaturePacketFormat

Conversation

@vanitasvitae

@vanitasvitae vanitasvitae commented May 14, 2025

Copy link
Copy Markdown
Contributor

This PR does:

  • Fix PGPSignature.join() to retain the signature packet length encoding format of the base signature. Previously, the merged result signature object would have its packet length format forced to LEGACY, no matter what the input signatures were encoded with. This would result in mismatches when doing comparisons between encodings in PGPainless' tests.
  • Fix PGPSignatureSubpacketGenerator.addEmbeddedSignature() to retrieve the encoding of the embedded signature in legacy format. Otherwise, signatures using the new packet length encoding format, which might have a different header length would result in broken embedded sigs, since the wrong number of header bytes would be cut stripped off.
  • Set the packet length encoding format of salted (= recently specified) signatures to the new packet format. This is done in an effort to begin phasing out producing the legacy packet length format.

Note: These changes are currently still part of #1911

@ligefeiBouncycastle
ligefeiBouncycastle self-requested a review May 20, 2025 06:39
hubot pushed a commit that referenced this pull request May 25, 2025
hubot pushed a commit that referenced this pull request May 25, 2025
Signature Packet format fixes #2078

See merge request root/bc-java!98
@ligefeiBouncycastle

Copy link
Copy Markdown
Collaborator

Thank you for this PR. The code has been merged by c70e8cd

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants