Commit Graph

12 Commits

Author SHA1 Message Date
Filippo Valsorda
980763a16e age: make TestVectorsRoundTrip a little stricter 2023-07-23 00:54:40 +02:00
Filippo Valsorda
4740a92ef9 age: use testkit vectors to test armor, header, and STREAM round-trips
Before

	filippo.io/age/armor	coverage: 72.3% of statements in filippo.io/age/...
	filippo.io/age/internal/format	coverage: 86.8% of statements in filippo.io/age/...
	filippo.io/age/internal/stream	coverage: 83.9% of statements in filippo.io/age/...

After

	filippo.io/age/armor	coverage: 88.0% of statements in filippo.io/age/...
	filippo.io/age/internal/format	coverage: 87.6% of statements in filippo.io/age/...
	filippo.io/age/internal/stream	coverage: 86.0% of statements in filippo.io/age/...
2023-07-23 00:18:41 +02:00
Berk D. Demir
edf7388f77 age: depend on c2sp.org/CCTV/age for TestVectors
Simplifies importing test data from CCTV without needing to invoke
"go mod download" from TestVectors. Makes life easier for package
builders with no networking, like Nixpkgs.
2022-12-30 18:24:08 -05:00
Filippo Valsorda
bf8d2a3911 age: move testkit to CCTV 2022-10-28 20:11:09 +02:00
Filippo Valsorda
799c2bf8e8 tests: add armor tests 2022-07-03 12:48:48 +02:00
Filippo Valsorda
8023f06ce2 all: build tag tests that require Go 1.18 2022-06-20 22:33:31 +01:00
Filippo Valsorda
3f56ac13fb internal/stream: reject trailing data (no EOF) after end of stream 2022-06-19 23:11:14 +02:00
Filippo Valsorda
2088adf268 tests: add expected no match and minor additions 2022-06-19 00:11:23 +02:00
Filippo Valsorda
eaa4e03cfe tests: finish parsing and X25519 tests, distinguish HMAC errors
If the implementation re-encodes the header before checking the HMAC,
that would mask malleability issues: the HMAC check would fail because
the tests HMAC'd the original header, but an attacker could also produce
the right HMAC. Instead of duplicating every parsing tests (with the
original and re-encoded HMAC), we make the test framework distinguish
HMAC errors, which ensures bad encodings are recognized as such and not
bypassable HMAC errors.
2022-06-18 13:47:00 +02:00
Filippo Valsorda
92713afd1e tests: add scrypt tests and move Go files from testdata 2022-06-15 20:38:59 +02:00
Filippo Valsorda
a787511e01 testdata: add a few more testkit vectors 2022-06-15 18:54:09 +02:00
Filippo Valsorda
e49b1f9afe internal/testkit: new test framework 2022-06-15 18:53:07 +02:00