Skip to content

fix(pgp): check packet length writes#1324

Closed
resolvicomai wants to merge 1 commit into
floatpane:masterfrom
resolvicomai:fix/yubikey-length-write-error
Closed

fix(pgp): check packet length writes#1324
resolvicomai wants to merge 1 commit into
floatpane:masterfrom
resolvicomai:fix/yubikey-length-write-error

Conversation

@resolvicomai
Copy link
Copy Markdown
Contributor

What?

Return and propagate write errors from writeNewFormatLength, and check the surrounding signature packet writes while building YubiKey OpenPGP signature packets.

Why?

Closes #621. The length helper previously wrote into the packet buffer without surfacing writer failures, which could silently produce an invalid packet if the writer failed. Added tests for the OpenPGP new-format length encodings and for write-error propagation.

Tests: go test ./pgp; go test ./...; make lint; git diff --check

@resolvicomai resolvicomai requested a review from a team as a code owner May 21, 2026 12:27
@floatpanebot floatpanebot added bug Something isn't working area/pgp PGP / encryption area/scard Smart card / PKCS#11 size/M Diff: 51–200 lines labels May 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/pgp PGP / encryption area/scard Smart card / PKCS#11 bug Something isn't working size/M Diff: 51–200 lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

BUG: Unchecked write error in writeNewFormatLength()

2 participants