age decrypt took the text form (--armor output) only when the input began exactly with -----BEGIN AGE ENCRYPTED FILE-----. A blank line in front, as pasting from mail or a terminal can leave, made it read the file as the binary form and refuse it with unexpected intro.
unarmored in internal/agekey/agekey.go now looks for that line past up to 1024 bytes of whitespace, the same check the age tool makes in its own decrypt. The text form reader from filippo.io/age/armor already skips blank lines in front of the first line, up to the same limit, so nothing else changes.
A test in internal/agekey/agekey_test.go puts a blank line and a line of two spaces in front of a text-form file and expects the plaintext. The README's age decrypt section now says the text form needs no flag and that up to 1024 bytes of blank lines in front of it are skipped.
Judgement call: the issue's test names a newline and two spaces in front of the file. Written straight before the first line, the spaces end up on the line -----BEGIN AGE ENCRYPTED FILE-----, which the armor reader refuses (invalid first line), in age as here. The test puts the two spaces on a line of their own instead, to match age.
Model: opus-5-5
For https://git.eeqj.de/sneak/keyfunc/issues/77.
`age decrypt` took the text form (`--armor` output) only when the input began exactly with `-----BEGIN AGE ENCRYPTED FILE-----`. A blank line in front, as pasting from mail or a terminal can leave, made it read the file as the binary form and refuse it with `unexpected intro`.
`unarmored` in `internal/agekey/agekey.go` now looks for that line past up to 1024 bytes of whitespace, the same check the `age` tool makes in its own decrypt. The text form reader from `filippo.io/age/armor` already skips blank lines in front of the first line, up to the same limit, so nothing else changes.
A test in `internal/agekey/agekey_test.go` puts a blank line and a line of two spaces in front of a text-form file and expects the plaintext. The README's `age decrypt` section now says the text form needs no flag and that up to 1024 bytes of blank lines in front of it are skipped.
Judgement call: the issue's test names a newline and two spaces in front of the file. Written straight before the first line, the spaces end up on the line ` -----BEGIN AGE ENCRYPTED FILE-----`, which the armor reader refuses (`invalid first line`), in `age` as here. The test puts the two spaces on a line of their own instead, to match `age`.
Model: opus-5-5
README.md:284-286, age decrypt: the new sentence says blank lines in front of the text form are skipped, with no limit. The code skips at most 1024 bytes of them; with more, the file is refused with the same unexpected intro: "\n" message that #77 is about. Acceptable: the sentence says that up to 1024 bytes of blank lines are skipped, as age skips them.
Judgement call accepted: the test puts its two spaces on a line of their own rather than straight before the first line, because age refuses spaces on that line too and the definition of done asks for the same result as age.
Model: opus-5-5
One finding.
- `README.md:284-286`, `age decrypt`: the new sentence says blank lines in front of the text form are skipped, with no limit. The code skips at most 1024 bytes of them; with more, the file is refused with the same `unexpected intro: "\n"` message that https://git.eeqj.de/sneak/keyfunc/issues/77 is about. Acceptable: the sentence says that up to 1024 bytes of blank lines are skipped, as `age` skips them.
Judgement call accepted: the test puts its two spaces on a line of their own rather than straight before the first line, because `age` refuses spaces on that line too and the definition of done asks for the same result as `age`.
Model: opus-5-5
age decrypt took the text form only when the file began exactly with
-----BEGIN AGE ENCRYPTED FILE-----, so a blank line in front made it
read the file as the binary form and refuse it. It now looks for that
line past up to 1024 bytes of whitespace, as the age tool does, and
the text form reader skips the blank lines. A test puts a blank line
and a line of two spaces in front of a text-form file. The README's
age decrypt section says so.
Judgement call: that first line with spaces in front of it on the same
line is still refused, as age refuses it.
Model: opus-5-5
Rework: the README's age decrypt sentence now says that up to 1024 bytes of blank lines in front of the text form are skipped, as age skips them. The PR body says the same. Rebased onto next, still one commit.
Model: opus-5-5
Rework: the README's `age decrypt` sentence now says that up to 1024 bytes of blank lines in front of the text form are skipped, as `age` skips them. The PR body says the same. Rebased onto `next`, still one commit.
Model: opus-5-5
Unverified: the reference age tool is not installed here, so the last step of the issue's "How to see" was compared against its v1.3.2 decrypt code instead of run.
Model: opus-5-5
Review passed: https://git.eeqj.de/sneak/keyfunc/pulls/88 is ready to merge into `next`.
Unverified: the reference `age` tool is not installed here, so the last step of the issue's "How to see" was compared against its v1.3.2 decrypt code instead of run.
Model: opus-5-5
clawbot
merged commit f1e27814cd into next2026-10-14 22:35:30 +02:00
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
For #77.
age decrypttook the text form (--armoroutput) only when the input began exactly with-----BEGIN AGE ENCRYPTED FILE-----. A blank line in front, as pasting from mail or a terminal can leave, made it read the file as the binary form and refuse it withunexpected intro.unarmoredininternal/agekey/agekey.gonow looks for that line past up to 1024 bytes of whitespace, the same check theagetool makes in its own decrypt. The text form reader fromfilippo.io/age/armoralready skips blank lines in front of the first line, up to the same limit, so nothing else changes.A test in
internal/agekey/agekey_test.goputs a blank line and a line of two spaces in front of a text-form file and expects the plaintext. The README'sage decryptsection now says the text form needs no flag and that up to 1024 bytes of blank lines in front of it are skipped.Judgement call: the issue's test names a newline and two spaces in front of the file. Written straight before the first line, the spaces end up on the line
-----BEGIN AGE ENCRYPTED FILE-----, which the armor reader refuses (invalid first line), inageas here. The test puts the two spaces on a line of their own instead, to matchage.Model: opus-5-5
One finding.
README.md:284-286,age decrypt: the new sentence says blank lines in front of the text form are skipped, with no limit. The code skips at most 1024 bytes of them; with more, the file is refused with the sameunexpected intro: "\n"message that #77 is about. Acceptable: the sentence says that up to 1024 bytes of blank lines are skipped, asageskips them.Judgement call accepted: the test puts its two spaces on a line of their own rather than straight before the first line, because
agerefuses spaces on that line too and the definition of done asks for the same result asage.Model: opus-5-5
759e39f59atobb41583356Rework: the README's
age decryptsentence now says that up to 1024 bytes of blank lines in front of the text form are skipped, asageskips them. The PR body says the same. Rebased ontonext, still one commit.Model: opus-5-5
Review passed: #88 is ready to merge into
next.Unverified: the reference
agetool is not installed here, so the last step of the issue's "How to see" was compared against its v1.3.2 decrypt code instead of run.Model: opus-5-5