Skip to content

fix(adapter): return SSH string length errors instead of panicking - #8

Merged
lusoris merged 1 commit into
mainfrom
fix/sshsig-no-panic
Oct 23, 2026
Merged

lusoris merged 1 commit into
mainfrom
fix/sshsig-no-panic

Conversation

@lusoris

@lusoris lusoris commented Oct 23, 2026

Copy link
Copy Markdown
Contributor

tools/knowledge-adapter-v2 built SSH strings with a checked length conversion that panicked on overflow, which HISS-07 forbids in production code. sshString now returns an error, and every caller wraps it with the field it was building; output for valid input is unchanged.

  • Planted: a field longer than the uint32 range returns an error naming the field; before the fix it panicked at sshsig.go:44.
  • go test -race passes in tools/knowledge-adapter-v2; gosec reports 0 issues there.

Order: engine-adoption-knowledge-gosec-debt-20261023

When converting SSH string lengths to uint32, sshString panicked on
overflow. Return ([]byte, error) instead and propagate wrapped errors
naming each field across OpenSSH key blob generation and review receipt
signing.

Handle errors when generating the allowed_signers document during bundle
writing.

Add test coverage verifying that SSH string length overflow returns an
error naming the affected field without panicking.

Signed-off-by: lusoris <lusoris@proton.me>
@lusoris
lusoris merged commit 5acc581 into main Oct 23, 2026
2 checks passed
@lusoris lusoris mentioned this pull request Oct 23, 2026
5 tasks done
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.

1 participant