| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
package main |
| 9 |
|
| 10 |
import ( |
| 11 |
"encoding/base64" |
| 12 |
|
| 13 |
"c2sp.org/CCTV/age/internal/testkit" |
| 14 |
) |
| 15 |
|
| 16 |
func main() { |
| 17 |
f := testkit.NewTestFile() |
| 18 |
f.VersionLine("v1") |
| 19 |
f.Scrypt("password", 10) |
| 20 |
body, _ := base64.RawStdEncoding.DecodeString(f.UnreadLine()) |
| 21 |
body[len(body)-1] ^= 0xff |
| 22 |
f.TextLine(base64.RawStdEncoding.EncodeToString(body)) |
| 23 |
f.HMAC() |
| 24 |
f.Payload("age") |
| 25 |
f.ExpectNoMatch() |
| 26 |
f.Comment("the ChaCha20Poly1305 authentication tag on the body of the scrypt stanza is wrong") |
| 27 |
f.Generate() |
| 28 |
} |