diff --git a/internal/testkit/testkit.go b/internal/testkit/testkit.go deleted file mode 100644 index f6bb52b2..00000000 --- a/internal/testkit/testkit.go +++ /dev/null @@ -1,310 +0,0 @@ -// Copyright 2022 The age Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package testkit - -import ( - "bytes" - "crypto/hmac" - "crypto/sha256" - "encoding/base64" - "encoding/hex" - "fmt" - "io" - "os" - "strconv" - "strings" - - "filippo.io/age/internal/bech32" - "golang.org/x/crypto/chacha20" - "golang.org/x/crypto/chacha20poly1305" - "golang.org/x/crypto/curve25519" - "golang.org/x/crypto/hkdf" - "golang.org/x/crypto/scrypt" -) - -var TestFileKey = []byte("YELLOW SUBMARINE") - -var _, TestX25519Identity, _ = bech32.Decode( - "AGE-SECRET-KEY-1EGTZVFFV20835NWYV6270LXYVK2VKNX2MMDKWYKLMGR48UAWX40Q2P2LM0") - -var TestX25519Recipient, _ = curve25519.X25519(TestX25519Identity, curve25519.Basepoint) - -// These are the file key and nonce used to encrypt any full/multiple-chunk -// tests. They were generated by a previous iteration of this test suite. -// Reusing them across files and history makes the repository easier to pack and -// the test suite easier to compress. -var LargeTestFileKey, _ = hex.DecodeString("7aa5bdac0e6afeed3dd0a7eccb42af44") -var LargeTestNonce, _ = hex.DecodeString("c82f71eb82029b77136399e485e879f4") -var LargeTestFirstChunk = bytes.Repeat([]byte{0}, 64*1024) -var LargeTestSecondChunk = bytes.Repeat([]byte{1}, 64*1024) -var LargeTestThirdChunk = bytes.Repeat([]byte{2}, 64*1024) - -func NotCanonicalBase64(s string) string { - // Assuming there are spare zero bits at the end of the encoded bitstring, - // the character immediately after in the alphabet compared to the last one - // in the encoding will only flip the last bit to one, making the string a - // non-canonical encoding of the same value. - alphabet := "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/" - idx := strings.IndexByte(alphabet, s[len(s)-1]) - return s[:len(s)-1] + string(alphabet[idx+1]) -} - -type TestFile struct { - Buf bytes.Buffer - Rand func(n int) []byte - - fileKey []byte - streamKey []byte - nonce [12]byte - payload bytes.Buffer - expect string - comment string - identities []string - passphrases []string - armor bool -} - -func NewTestFile() *TestFile { - c, _ := chacha20.NewUnauthenticatedCipher( - []byte("TEST RANDOMNESS TEST RANDOMNESS!"), make([]byte, chacha20.NonceSize)) - rand := func(n int) []byte { - out := make([]byte, n) - c.XORKeyStream(out, out) - return out - } - return &TestFile{Rand: rand, expect: "success", fileKey: TestFileKey} -} - -func (f *TestFile) FileKey(key []byte) { - f.fileKey = key -} - -func (f *TestFile) TextLine(s string) { - f.Buf.WriteString(s) - f.Buf.WriteString("\n") -} - -func (f *TestFile) UnreadLine() string { - buf := bytes.TrimSuffix(f.Buf.Bytes(), []byte("\n")) - idx := bytes.LastIndex(buf, []byte("\n")) + 1 - f.Buf.Reset() - f.Buf.Write(buf[:idx]) - return string(buf[idx:]) -} - -func (f *TestFile) VersionLine(v string) { - f.TextLine("age-encryption.org/" + v) -} - -func (f *TestFile) ArgsLine(args ...string) { - f.TextLine(strings.Join(append([]string{"->"}, args...), " ")) -} - -func (f *TestFile) UnreadArgsLine() []string { - line := strings.TrimPrefix(f.UnreadLine(), "-> ") - return strings.Split(line, " ") -} - -var b64 = base64.RawStdEncoding.EncodeToString - -func (f *TestFile) Body(body []byte) { - for { - line := body - if len(line) > 48 { - line = line[:48] - } - f.TextLine(b64(line)) - body = body[len(line):] - if len(line) < 48 { - break - } - } -} - -func (f *TestFile) Base64Padding() { - line := f.UnreadLine() - paddingLen := 4 - len(line)%4 - if paddingLen == 4 { - paddingLen = 0 - } - padding := strings.Repeat("=", paddingLen) - f.TextLine(line + padding) -} - -func (f *TestFile) AEADBody(key, body []byte) { - aead, _ := chacha20poly1305.New(key) - f.Body(aead.Seal(nil, make([]byte, chacha20poly1305.NonceSize), body, nil)) -} - -func x25519(scalar, point []byte) []byte { - secret, err := curve25519.X25519(scalar, point) - if err != nil { - if err.Error() == "bad input point: low order point" { - return make([]byte, 32) - } - panic(err) - } - return secret -} - -func (f *TestFile) X25519(identity []byte) { - f.X25519RecordIdentity(identity) - f.X25519NoRecordIdentity(identity) -} - -func (f *TestFile) X25519RecordIdentity(identity []byte) { - id, _ := bech32.Encode("AGE-SECRET-KEY-", identity) - f.identities = append(f.identities, id) -} - -func (f *TestFile) X25519NoRecordIdentity(identity []byte) { - share := x25519(f.Rand(32), curve25519.Basepoint) - f.X25519Stanza(share, identity) -} - -func (f *TestFile) X25519Stanza(share, identity []byte) { - recipient := x25519(identity, curve25519.Basepoint) - f.ArgsLine("X25519", b64(share)) - // This would be ordinarily done as [ephemeral]recipient rather than - // [identity]share, but for some tests we don't have the dlog of share. - secret := x25519(identity, share) - key := make([]byte, 32) - hkdf.New(sha256.New, secret, append(share, recipient...), - []byte("age-encryption.org/v1/X25519")).Read(key) - f.AEADBody(key, f.fileKey) -} - -func (f *TestFile) Scrypt(passphrase string, workFactor int) { - f.ScryptRecordPassphrase(passphrase) - f.ScryptNoRecordPassphrase(passphrase, workFactor) -} - -func (f *TestFile) ScryptRecordPassphrase(passphrase string) { - f.passphrases = append(f.passphrases, passphrase) -} - -func (f *TestFile) ScryptNoRecordPassphrase(passphrase string, workFactor int) { - salt := f.Rand(16) - f.ScryptNoRecordPassphraseWithSalt(passphrase, workFactor, salt) -} - -func (f *TestFile) ScryptNoRecordPassphraseWithSalt(passphrase string, workFactor int, salt []byte) { - f.ArgsLine("scrypt", b64(salt), strconv.Itoa(workFactor)) - key, err := scrypt.Key([]byte(passphrase), append([]byte("age-encryption.org/v1/scrypt"), salt...), - 1< X25519 TEiF0ypqr+bpvcqXNyCVJpL7OuwPdVwPL7KQEbFDOCc -hjabGXwSLQ9c3S6Lw2i+S2Tu2fiwQHHslbBN6B41FLE ---- 2KIGb7ye32MWtUuEVWkO3MP6qCDLzOvT9wF06lelBSI -๎ฯbวฮ‘ด3'Nhิ๒๙LทL[๗พชRศ๐ผ™,ƒ1๛f \ No newline at end of file diff --git a/testdata/testkit/hmac_bad b/testdata/testkit/hmac_bad deleted file mode 100644 index 5021bb6d..00000000 --- a/testdata/testkit/hmac_bad +++ /dev/null @@ -1,9 +0,0 @@ -expect: HMAC failure -file key: 59454c4c4f57205355424d4152494e45 -identity: AGE-SECRET-KEY-1EGTZVFFV20835NWYV6270LXYVK2VKNX2MMDKWYKLMGR48UAWX40Q2P2LM0 - -age-encryption.org/v1 --> X25519 TEiF0ypqr+bpvcqXNyCVJpL7OuwPdVwPL7KQEbFDOCc -hjabGXwSLQ9c3S6Lw2i+S2Tu2fiwQHHslbBN6B41FLE ---- 8McE3ix9R34E/vLrQv3yepsHjo/LXhfs22Ab3UyInmg -๎ฯbวฮ‘ด3'Nhิ๒๙LทL[๗พชRศ๐ผ™,ƒ1๛f \ No newline at end of file diff --git a/testdata/testkit/hmac_extra_space b/testdata/testkit/hmac_extra_space deleted file mode 100644 index f3bfd1ec..00000000 --- a/testdata/testkit/hmac_extra_space +++ /dev/null @@ -1,9 +0,0 @@ -expect: header failure -file key: 59454c4c4f57205355424d4152494e45 -identity: AGE-SECRET-KEY-1EGTZVFFV20835NWYV6270LXYVK2VKNX2MMDKWYKLMGR48UAWX40Q2P2LM0 - -age-encryption.org/v1 --> X25519 TEiF0ypqr+bpvcqXNyCVJpL7OuwPdVwPL7KQEbFDOCc -hjabGXwSLQ9c3S6Lw2i+S2Tu2fiwQHHslbBN6B41FLE ---- WyJp9F/9FOZh7gJdheq2WIJcwHgYc8NIVh3ddwhrcNg -๎ฯbวฮ‘ด3'Nhิ๒๙LทL[๗พชRศ๐ผ™,ƒ1๛f \ No newline at end of file diff --git a/testdata/testkit/hmac_garbage b/testdata/testkit/hmac_garbage deleted file mode 100644 index 29e54ab6..00000000 --- a/testdata/testkit/hmac_garbage +++ /dev/null @@ -1,9 +0,0 @@ -expect: header failure -file key: 59454c4c4f57205355424d4152494e45 -identity: AGE-SECRET-KEY-1EGTZVFFV20835NWYV6270LXYVK2VKNX2MMDKWYKLMGR48UAWX40Q2P2LM0 - -age-encryption.org/v1 --> X25519 TEiF0ypqr+bpvcqXNyCVJpL7OuwPdVwPL7KQEbFDOCc -hjabGXwSLQ9c3S6Lw2i+S2Tu2fiwQHHslbBN6B41FLE ---- WyJp9F/9FOZh7gJdheq2WIJcwHgYc8NIVh3ddwhrcNgAAA -๎ฯbวฮ‘ด3'Nhิ๒๙LทL[๗พชRศ๐ผ™,ƒ1๛f \ No newline at end of file diff --git a/testdata/testkit/hmac_missing b/testdata/testkit/hmac_missing deleted file mode 100644 index 6ecea2ae..00000000 --- a/testdata/testkit/hmac_missing +++ /dev/null @@ -1,9 +0,0 @@ -expect: header failure -file key: 59454c4c4f57205355424d4152494e45 -identity: AGE-SECRET-KEY-1EGTZVFFV20835NWYV6270LXYVK2VKNX2MMDKWYKLMGR48UAWX40Q2P2LM0 - -age-encryption.org/v1 --> X25519 TEiF0ypqr+bpvcqXNyCVJpL7OuwPdVwPL7KQEbFDOCc -hjabGXwSLQ9c3S6Lw2i+S2Tu2fiwQHHslbBN6B41FLE ---- -๎ฯbวฮ‘ด3'Nhิ๒๙LทL[๗พชRศ๐ผ™,ƒ1๛f \ No newline at end of file diff --git a/testdata/testkit/hmac_no_space b/testdata/testkit/hmac_no_space deleted file mode 100644 index 9f1d80d7..00000000 --- a/testdata/testkit/hmac_no_space +++ /dev/null @@ -1,9 +0,0 @@ -expect: header failure -file key: 59454c4c4f57205355424d4152494e45 -identity: AGE-SECRET-KEY-1EGTZVFFV20835NWYV6270LXYVK2VKNX2MMDKWYKLMGR48UAWX40Q2P2LM0 - -age-encryption.org/v1 --> X25519 TEiF0ypqr+bpvcqXNyCVJpL7OuwPdVwPL7KQEbFDOCc -hjabGXwSLQ9c3S6Lw2i+S2Tu2fiwQHHslbBN6B41FLE ----WyJp9F/9FOZh7gJdheq2WIJcwHgYc8NIVh3ddwhrcNg -๎ฯbวฮ‘ด3'Nhิ๒๙LทL[๗พชRศ๐ผ™,ƒ1๛f \ No newline at end of file diff --git a/testdata/testkit/hmac_not_canonical b/testdata/testkit/hmac_not_canonical deleted file mode 100644 index fd18cda6..00000000 --- a/testdata/testkit/hmac_not_canonical +++ /dev/null @@ -1,10 +0,0 @@ -expect: header failure -file key: 59454c4c4f57205355424d4152494e45 -identity: AGE-SECRET-KEY-1EGTZVFFV20835NWYV6270LXYVK2VKNX2MMDKWYKLMGR48UAWX40Q2P2LM0 -comment: the base64 encoding of the HMAC is not canonical - -age-encryption.org/v1 --> X25519 TEiF0ypqr+bpvcqXNyCVJpL7OuwPdVwPL7KQEbFDOCc -hjabGXwSLQ9c3S6Lw2i+S2Tu2fiwQHHslbBN6B41FLE ---- WyJp9F/9FOZh7gJdheq2WIJcwHgYc8NIVh3ddwhrcNh -๎ฯbวฮ‘ด3'Nhิ๒๙LทL[๗พชRศ๐ผ™,ƒ1๛f \ No newline at end of file diff --git a/testdata/testkit/hmac_trailing_space b/testdata/testkit/hmac_trailing_space deleted file mode 100644 index 2e216bdd..00000000 --- a/testdata/testkit/hmac_trailing_space +++ /dev/null @@ -1,9 +0,0 @@ -expect: header failure -file key: 59454c4c4f57205355424d4152494e45 -identity: AGE-SECRET-KEY-1EGTZVFFV20835NWYV6270LXYVK2VKNX2MMDKWYKLMGR48UAWX40Q2P2LM0 - -age-encryption.org/v1 --> X25519 TEiF0ypqr+bpvcqXNyCVJpL7OuwPdVwPL7KQEbFDOCc -hjabGXwSLQ9c3S6Lw2i+S2Tu2fiwQHHslbBN6B41FLE ---- WyJp9F/9FOZh7gJdheq2WIJcwHgYc8NIVh3ddwhrcNg -๎ฯbวฮ‘ด3'Nhิ๒๙LทL[๗พชRศ๐ผ™,ƒ1๛f \ No newline at end of file diff --git a/testdata/testkit/hmac_truncated b/testdata/testkit/hmac_truncated deleted file mode 100644 index e7f71966..00000000 --- a/testdata/testkit/hmac_truncated +++ /dev/null @@ -1,9 +0,0 @@ -expect: header failure -file key: 59454c4c4f57205355424d4152494e45 -identity: AGE-SECRET-KEY-1EGTZVFFV20835NWYV6270LXYVK2VKNX2MMDKWYKLMGR48UAWX40Q2P2LM0 - -age-encryption.org/v1 --> X25519 TEiF0ypqr+bpvcqXNyCVJpL7OuwPdVwPL7KQEbFDOCc -hjabGXwSLQ9c3S6Lw2i+S2Tu2fiwQHHslbBN6B41FLE ---- WyJp -๎ฯbวฮ‘ด3'Nhิ๒๙LทL[๗พชRศ๐ผ™,ƒ1๛f \ No newline at end of file diff --git a/testdata/testkit/scrypt b/testdata/testkit/scrypt deleted file mode 100644 index 57dd08f0..00000000 Binary files a/testdata/testkit/scrypt and /dev/null differ diff --git a/testdata/testkit/scrypt_and_x25519 b/testdata/testkit/scrypt_and_x25519 deleted file mode 100644 index 90a61fd0..00000000 --- a/testdata/testkit/scrypt_and_x25519 +++ /dev/null @@ -1,13 +0,0 @@ -expect: header failure -file key: 59454c4c4f57205355424d4152494e45 -identity: AGE-SECRET-KEY-143WN7DCXU4G8R5AXQSSYD9AEPYDNT3HXSLWSPK36CDU6E8M59SSSAGZ3KG -passphrase: password -comment: scrypt stanzas must be alone in the header - -age-encryption.org/v1 --> X25519 ajtqAvDEkVNr2B7zUOtq2mAQXDSBlNrVAuM/dKb5sT4 -U+hKlJ4isweJ9PKG7pgscmG3cPASLgTw7SOBpbZ8x2U --> scrypt 3d9y0G+8q1ffPQ0xJJatIQ 10 -foZolxuhRSL7IG7oaR+456IzkHtvue7j4mUjh3DB6EI ---- yp4Z0lV1LEdkm1+uDCuPUV+9hIXbPKrBXKQ/f5Y03As -T^k๔ฦ‰>)์อ, rฑฬFlž'cฯ๔’‚ž›ธVต \ No newline at end of file diff --git a/testdata/testkit/scrypt_bad_tag b/testdata/testkit/scrypt_bad_tag deleted file mode 100644 index b47512f0..00000000 Binary files a/testdata/testkit/scrypt_bad_tag and /dev/null differ diff --git a/testdata/testkit/scrypt_double b/testdata/testkit/scrypt_double deleted file mode 100644 index da069edc..00000000 --- a/testdata/testkit/scrypt_double +++ /dev/null @@ -1,13 +0,0 @@ -expect: header failure -file key: 59454c4c4f57205355424d4152494e45 -passphrase: password -passphrase: hunter2 -comment: scrypt stanzas must be alone in the header - -age-encryption.org/v1 --> scrypt rF0/NwblUHHTpgQgRpe5CQ 10 -gUjEymFKMVXQEKdMMHL24oYexjE3TIC0O0zGSqJ2aUY --> scrypt GzXG5ofdANo6w3msn3QsIQ 10 -OveITuwxakv7k2oLnioNYF4Bhgz9KZ36pb098wDoAv8 ---- a5d+4Ay1evJhoDskIzuTZV9bBgKk4573VZNfuoWJDPE -๎ฯbวฮ‘ด3'Nhิ๒๙LทL[๗พชRศ๐ผ™,ƒ1๛f \ No newline at end of file diff --git a/testdata/testkit/scrypt_extra_argument b/testdata/testkit/scrypt_extra_argument deleted file mode 100644 index 3fa92ee9..00000000 Binary files a/testdata/testkit/scrypt_extra_argument and /dev/null differ diff --git a/testdata/testkit/scrypt_long_file_key b/testdata/testkit/scrypt_long_file_key deleted file mode 100644 index 669c2225..00000000 Binary files a/testdata/testkit/scrypt_long_file_key and /dev/null differ diff --git a/testdata/testkit/scrypt_no_match b/testdata/testkit/scrypt_no_match deleted file mode 100644 index 3d090e18..00000000 Binary files a/testdata/testkit/scrypt_no_match and /dev/null differ diff --git a/testdata/testkit/scrypt_not_canonical_body b/testdata/testkit/scrypt_not_canonical_body deleted file mode 100644 index 65298afd..00000000 Binary files a/testdata/testkit/scrypt_not_canonical_body and /dev/null differ diff --git a/testdata/testkit/scrypt_not_canonical_salt b/testdata/testkit/scrypt_not_canonical_salt deleted file mode 100644 index 50741d5d..00000000 Binary files a/testdata/testkit/scrypt_not_canonical_salt and /dev/null differ diff --git a/testdata/testkit/scrypt_salt_long b/testdata/testkit/scrypt_salt_long deleted file mode 100644 index 66e37f93..00000000 Binary files a/testdata/testkit/scrypt_salt_long and /dev/null differ diff --git a/testdata/testkit/scrypt_salt_missing b/testdata/testkit/scrypt_salt_missing deleted file mode 100644 index 880b0e1a..00000000 --- a/testdata/testkit/scrypt_salt_missing +++ /dev/null @@ -1,9 +0,0 @@ -expect: header failure -file key: 59454c4c4f57205355424d4152494e45 -passphrase: password - -age-encryption.org/v1 --> scrypt 10 -W0mMthyhNJOV3debCwkQcUlNx/i6Ss/A07aQCrG5Gcw ---- 1QsPcEbBSylfP4apakJqtDBJMrpd81rPuSLTCvdZx6E -ฌ]?7ๅPqำฆ F—น •ย๗๕ฎ่ zŒ(rŠ๓ฮ| \ No newline at end of file diff --git a/testdata/testkit/scrypt_salt_short b/testdata/testkit/scrypt_salt_short deleted file mode 100644 index a95f4608..00000000 Binary files a/testdata/testkit/scrypt_salt_short and /dev/null differ diff --git a/testdata/testkit/scrypt_uppercase b/testdata/testkit/scrypt_uppercase deleted file mode 100644 index 88bd1e42..00000000 Binary files a/testdata/testkit/scrypt_uppercase and /dev/null differ diff --git a/testdata/testkit/scrypt_work_factor_23 b/testdata/testkit/scrypt_work_factor_23 deleted file mode 100644 index 4d286beb..00000000 --- a/testdata/testkit/scrypt_work_factor_23 +++ /dev/null @@ -1,10 +0,0 @@ -expect: header failure -file key: 59454c4c4f57205355424d4152494e45 -passphrase: password -comment: work factor is very high, would take a long time to compute - -age-encryption.org/v1 --> scrypt rF0/NwblUHHTpgQgRpe5CQ 23 -qW9eVsT0NVb/Vswtw8kPIxUnaYmm9Px1dYmq2+4+qZA ---- 38TpQMxQRRNMfmYYpBX6DDrPx4/QY5UmJnhPyVoX/cw -ฌ]?7ๅPqำฆ F—น •ย๗๕ฎ่ zŒ(rŠ๓ฮ| \ No newline at end of file diff --git a/testdata/testkit/scrypt_work_factor_hex b/testdata/testkit/scrypt_work_factor_hex deleted file mode 100644 index a1feca9a..00000000 Binary files a/testdata/testkit/scrypt_work_factor_hex and /dev/null differ diff --git a/testdata/testkit/scrypt_work_factor_leading_garbage b/testdata/testkit/scrypt_work_factor_leading_garbage deleted file mode 100644 index bf3bfd5f..00000000 Binary files a/testdata/testkit/scrypt_work_factor_leading_garbage and /dev/null differ diff --git a/testdata/testkit/scrypt_work_factor_leading_plus b/testdata/testkit/scrypt_work_factor_leading_plus deleted file mode 100644 index 57f400ed..00000000 Binary files a/testdata/testkit/scrypt_work_factor_leading_plus and /dev/null differ diff --git a/testdata/testkit/scrypt_work_factor_leading_zero_decimal b/testdata/testkit/scrypt_work_factor_leading_zero_decimal deleted file mode 100644 index 303e2f97..00000000 Binary files a/testdata/testkit/scrypt_work_factor_leading_zero_decimal and /dev/null differ diff --git a/testdata/testkit/scrypt_work_factor_leading_zero_octal b/testdata/testkit/scrypt_work_factor_leading_zero_octal deleted file mode 100644 index 46c12f89..00000000 Binary files a/testdata/testkit/scrypt_work_factor_leading_zero_octal and /dev/null differ diff --git a/testdata/testkit/scrypt_work_factor_missing b/testdata/testkit/scrypt_work_factor_missing deleted file mode 100644 index 62c14e21..00000000 Binary files a/testdata/testkit/scrypt_work_factor_missing and /dev/null differ diff --git a/testdata/testkit/scrypt_work_factor_negative b/testdata/testkit/scrypt_work_factor_negative deleted file mode 100644 index eaf54000..00000000 Binary files a/testdata/testkit/scrypt_work_factor_negative and /dev/null differ diff --git a/testdata/testkit/scrypt_work_factor_overflow b/testdata/testkit/scrypt_work_factor_overflow deleted file mode 100644 index 03aeb030..00000000 Binary files a/testdata/testkit/scrypt_work_factor_overflow and /dev/null differ diff --git a/testdata/testkit/scrypt_work_factor_trailing_garbage b/testdata/testkit/scrypt_work_factor_trailing_garbage deleted file mode 100644 index bf3bfd5f..00000000 Binary files a/testdata/testkit/scrypt_work_factor_trailing_garbage and /dev/null differ diff --git a/testdata/testkit/scrypt_work_factor_wrong b/testdata/testkit/scrypt_work_factor_wrong deleted file mode 100644 index 209e1f63..00000000 Binary files a/testdata/testkit/scrypt_work_factor_wrong and /dev/null differ diff --git a/testdata/testkit/scrypt_work_factor_zero b/testdata/testkit/scrypt_work_factor_zero deleted file mode 100644 index 9d8c2789..00000000 Binary files a/testdata/testkit/scrypt_work_factor_zero and /dev/null differ diff --git a/testdata/testkit/stanza_bad_start b/testdata/testkit/stanza_bad_start deleted file mode 100644 index d040d65b..00000000 --- a/testdata/testkit/stanza_bad_start +++ /dev/null @@ -1,11 +0,0 @@ -expect: header failure -file key: 59454c4c4f57205355424d4152494e45 -identity: AGE-SECRET-KEY-1XMWWC06LY3EE5RYTXM9MFLAZ2U56JJJ36S0MYPDRWSVLUL66MV4QX3S7F6 - -age-encryption.org/v1 --> X25519 TEiF0ypqr+bpvcqXNyCVJpL7OuwPdVwPL7KQEbFDOCc -EmECAEcKN+n/Vs9SbWiV+Hu0r+E8R77DdWYyd83nw7U --- stanza - ---- lpxzkyQGe/sA7F1yh4c6KVZV7//jANm5lYefTToioXs -๎ฯbวฮ‘ด3'Nhิ๒๙LทL[๗พชRศ๐ผ™,ƒ1๛f \ No newline at end of file diff --git a/testdata/testkit/stanza_base64_padding b/testdata/testkit/stanza_base64_padding deleted file mode 100644 index 18ad2d28..00000000 --- a/testdata/testkit/stanza_base64_padding +++ /dev/null @@ -1,12 +0,0 @@ -expect: header failure -file key: 59454c4c4f57205355424d4152494e45 -identity: AGE-SECRET-KEY-1XMWWC06LY3EE5RYTXM9MFLAZ2U56JJJ36S0MYPDRWSVLUL66MV4QX3S7F6 - -age-encryption.org/v1 --> X25519 TEiF0ypqr+bpvcqXNyCVJpL7OuwPdVwPL7KQEbFDOCc -EmECAEcKN+n/Vs9SbWiV+Hu0r+E8R77DdWYyd83nw7U --> stanza -QUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFB -QUE= ---- OtG7IuNHaf2SHZuowmxg/fhbhtz0/DI5g5OGd7WH7S0 -๎ฯbวฮ‘ด3'Nhิ๒๙LทL[๗พชRศ๐ผ™,ƒ1๛f \ No newline at end of file diff --git a/testdata/testkit/stanza_empty_argument b/testdata/testkit/stanza_empty_argument deleted file mode 100644 index cb9ef0b5..00000000 --- a/testdata/testkit/stanza_empty_argument +++ /dev/null @@ -1,11 +0,0 @@ -expect: header failure -file key: 59454c4c4f57205355424d4152494e45 -identity: AGE-SECRET-KEY-1XMWWC06LY3EE5RYTXM9MFLAZ2U56JJJ36S0MYPDRWSVLUL66MV4QX3S7F6 - -age-encryption.org/v1 --> X25519 TEiF0ypqr+bpvcqXNyCVJpL7OuwPdVwPL7KQEbFDOCc -EmECAEcKN+n/Vs9SbWiV+Hu0r+E8R77DdWYyd83nw7U --> stanza argument - ---- bosBxVRBzKF9emyxQ9BERq7+D5JKU+lvbEsL8UHJ/SA -๎ฯbวฮ‘ด3'Nhิ๒๙LทL[๗พชRศ๐ผ™,ƒ1๛f \ No newline at end of file diff --git a/testdata/testkit/stanza_empty_body b/testdata/testkit/stanza_empty_body deleted file mode 100644 index cf8ec9b3..00000000 --- a/testdata/testkit/stanza_empty_body +++ /dev/null @@ -1,12 +0,0 @@ -expect: success -payload: 013f54400c82da08037759ada907a8b864e97de81c088a182062c4b5622fd2ab -file key: 59454c4c4f57205355424d4152494e45 -identity: AGE-SECRET-KEY-1XMWWC06LY3EE5RYTXM9MFLAZ2U56JJJ36S0MYPDRWSVLUL66MV4QX3S7F6 - -age-encryption.org/v1 --> X25519 TEiF0ypqr+bpvcqXNyCVJpL7OuwPdVwPL7KQEbFDOCc -EmECAEcKN+n/Vs9SbWiV+Hu0r+E8R77DdWYyd83nw7U --> empty - ---- 697zSC9pa/ZLNIaXGtuwcUobmxv+Dpx48Hv0papk5c0 -๎ฯbวฮ‘ด3'Nhิ๒๙LทL[๗พชRศ๐ผ™,ƒ1๛f \ No newline at end of file diff --git a/testdata/testkit/stanza_empty_last_line b/testdata/testkit/stanza_empty_last_line deleted file mode 100644 index 30a6c8fd..00000000 --- a/testdata/testkit/stanza_empty_last_line +++ /dev/null @@ -1,14 +0,0 @@ -expect: success -payload: 013f54400c82da08037759ada907a8b864e97de81c088a182062c4b5622fd2ab -file key: 59454c4c4f57205355424d4152494e45 -identity: AGE-SECRET-KEY-1XMWWC06LY3EE5RYTXM9MFLAZ2U56JJJ36S0MYPDRWSVLUL66MV4QX3S7F6 - -age-encryption.org/v1 --> X25519 TEiF0ypqr+bpvcqXNyCVJpL7OuwPdVwPL7KQEbFDOCc -EmECAEcKN+n/Vs9SbWiV+Hu0r+E8R77DdWYyd83nw7U --> stanza -QUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFB -QUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFB - ---- cb4SqtunSJzXKDGjqeYxuva9Be80QXEDKDn2aKBaCsw -๎ฯbวฮ‘ด3'Nhิ๒๙LทL[๗พชRศ๐ผ™,ƒ1๛f \ No newline at end of file diff --git a/testdata/testkit/stanza_invalid_character b/testdata/testkit/stanza_invalid_character deleted file mode 100644 index d5c8b430..00000000 --- a/testdata/testkit/stanza_invalid_character +++ /dev/null @@ -1,11 +0,0 @@ -expect: header failure -file key: 59454c4c4f57205355424d4152494e45 -identity: AGE-SECRET-KEY-1XMWWC06LY3EE5RYTXM9MFLAZ2U56JJJ36S0MYPDRWSVLUL66MV4QX3S7F6 - -age-encryption.org/v1 --> X25519 TEiF0ypqr+bpvcqXNyCVJpL7OuwPdVwPL7KQEbFDOCc -EmECAEcKN+n/Vs9SbWiV+Hu0r+E8R77DdWYyd83nw7U --> stanza รจ - ---- sTIB/0Fc74rhpjC4RAxoR3E01eVTTnWruaD+c5QWjKI -๎ฯbวฮ‘ด3'Nhิ๒๙LทL[๗พชRศ๐ผ™,ƒ1๛f \ No newline at end of file diff --git a/testdata/testkit/stanza_long_line b/testdata/testkit/stanza_long_line deleted file mode 100644 index 54352607..00000000 --- a/testdata/testkit/stanza_long_line +++ /dev/null @@ -1,13 +0,0 @@ -expect: header failure -file key: 59454c4c4f57205355424d4152494e45 -identity: AGE-SECRET-KEY-1XMWWC06LY3EE5RYTXM9MFLAZ2U56JJJ36S0MYPDRWSVLUL66MV4QX3S7F6 -comment: a body line is longer than 64 columns - -age-encryption.org/v1 --> X25519 TEiF0ypqr+bpvcqXNyCVJpL7OuwPdVwPL7KQEbFDOCc -EmECAEcKN+n/Vs9SbWiV+Hu0r+E8R77DdWYyd83nw7U --> stanza -AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - ---- tnRUR2vmmU92czsjnioF5ujgXUetUhzUoQPPGT9wmug -๎ฯbวฮ‘ด3'Nhิ๒๙LทL[๗พชRศ๐ผ™,ƒ1๛f \ No newline at end of file diff --git a/testdata/testkit/stanza_missing_body b/testdata/testkit/stanza_missing_body deleted file mode 100644 index 4c184c7b..00000000 --- a/testdata/testkit/stanza_missing_body +++ /dev/null @@ -1,11 +0,0 @@ -expect: header failure -file key: 59454c4c4f57205355424d4152494e45 -identity: AGE-SECRET-KEY-1XMWWC06LY3EE5RYTXM9MFLAZ2U56JJJ36S0MYPDRWSVLUL66MV4QX3S7F6 -comment: every stanza must end with a short body line, even if empty - -age-encryption.org/v1 --> X25519 TEiF0ypqr+bpvcqXNyCVJpL7OuwPdVwPL7KQEbFDOCc -EmECAEcKN+n/Vs9SbWiV+Hu0r+E8R77DdWYyd83nw7U --> empty ---- CDgFIIJ1wE4CpW6zG+LVZ6/G/RCNTH6ZUVGp2NbeIkU -๎ฯbวฮ‘ด3'Nhิ๒๙LทL[๗พชRศ๐ผ™,ƒ1๛f \ No newline at end of file diff --git a/testdata/testkit/stanza_missing_final_line b/testdata/testkit/stanza_missing_final_line deleted file mode 100644 index 58774f4d..00000000 --- a/testdata/testkit/stanza_missing_final_line +++ /dev/null @@ -1,12 +0,0 @@ -expect: header failure -file key: 59454c4c4f57205355424d4152494e45 -identity: AGE-SECRET-KEY-1XMWWC06LY3EE5RYTXM9MFLAZ2U56JJJ36S0MYPDRWSVLUL66MV4QX3S7F6 -comment: every stanza must end with a short body line - -age-encryption.org/v1 --> X25519 TEiF0ypqr+bpvcqXNyCVJpL7OuwPdVwPL7KQEbFDOCc -EmECAEcKN+n/Vs9SbWiV+Hu0r+E8R77DdWYyd83nw7U --> stanza -AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA ---- GRjUy1ShNhFoV3cQikdtUZqDeDEZSrbtNXUgDtDbwC8 -๎ฯbวฮ‘ด3'Nhิ๒๙LทL[๗พชRศ๐ผ™,ƒ1๛f \ No newline at end of file diff --git a/testdata/testkit/stanza_multiple_short_lines b/testdata/testkit/stanza_multiple_short_lines deleted file mode 100644 index e1917646..00000000 --- a/testdata/testkit/stanza_multiple_short_lines +++ /dev/null @@ -1,13 +0,0 @@ -expect: header failure -file key: 59454c4c4f57205355424d4152494e45 -identity: AGE-SECRET-KEY-1XMWWC06LY3EE5RYTXM9MFLAZ2U56JJJ36S0MYPDRWSVLUL66MV4QX3S7F6 -comment: a short body line ends the stanza - -age-encryption.org/v1 --> X25519 TEiF0ypqr+bpvcqXNyCVJpL7OuwPdVwPL7KQEbFDOCc -EmECAEcKN+n/Vs9SbWiV+Hu0r+E8R77DdWYyd83nw7U --> stanza -AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA -AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA ---- ct87HSIMoTC4nUsQva+8AeKc2bK2q8b9sPjRhjuf1us -๎ฯbวฮ‘ด3'Nhิ๒๙LทL[๗พชRศ๐ผ™,ƒ1๛f \ No newline at end of file diff --git a/testdata/testkit/stanza_no_arguments b/testdata/testkit/stanza_no_arguments deleted file mode 100644 index a667ad97..00000000 --- a/testdata/testkit/stanza_no_arguments +++ /dev/null @@ -1,11 +0,0 @@ -expect: header failure -file key: 59454c4c4f57205355424d4152494e45 -identity: AGE-SECRET-KEY-1XMWWC06LY3EE5RYTXM9MFLAZ2U56JJJ36S0MYPDRWSVLUL66MV4QX3S7F6 - -age-encryption.org/v1 --> X25519 TEiF0ypqr+bpvcqXNyCVJpL7OuwPdVwPL7KQEbFDOCc -EmECAEcKN+n/Vs9SbWiV+Hu0r+E8R77DdWYyd83nw7U --> - ---- B0qjnUjVajTa8I4Uia49g1c4DMQQN6u9m9QOSS1HLks -๎ฯbวฮ‘ด3'Nhิ๒๙LทL[๗พชRศ๐ผ™,ƒ1๛f \ No newline at end of file diff --git a/testdata/testkit/stanza_not_canonical b/testdata/testkit/stanza_not_canonical deleted file mode 100644 index f7794aad..00000000 --- a/testdata/testkit/stanza_not_canonical +++ /dev/null @@ -1,12 +0,0 @@ -expect: header failure -file key: 59454c4c4f57205355424d4152494e45 -identity: AGE-SECRET-KEY-1XMWWC06LY3EE5RYTXM9MFLAZ2U56JJJ36S0MYPDRWSVLUL66MV4QX3S7F6 - -age-encryption.org/v1 --> X25519 TEiF0ypqr+bpvcqXNyCVJpL7OuwPdVwPL7KQEbFDOCc -EmECAEcKN+n/Vs9SbWiV+Hu0r+E8R77DdWYyd83nw7U --> stanza -QUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFB -QUF ---- nQM2VCzmNLPrUurNWN+SW9wVp/9uTMQ/6CTUM7l8c84 -๎ฯbวฮ‘ด3'Nhิ๒๙LทL[๗พชRศ๐ผ™,ƒ1๛f \ No newline at end of file diff --git a/testdata/testkit/stanza_spurious_cr b/testdata/testkit/stanza_spurious_cr deleted file mode 100644 index b85c2ce6..00000000 --- a/testdata/testkit/stanza_spurious_cr +++ /dev/null @@ -1,11 +0,0 @@ -expect: header failure -file key: 59454c4c4f57205355424d4152494e45 -identity: AGE-SECRET-KEY-1XMWWC06LY3EE5RYTXM9MFLAZ2U56JJJ36S0MYPDRWSVLUL66MV4QX3S7F6 - -age-encryption.org/v1 --> X25519 TEiF0ypqr+bpvcqXNyCVJpL7OuwPdVwPL7KQEbFDOCc -EmECAEcKN+n/Vs9SbWiV+Hu0r+E8R77DdWYyd83nw7U --> stanza -AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA ---- MZaFAh8ldzU0F88NJjLx5yd7fnd57XS5COowmgvQtXQ -๎ฯbวฮ‘ด3'Nhิ๒๙LทL[๗พชRศ๐ผ™,ƒ1๛f \ No newline at end of file diff --git a/testdata/testkit/stanza_valid_characters b/testdata/testkit/stanza_valid_characters deleted file mode 100644 index c506f309..00000000 --- a/testdata/testkit/stanza_valid_characters +++ /dev/null @@ -1,14 +0,0 @@ -expect: success -payload: 013f54400c82da08037759ada907a8b864e97de81c088a182062c4b5622fd2ab -file key: 59454c4c4f57205355424d4152494e45 -identity: AGE-SECRET-KEY-1XMWWC06LY3EE5RYTXM9MFLAZ2U56JJJ36S0MYPDRWSVLUL66MV4QX3S7F6 - -age-encryption.org/v1 --> !"#$%&' ()*+,-./ 01234567 89:;<=>? @ABCDEFG HIJKLMNO - --> PQRSTUVW XYZ[\]^_ `abcdefg hijklmno pqrstuvw xyz{|}~ - --> X25519 TEiF0ypqr+bpvcqXNyCVJpL7OuwPdVwPL7KQEbFDOCc -EmECAEcKN+n/Vs9SbWiV+Hu0r+E8R77DdWYyd83nw7U ---- x538z9xJq9XEK1aTTTv80aWDVvVdROvaXn2tpqXPC8g -๎ฯbวฮ‘ด3'Nhิ๒๙LทL[๗พชRศ๐ผ™,ƒ1๛f \ No newline at end of file diff --git a/testdata/testkit/stream_bad_tag b/testdata/testkit/stream_bad_tag deleted file mode 100644 index ce8189a0..00000000 --- a/testdata/testkit/stream_bad_tag +++ /dev/null @@ -1,10 +0,0 @@ -expect: payload failure -payload: e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 -file key: 59454c4c4f57205355424d4152494e45 -identity: AGE-SECRET-KEY-1XMWWC06LY3EE5RYTXM9MFLAZ2U56JJJ36S0MYPDRWSVLUL66MV4QX3S7F6 - -age-encryption.org/v1 --> X25519 TEiF0ypqr+bpvcqXNyCVJpL7OuwPdVwPL7KQEbFDOCc -EmECAEcKN+n/Vs9SbWiV+Hu0r+E8R77DdWYyd83nw7U ---- Vn+54jqiiUCE+WZcEVY3f1sqHjlu/z1LCQ/T7Xm7qI0 -๎ฯbวฮ‘ด3'Nhิ๒๙LทL[๗พชRศ๐ผ™,ƒ1๛F \ No newline at end of file diff --git a/testdata/testkit/stream_bad_tag_second_chunk b/testdata/testkit/stream_bad_tag_second_chunk deleted file mode 100644 index 21ec15e0..00000000 Binary files a/testdata/testkit/stream_bad_tag_second_chunk and /dev/null differ diff --git a/testdata/testkit/stream_bad_tag_second_chunk_full b/testdata/testkit/stream_bad_tag_second_chunk_full deleted file mode 100644 index bcf23ad5..00000000 Binary files a/testdata/testkit/stream_bad_tag_second_chunk_full and /dev/null differ diff --git a/testdata/testkit/stream_empty_payload b/testdata/testkit/stream_empty_payload deleted file mode 100644 index 6ec1c831..00000000 --- a/testdata/testkit/stream_empty_payload +++ /dev/null @@ -1,10 +0,0 @@ -expect: success -payload: e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 -file key: 59454c4c4f57205355424d4152494e45 -identity: AGE-SECRET-KEY-1XMWWC06LY3EE5RYTXM9MFLAZ2U56JJJ36S0MYPDRWSVLUL66MV4QX3S7F6 - -age-encryption.org/v1 --> X25519 TEiF0ypqr+bpvcqXNyCVJpL7OuwPdVwPL7KQEbFDOCc -EmECAEcKN+n/Vs9SbWiV+Hu0r+E8R77DdWYyd83nw7U ---- Vn+54jqiiUCE+WZcEVY3f1sqHjlu/z1LCQ/T7Xm7qI0 -๎ฯbวฮ‘ด3'Nhิ๒๙Lญ.Oฯ>RŠA0ซ๏C6ๅU \ No newline at end of file diff --git a/testdata/testkit/stream_last_chunk_empty b/testdata/testkit/stream_last_chunk_empty deleted file mode 100644 index b3a2a64c..00000000 Binary files a/testdata/testkit/stream_last_chunk_empty and /dev/null differ diff --git a/testdata/testkit/stream_last_chunk_full b/testdata/testkit/stream_last_chunk_full deleted file mode 100644 index 5792b426..00000000 Binary files a/testdata/testkit/stream_last_chunk_full and /dev/null differ diff --git a/testdata/testkit/stream_last_chunk_full_second b/testdata/testkit/stream_last_chunk_full_second deleted file mode 100644 index 8e9936df..00000000 Binary files a/testdata/testkit/stream_last_chunk_full_second and /dev/null differ diff --git a/testdata/testkit/stream_missing_tag b/testdata/testkit/stream_missing_tag deleted file mode 100644 index 87bf2150..00000000 --- a/testdata/testkit/stream_missing_tag +++ /dev/null @@ -1,10 +0,0 @@ -expect: payload failure -payload: e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 -file key: 59454c4c4f57205355424d4152494e45 -identity: AGE-SECRET-KEY-1XMWWC06LY3EE5RYTXM9MFLAZ2U56JJJ36S0MYPDRWSVLUL66MV4QX3S7F6 - -age-encryption.org/v1 --> X25519 TEiF0ypqr+bpvcqXNyCVJpL7OuwPdVwPL7KQEbFDOCc -EmECAEcKN+n/Vs9SbWiV+Hu0r+E8R77DdWYyd83nw7U ---- Vn+54jqiiUCE+WZcEVY3f1sqHjlu/z1LCQ/T7Xm7qI0 -๎ฯbวฮ‘ด3'Nhิ๒๙LทL[ \ No newline at end of file diff --git a/testdata/testkit/stream_no_chunks b/testdata/testkit/stream_no_chunks deleted file mode 100644 index 7d68f8be..00000000 --- a/testdata/testkit/stream_no_chunks +++ /dev/null @@ -1,10 +0,0 @@ -expect: payload failure -payload: e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 -file key: 59454c4c4f57205355424d4152494e45 -identity: AGE-SECRET-KEY-1XMWWC06LY3EE5RYTXM9MFLAZ2U56JJJ36S0MYPDRWSVLUL66MV4QX3S7F6 - -age-encryption.org/v1 --> X25519 TEiF0ypqr+bpvcqXNyCVJpL7OuwPdVwPL7KQEbFDOCc -EmECAEcKN+n/Vs9SbWiV+Hu0r+E8R77DdWYyd83nw7U ---- Vn+54jqiiUCE+WZcEVY3f1sqHjlu/z1LCQ/T7Xm7qI0 -๎ฯbวฮ‘ด3'Nhิ๒๙L \ No newline at end of file diff --git a/testdata/testkit/stream_no_final b/testdata/testkit/stream_no_final deleted file mode 100644 index 413187e8..00000000 --- a/testdata/testkit/stream_no_final +++ /dev/null @@ -1,11 +0,0 @@ -expect: payload failure -payload: e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 -file key: 59454c4c4f57205355424d4152494e45 -identity: AGE-SECRET-KEY-1XMWWC06LY3EE5RYTXM9MFLAZ2U56JJJ36S0MYPDRWSVLUL66MV4QX3S7F6 - -age-encryption.org/v1 --> X25519 TEiF0ypqr+bpvcqXNyCVJpL7OuwPdVwPL7KQEbFDOCc -EmECAEcKN+n/Vs9SbWiV+Hu0r+E8R77DdWYyd83nw7U ---- Vn+54jqiiUCE+WZcEVY3f1sqHjlu/z1LCQ/T7Xm7qI0 -๎ฯbวฮ‘ด3'Nhิ๒๙LํS ;เ๛ฌ|บ9ฅฅศ -w^ฺ \ No newline at end of file diff --git a/testdata/testkit/stream_no_final_full b/testdata/testkit/stream_no_final_full deleted file mode 100644 index f61cf077..00000000 Binary files a/testdata/testkit/stream_no_final_full and /dev/null differ diff --git a/testdata/testkit/stream_no_final_two_chunks b/testdata/testkit/stream_no_final_two_chunks deleted file mode 100644 index ecdf7692..00000000 Binary files a/testdata/testkit/stream_no_final_two_chunks and /dev/null differ diff --git a/testdata/testkit/stream_no_final_two_chunks_full b/testdata/testkit/stream_no_final_two_chunks_full deleted file mode 100644 index 88930eed..00000000 Binary files a/testdata/testkit/stream_no_final_two_chunks_full and /dev/null differ diff --git a/testdata/testkit/stream_no_nonce b/testdata/testkit/stream_no_nonce deleted file mode 100644 index 62dcf369..00000000 --- a/testdata/testkit/stream_no_nonce +++ /dev/null @@ -1,8 +0,0 @@ -expect: header failure -file key: 59454c4c4f57205355424d4152494e45 -identity: AGE-SECRET-KEY-1XMWWC06LY3EE5RYTXM9MFLAZ2U56JJJ36S0MYPDRWSVLUL66MV4QX3S7F6 - -age-encryption.org/v1 --> X25519 TEiF0ypqr+bpvcqXNyCVJpL7OuwPdVwPL7KQEbFDOCc -EmECAEcKN+n/Vs9SbWiV+Hu0r+E8R77DdWYyd83nw7U ---- Vn+54jqiiUCE+WZcEVY3f1sqHjlu/z1LCQ/T7Xm7qI0 diff --git a/testdata/testkit/stream_short_chunk b/testdata/testkit/stream_short_chunk deleted file mode 100644 index 13796deb..00000000 --- a/testdata/testkit/stream_short_chunk +++ /dev/null @@ -1,10 +0,0 @@ -expect: payload failure -payload: e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 -file key: 59454c4c4f57205355424d4152494e45 -identity: AGE-SECRET-KEY-1XMWWC06LY3EE5RYTXM9MFLAZ2U56JJJ36S0MYPDRWSVLUL66MV4QX3S7F6 - -age-encryption.org/v1 --> X25519 TEiF0ypqr+bpvcqXNyCVJpL7OuwPdVwPL7KQEbFDOCc -EmECAEcKN+n/Vs9SbWiV+Hu0r+E8R77DdWYyd83nw7U ---- Vn+54jqiiUCE+WZcEVY3f1sqHjlu/z1LCQ/T7Xm7qI0 -๎ฯbวฮ‘ด3'Nhิ๒๙L[ๆ่. ฝำ#ศw \ No newline at end of file diff --git a/testdata/testkit/stream_short_nonce b/testdata/testkit/stream_short_nonce deleted file mode 100644 index 06dc835a..00000000 --- a/testdata/testkit/stream_short_nonce +++ /dev/null @@ -1,9 +0,0 @@ -expect: header failure -file key: 59454c4c4f57205355424d4152494e45 -identity: AGE-SECRET-KEY-1XMWWC06LY3EE5RYTXM9MFLAZ2U56JJJ36S0MYPDRWSVLUL66MV4QX3S7F6 - -age-encryption.org/v1 --> X25519 TEiF0ypqr+bpvcqXNyCVJpL7OuwPdVwPL7KQEbFDOCc -EmECAEcKN+n/Vs9SbWiV+Hu0r+E8R77DdWYyd83nw7U ---- Vn+54jqiiUCE+WZcEVY3f1sqHjlu/z1LCQ/T7Xm7qI0 -๎ฯbวฮ‘ด3'Nhิ \ No newline at end of file diff --git a/testdata/testkit/stream_short_second_chunk b/testdata/testkit/stream_short_second_chunk deleted file mode 100644 index c448186d..00000000 Binary files a/testdata/testkit/stream_short_second_chunk and /dev/null differ diff --git a/testdata/testkit/stream_three_chunks b/testdata/testkit/stream_three_chunks deleted file mode 100644 index 734ed991..00000000 Binary files a/testdata/testkit/stream_three_chunks and /dev/null differ diff --git a/testdata/testkit/stream_trailing_garbage_long b/testdata/testkit/stream_trailing_garbage_long deleted file mode 100644 index 08624390..00000000 Binary files a/testdata/testkit/stream_trailing_garbage_long and /dev/null differ diff --git a/testdata/testkit/stream_trailing_garbage_short b/testdata/testkit/stream_trailing_garbage_short deleted file mode 100644 index 733e401f..00000000 Binary files a/testdata/testkit/stream_trailing_garbage_short and /dev/null differ diff --git a/testdata/testkit/stream_two_chunks b/testdata/testkit/stream_two_chunks deleted file mode 100644 index 8e9936df..00000000 Binary files a/testdata/testkit/stream_two_chunks and /dev/null differ diff --git a/testdata/testkit/stream_two_final_chunks b/testdata/testkit/stream_two_final_chunks deleted file mode 100644 index ac2e7a79..00000000 Binary files a/testdata/testkit/stream_two_final_chunks and /dev/null differ diff --git a/testdata/testkit/version_unsupported b/testdata/testkit/version_unsupported deleted file mode 100644 index e7a7ddf4..00000000 --- a/testdata/testkit/version_unsupported +++ /dev/null @@ -1,9 +0,0 @@ -expect: header failure -file key: 59454c4c4f57205355424d4152494e45 -identity: AGE-SECRET-KEY-1XMWWC06LY3EE5RYTXM9MFLAZ2U56JJJ36S0MYPDRWSVLUL66MV4QX3S7F6 - -age-encryption.org/v1234 --> X25519 TEiF0ypqr+bpvcqXNyCVJpL7OuwPdVwPL7KQEbFDOCc -EmECAEcKN+n/Vs9SbWiV+Hu0r+E8R77DdWYyd83nw7U ---- 38AL8Mr4VwmS6CNbM4bc7u3WwGBDqsMTRHOuYJ9ckqs -๎ฯbวฮ‘ด3'Nhิ๒๙LทL[๗พชRศ๐ผ™,ƒ1๛f \ No newline at end of file diff --git a/testdata/testkit/x25519 b/testdata/testkit/x25519 deleted file mode 100644 index c7bb5096..00000000 --- a/testdata/testkit/x25519 +++ /dev/null @@ -1,10 +0,0 @@ -expect: success -payload: 013f54400c82da08037759ada907a8b864e97de81c088a182062c4b5622fd2ab -file key: 59454c4c4f57205355424d4152494e45 -identity: AGE-SECRET-KEY-1XMWWC06LY3EE5RYTXM9MFLAZ2U56JJJ36S0MYPDRWSVLUL66MV4QX3S7F6 - -age-encryption.org/v1 --> X25519 TEiF0ypqr+bpvcqXNyCVJpL7OuwPdVwPL7KQEbFDOCc -EmECAEcKN+n/Vs9SbWiV+Hu0r+E8R77DdWYyd83nw7U ---- Vn+54jqiiUCE+WZcEVY3f1sqHjlu/z1LCQ/T7Xm7qI0 -๎ฯbวฮ‘ด3'Nhิ๒๙LทL[๗พชRศ๐ผ™,ƒ1๛f \ No newline at end of file diff --git a/testdata/testkit/x25519_bad_tag b/testdata/testkit/x25519_bad_tag deleted file mode 100644 index 13c7c709..00000000 --- a/testdata/testkit/x25519_bad_tag +++ /dev/null @@ -1,10 +0,0 @@ -expect: no match -file key: 59454c4c4f57205355424d4152494e45 -identity: AGE-SECRET-KEY-1XMWWC06LY3EE5RYTXM9MFLAZ2U56JJJ36S0MYPDRWSVLUL66MV4QX3S7F6 -comment: the ChaCha20Poly1305 authentication tag on the body of the X25519 stanza is wrong - -age-encryption.org/v1 --> X25519 TEiF0ypqr+bpvcqXNyCVJpL7OuwPdVwPL7KQEbFDOCc -EmECAEcKN+n/Vs9SbWiV+Hu0r+E8R77DdWYyd83nw0o ---- tG0k9bg4iIuBdMWb13n7FFYDzoBbtsLppNLhbh22aKg -๎ฯbวฮ‘ด3'Nhิ๒๙LทL[๗พชRศ๐ผ™,ƒ1๛f \ No newline at end of file diff --git a/testdata/testkit/x25519_extra_argument b/testdata/testkit/x25519_extra_argument deleted file mode 100644 index 198389b2..00000000 --- a/testdata/testkit/x25519_extra_argument +++ /dev/null @@ -1,10 +0,0 @@ -expect: header failure -file key: 59454c4c4f57205355424d4152494e45 -identity: AGE-SECRET-KEY-1XMWWC06LY3EE5RYTXM9MFLAZ2U56JJJ36S0MYPDRWSVLUL66MV4QX3S7F6 -comment: the base64 encoding of the share is not canonical - -age-encryption.org/v1 --> X25519 TEiF0ypqr+bpvcqXNyCVJpL7OuwPdVwPL7KQEbFDOCc 1234 -EmECAEcKN+n/Vs9SbWiV+Hu0r+E8R77DdWYyd83nw7U ---- hQQySEUXL8pOuIOuw0qXzi66RphDJP9IKMNEChNJIPk -๎ฯbวฮ‘ด3'Nhิ๒๙LทL[๗พชRศ๐ผ™,ƒ1๛f \ No newline at end of file diff --git a/testdata/testkit/x25519_grease b/testdata/testkit/x25519_grease deleted file mode 100644 index aa212d9c..00000000 --- a/testdata/testkit/x25519_grease +++ /dev/null @@ -1,14 +0,0 @@ -expect: success -payload: 013f54400c82da08037759ada907a8b864e97de81c088a182062c4b5622fd2ab -file key: 59454c4c4f57205355424d4152494e45 -identity: AGE-SECRET-KEY-1XMWWC06LY3EE5RYTXM9MFLAZ2U56JJJ36S0MYPDRWSVLUL66MV4QX3S7F6 - -age-encryption.org/v1 --> grease - --> X25519 TEiF0ypqr+bpvcqXNyCVJpL7OuwPdVwPL7KQEbFDOCc -EmECAEcKN+n/Vs9SbWiV+Hu0r+E8R77DdWYyd83nw7U --> grease - ---- 7NLrfbRUZt6qK0pdtARUf59dHwo12ReldjJKjMlbE3I -๎ฯbวฮ‘ด3'Nhิ๒๙LทL[๗พชRศ๐ผ™,ƒ1๛f \ No newline at end of file diff --git a/testdata/testkit/x25519_identity b/testdata/testkit/x25519_identity deleted file mode 100644 index eb254e70..00000000 --- a/testdata/testkit/x25519_identity +++ /dev/null @@ -1,10 +0,0 @@ -expect: header failure -file key: 59454c4c4f57205355424d4152494e45 -identity: AGE-SECRET-KEY-1EGTZVFFV20835NWYV6270LXYVK2VKNX2MMDKWYKLMGR48UAWX40Q2P2LM0 -comment: the X25519 share is a low-order point, so the shared secret is the disallowed all-zero value - -age-encryption.org/v1 --> X25519 AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA -W3E/OCRme9TiTY97JoK31Z71arNur77WIIdB90XnN3M ---- Pne3IPMDvBj7wRbPMcNViffpVZAx814tgMxp8AwyMhs -ฌ]?7ๅPqำฆ F—น •ย๗๕ฎ่ zŒ(rŠ๓ฮ| \ No newline at end of file diff --git a/testdata/testkit/x25519_long_file_key b/testdata/testkit/x25519_long_file_key deleted file mode 100644 index 30dc440f..00000000 --- a/testdata/testkit/x25519_long_file_key +++ /dev/null @@ -1,10 +0,0 @@ -expect: header failure -file key: 41204c4f4e4745522059454c4c4f57205355424d4152494e45 -identity: AGE-SECRET-KEY-1EGTZVFFV20835NWYV6270LXYVK2VKNX2MMDKWYKLMGR48UAWX40Q2P2LM0 -comment: the file key must be checked to be 16 bytes before decrypting it - -age-encryption.org/v1 --> X25519 TEiF0ypqr+bpvcqXNyCVJpL7OuwPdVwPL7KQEbFDOCc -nlObGn0CSA4pxiaG3W6nLlaFFuHmqW+bFC6sJmbsJ9yFesgSok1K0AI ---- C49Jo3+j4I6jWB2tldSs1jVAXbv0mOTAnwdT+5vOiBg -๎ฯbวฮ‘ด3'Nhิ๒๙Lc๗(ญ็๑ ะtวPฒ)€x1 \ No newline at end of file diff --git a/testdata/testkit/x25519_long_share b/testdata/testkit/x25519_long_share deleted file mode 100644 index a2f3a047..00000000 --- a/testdata/testkit/x25519_long_share +++ /dev/null @@ -1,10 +0,0 @@ -expect: header failure -file key: 59454c4c4f57205355424d4152494e45 -identity: AGE-SECRET-KEY-1EGTZVFFV20835NWYV6270LXYVK2VKNX2MMDKWYKLMGR48UAWX40Q2P2LM0 -comment: a trailing zero is missing from the X25519 share - -age-encryption.org/v1 --> X25519 TEiF0ypqr+bpvcqXNyCVJpL7OuwPdVwPL7KQEbFDOCcA -hjabGXwSLQ9c3S6Lw2i+S2Tu2fiwQHHslbBN6B41FLE ---- QbEwdWirchS37UUOPh7uVddRiOaWjFwRUpaQ4Q+Z1RE -๎ฯbวฮ‘ด3'Nhิ๒๙LทL[๗พชRศ๐ผ™,ƒ1๛f \ No newline at end of file diff --git a/testdata/testkit/x25519_low_order b/testdata/testkit/x25519_low_order deleted file mode 100644 index f528a0d4..00000000 --- a/testdata/testkit/x25519_low_order +++ /dev/null @@ -1,10 +0,0 @@ -expect: header failure -file key: 59454c4c4f57205355424d4152494e45 -identity: AGE-SECRET-KEY-1EGTZVFFV20835NWYV6270LXYVK2VKNX2MMDKWYKLMGR48UAWX40Q2P2LM0 -comment: the X25519 share is a low-order point, so the shared secretis the disallowed all-zero value - -age-encryption.org/v1 --> X25519 X5yVvKNQjCSx0LFVnIPvWwREXMRYHI6G2CJO3dCfEdc -3E0NpFans/m0WLWF7+54ZBdNj3iqQqpraGDFiaRkvBA ---- sXw327YMT1/ULXe+ZyRMbMY0Z2jnWHGgI9j1we6yQ8A -ฌ]?7ๅPqำฆ F—น •ย๗๕ฎ่ zŒ(rŠ๓ฮ| \ No newline at end of file diff --git a/testdata/testkit/x25519_lowercase b/testdata/testkit/x25519_lowercase deleted file mode 100644 index 3eeb8bc5..00000000 --- a/testdata/testkit/x25519_lowercase +++ /dev/null @@ -1,10 +0,0 @@ -expect: no match -file key: 59454c4c4f57205355424d4152494e45 -identity: AGE-SECRET-KEY-1XMWWC06LY3EE5RYTXM9MFLAZ2U56JJJ36S0MYPDRWSVLUL66MV4QX3S7F6 -comment: the first argument in the X25519 stanza is lowercase - -age-encryption.org/v1 --> x25519 TEiF0ypqr+bpvcqXNyCVJpL7OuwPdVwPL7KQEbFDOCc -EmECAEcKN+n/Vs9SbWiV+Hu0r+E8R77DdWYyd83nw7U ---- SwXKO3dXLh9l5QiSgMWgPhCkwstT8oB4jLDv7aBgC+c -๎ฯbวฮ‘ด3'Nhิ๒๙LทL[๗พชRศ๐ผ™,ƒ1๛f \ No newline at end of file diff --git a/testdata/testkit/x25519_multiple_recipients b/testdata/testkit/x25519_multiple_recipients deleted file mode 100644 index 27c772c2..00000000 --- a/testdata/testkit/x25519_multiple_recipients +++ /dev/null @@ -1,12 +0,0 @@ -expect: success -payload: 013f54400c82da08037759ada907a8b864e97de81c088a182062c4b5622fd2ab -file key: 59454c4c4f57205355424d4152494e45 -identity: AGE-SECRET-KEY-1XMWWC06LY3EE5RYTXM9MFLAZ2U56JJJ36S0MYPDRWSVLUL66MV4QX3S7F6 - -age-encryption.org/v1 --> X25519 ajtqAvDEkVNr2B7zUOtq2mAQXDSBlNrVAuM/dKb5sT4 -0evrK/HQXVsQ4YaDe+659l5OQzvAzD2ytLGHQLQiqxg --> X25519 0qC7u6AbLxuwnM8tPFOWVtWZn/ZZe7z7gcsP5kgA0FI -T/PZg76MmVt2IaLntrxppzDnzeFDYHsHFcnTnhbRLQ8 ---- 7W07ef2PhsTAl74pn+9vSj/Xzukwa6SuTqMc16cdBk0 -๐ธพ5TB9™ ญ€„–Ko•รmณ^OYุ๘ž<๒o-ฅB \ No newline at end of file diff --git a/testdata/testkit/x25519_no_match b/testdata/testkit/x25519_no_match deleted file mode 100644 index 1bf961ff..00000000 --- a/testdata/testkit/x25519_no_match +++ /dev/null @@ -1,9 +0,0 @@ -expect: no match -file key: 59454c4c4f57205355424d4152494e45 -identity: AGE-SECRET-KEY-143WN7DCXU4G8R5AXQSSYD9AEPYDNT3HXSLWSPK36CDU6E8M59SSSAGZ3KG - -age-encryption.org/v1 --> X25519 ajtqAvDEkVNr2B7zUOtq2mAQXDSBlNrVAuM/dKb5sT4 -HUKtz0R2j5Bl2ER7HhAZrURikCFpiIjNa0KjHcjbAGU ---- rrpTlvKEKrK3EqhoOPJeP1KE8O1d2arrRez77mwekRc -฿rะoผซW฿= 1$–ญ!Œืo€xป๘-ุyG^ทฝ^ˆ \ No newline at end of file diff --git a/testdata/testkit/x25519_not_canonical_body b/testdata/testkit/x25519_not_canonical_body deleted file mode 100644 index 11138dbe..00000000 --- a/testdata/testkit/x25519_not_canonical_body +++ /dev/null @@ -1,10 +0,0 @@ -expect: header failure -file key: 59454c4c4f57205355424d4152494e45 -identity: AGE-SECRET-KEY-1XMWWC06LY3EE5RYTXM9MFLAZ2U56JJJ36S0MYPDRWSVLUL66MV4QX3S7F6 -comment: the base64 encoding of the share is not canonical - -age-encryption.org/v1 --> X25519 TEiF0ypqr+bpvcqXNyCVJpL7OuwPdVwPL7KQEbFDOCc -EmECAEcKN+n/Vs9SbWiV+Hu0r+E8R77DdWYyd83nw7V ---- eSjjCjQyp30yHDPwCztKS+1txs+aoCa5ERz8jeEp+9A -๎ฯbวฮ‘ด3'Nhิ๒๙LทL[๗พชRศ๐ผ™,ƒ1๛f \ No newline at end of file diff --git a/testdata/testkit/x25519_not_canonical_share b/testdata/testkit/x25519_not_canonical_share deleted file mode 100644 index 0b2a08d7..00000000 --- a/testdata/testkit/x25519_not_canonical_share +++ /dev/null @@ -1,10 +0,0 @@ -expect: header failure -file key: 59454c4c4f57205355424d4152494e45 -identity: AGE-SECRET-KEY-1XMWWC06LY3EE5RYTXM9MFLAZ2U56JJJ36S0MYPDRWSVLUL66MV4QX3S7F6 -comment: the base64 encoding of the share is not canonical - -age-encryption.org/v1 --> X25519 TEiF0ypqr+bpvcqXNyCVJpL7OuwPdVwPL7KQEbFDOCd -EmECAEcKN+n/Vs9SbWiV+Hu0r+E8R77DdWYyd83nw7U ---- AO6haEGU6BGJ8Tzeqnr2fSLEo31JrWodGtZuCZmijI8 -๎ฯbวฮ‘ด3'Nhิ๒๙LทL[๗พชRศ๐ผ™,ƒ1๛f \ No newline at end of file diff --git a/testdata/testkit/x25519_short_share b/testdata/testkit/x25519_short_share deleted file mode 100644 index 7feb27e5..00000000 --- a/testdata/testkit/x25519_short_share +++ /dev/null @@ -1,10 +0,0 @@ -expect: header failure -file key: 59454c4c4f57205355424d4152494e45 -identity: AGE-SECRET-KEY-1EGTZVFFV20835NWYV6270LXYVK2VKNX2MMDKWYKLMGR48UAWX40Q2P2LM0 -comment: a trailing zero is missing from the X25519 share - -age-encryption.org/v1 --> X25519 l7o4oTX9X5E3/KODa/7CQ0CrA9fKMWsm9IJjYzSlJg -yUGP5aPob6YJ+vzRfBtDT9D1K/wmyheZE/Xl/mDSKA4 ---- Zn1/VRtHpD93HtIXSv1S++POXeKcQF7w1+hpXhMiAbk -ฌ]?7ๅPqำฆ F—น •ย๗๕ฎ่ zŒ(rŠ๓ฮ| \ No newline at end of file diff --git a/testkit_test.go b/testkit_test.go index a354fd96..e4480b4f 100644 --- a/testkit_test.go +++ b/testkit_test.go @@ -11,10 +11,9 @@ import ( "bytes" "crypto/sha256" "encoding/hex" + "encoding/json" "errors" - "flag" "io" - "log" "os" "os/exec" "path/filepath" @@ -25,53 +24,37 @@ import ( "filippo.io/age/armor" ) -//go:generate go test -generate -run ^$ - -func TestMain(m *testing.M) { - genFlag := flag.Bool("generate", false, "regenerate test files") - flag.Parse() - if *genFlag { - log.SetFlags(0) - tests, err := filepath.Glob("testdata/testkit/*") - if err != nil { - log.Fatal(err) - } - for _, test := range tests { - os.Remove(test) - } - generators, err := filepath.Glob("tests/*.go") - if err != nil { - log.Fatal(err) - } - for _, generator := range generators { - vector := strings.TrimSuffix(generator, ".go") - vector = "testdata/testkit/" + strings.TrimPrefix(vector, "tests/") - log.Printf("%s -> %s\n", generator, vector) - out, err := exec.Command("go", "run", generator).Output() - if err != nil { - if err, ok := err.(*exec.ExitError); ok { - log.Fatalf("%s", err.Stderr) - } - log.Fatal(err) - } - os.WriteFile(vector, out, 0664) - } +func TestVectors(t *testing.T) { + if _, err := exec.LookPath("go"); err != nil { + t.Skipf("skipping test because 'go' command is unavailable: %v", err) } - os.Exit(m.Run()) -} + // Download the testkit files from CCTV using `go mod download -json` so the + // cached source of the testdata can be reused. + path := "c2sp.org/CCTV/age@v0.0.0-20221027185432-cfaa74dc42af" + cmd := exec.Command("go", "mod", "download", "-json", path) + output, err := cmd.Output() + if err != nil { + t.Fatalf("failed to run `go mod download -json %s`, output: %s", path, output) + } + var dm struct { + Dir string // absolute path to cached source root directory + } + if err := json.Unmarshal(output, &dm); err != nil { + t.Fatal(err) + } + testkitDir := filepath.Join(dm.Dir, "testdata") -func TestVectors(t *testing.T) { - tests, err := filepath.Glob("testdata/testkit/*") + tests, err := filepath.Glob(testkitDir + "/*") if err != nil { - log.Fatal(err) + t.Fatal(err) } for _, test := range tests { contents, err := os.ReadFile(test) if err != nil { t.Fatal(err) } - name := strings.TrimPrefix(test, "testdata/testkit/") + name := filepath.Base(test) t.Run(name, func(t *testing.T) { testVector(t, contents) }) diff --git a/tests/armor.go b/tests/armor.go deleted file mode 100644 index 1c00eada..00000000 --- a/tests/armor.go +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright 2022 The age Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//go:build ignore -// +build ignore - -package main - -import "filippo.io/age/internal/testkit" - -func main() { - f := testkit.NewTestFile() - f.VersionLine("v1") - f.X25519(testkit.TestX25519Recipient) - f.HMAC() - f.Payload("age") - file := f.Bytes() - f.Buf.Reset() - f.BeginArmor("AGE ENCRYPTED FILE") - f.Body(file) - f.Base64Padding() - f.EndArmor("AGE ENCRYPTED FILE") - f.Generate() -} diff --git a/tests/armor_crlf.go b/tests/armor_crlf.go deleted file mode 100644 index 8b2f569a..00000000 --- a/tests/armor_crlf.go +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright 2022 The age Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//go:build ignore -// +build ignore - -package main - -import ( - "bytes" - - "filippo.io/age/internal/testkit" -) - -func main() { - f := testkit.NewTestFile() - f.VersionLine("v1") - f.X25519(testkit.TestX25519Recipient) - f.HMAC() - f.Payload("age") - file := f.Bytes() - f.Buf.Reset() - f.BeginArmor("AGE ENCRYPTED FILE") - f.Body(file) - f.Base64Padding() - f.EndArmor("AGE ENCRYPTED FILE") - armored := f.Bytes() - f.Buf.Reset() - f.Buf.Write(bytes.Replace(armored, []byte("\n"), []byte("\r\n"), -1)) - f.Comment("CRLF is allowed as a end of line for armored files") - f.Generate() -} diff --git a/tests/armor_empty_line_begin.go b/tests/armor_empty_line_begin.go deleted file mode 100644 index 75dfff2e..00000000 --- a/tests/armor_empty_line_begin.go +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright 2022 The age Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//go:build ignore -// +build ignore - -package main - -import "filippo.io/age/internal/testkit" - -func main() { - f := testkit.NewTestFile() - f.VersionLine("v1") - f.X25519(testkit.TestX25519Recipient) - f.HMAC() - f.Payload("age") - file := f.Bytes() - f.Buf.Reset() - f.BeginArmor("AGE ENCRYPTED FILE") - f.TextLine("") - f.Body(file) - f.Base64Padding() - f.EndArmor("AGE ENCRYPTED FILE") - f.ExpectArmorFailure() - f.Generate() -} diff --git a/tests/armor_empty_line_end.go b/tests/armor_empty_line_end.go deleted file mode 100644 index 68ff5021..00000000 --- a/tests/armor_empty_line_end.go +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright 2022 The age Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//go:build ignore -// +build ignore - -package main - -import "filippo.io/age/internal/testkit" - -func main() { - f := testkit.NewTestFile() - f.VersionLine("v1") - f.X25519(testkit.TestX25519Recipient) - f.HMAC() - f.Payload("age") - file := f.Bytes() - f.Buf.Reset() - f.BeginArmor("AGE ENCRYPTED FILE") - f.Body(file) - f.Base64Padding() - f.TextLine("") - f.EndArmor("AGE ENCRYPTED FILE") - f.ExpectArmorFailure() - f.Generate() -} diff --git a/tests/armor_eol_between_padding.go b/tests/armor_eol_between_padding.go deleted file mode 100644 index eaef051d..00000000 --- a/tests/armor_eol_between_padding.go +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright 2022 The age Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//go:build ignore -// +build ignore - -package main - -import ( - "strings" - - "filippo.io/age/internal/testkit" -) - -// See base64finl in RFC 7468. -// ; ...AB= = is not good, but is valid - -func main() { - f := testkit.NewTestFile() - f.VersionLine("v1") - f.X25519(testkit.TestX25519Recipient) - f.HMAC() - f.Payload("age12") - file := f.Bytes() - f.Buf.Reset() - f.BeginArmor("AGE ENCRYPTED FILE") - f.Body(file) - f.Base64Padding() - line := f.UnreadLine() - if !strings.Contains(line, "==") { - panic("need two padding characters") - } - line = strings.Replace(line, "==", "=\n=", 1) - f.TextLine(line) - f.EndArmor("AGE ENCRYPTED FILE") - f.ExpectArmorFailure() - f.Generate() -} diff --git a/tests/armor_full_last_line.go b/tests/armor_full_last_line.go deleted file mode 100644 index be76f870..00000000 --- a/tests/armor_full_last_line.go +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright 2022 The age Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//go:build ignore -// +build ignore - -package main - -import "filippo.io/age/internal/testkit" - -func main() { - f := testkit.NewTestFile() - f.VersionLine("v1") - f.X25519(testkit.TestX25519Recipient) - f.HMAC() - f.Payload("age age age age age age age age age age ") - file := f.Bytes() - f.Buf.Reset() - f.BeginArmor("AGE ENCRYPTED FILE") - if len(file)%48 != 0 { - println(len(file) % 48) - panic("last line is not full") - } - f.Body(file) - f.UnreadLine() // Body leaves an empty line, PEM doesn't. - f.EndArmor("AGE ENCRYPTED FILE") - f.Generate() -} diff --git a/tests/armor_garbage_encoded.go b/tests/armor_garbage_encoded.go deleted file mode 100644 index 18985826..00000000 --- a/tests/armor_garbage_encoded.go +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright 2022 The age Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//go:build ignore -// +build ignore - -package main - -import "filippo.io/age/internal/testkit" - -func main() { - f := testkit.NewTestFile() - f.FileKey(testkit.LargeTestFileKey) - f.VersionLine("v1") - f.X25519(testkit.TestX25519Identity) - f.HMAC() - f.Nonce(testkit.LargeTestNonce) - f.PayloadChunkFinal(testkit.LargeTestFirstChunk) - f.Buf.Write(f.Rand(20)) - f.ExpectPartialPayload(64 * 1024) - file := f.Bytes() - f.Buf.Reset() - f.BeginArmor("AGE ENCRYPTED FILE") - f.Body(file) - f.Base64Padding() - f.EndArmor("AGE ENCRYPTED FILE") - f.Comment("there is trailing garbage encoded after the final chunk") - f.Generate() -} diff --git a/tests/armor_garbage_leading.go b/tests/armor_garbage_leading.go deleted file mode 100644 index a700abc1..00000000 --- a/tests/armor_garbage_leading.go +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright 2022 The age Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//go:build ignore -// +build ignore - -package main - -import "filippo.io/age/internal/testkit" - -func main() { - f := testkit.NewTestFile() - f.VersionLine("v1") - f.X25519(testkit.TestX25519Recipient) - f.HMAC() - f.Payload("age") - file := f.Bytes() - f.Buf.Reset() - f.TextLine("garbage") - f.BeginArmor("AGE ENCRYPTED FILE") - f.Body(file) - f.Base64Padding() - f.EndArmor("AGE ENCRYPTED FILE") - f.ExpectArmorFailure() - f.Generate() -} diff --git a/tests/armor_garbage_trailing.go b/tests/armor_garbage_trailing.go deleted file mode 100644 index 51261438..00000000 --- a/tests/armor_garbage_trailing.go +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright 2022 The age Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//go:build ignore -// +build ignore - -package main - -import "filippo.io/age/internal/testkit" - -func main() { - f := testkit.NewTestFile() - f.VersionLine("v1") - f.X25519(testkit.TestX25519Recipient) - f.HMAC() - f.Payload("age") - file := f.Bytes() - f.Buf.Reset() - f.BeginArmor("AGE ENCRYPTED FILE") - f.Body(file) - f.Base64Padding() - f.EndArmor("AGE ENCRYPTED FILE") - f.TextLine("garbage") - f.ExpectArmorFailure() - f.Generate() -} diff --git a/tests/armor_header_crlf.go b/tests/armor_header_crlf.go deleted file mode 100644 index 5a902460..00000000 --- a/tests/armor_header_crlf.go +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright 2022 The age Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//go:build ignore -// +build ignore - -package main - -import ( - "bytes" - - "filippo.io/age/internal/testkit" -) - -func main() { - f := testkit.NewTestFile() - f.VersionLine("v1") - f.X25519(testkit.TestX25519Identity) - hdr := f.Buf.Bytes() - f.Buf.Reset() - f.Buf.Write(bytes.Replace(hdr, []byte("\n"), []byte("\r\n"), -1)) - f.HMAC() - f.Buf.WriteString(f.UnreadLine() + "\r\n") - f.Payload("age") - f.ExpectHeaderFailure() - f.Comment("lines in the header end with CRLF instead of LF") - file := f.Bytes() - f.Buf.Reset() - f.BeginArmor("AGE ENCRYPTED FILE") - f.Body(file) - f.Base64Padding() - f.EndArmor("AGE ENCRYPTED FILE") - f.Generate() -} diff --git a/tests/armor_headers.go b/tests/armor_headers.go deleted file mode 100644 index 7cfd5497..00000000 --- a/tests/armor_headers.go +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright 2022 The age Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//go:build ignore -// +build ignore - -package main - -import "filippo.io/age/internal/testkit" - -func main() { - f := testkit.NewTestFile() - f.VersionLine("v1") - f.X25519(testkit.TestX25519Recipient) - f.HMAC() - f.Payload("age") - file := f.Bytes() - f.Buf.Reset() - f.BeginArmor("AGE ENCRYPTED FILE") - f.TextLine("Headers: are") - f.TextLine("Not: allowed") - f.TextLine("") - f.Body(file) - f.Base64Padding() - f.EndArmor("AGE ENCRYPTED FILE") - f.ExpectArmorFailure() - f.Generate() -} diff --git a/tests/armor_invalid_character_header.go b/tests/armor_invalid_character_header.go deleted file mode 100644 index cfc7d723..00000000 --- a/tests/armor_invalid_character_header.go +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright 2022 The age Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//go:build ignore -// +build ignore - -package main - -import ( - "strings" - - "filippo.io/age/internal/testkit" -) - -func main() { - f := testkit.NewTestFile() - f.VersionLine("v1") - f.X25519(testkit.TestX25519Recipient) - f.HMAC() - f.Payload("age") - file := f.Bytes() - f.Buf.Reset() - f.BeginArmor("AGE ENCRYPTED FILE") - f.Body(file) - f.Base64Padding() - begin, rest, _ := strings.Cut(string(f.Bytes()), "\n") - f.Buf.Reset() - f.TextLine(begin) - f.Buf.WriteString(rest[:4] + "*" + rest[5:]) - f.EndArmor("AGE ENCRYPTED FILE") - f.ExpectArmorFailure() - f.Generate() -} diff --git a/tests/armor_invalid_character_payload.go b/tests/armor_invalid_character_payload.go deleted file mode 100644 index 0738b5f7..00000000 --- a/tests/armor_invalid_character_payload.go +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright 2022 The age Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//go:build ignore -// +build ignore - -package main - -import "filippo.io/age/internal/testkit" - -func main() { - f := testkit.NewTestFile() - f.VersionLine("v1") - f.X25519(testkit.TestX25519Recipient) - f.HMAC() - f.Payload("age") - file := f.Bytes() - f.Buf.Reset() - f.BeginArmor("AGE ENCRYPTED FILE") - f.Body(file) - f.Base64Padding() - line := f.UnreadLine() - f.TextLine("*" + line[1:]) - f.EndArmor("AGE ENCRYPTED FILE") - f.ExpectArmorFailure() - f.Generate() -} diff --git a/tests/armor_long_line.go b/tests/armor_long_line.go deleted file mode 100644 index aae9f941..00000000 --- a/tests/armor_long_line.go +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright 2022 The age Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//go:build ignore -// +build ignore - -package main - -import ( - "encoding/base64" - - "filippo.io/age/internal/testkit" -) - -func main() { - f := testkit.NewTestFile() - f.VersionLine("v1") - f.X25519(testkit.TestX25519Recipient) - f.HMAC() - f.Payload("age") - file := f.Bytes() - f.Buf.Reset() - f.BeginArmor("AGE ENCRYPTED FILE") - f.TextLine(base64.StdEncoding.EncodeToString(file)) - f.Base64Padding() - f.EndArmor("AGE ENCRYPTED FILE") - f.ExpectArmorFailure() - f.Generate() -} diff --git a/tests/armor_lowercase.go b/tests/armor_lowercase.go deleted file mode 100644 index cb823b4f..00000000 --- a/tests/armor_lowercase.go +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright 2022 The age Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//go:build ignore -// +build ignore - -package main - -import "filippo.io/age/internal/testkit" - -func main() { - f := testkit.NewTestFile() - f.VersionLine("v1") - f.X25519(testkit.TestX25519Recipient) - f.HMAC() - f.Payload("age") - file := f.Bytes() - f.Buf.Reset() - f.BeginArmor("age ENCRYPTED FILE") - f.Body(file) - f.Base64Padding() - f.EndArmor("age ENCRYPTED FILE") - f.ExpectArmorFailure() - f.Generate() -} diff --git a/tests/armor_no_end_line.go b/tests/armor_no_end_line.go deleted file mode 100644 index 46b8f039..00000000 --- a/tests/armor_no_end_line.go +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright 2022 The age Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//go:build ignore -// +build ignore - -package main - -import "filippo.io/age/internal/testkit" - -func main() { - f := testkit.NewTestFile() - f.VersionLine("v1") - f.X25519(testkit.TestX25519Recipient) - f.HMAC() - f.Payload("age") - file := f.Bytes() - f.Buf.Reset() - f.BeginArmor("AGE ENCRYPTED FILE") - f.Body(file) - f.Base64Padding() - f.ExpectArmorFailure() - f.Generate() -} diff --git a/tests/armor_no_eol.go b/tests/armor_no_eol.go deleted file mode 100644 index e9b673d9..00000000 --- a/tests/armor_no_eol.go +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright 2022 The age Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//go:build ignore -// +build ignore - -package main - -import "filippo.io/age/internal/testkit" - -func main() { - f := testkit.NewTestFile() - f.VersionLine("v1") - f.X25519(testkit.TestX25519Recipient) - f.HMAC() - f.Payload("age") - file := f.Bytes() - f.Buf.Reset() - f.BeginArmor("AGE ENCRYPTED FILE") - f.Body(file) - f.Base64Padding() - f.Buf.WriteString("-----END AGE ENCRYPTED FILE-----") - f.Comment("there is no end of line at the end of the file") - f.Generate() -} diff --git a/tests/armor_no_match.go b/tests/armor_no_match.go deleted file mode 100644 index 130956d6..00000000 --- a/tests/armor_no_match.go +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright 2022 The age Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//go:build ignore -// +build ignore - -package main - -import "filippo.io/age/internal/testkit" - -func main() { - f := testkit.NewTestFile() - f.VersionLine("v1") - identity := f.Rand(32) - f.X25519RecordIdentity(identity) - f.X25519NoRecordIdentity(testkit.TestX25519Recipient) - f.HMAC() - f.Payload("age") - f.ExpectNoMatch() - file := f.Bytes() - f.Buf.Reset() - f.BeginArmor("AGE ENCRYPTED FILE") - f.Body(file) - f.Base64Padding() - f.EndArmor("AGE ENCRYPTED FILE") - f.Generate() -} diff --git a/tests/armor_no_padding.go b/tests/armor_no_padding.go deleted file mode 100644 index 789efb9c..00000000 --- a/tests/armor_no_padding.go +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright 2022 The age Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//go:build ignore -// +build ignore - -package main - -import "filippo.io/age/internal/testkit" - -func main() { - f := testkit.NewTestFile() - f.VersionLine("v1") - f.X25519(testkit.TestX25519Recipient) - f.HMAC() - f.Payload("age") - file := f.Bytes() - f.Buf.Reset() - f.BeginArmor("AGE ENCRYPTED FILE") - if len(file)%3 == 0 { - panic("no need for padding") - } - f.Body(file) - f.EndArmor("AGE ENCRYPTED FILE") - f.ExpectArmorFailure() - f.Comment("missing base64 padding") - f.Generate() -} diff --git a/tests/armor_not_canonical.go b/tests/armor_not_canonical.go deleted file mode 100644 index 92efb834..00000000 --- a/tests/armor_not_canonical.go +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright 2022 The age Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//go:build ignore -// +build ignore - -package main - -import "filippo.io/age/internal/testkit" - -func main() { - f := testkit.NewTestFile() - f.VersionLine("v1") - f.X25519(testkit.TestX25519Recipient) - f.HMAC() - f.Payload("age") - file := f.Bytes() - f.Buf.Reset() - f.BeginArmor("AGE ENCRYPTED FILE") - f.Body(file) - f.TextLine(testkit.NotCanonicalBase64(f.UnreadLine())) - f.Base64Padding() - f.EndArmor("AGE ENCRYPTED FILE") - f.ExpectArmorFailure() - f.Comment("base64 is not canonical") - f.Generate() -} diff --git a/tests/armor_pgp_checksum.go b/tests/armor_pgp_checksum.go deleted file mode 100644 index 4172f099..00000000 --- a/tests/armor_pgp_checksum.go +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright 2022 The age Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//go:build ignore -// +build ignore - -package main - -import ( - "filippo.io/age/internal/testkit" - "golang.org/x/crypto/openpgp/armor" -) - -func main() { - f := testkit.NewTestFile() - f.VersionLine("v1") - f.X25519(testkit.TestX25519Recipient) - f.HMAC() - f.Payload("age") - file := f.Bytes() - f.Buf.Reset() - w, _ := armor.Encode(&f.Buf, "AGE ENCRYPTED FILE", nil) - w.Write(file) - w.Close() - f.Buf.WriteString("\n") - f.ExpectArmorFailure() - f.Generate() -} diff --git a/tests/armor_short_line.go b/tests/armor_short_line.go deleted file mode 100644 index 7a4df09a..00000000 --- a/tests/armor_short_line.go +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright 2022 The age Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//go:build ignore -// +build ignore - -package main - -import "filippo.io/age/internal/testkit" - -func main() { - f := testkit.NewTestFile() - f.VersionLine("v1") - f.X25519(testkit.TestX25519Recipient) - f.HMAC() - f.Payload("age") - file := f.Bytes() - f.Buf.Reset() - f.BeginArmor("AGE ENCRYPTED FILE") - f.Body(file[:12]) - f.Body(file[12:]) - f.Base64Padding() - f.EndArmor("AGE ENCRYPTED FILE") - f.ExpectArmorFailure() - f.Generate() -} diff --git a/tests/armor_whitespace_begin.go b/tests/armor_whitespace_begin.go deleted file mode 100644 index bf34a9a9..00000000 --- a/tests/armor_whitespace_begin.go +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright 2022 The age Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//go:build ignore -// +build ignore - -package main - -import "filippo.io/age/internal/testkit" - -func main() { - f := testkit.NewTestFile() - f.VersionLine("v1") - f.X25519(testkit.TestX25519Recipient) - f.HMAC() - f.Payload("age") - file := f.Bytes() - f.Buf.Reset() - f.TextLine("----- BEGIN AGE ENCRYPTED FILE -----") - f.Body(file) - f.Base64Padding() - f.EndArmor("AGE ENCRYPTED FILE") - f.ExpectArmorFailure() - f.Generate() -} diff --git a/tests/armor_whitespace_end.go b/tests/armor_whitespace_end.go deleted file mode 100644 index c85bac16..00000000 --- a/tests/armor_whitespace_end.go +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright 2022 The age Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//go:build ignore -// +build ignore - -package main - -import "filippo.io/age/internal/testkit" - -func main() { - f := testkit.NewTestFile() - f.VersionLine("v1") - f.X25519(testkit.TestX25519Recipient) - f.HMAC() - f.Payload("age") - file := f.Bytes() - f.Buf.Reset() - f.BeginArmor("AGE ENCRYPTED FILE") - f.Body(file) - f.Base64Padding() - f.TextLine("----- END AGE ENCRYPTED FILE -----") - f.ExpectArmorFailure() - f.Generate() -} diff --git a/tests/armor_whitespace_eol.go b/tests/armor_whitespace_eol.go deleted file mode 100644 index 32419d88..00000000 --- a/tests/armor_whitespace_eol.go +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright 2022 The age Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//go:build ignore -// +build ignore - -package main - -import "filippo.io/age/internal/testkit" - -func main() { - f := testkit.NewTestFile() - f.VersionLine("v1") - f.X25519(testkit.TestX25519Recipient) - f.HMAC() - f.Payload("age") - file := f.Bytes() - f.Buf.Reset() - f.BeginArmor("AGE ENCRYPTED FILE") - f.Body(file) - f.Base64Padding() - line2, line1 := f.UnreadLine(), f.UnreadLine() - f.TextLine(line1 + " ") - f.TextLine(line2) - f.EndArmor("AGE ENCRYPTED FILE") - f.ExpectArmorFailure() - f.Generate() -} diff --git a/tests/armor_whitespace_last_line.go b/tests/armor_whitespace_last_line.go deleted file mode 100644 index e287f0a6..00000000 --- a/tests/armor_whitespace_last_line.go +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright 2022 The age Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//go:build ignore -// +build ignore - -package main - -import "filippo.io/age/internal/testkit" - -func main() { - f := testkit.NewTestFile() - f.VersionLine("v1") - f.X25519(testkit.TestX25519Recipient) - f.HMAC() - f.Payload("age") - file := f.Bytes() - f.Buf.Reset() - f.BeginArmor("AGE ENCRYPTED FILE") - f.Body(file) - f.Base64Padding() - f.TextLine(f.UnreadLine() + " ") - f.EndArmor("AGE ENCRYPTED FILE") - f.ExpectArmorFailure() - f.Generate() -} diff --git a/tests/armor_whitespace_line_start.go b/tests/armor_whitespace_line_start.go deleted file mode 100644 index cb17c9ed..00000000 --- a/tests/armor_whitespace_line_start.go +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright 2022 The age Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//go:build ignore -// +build ignore - -package main - -import "filippo.io/age/internal/testkit" - -func main() { - f := testkit.NewTestFile() - f.VersionLine("v1") - f.X25519(testkit.TestX25519Recipient) - f.HMAC() - f.Payload("age") - file := f.Bytes() - f.Buf.Reset() - f.BeginArmor("AGE ENCRYPTED FILE") - f.Body(file) - f.Base64Padding() - line2, line1 := f.UnreadLine(), f.UnreadLine() - f.TextLine(" " + line1) - f.TextLine(line2) - f.EndArmor("AGE ENCRYPTED FILE") - f.ExpectArmorFailure() - f.Generate() -} diff --git a/tests/armor_whitespace_outside.go b/tests/armor_whitespace_outside.go deleted file mode 100644 index 516c5fa6..00000000 --- a/tests/armor_whitespace_outside.go +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright 2022 The age Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//go:build ignore -// +build ignore - -package main - -import "filippo.io/age/internal/testkit" - -func main() { - f := testkit.NewTestFile() - f.VersionLine("v1") - f.X25519(testkit.TestX25519Recipient) - f.HMAC() - f.Payload("age") - file := f.Bytes() - f.Buf.Reset() - f.Buf.Write([]byte("\n\r \t\n")) - f.BeginArmor("AGE ENCRYPTED FILE") - f.Body(file) - f.Base64Padding() - f.EndArmor("AGE ENCRYPTED FILE") - f.Buf.Write([]byte("\n\r \t\n")) - f.Comment("whitespace is allowed before and after armored files") - f.Generate() -} diff --git a/tests/armor_wrong_type.go b/tests/armor_wrong_type.go deleted file mode 100644 index de8521d3..00000000 --- a/tests/armor_wrong_type.go +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright 2022 The age Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//go:build ignore -// +build ignore - -package main - -import "filippo.io/age/internal/testkit" - -func main() { - f := testkit.NewTestFile() - f.VersionLine("v1") - f.X25519(testkit.TestX25519Recipient) - f.HMAC() - f.Payload("age") - file := f.Bytes() - f.Buf.Reset() - f.BeginArmor("AGE ENCRYPTED MESSAGE") - f.Body(file) - f.Base64Padding() - f.EndArmor("AGE ENCRYPTED MESSAGE") - f.ExpectArmorFailure() - f.Generate() -} diff --git a/tests/header_crlf.go b/tests/header_crlf.go deleted file mode 100644 index 90714902..00000000 --- a/tests/header_crlf.go +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright 2022 The age Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//go:build ignore -// +build ignore - -package main - -import ( - "bytes" - - "filippo.io/age/internal/testkit" -) - -func main() { - f := testkit.NewTestFile() - f.VersionLine("v1") - f.X25519(testkit.TestX25519Identity) - hdr := f.Buf.Bytes() - f.Buf.Reset() - f.Buf.Write(bytes.Replace(hdr, []byte("\n"), []byte("\r\n"), -1)) - f.HMAC() - f.Buf.WriteString(f.UnreadLine() + "\r\n") - f.Payload("age") - f.ExpectHeaderFailure() - f.Comment("lines in the header end with CRLF instead of LF") - f.Generate() -} diff --git a/tests/hmac_bad.go b/tests/hmac_bad.go deleted file mode 100644 index 801f45d7..00000000 --- a/tests/hmac_bad.go +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright 2022 The age Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//go:build ignore -// +build ignore - -package main - -import "filippo.io/age/internal/testkit" - -func main() { - f := testkit.NewTestFile() - f.VersionLine("v1") - f.X25519(testkit.TestX25519Identity) - f.FileKey(make([]byte, 16)) - f.HMAC() - f.FileKey(testkit.TestFileKey) - f.Payload("age") - f.ExpectHMACFailure() - f.Generate() -} diff --git a/tests/hmac_extra_space.go b/tests/hmac_extra_space.go deleted file mode 100644 index 300a76fb..00000000 --- a/tests/hmac_extra_space.go +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright 2022 The age Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//go:build ignore -// +build ignore - -package main - -import ( - "strings" - - "filippo.io/age/internal/testkit" -) - -func main() { - f := testkit.NewTestFile() - f.VersionLine("v1") - f.X25519(testkit.TestX25519Identity) - f.HMAC() - f.TextLine(strings.Replace(f.UnreadLine(), "--- ", "--- ", -1)) - f.Payload("age") - f.ExpectHeaderFailure() - f.Generate() -} diff --git a/tests/hmac_garbage.go b/tests/hmac_garbage.go deleted file mode 100644 index 0756f7dc..00000000 --- a/tests/hmac_garbage.go +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright 2022 The age Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//go:build ignore -// +build ignore - -package main - -import "filippo.io/age/internal/testkit" - -func main() { - f := testkit.NewTestFile() - f.VersionLine("v1") - f.X25519(testkit.TestX25519Identity) - f.HMAC() - f.TextLine(f.UnreadLine() + "AAA") - f.Payload("age") - f.ExpectHeaderFailure() - f.Generate() -} diff --git a/tests/hmac_missing.go b/tests/hmac_missing.go deleted file mode 100644 index 9b1b042a..00000000 --- a/tests/hmac_missing.go +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright 2022 The age Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//go:build ignore -// +build ignore - -package main - -import "filippo.io/age/internal/testkit" - -func main() { - f := testkit.NewTestFile() - f.VersionLine("v1") - f.X25519(testkit.TestX25519Identity) - f.HMACLine(nil) - f.Payload("age") - f.ExpectHeaderFailure() - f.Generate() -} diff --git a/tests/hmac_no_space.go b/tests/hmac_no_space.go deleted file mode 100644 index a249368d..00000000 --- a/tests/hmac_no_space.go +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright 2022 The age Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//go:build ignore -// +build ignore - -package main - -import ( - "strings" - - "filippo.io/age/internal/testkit" -) - -func main() { - f := testkit.NewTestFile() - f.VersionLine("v1") - f.X25519(testkit.TestX25519Identity) - f.HMAC() - f.TextLine(strings.Replace(f.UnreadLine(), "--- ", "---", -1)) - f.Payload("age") - f.ExpectHeaderFailure() - f.Generate() -} diff --git a/tests/hmac_not_canonical.go b/tests/hmac_not_canonical.go deleted file mode 100644 index 81968c79..00000000 --- a/tests/hmac_not_canonical.go +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright 2022 The age Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//go:build ignore -// +build ignore - -package main - -import "filippo.io/age/internal/testkit" - -func main() { - f := testkit.NewTestFile() - f.VersionLine("v1") - f.X25519(testkit.TestX25519Identity) - f.HMAC() - f.TextLine(testkit.NotCanonicalBase64(f.UnreadLine())) - f.Payload("age") - f.ExpectHeaderFailure() - f.Comment("the base64 encoding of the HMAC is not canonical") - f.Generate() -} diff --git a/tests/hmac_trailing_space.go b/tests/hmac_trailing_space.go deleted file mode 100644 index 93eecc66..00000000 --- a/tests/hmac_trailing_space.go +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright 2022 The age Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//go:build ignore -// +build ignore - -package main - -import "filippo.io/age/internal/testkit" - -func main() { - f := testkit.NewTestFile() - f.VersionLine("v1") - f.X25519(testkit.TestX25519Identity) - f.HMAC() - f.TextLine(f.UnreadLine() + " ") - f.Payload("age") - f.ExpectHeaderFailure() - f.Generate() -} diff --git a/tests/hmac_truncated.go b/tests/hmac_truncated.go deleted file mode 100644 index 4336beae..00000000 --- a/tests/hmac_truncated.go +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright 2022 The age Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//go:build ignore -// +build ignore - -package main - -import "filippo.io/age/internal/testkit" - -func main() { - f := testkit.NewTestFile() - f.VersionLine("v1") - f.X25519(testkit.TestX25519Identity) - f.HMAC() - f.TextLine(f.UnreadLine()[:len("--- 1234")]) - f.Payload("age") - f.ExpectHeaderFailure() - f.Generate() -} diff --git a/tests/scrypt.go b/tests/scrypt.go deleted file mode 100644 index 8bdb40e2..00000000 --- a/tests/scrypt.go +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2022 The age Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//go:build ignore -// +build ignore - -package main - -import "filippo.io/age/internal/testkit" - -func main() { - f := testkit.NewTestFile() - f.VersionLine("v1") - f.Scrypt("password", 10) - f.HMAC() - f.Payload("age") - f.Generate() -} diff --git a/tests/scrypt_and_x25519.go b/tests/scrypt_and_x25519.go deleted file mode 100644 index efdc9fde..00000000 --- a/tests/scrypt_and_x25519.go +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright 2022 The age Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//go:build ignore -// +build ignore - -package main - -import "filippo.io/age/internal/testkit" - -func main() { - f := testkit.NewTestFile() - f.VersionLine("v1") - f.X25519RecordIdentity(f.Rand(32)) - f.X25519NoRecordIdentity(testkit.TestX25519Identity) - f.Scrypt("password", 10) - f.HMAC() - f.Payload("age") - f.ExpectHeaderFailure() - f.Comment("scrypt stanzas must be alone in the header") - f.Generate() -} diff --git a/tests/scrypt_bad_tag.go b/tests/scrypt_bad_tag.go deleted file mode 100644 index ee687aea..00000000 --- a/tests/scrypt_bad_tag.go +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright 2022 The age Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//go:build ignore -// +build ignore - -package main - -import ( - "encoding/base64" - - "filippo.io/age/internal/testkit" -) - -func main() { - f := testkit.NewTestFile() - f.VersionLine("v1") - f.Scrypt("password", 10) - body, _ := base64.RawStdEncoding.DecodeString(f.UnreadLine()) - body[len(body)-1] ^= 0xff - f.TextLine(base64.RawStdEncoding.EncodeToString(body)) - f.HMAC() - f.Payload("age") - f.ExpectNoMatch() - f.Comment("the ChaCha20Poly1305 authentication tag on the body of the scrypt stanza is wrong") - f.Generate() -} diff --git a/tests/scrypt_double.go b/tests/scrypt_double.go deleted file mode 100644 index 8118295d..00000000 --- a/tests/scrypt_double.go +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright 2022 The age Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//go:build ignore -// +build ignore - -package main - -import "filippo.io/age/internal/testkit" - -func main() { - f := testkit.NewTestFile() - f.VersionLine("v1") - f.Scrypt("password", 10) - f.Scrypt("hunter2", 10) - f.HMAC() - f.Payload("age") - f.ExpectHeaderFailure() - f.Comment("scrypt stanzas must be alone in the header") - f.Generate() -} diff --git a/tests/scrypt_extra_argument.go b/tests/scrypt_extra_argument.go deleted file mode 100644 index 7439b248..00000000 --- a/tests/scrypt_extra_argument.go +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright 2022 The age Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//go:build ignore -// +build ignore - -package main - -import "filippo.io/age/internal/testkit" - -func main() { - f := testkit.NewTestFile() - f.VersionLine("v1") - f.Scrypt("password", 10) - body, args := f.UnreadLine(), f.UnreadLine() - f.TextLine(args + " 10") - f.TextLine(body) - f.HMAC() - f.Payload("age") - f.ExpectHeaderFailure() - f.Comment("the base64 encoding of the share is not canonical") - f.Generate() -} diff --git a/tests/scrypt_long_file_key.go b/tests/scrypt_long_file_key.go deleted file mode 100644 index d9da5602..00000000 --- a/tests/scrypt_long_file_key.go +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright 2022 The age Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//go:build ignore -// +build ignore - -package main - -import "filippo.io/age/internal/testkit" - -func main() { - f := testkit.NewTestFile() - f.FileKey([]byte("A LONGER YELLOW SUBMARINE")) - f.VersionLine("v1") - f.Scrypt("password", 10) - f.HMAC() - f.Payload("age") - f.ExpectHeaderFailure() - f.Comment("the file key must be checked to be 16 bytes before decrypting it") - f.Generate() -} diff --git a/tests/scrypt_no_match.go b/tests/scrypt_no_match.go deleted file mode 100644 index 32754ebc..00000000 --- a/tests/scrypt_no_match.go +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright 2022 The age Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//go:build ignore -// +build ignore - -package main - -import "filippo.io/age/internal/testkit" - -func main() { - f := testkit.NewTestFile() - f.VersionLine("v1") - f.ScryptRecordPassphrase("wrong") - f.ScryptNoRecordPassphrase("password", 10) - f.HMAC() - f.Payload("age") - f.ExpectNoMatch() - f.Generate() -} diff --git a/tests/scrypt_not_canonical_body.go b/tests/scrypt_not_canonical_body.go deleted file mode 100644 index 35f83fe0..00000000 --- a/tests/scrypt_not_canonical_body.go +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright 2022 The age Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//go:build ignore -// +build ignore - -package main - -import "filippo.io/age/internal/testkit" - -func main() { - f := testkit.NewTestFile() - f.VersionLine("v1") - f.Scrypt("password", 10) - body := f.UnreadLine() - f.TextLine(testkit.NotCanonicalBase64(body)) - f.HMAC() - f.Payload("age") - f.ExpectHeaderFailure() - f.Comment("the base64 encoding of the share is not canonical") - f.Generate() -} diff --git a/tests/scrypt_not_canonical_salt.go b/tests/scrypt_not_canonical_salt.go deleted file mode 100644 index 383ad0b5..00000000 --- a/tests/scrypt_not_canonical_salt.go +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright 2022 The age Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//go:build ignore -// +build ignore - -package main - -import "filippo.io/age/internal/testkit" - -func main() { - f := testkit.NewTestFile() - f.VersionLine("v1") - f.Scrypt("password", 10) - body, args := f.UnreadLine(), f.UnreadArgsLine() - f.ArgsLine(args[0], testkit.NotCanonicalBase64(args[1]), args[2]) - f.TextLine(body) - f.HMAC() - f.Payload("age") - f.ExpectHeaderFailure() - f.Generate() -} diff --git a/tests/scrypt_salt_long.go b/tests/scrypt_salt_long.go deleted file mode 100644 index f2522c89..00000000 --- a/tests/scrypt_salt_long.go +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright 2022 The age Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//go:build ignore -// +build ignore - -package main - -import "filippo.io/age/internal/testkit" - -func main() { - f := testkit.NewTestFile() - f.VersionLine("v1") - f.ScryptRecordPassphrase("password") - f.ScryptNoRecordPassphraseWithSalt("password", 10, f.Rand(20)) - f.HMAC() - f.Payload("age") - f.ExpectHeaderFailure() - f.Generate() -} diff --git a/tests/scrypt_salt_missing.go b/tests/scrypt_salt_missing.go deleted file mode 100644 index aa227a81..00000000 --- a/tests/scrypt_salt_missing.go +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright 2022 The age Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//go:build ignore -// +build ignore - -package main - -import "filippo.io/age/internal/testkit" - -func main() { - f := testkit.NewTestFile() - f.VersionLine("v1") - f.ScryptRecordPassphrase("password") - f.ScryptNoRecordPassphraseWithSalt("password", 10, nil) - body, args := f.UnreadLine(), f.UnreadArgsLine() - f.ArgsLine(args[0], args[2]) - f.TextLine(body) - f.HMAC() - f.Payload("age") - f.ExpectHeaderFailure() - f.Generate() -} diff --git a/tests/scrypt_salt_short.go b/tests/scrypt_salt_short.go deleted file mode 100644 index 30ae21f0..00000000 --- a/tests/scrypt_salt_short.go +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright 2022 The age Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//go:build ignore -// +build ignore - -package main - -import "filippo.io/age/internal/testkit" - -func main() { - f := testkit.NewTestFile() - f.VersionLine("v1") - f.ScryptRecordPassphrase("password") - f.ScryptNoRecordPassphraseWithSalt("password", 10, f.Rand(12)) - f.HMAC() - f.Payload("age") - f.ExpectHeaderFailure() - f.Generate() -} diff --git a/tests/scrypt_uppercase.go b/tests/scrypt_uppercase.go deleted file mode 100644 index ec3e5eff..00000000 --- a/tests/scrypt_uppercase.go +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright 2022 The age Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//go:build ignore -// +build ignore - -package main - -import "filippo.io/age/internal/testkit" - -func main() { - f := testkit.NewTestFile() - f.VersionLine("v1") - f.Scrypt("password", 10) - body, args := f.UnreadLine(), f.UnreadArgsLine() - f.ArgsLine("Scrypt", args[1], args[2]) - f.TextLine(body) - f.HMAC() - f.Payload("age") - f.ExpectNoMatch() - f.Generate() -} diff --git a/tests/scrypt_work_factor_23.go b/tests/scrypt_work_factor_23.go deleted file mode 100644 index 5e6a7860..00000000 --- a/tests/scrypt_work_factor_23.go +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright 2022 The age Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//go:build ignore -// +build ignore - -package main - -import "filippo.io/age/internal/testkit" - -func main() { - f := testkit.NewTestFile() - f.VersionLine("v1") - // Hardcoded because it would be too slow to regenerate every time. - // f.Scrypt("password", 23) - f.ScryptRecordPassphrase("password") - f.ArgsLine("scrypt", "rF0/NwblUHHTpgQgRpe5CQ", "23") - f.TextLine("qW9eVsT0NVb/Vswtw8kPIxUnaYmm9Px1dYmq2+4+qZA") - f.HMAC() - f.Payload("age") - f.ExpectHeaderFailure() - f.Comment("work factor is very high, would take a long time to compute") - f.Generate() -} diff --git a/tests/scrypt_work_factor_hex.go b/tests/scrypt_work_factor_hex.go deleted file mode 100644 index 59c5b032..00000000 --- a/tests/scrypt_work_factor_hex.go +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright 2022 The age Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//go:build ignore -// +build ignore - -package main - -import "filippo.io/age/internal/testkit" - -func main() { - f := testkit.NewTestFile() - f.VersionLine("v1") - f.Scrypt("password", 10) - body, args := f.UnreadLine(), f.UnreadArgsLine() - f.ArgsLine(args[0], args[1], "0xa") - f.TextLine(body) - f.HMAC() - f.Payload("age") - f.ExpectHeaderFailure() - f.Generate() -} diff --git a/tests/scrypt_work_factor_leading_garbage.go b/tests/scrypt_work_factor_leading_garbage.go deleted file mode 100644 index 50b2e211..00000000 --- a/tests/scrypt_work_factor_leading_garbage.go +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright 2022 The age Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//go:build ignore -// +build ignore - -package main - -import "filippo.io/age/internal/testkit" - -func main() { - f := testkit.NewTestFile() - f.VersionLine("v1") - f.Scrypt("password", 10) - body, args := f.UnreadLine(), f.UnreadArgsLine() - f.ArgsLine(args[0], args[1], "aaaa10") - f.TextLine(body) - f.HMAC() - f.Payload("age") - f.ExpectHeaderFailure() - f.Generate() -} diff --git a/tests/scrypt_work_factor_leading_plus.go b/tests/scrypt_work_factor_leading_plus.go deleted file mode 100644 index 9b84967d..00000000 --- a/tests/scrypt_work_factor_leading_plus.go +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright 2022 The age Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//go:build ignore -// +build ignore - -package main - -import "filippo.io/age/internal/testkit" - -func main() { - f := testkit.NewTestFile() - f.VersionLine("v1") - f.Scrypt("password", 10) - body, args := f.UnreadLine(), f.UnreadArgsLine() - f.ArgsLine(args[0], args[1], "+10") - f.TextLine(body) - f.HMAC() - f.Payload("age") - f.ExpectHeaderFailure() - f.Generate() -} diff --git a/tests/scrypt_work_factor_leading_zero_decimal.go b/tests/scrypt_work_factor_leading_zero_decimal.go deleted file mode 100644 index 62f1e2e3..00000000 --- a/tests/scrypt_work_factor_leading_zero_decimal.go +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright 2022 The age Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//go:build ignore -// +build ignore - -package main - -import "filippo.io/age/internal/testkit" - -func main() { - f := testkit.NewTestFile() - f.VersionLine("v1") - f.Scrypt("password", 10) - body, args := f.UnreadLine(), f.UnreadArgsLine() - f.ArgsLine(args[0], args[1], "010") - f.TextLine(body) - f.HMAC() - f.Payload("age") - f.ExpectHeaderFailure() - f.Generate() -} diff --git a/tests/scrypt_work_factor_leading_zero_octal.go b/tests/scrypt_work_factor_leading_zero_octal.go deleted file mode 100644 index 2485643c..00000000 --- a/tests/scrypt_work_factor_leading_zero_octal.go +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright 2022 The age Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//go:build ignore -// +build ignore - -package main - -import "filippo.io/age/internal/testkit" - -func main() { - f := testkit.NewTestFile() - f.VersionLine("v1") - f.Scrypt("password", 10) - body, args := f.UnreadLine(), f.UnreadArgsLine() - f.ArgsLine(args[0], args[1], "012") - f.TextLine(body) - f.HMAC() - f.Payload("age") - f.ExpectHeaderFailure() - f.Generate() -} diff --git a/tests/scrypt_work_factor_missing.go b/tests/scrypt_work_factor_missing.go deleted file mode 100644 index fc6f580c..00000000 --- a/tests/scrypt_work_factor_missing.go +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright 2022 The age Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//go:build ignore -// +build ignore - -package main - -import "filippo.io/age/internal/testkit" - -func main() { - f := testkit.NewTestFile() - f.VersionLine("v1") - f.Scrypt("password", 18) // cmd/age default - body, args := f.UnreadLine(), f.UnreadArgsLine() - f.ArgsLine(args[0], args[1]) - f.TextLine(body) - f.HMAC() - f.Payload("age") - f.ExpectHeaderFailure() - f.Generate() -} diff --git a/tests/scrypt_work_factor_negative.go b/tests/scrypt_work_factor_negative.go deleted file mode 100644 index 5ff675e8..00000000 --- a/tests/scrypt_work_factor_negative.go +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright 2022 The age Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//go:build ignore -// +build ignore - -package main - -import "filippo.io/age/internal/testkit" - -func main() { - f := testkit.NewTestFile() - f.VersionLine("v1") - f.Scrypt("password", 10) - body, args := f.UnreadLine(), f.UnreadArgsLine() - f.ArgsLine(args[0], args[1], "-10") - f.TextLine(body) - f.HMAC() - f.Payload("age") - f.ExpectHeaderFailure() - f.Generate() -} diff --git a/tests/scrypt_work_factor_overflow.go b/tests/scrypt_work_factor_overflow.go deleted file mode 100644 index deb9cbca..00000000 --- a/tests/scrypt_work_factor_overflow.go +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright 2022 The age Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//go:build ignore -// +build ignore - -package main - -import ( - "math" - "strconv" - - "filippo.io/age/internal/testkit" -) - -func main() { - f := testkit.NewTestFile() - f.VersionLine("v1") - f.Scrypt("password", 10) - body, args := f.UnreadLine(), f.UnreadArgsLine() - f.ArgsLine(args[0], args[1], strconv.FormatUint(math.MaxInt64+1+10, 10)) - f.TextLine(body) - f.HMAC() - f.Payload("age") - f.ExpectHeaderFailure() - f.Generate() -} diff --git a/tests/scrypt_work_factor_trailing_garbage.go b/tests/scrypt_work_factor_trailing_garbage.go deleted file mode 100644 index 50b2e211..00000000 --- a/tests/scrypt_work_factor_trailing_garbage.go +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright 2022 The age Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//go:build ignore -// +build ignore - -package main - -import "filippo.io/age/internal/testkit" - -func main() { - f := testkit.NewTestFile() - f.VersionLine("v1") - f.Scrypt("password", 10) - body, args := f.UnreadLine(), f.UnreadArgsLine() - f.ArgsLine(args[0], args[1], "aaaa10") - f.TextLine(body) - f.HMAC() - f.Payload("age") - f.ExpectHeaderFailure() - f.Generate() -} diff --git a/tests/scrypt_work_factor_wrong.go b/tests/scrypt_work_factor_wrong.go deleted file mode 100644 index bb6101ff..00000000 --- a/tests/scrypt_work_factor_wrong.go +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright 2022 The age Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//go:build ignore -// +build ignore - -package main - -import "filippo.io/age/internal/testkit" - -func main() { - f := testkit.NewTestFile() - f.VersionLine("v1") - f.Scrypt("password", 18) // cmd/go default - body, args := f.UnreadLine(), f.UnreadArgsLine() - f.ArgsLine(args[0], args[1], "10") - f.TextLine(body) - f.HMAC() - f.Payload("age") - f.ExpectNoMatch() - f.Generate() -} diff --git a/tests/scrypt_work_factor_zero.go b/tests/scrypt_work_factor_zero.go deleted file mode 100644 index 541f9d0f..00000000 --- a/tests/scrypt_work_factor_zero.go +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright 2022 The age Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//go:build ignore -// +build ignore - -package main - -import "filippo.io/age/internal/testkit" - -func main() { - f := testkit.NewTestFile() - f.VersionLine("v1") - f.Scrypt("password", 10) - body, args := f.UnreadLine(), f.UnreadArgsLine() - f.ArgsLine(args[0], args[1], "0") - f.TextLine(body) - f.HMAC() - f.Payload("age") - f.ExpectHeaderFailure() - f.Generate() -} diff --git a/tests/stanza_bad_start.go b/tests/stanza_bad_start.go deleted file mode 100644 index 53542e7f..00000000 --- a/tests/stanza_bad_start.go +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright 2022 The age Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//go:build ignore -// +build ignore - -package main - -import "filippo.io/age/internal/testkit" - -func main() { - f := testkit.NewTestFile() - f.VersionLine("v1") - f.X25519(testkit.TestX25519Recipient) - f.TextLine("-- stanza") - f.Body([]byte("")) - f.HMAC() - f.Payload("age") - f.ExpectHeaderFailure() - f.Generate() -} diff --git a/tests/stanza_base64_padding.go b/tests/stanza_base64_padding.go deleted file mode 100644 index 76fb221f..00000000 --- a/tests/stanza_base64_padding.go +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright 2022 The age Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//go:build ignore -// +build ignore - -package main - -import ( - "bytes" - - "filippo.io/age/internal/testkit" -) - -func main() { - f := testkit.NewTestFile() - f.VersionLine("v1") - f.X25519(testkit.TestX25519Recipient) - f.ArgsLine("stanza") - f.Body(bytes.Repeat([]byte("A"), 50)) - f.TextLine(f.UnreadLine() + "=") - f.HMAC() - f.Payload("age") - f.ExpectHeaderFailure() - f.Generate() -} diff --git a/tests/stanza_empty_argument.go b/tests/stanza_empty_argument.go deleted file mode 100644 index 71c2c256..00000000 --- a/tests/stanza_empty_argument.go +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright 2022 The age Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//go:build ignore -// +build ignore - -package main - -import "filippo.io/age/internal/testkit" - -func main() { - f := testkit.NewTestFile() - f.VersionLine("v1") - f.X25519(testkit.TestX25519Recipient) - f.ArgsLine("stanza", "", "argument") - f.Body([]byte("")) - f.HMAC() - f.Payload("age") - f.ExpectHeaderFailure() - f.Generate() -} diff --git a/tests/stanza_empty_body.go b/tests/stanza_empty_body.go deleted file mode 100644 index 5013e943..00000000 --- a/tests/stanza_empty_body.go +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright 2022 The age Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//go:build ignore -// +build ignore - -package main - -import "filippo.io/age/internal/testkit" - -func main() { - f := testkit.NewTestFile() - f.VersionLine("v1") - f.X25519(testkit.TestX25519Recipient) - f.ArgsLine("empty") - f.Body([]byte("")) - f.HMAC() - f.Payload("age") - f.Generate() -} diff --git a/tests/stanza_empty_last_line.go b/tests/stanza_empty_last_line.go deleted file mode 100644 index f1e3777d..00000000 --- a/tests/stanza_empty_last_line.go +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright 2022 The age Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//go:build ignore -// +build ignore - -package main - -import ( - "bytes" - - "filippo.io/age/internal/testkit" -) - -func main() { - f := testkit.NewTestFile() - f.VersionLine("v1") - f.X25519(testkit.TestX25519Recipient) - f.ArgsLine("stanza") - f.Body(bytes.Repeat([]byte("A"), 48*2)) - f.HMAC() - f.Payload("age") - f.Generate() -} diff --git a/tests/stanza_invalid_character.go b/tests/stanza_invalid_character.go deleted file mode 100644 index 143b488a..00000000 --- a/tests/stanza_invalid_character.go +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright 2022 The age Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//go:build ignore -// +build ignore - -package main - -import "filippo.io/age/internal/testkit" - -func main() { - f := testkit.NewTestFile() - f.VersionLine("v1") - f.X25519(testkit.TestX25519Recipient) - f.ArgsLine("stanza", "รจ") - f.Body([]byte("")) - f.HMAC() - f.Payload("age") - f.ExpectHeaderFailure() - f.Generate() -} diff --git a/tests/stanza_long_line.go b/tests/stanza_long_line.go deleted file mode 100644 index 9debef1b..00000000 --- a/tests/stanza_long_line.go +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright 2022 The age Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//go:build ignore -// +build ignore - -package main - -import ( - "strings" - - "filippo.io/age/internal/testkit" -) - -func main() { - f := testkit.NewTestFile() - f.VersionLine("v1") - f.X25519(testkit.TestX25519Recipient) - f.ArgsLine("stanza") - f.TextLine(strings.Repeat("A", 68)) - f.TextLine("") - f.HMAC() - f.Payload("age") - f.ExpectHeaderFailure() - f.Comment("a body line is longer than 64 columns") - f.Generate() -} diff --git a/tests/stanza_missing_body.go b/tests/stanza_missing_body.go deleted file mode 100644 index fc401ad8..00000000 --- a/tests/stanza_missing_body.go +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright 2022 The age Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//go:build ignore -// +build ignore - -package main - -import "filippo.io/age/internal/testkit" - -func main() { - f := testkit.NewTestFile() - f.VersionLine("v1") - f.X25519(testkit.TestX25519Recipient) - f.ArgsLine("empty") - // Missing body. - f.HMAC() - f.Payload("age") - f.ExpectHeaderFailure() - f.Comment("every stanza must end with a short body line, even if empty") - f.Generate() -} diff --git a/tests/stanza_missing_final_line.go b/tests/stanza_missing_final_line.go deleted file mode 100644 index 57222833..00000000 --- a/tests/stanza_missing_final_line.go +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright 2022 The age Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//go:build ignore -// +build ignore - -package main - -import ( - "strings" - - "filippo.io/age/internal/testkit" -) - -func main() { - f := testkit.NewTestFile() - f.VersionLine("v1") - f.X25519(testkit.TestX25519Recipient) - f.ArgsLine("stanza") - f.TextLine(strings.Repeat("A", 64)) - f.HMAC() - f.Payload("age") - f.ExpectHeaderFailure() - f.Comment("every stanza must end with a short body line") - f.Generate() -} diff --git a/tests/stanza_multiple_short_lines.go b/tests/stanza_multiple_short_lines.go deleted file mode 100644 index 427873ff..00000000 --- a/tests/stanza_multiple_short_lines.go +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright 2022 The age Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//go:build ignore -// +build ignore - -package main - -import ( - "strings" - - "filippo.io/age/internal/testkit" -) - -func main() { - f := testkit.NewTestFile() - f.VersionLine("v1") - f.X25519(testkit.TestX25519Recipient) - f.ArgsLine("stanza") - f.TextLine(strings.Repeat("A", 32)) - f.TextLine(strings.Repeat("A", 32)) - f.HMAC() - f.Payload("age") - f.ExpectHeaderFailure() - f.Comment("a short body line ends the stanza") - f.Generate() -} diff --git a/tests/stanza_no_arguments.go b/tests/stanza_no_arguments.go deleted file mode 100644 index 89638029..00000000 --- a/tests/stanza_no_arguments.go +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright 2022 The age Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//go:build ignore -// +build ignore - -package main - -import "filippo.io/age/internal/testkit" - -func main() { - f := testkit.NewTestFile() - f.VersionLine("v1") - f.X25519(testkit.TestX25519Recipient) - f.ArgsLine() - f.Body([]byte("")) - f.HMAC() - f.Payload("age") - f.ExpectHeaderFailure() - f.Generate() -} diff --git a/tests/stanza_not_canonical.go b/tests/stanza_not_canonical.go deleted file mode 100644 index 3473f805..00000000 --- a/tests/stanza_not_canonical.go +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright 2022 The age Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//go:build ignore -// +build ignore - -package main - -import ( - "bytes" - - "filippo.io/age/internal/testkit" -) - -func main() { - f := testkit.NewTestFile() - f.VersionLine("v1") - f.X25519(testkit.TestX25519Recipient) - f.ArgsLine("stanza") - f.Body(bytes.Repeat([]byte("A"), 50)) - f.TextLine(testkit.NotCanonicalBase64(f.UnreadLine())) - f.HMAC() - f.Payload("age") - f.ExpectHeaderFailure() - f.Generate() -} diff --git a/tests/stanza_spurious_cr.go b/tests/stanza_spurious_cr.go deleted file mode 100644 index a1eddce2..00000000 --- a/tests/stanza_spurious_cr.go +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright 2022 The age Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//go:build ignore -// +build ignore - -package main - -import ( - "strings" - - "filippo.io/age/internal/testkit" -) - -func main() { - f := testkit.NewTestFile() - f.VersionLine("v1") - f.X25519(testkit.TestX25519Recipient) - f.ArgsLine("stanza") - f.TextLine(strings.Repeat("A", 32) + "\r" + strings.Repeat("A", 31)) - f.HMAC() - f.Payload("age") - f.ExpectHeaderFailure() - f.Generate() -} diff --git a/tests/stanza_valid_characters.go b/tests/stanza_valid_characters.go deleted file mode 100644 index 74fc2114..00000000 --- a/tests/stanza_valid_characters.go +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright 2022 The age Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//go:build ignore -// +build ignore - -package main - -import "filippo.io/age/internal/testkit" - -func main() { - f := testkit.NewTestFile() - f.VersionLine("v1") - f.ArgsLine("!\"#$%&'", "()*+,-./", "01234567", "89:;<=>?", "@ABCDEFG", "HIJKLMNO") - f.Body([]byte("")) - f.ArgsLine("PQRSTUVW", "XYZ[\\]^_", "`abcdefg", "hijklmno", "pqrstuvw", "xyz{|}~") - f.Body([]byte("")) - f.X25519(testkit.TestX25519Recipient) - f.HMAC() - f.Payload("age") - f.Generate() -} diff --git a/tests/stream_bad_tag.go b/tests/stream_bad_tag.go deleted file mode 100644 index e6a383b0..00000000 --- a/tests/stream_bad_tag.go +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright 2022 The age Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//go:build ignore -// +build ignore - -package main - -import "filippo.io/age/internal/testkit" - -func main() { - f := testkit.NewTestFile() - f.VersionLine("v1") - f.X25519(testkit.TestX25519Recipient) - f.HMAC() - f.Payload("age") - file := f.Buf.Bytes() - f.Buf.Reset() - file[len(file)-1] ^= 0b0010_0000 - f.Buf.Write(file) - f.ExpectPayloadFailure() - f.Generate() -} diff --git a/tests/stream_bad_tag_second_chunk.go b/tests/stream_bad_tag_second_chunk.go deleted file mode 100644 index bc3ffb05..00000000 --- a/tests/stream_bad_tag_second_chunk.go +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright 2022 The age Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//go:build ignore -// +build ignore - -package main - -import "filippo.io/age/internal/testkit" - -func main() { - f := testkit.NewTestFile() - f.FileKey(testkit.LargeTestFileKey) - f.VersionLine("v1") - f.X25519(testkit.TestX25519Identity) - f.HMAC() - f.Nonce(testkit.LargeTestNonce) - f.PayloadChunk(testkit.LargeTestFirstChunk) - f.PayloadChunkFinal([]byte("age")) - file := f.Buf.Bytes() - f.Buf.Reset() - file[len(file)-1] ^= 0b0010_0000 - f.Buf.Write(file) - f.ExpectPartialPayload(64 * 1024) - f.Generate() -} diff --git a/tests/stream_bad_tag_second_chunk_full.go b/tests/stream_bad_tag_second_chunk_full.go deleted file mode 100644 index 58dd46ff..00000000 --- a/tests/stream_bad_tag_second_chunk_full.go +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright 2022 The age Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//go:build ignore -// +build ignore - -package main - -import "filippo.io/age/internal/testkit" - -func main() { - f := testkit.NewTestFile() - f.FileKey(testkit.LargeTestFileKey) - f.VersionLine("v1") - f.X25519(testkit.TestX25519Identity) - f.HMAC() - f.Nonce(testkit.LargeTestNonce) - f.PayloadChunk(testkit.LargeTestFirstChunk) - f.PayloadChunkFinal(testkit.LargeTestSecondChunk) - file := f.Buf.Bytes() - f.Buf.Reset() - file[len(file)-1] ^= 0b0010_0000 - f.Buf.Write(file) - f.ExpectPartialPayload(64 * 1024) - f.Generate() -} diff --git a/tests/stream_empty_payload.go b/tests/stream_empty_payload.go deleted file mode 100644 index 89e086b8..00000000 --- a/tests/stream_empty_payload.go +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2022 The age Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//go:build ignore -// +build ignore - -package main - -import "filippo.io/age/internal/testkit" - -func main() { - f := testkit.NewTestFile() - f.VersionLine("v1") - f.X25519(testkit.TestX25519Recipient) - f.HMAC() - f.Payload("") - f.Generate() -} diff --git a/tests/stream_last_chunk_empty.go b/tests/stream_last_chunk_empty.go deleted file mode 100644 index dcbcc0ba..00000000 --- a/tests/stream_last_chunk_empty.go +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright 2022 The age Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//go:build ignore -// +build ignore - -package main - -import "filippo.io/age/internal/testkit" - -func main() { - f := testkit.NewTestFile() - f.FileKey(testkit.LargeTestFileKey) - f.VersionLine("v1") - f.X25519(testkit.TestX25519Identity) - f.HMAC() - f.Nonce(testkit.LargeTestNonce) - f.PayloadChunk(testkit.LargeTestFirstChunk) - f.PayloadChunkFinal([]byte{}) - f.Comment("final STREAM chunk can't be empty unless whole payload is empty") - f.ExpectPartialPayload(64 * 1024) - f.Generate() -} diff --git a/tests/stream_last_chunk_full.go b/tests/stream_last_chunk_full.go deleted file mode 100644 index 09502e4f..00000000 --- a/tests/stream_last_chunk_full.go +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright 2022 The age Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//go:build ignore -// +build ignore - -package main - -import "filippo.io/age/internal/testkit" - -func main() { - f := testkit.NewTestFile() - f.FileKey(testkit.LargeTestFileKey) - f.VersionLine("v1") - f.X25519(testkit.TestX25519Identity) - f.HMAC() - f.Nonce(testkit.LargeTestNonce) - f.PayloadChunkFinal(testkit.LargeTestFirstChunk) - f.Generate() -} diff --git a/tests/stream_last_chunk_full_second.go b/tests/stream_last_chunk_full_second.go deleted file mode 100644 index ceeec8ac..00000000 --- a/tests/stream_last_chunk_full_second.go +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright 2022 The age Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//go:build ignore -// +build ignore - -package main - -import "filippo.io/age/internal/testkit" - -func main() { - f := testkit.NewTestFile() - f.FileKey(testkit.LargeTestFileKey) - f.VersionLine("v1") - f.X25519(testkit.TestX25519Identity) - f.HMAC() - f.Nonce(testkit.LargeTestNonce) - f.PayloadChunk(testkit.LargeTestFirstChunk) - f.PayloadChunkFinal(testkit.LargeTestSecondChunk) - f.Generate() -} diff --git a/tests/stream_missing_tag.go b/tests/stream_missing_tag.go deleted file mode 100644 index a0d407f0..00000000 --- a/tests/stream_missing_tag.go +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright 2022 The age Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//go:build ignore -// +build ignore - -package main - -import "filippo.io/age/internal/testkit" - -func main() { - f := testkit.NewTestFile() - f.VersionLine("v1") - f.X25519(testkit.TestX25519Recipient) - f.HMAC() - f.Payload("age") - file := f.Buf.Bytes() - f.Buf.Reset() - f.Buf.Write(file[:len(file)-16]) - f.ExpectPayloadFailure() - f.Generate() -} diff --git a/tests/stream_no_chunks.go b/tests/stream_no_chunks.go deleted file mode 100644 index c0114a30..00000000 --- a/tests/stream_no_chunks.go +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright 2022 The age Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//go:build ignore -// +build ignore - -package main - -import "filippo.io/age/internal/testkit" - -func main() { - f := testkit.NewTestFile() - f.VersionLine("v1") - f.X25519(testkit.TestX25519Recipient) - f.HMAC() - f.Nonce(f.Rand(16)) - f.ExpectPayloadFailure() - f.Generate() -} diff --git a/tests/stream_no_final.go b/tests/stream_no_final.go deleted file mode 100644 index da820de8..00000000 --- a/tests/stream_no_final.go +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright 2022 The age Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//go:build ignore -// +build ignore - -package main - -import "filippo.io/age/internal/testkit" - -func main() { - f := testkit.NewTestFile() - f.VersionLine("v1") - f.X25519(testkit.TestX25519Recipient) - f.HMAC() - f.Nonce(f.Rand(16)) - f.PayloadChunk([]byte("age")) - f.ExpectPayloadFailure() - f.Generate() -} diff --git a/tests/stream_no_final_full.go b/tests/stream_no_final_full.go deleted file mode 100644 index 374a96eb..00000000 --- a/tests/stream_no_final_full.go +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright 2022 The age Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//go:build ignore -// +build ignore - -package main - -import "filippo.io/age/internal/testkit" - -func main() { - f := testkit.NewTestFile() - f.FileKey(testkit.LargeTestFileKey) - f.VersionLine("v1") - f.X25519(testkit.TestX25519Identity) - f.HMAC() - f.Nonce(testkit.LargeTestNonce) - f.PayloadChunk(testkit.LargeTestFirstChunk) - f.ExpectPartialPayload(64 * 1024) - f.Generate() -} diff --git a/tests/stream_no_final_two_chunks.go b/tests/stream_no_final_two_chunks.go deleted file mode 100644 index 8b475728..00000000 --- a/tests/stream_no_final_two_chunks.go +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright 2022 The age Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//go:build ignore -// +build ignore - -package main - -import "filippo.io/age/internal/testkit" - -func main() { - f := testkit.NewTestFile() - f.FileKey(testkit.LargeTestFileKey) - f.VersionLine("v1") - f.X25519(testkit.TestX25519Identity) - f.HMAC() - f.Nonce(testkit.LargeTestNonce) - f.PayloadChunk(testkit.LargeTestFirstChunk) - f.PayloadChunk([]byte("age")) - f.ExpectPartialPayload(64 * 1024) - f.Generate() -} diff --git a/tests/stream_no_final_two_chunks_full.go b/tests/stream_no_final_two_chunks_full.go deleted file mode 100644 index 41c2f3c0..00000000 --- a/tests/stream_no_final_two_chunks_full.go +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright 2022 The age Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//go:build ignore -// +build ignore - -package main - -import "filippo.io/age/internal/testkit" - -func main() { - f := testkit.NewTestFile() - f.FileKey(testkit.LargeTestFileKey) - f.VersionLine("v1") - f.X25519(testkit.TestX25519Identity) - f.HMAC() - f.Nonce(testkit.LargeTestNonce) - f.PayloadChunk(testkit.LargeTestFirstChunk) - f.PayloadChunk(testkit.LargeTestSecondChunk) - f.ExpectPartialPayload(64 * 1024 * 2) - f.Generate() -} diff --git a/tests/stream_no_nonce.go b/tests/stream_no_nonce.go deleted file mode 100644 index 6fb3dd8c..00000000 --- a/tests/stream_no_nonce.go +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright 2022 The age Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//go:build ignore -// +build ignore - -package main - -import "filippo.io/age/internal/testkit" - -func main() { - f := testkit.NewTestFile() - f.VersionLine("v1") - f.X25519(testkit.TestX25519Recipient) - f.HMAC() - // Marked as header failure because we read the nonce while reading the - // header, before handing off to the STREAM implementation. - f.ExpectHeaderFailure() - f.Generate() -} diff --git a/tests/stream_short_chunk.go b/tests/stream_short_chunk.go deleted file mode 100644 index 27cb10d0..00000000 --- a/tests/stream_short_chunk.go +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright 2022 The age Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//go:build ignore -// +build ignore - -package main - -import "filippo.io/age/internal/testkit" - -func main() { - f := testkit.NewTestFile() - f.VersionLine("v1") - f.X25519(testkit.TestX25519Recipient) - f.HMAC() - f.Nonce(f.Rand(16)) - f.Nonce(f.Rand(12)) // less than the length of a Poly1305 tag - f.ExpectPayloadFailure() - f.Generate() -} diff --git a/tests/stream_short_nonce.go b/tests/stream_short_nonce.go deleted file mode 100644 index 6ba67e48..00000000 --- a/tests/stream_short_nonce.go +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright 2022 The age Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//go:build ignore -// +build ignore - -package main - -import "filippo.io/age/internal/testkit" - -func main() { - f := testkit.NewTestFile() - f.VersionLine("v1") - f.X25519(testkit.TestX25519Recipient) - f.HMAC() - f.Nonce(f.Rand(12)) - // Marked as header failure because we read the nonce while reading the - // header, before handing off to the STREAM implementation. - f.ExpectHeaderFailure() - f.Generate() -} diff --git a/tests/stream_short_second_chunk.go b/tests/stream_short_second_chunk.go deleted file mode 100644 index 7e16b0e9..00000000 --- a/tests/stream_short_second_chunk.go +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright 2022 The age Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//go:build ignore -// +build ignore - -package main - -import "filippo.io/age/internal/testkit" - -func main() { - f := testkit.NewTestFile() - f.FileKey(testkit.LargeTestFileKey) - f.VersionLine("v1") - f.X25519(testkit.TestX25519Identity) - f.HMAC() - f.Nonce(testkit.LargeTestNonce) - f.PayloadChunk(testkit.LargeTestFirstChunk) - f.Nonce(f.Rand(12)) // less than the length of a Poly1305 tag - f.ExpectPartialPayload(64 * 1024) - f.Generate() -} diff --git a/tests/stream_three_chunks.go b/tests/stream_three_chunks.go deleted file mode 100644 index 82df78a4..00000000 --- a/tests/stream_three_chunks.go +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright 2022 The age Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//go:build ignore -// +build ignore - -package main - -import "filippo.io/age/internal/testkit" - -func main() { - f := testkit.NewTestFile() - f.FileKey(testkit.LargeTestFileKey) - f.VersionLine("v1") - f.X25519(testkit.TestX25519Identity) - f.HMAC() - f.Nonce(testkit.LargeTestNonce) - f.PayloadChunk(testkit.LargeTestFirstChunk) - f.PayloadChunk(testkit.LargeTestSecondChunk) - f.PayloadChunkFinal(testkit.LargeTestThirdChunk) - f.Generate() -} diff --git a/tests/stream_trailing_garbage_long.go b/tests/stream_trailing_garbage_long.go deleted file mode 100644 index fd4b2ed7..00000000 --- a/tests/stream_trailing_garbage_long.go +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright 2022 The age Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//go:build ignore -// +build ignore - -package main - -import "filippo.io/age/internal/testkit" - -func main() { - f := testkit.NewTestFile() - f.FileKey(testkit.LargeTestFileKey) - f.VersionLine("v1") - f.X25519(testkit.TestX25519Identity) - f.HMAC() - f.Nonce(testkit.LargeTestNonce) - f.PayloadChunkFinal(testkit.LargeTestFirstChunk) - f.Buf.Write(f.Rand(20)) - f.ExpectPartialPayload(64 * 1024) - f.Generate() -} diff --git a/tests/stream_trailing_garbage_short.go b/tests/stream_trailing_garbage_short.go deleted file mode 100644 index 3ac584ee..00000000 --- a/tests/stream_trailing_garbage_short.go +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright 2022 The age Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//go:build ignore -// +build ignore - -package main - -import "filippo.io/age/internal/testkit" - -func main() { - f := testkit.NewTestFile() - f.FileKey(testkit.LargeTestFileKey) - f.VersionLine("v1") - f.X25519(testkit.TestX25519Identity) - f.HMAC() - f.Nonce(testkit.LargeTestNonce) - f.PayloadChunkFinal(testkit.LargeTestFirstChunk) - f.Buf.Write(f.Rand(12)) - f.ExpectPartialPayload(64 * 1024) - f.Generate() -} diff --git a/tests/stream_two_chunks.go b/tests/stream_two_chunks.go deleted file mode 100644 index ceeec8ac..00000000 --- a/tests/stream_two_chunks.go +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright 2022 The age Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//go:build ignore -// +build ignore - -package main - -import "filippo.io/age/internal/testkit" - -func main() { - f := testkit.NewTestFile() - f.FileKey(testkit.LargeTestFileKey) - f.VersionLine("v1") - f.X25519(testkit.TestX25519Identity) - f.HMAC() - f.Nonce(testkit.LargeTestNonce) - f.PayloadChunk(testkit.LargeTestFirstChunk) - f.PayloadChunkFinal(testkit.LargeTestSecondChunk) - f.Generate() -} diff --git a/tests/stream_two_final_chunks.go b/tests/stream_two_final_chunks.go deleted file mode 100644 index 3059fb39..00000000 --- a/tests/stream_two_final_chunks.go +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright 2022 The age Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//go:build ignore -// +build ignore - -package main - -import "filippo.io/age/internal/testkit" - -func main() { - f := testkit.NewTestFile() - f.FileKey(testkit.LargeTestFileKey) - f.VersionLine("v1") - f.X25519(testkit.TestX25519Identity) - f.HMAC() - f.Nonce(testkit.LargeTestNonce) - f.PayloadChunkFinal(testkit.LargeTestFirstChunk) - f.PayloadChunkFinal([]byte("age")) - f.ExpectPartialPayload(64 * 1024) - f.Generate() -} diff --git a/tests/version_unsupported.go b/tests/version_unsupported.go deleted file mode 100644 index c9d477cc..00000000 --- a/tests/version_unsupported.go +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright 2022 The age Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//go:build ignore -// +build ignore - -package main - -import "filippo.io/age/internal/testkit" - -func main() { - f := testkit.NewTestFile() - f.VersionLine("v1234") - f.X25519(testkit.TestX25519Recipient) - f.HMAC() - f.Payload("age") - f.ExpectHeaderFailure() - f.Generate() -} diff --git a/tests/x25519.go b/tests/x25519.go deleted file mode 100644 index 52e1a906..00000000 --- a/tests/x25519.go +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2022 The age Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//go:build ignore -// +build ignore - -package main - -import "filippo.io/age/internal/testkit" - -func main() { - f := testkit.NewTestFile() - f.VersionLine("v1") - f.X25519(testkit.TestX25519Recipient) - f.HMAC() - f.Payload("age") - f.Generate() -} diff --git a/tests/x25519_bad_tag.go b/tests/x25519_bad_tag.go deleted file mode 100644 index c6eb7b59..00000000 --- a/tests/x25519_bad_tag.go +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright 2022 The age Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//go:build ignore -// +build ignore - -package main - -import ( - "encoding/base64" - - "filippo.io/age/internal/testkit" -) - -func main() { - f := testkit.NewTestFile() - f.VersionLine("v1") - f.X25519(testkit.TestX25519Recipient) - body, _ := base64.RawStdEncoding.DecodeString(f.UnreadLine()) - body[len(body)-1] ^= 0xff - f.TextLine(base64.RawStdEncoding.EncodeToString(body)) - f.HMAC() - f.Payload("age") - f.ExpectNoMatch() - f.Comment("the ChaCha20Poly1305 authentication tag on the body of the X25519 stanza is wrong") - f.Generate() -} diff --git a/tests/x25519_extra_argument.go b/tests/x25519_extra_argument.go deleted file mode 100644 index 5febbdcc..00000000 --- a/tests/x25519_extra_argument.go +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright 2022 The age Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//go:build ignore -// +build ignore - -package main - -import "filippo.io/age/internal/testkit" - -func main() { - f := testkit.NewTestFile() - f.VersionLine("v1") - f.X25519(testkit.TestX25519Recipient) - body, args := f.UnreadLine(), f.UnreadLine() - f.TextLine(args + " 1234") - f.TextLine(body) - f.HMAC() - f.Payload("age") - f.ExpectHeaderFailure() - f.Comment("the base64 encoding of the share is not canonical") - f.Generate() -} diff --git a/tests/x25519_grease.go b/tests/x25519_grease.go deleted file mode 100644 index 8c95722c..00000000 --- a/tests/x25519_grease.go +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright 2022 The age Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//go:build ignore -// +build ignore - -package main - -import "filippo.io/age/internal/testkit" - -func main() { - f := testkit.NewTestFile() - f.VersionLine("v1") - f.ArgsLine("grease") - f.Body(nil) - f.X25519(testkit.TestX25519Recipient) - f.ArgsLine("grease") - f.Body(nil) - f.HMAC() - f.Payload("age") - f.Generate() -} diff --git a/tests/x25519_identity.go b/tests/x25519_identity.go deleted file mode 100644 index b7bc11c7..00000000 --- a/tests/x25519_identity.go +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright 2022 The age Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//go:build ignore -// +build ignore - -package main - -import "filippo.io/age/internal/testkit" - -func main() { - f := testkit.NewTestFile() - f.VersionLine("v1") - f.X25519RecordIdentity(testkit.TestX25519Identity) - share := make([]byte, 32) - f.X25519Stanza(share, testkit.TestX25519Identity) - f.HMAC() - f.Payload("age") - f.ExpectHeaderFailure() - f.Comment("the X25519 share is a low-order point, so the shared secret is the disallowed all-zero value") - f.Generate() -} diff --git a/tests/x25519_long_file_key.go b/tests/x25519_long_file_key.go deleted file mode 100644 index dd648feb..00000000 --- a/tests/x25519_long_file_key.go +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright 2022 The age Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//go:build ignore -// +build ignore - -package main - -import "filippo.io/age/internal/testkit" - -func main() { - f := testkit.NewTestFile() - f.FileKey([]byte("A LONGER YELLOW SUBMARINE")) - f.VersionLine("v1") - f.X25519(testkit.TestX25519Identity) - f.HMAC() - f.Payload("age") - f.ExpectHeaderFailure() - f.Comment("the file key must be checked to be 16 bytes before decrypting it") - f.Generate() -} diff --git a/tests/x25519_long_share.go b/tests/x25519_long_share.go deleted file mode 100644 index de9cea3d..00000000 --- a/tests/x25519_long_share.go +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright 2022 The age Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//go:build ignore -// +build ignore - -package main - -import ( - "encoding/base64" - - "filippo.io/age/internal/testkit" - "golang.org/x/crypto/curve25519" -) - -func main() { - f := testkit.NewTestFile() - f.VersionLine("v1") - share, _ := curve25519.X25519(f.Rand(32), curve25519.Basepoint) - f.X25519RecordIdentity(testkit.TestX25519Identity) - f.X25519Stanza(share, testkit.TestX25519Identity) - body, _ := f.UnreadLine(), f.UnreadLine() - f.TextLine("-> X25519 " + base64.RawStdEncoding.EncodeToString(append(share, 0x00))) - f.TextLine(body) - f.HMAC() - f.Payload("age") - f.ExpectHeaderFailure() - f.Comment("a trailing zero is missing from the X25519 share") - f.Generate() -} diff --git a/tests/x25519_low_order.go b/tests/x25519_low_order.go deleted file mode 100644 index e45c5bd8..00000000 --- a/tests/x25519_low_order.go +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright 2022 The age Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//go:build ignore -// +build ignore - -package main - -import "filippo.io/age/internal/testkit" - -func main() { - f := testkit.NewTestFile() - f.VersionLine("v1") - f.X25519RecordIdentity(testkit.TestX25519Identity) - // Point of order 8 on Curve25519, chosen to be the least likely to be - // flagged by hardcoded list exclusions. - share := []byte{0x5f, 0x9c, 0x95, 0xbc, 0xa3, 0x50, 0x8c, 0x24, 0xb1, 0xd0, - 0xb1, 0x55, 0x9c, 0x83, 0xef, 0x5b, 0x04, 0x44, 0x5c, 0xc4, 0x58, 0x1c, - 0x8e, 0x86, 0xd8, 0x22, 0x4e, 0xdd, 0xd0, 0x9f, 0x11, 0xd7} - f.X25519Stanza(share, testkit.TestX25519Identity) - f.HMAC() - f.Payload("age") - f.ExpectHeaderFailure() - f.Comment("the X25519 share is a low-order point, so the shared secret" + - "is the disallowed all-zero value") - f.Generate() -} diff --git a/tests/x25519_lowercase.go b/tests/x25519_lowercase.go deleted file mode 100644 index cdb8384e..00000000 --- a/tests/x25519_lowercase.go +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright 2022 The age Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//go:build ignore -// +build ignore - -package main - -import "filippo.io/age/internal/testkit" - -func main() { - f := testkit.NewTestFile() - f.VersionLine("v1") - f.X25519(testkit.TestX25519Recipient) - body, args := f.UnreadLine(), f.UnreadArgsLine() - f.ArgsLine("x25519", args[1]) - f.TextLine(body) - f.HMAC() - f.Payload("age") - f.ExpectNoMatch() - f.Comment("the first argument in the X25519 stanza is lowercase") - f.Generate() -} diff --git a/tests/x25519_multiple_recipients.go b/tests/x25519_multiple_recipients.go deleted file mode 100644 index 993fa55d..00000000 --- a/tests/x25519_multiple_recipients.go +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright 2022 The age Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//go:build ignore -// +build ignore - -package main - -import "filippo.io/age/internal/testkit" - -func main() { - f := testkit.NewTestFile() - f.VersionLine("v1") - f.X25519NoRecordIdentity(f.Rand(32)) - f.X25519(testkit.TestX25519Recipient) - f.HMAC() - f.Payload("age") - f.Generate() -} diff --git a/tests/x25519_no_match.go b/tests/x25519_no_match.go deleted file mode 100644 index 5f3b4db6..00000000 --- a/tests/x25519_no_match.go +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright 2022 The age Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//go:build ignore -// +build ignore - -package main - -import "filippo.io/age/internal/testkit" - -func main() { - f := testkit.NewTestFile() - f.VersionLine("v1") - identity := f.Rand(32) - f.X25519RecordIdentity(identity) - f.X25519NoRecordIdentity(testkit.TestX25519Recipient) - f.HMAC() - f.Payload("age") - f.ExpectNoMatch() - f.Generate() -} diff --git a/tests/x25519_not_canonical_body.go b/tests/x25519_not_canonical_body.go deleted file mode 100644 index 6b226269..00000000 --- a/tests/x25519_not_canonical_body.go +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright 2022 The age Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//go:build ignore -// +build ignore - -package main - -import "filippo.io/age/internal/testkit" - -func main() { - f := testkit.NewTestFile() - f.VersionLine("v1") - f.X25519(testkit.TestX25519Recipient) - body := f.UnreadLine() - f.TextLine(testkit.NotCanonicalBase64(body)) - f.HMAC() - f.Payload("age") - f.ExpectHeaderFailure() - f.Comment("the base64 encoding of the share is not canonical") - f.Generate() -} diff --git a/tests/x25519_not_canonical_share.go b/tests/x25519_not_canonical_share.go deleted file mode 100644 index d31b3ff9..00000000 --- a/tests/x25519_not_canonical_share.go +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright 2022 The age Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//go:build ignore -// +build ignore - -package main - -import "filippo.io/age/internal/testkit" - -func main() { - f := testkit.NewTestFile() - f.VersionLine("v1") - f.X25519(testkit.TestX25519Recipient) - body, args := f.UnreadLine(), f.UnreadLine() - f.TextLine(testkit.NotCanonicalBase64(args)) - f.TextLine(body) - f.HMAC() - f.Payload("age") - f.ExpectHeaderFailure() - f.Comment("the base64 encoding of the share is not canonical") - f.Generate() -} diff --git a/tests/x25519_short_share.go b/tests/x25519_short_share.go deleted file mode 100644 index 01ea1930..00000000 --- a/tests/x25519_short_share.go +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright 2022 The age Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//go:build ignore -// +build ignore - -package main - -import ( - "encoding/base64" - "encoding/hex" - - "filippo.io/age/internal/testkit" -) - -func main() { - f := testkit.NewTestFile() - f.VersionLine("v1") - share, _ := hex.DecodeString("97ba38a135fd5f9137fca3836bfec24340ab03d7ca316b26f482636334a52600") - f.X25519RecordIdentity(testkit.TestX25519Identity) - f.X25519Stanza(share, testkit.TestX25519Identity) - body, _ := f.UnreadLine(), f.UnreadLine() - f.TextLine("-> X25519 " + base64.RawStdEncoding.EncodeToString(share[:31])) - f.TextLine(body) - f.HMAC() - f.Payload("age") - f.ExpectHeaderFailure() - f.Comment("a trailing zero is missing from the X25519 share") - f.Generate() -}