mirror of
https://github.com/FiloSottile/age.git
synced 2026-01-14 15:32:48 +00:00
Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b6b5f4300f | ||
|
|
627e6bc9d8 |
@@ -465,6 +465,7 @@ func decrypt(identities []age.Identity, in io.Reader, out io.Writer) {
|
||||
if err != nil {
|
||||
errorf("%v", err)
|
||||
}
|
||||
out.Write(nil) // trigger the lazyOpener even if r is empty
|
||||
if _, err := io.Copy(out, r); err != nil {
|
||||
errorf("%v", err)
|
||||
}
|
||||
|
||||
1
cmd/age/testdata/encrypted_keys.txt
vendored
1
cmd/age/testdata/encrypted_keys.txt
vendored
@@ -2,7 +2,6 @@
|
||||
# age file password prompt during encryption
|
||||
|
||||
[!linux] [!darwin] skip # no pty support
|
||||
[darwin] [go1.20] skip # https://go.dev/issue/61779
|
||||
|
||||
# use an encrypted OpenSSH private key without .pub file
|
||||
age -R key_ed25519.pub -o ed25519.age input
|
||||
|
||||
54
cmd/age/testdata/output_file.txt
vendored
Normal file
54
cmd/age/testdata/output_file.txt
vendored
Normal file
@@ -0,0 +1,54 @@
|
||||
# https://github.com/FiloSottile/age/issues/57
|
||||
age -r age1xmwwc06ly3ee5rytxm9mflaz2u56jjj36s0mypdrwsvlul66mv4q47ryef -o test.age input
|
||||
! age -o test.out -d -i wrong.txt test.age
|
||||
! exists test.out
|
||||
! age -o test.out -d test.age
|
||||
! exists test.out
|
||||
! age -o test.out -d -i notexist test.age
|
||||
! exists test.out
|
||||
! age -o test.out -d -i wrong.txt notexist
|
||||
! exists test.out
|
||||
! age -o test.out -r BAD
|
||||
! exists test.out
|
||||
! age -o test.out -r age1xmwwc06ly3ee5rytxm9mflaz2u56jjj36s0mypdrwsvlul66mv4q47ryef notexist
|
||||
! exists test.out
|
||||
! age -o test.out -p notexist
|
||||
! exists test.out
|
||||
|
||||
# https://github.com/FiloSottile/age/issues/555
|
||||
age -r age1xmwwc06ly3ee5rytxm9mflaz2u56jjj36s0mypdrwsvlul66mv4q47ryef -o empty.age empty
|
||||
exists empty.age
|
||||
age -d -i key.txt empty.age
|
||||
! stdout .
|
||||
! stderr .
|
||||
age -d -i key.txt -o new empty.age
|
||||
! stderr .
|
||||
cmp new empty
|
||||
|
||||
[!linux] [!darwin] skip # no pty support
|
||||
|
||||
# https://github.com/FiloSottile/age/issues/159
|
||||
ttyin terminal
|
||||
age -p -a -o test.age input
|
||||
ttyin terminalwrong
|
||||
! age -o test.out -d test.age
|
||||
ttyout 'Enter passphrase'
|
||||
stderr 'incorrect passphrase'
|
||||
! exists test.out
|
||||
|
||||
-- terminal --
|
||||
password
|
||||
password
|
||||
-- terminalwrong --
|
||||
wrong
|
||||
-- input --
|
||||
age
|
||||
-- empty --
|
||||
-- key.txt --
|
||||
# created: 2021-02-02T13:09:43+01:00
|
||||
# public key: age1xmwwc06ly3ee5rytxm9mflaz2u56jjj36s0mypdrwsvlul66mv4q47ryef
|
||||
AGE-SECRET-KEY-1EGTZVFFV20835NWYV6270LXYVK2VKNX2MMDKWYKLMGR48UAWX40Q2P2LM0
|
||||
-- wrong.txt --
|
||||
# created: 2024-06-16T12:14:00+02:00
|
||||
# public key: age10k7vsqmeg3sp8elfyq5ts55feg4huarpcaf9dmljn9umydg3gymsvx4dp9
|
||||
AGE-SECRET-KEY-1NPX08S4LELW9K68FKU0U05XXEKG6X7GT004TPNYLF86H3M00D3FQ3VQQNN
|
||||
1
cmd/age/testdata/scrypt.txt
vendored
1
cmd/age/testdata/scrypt.txt
vendored
@@ -1,5 +1,4 @@
|
||||
[!linux] [!darwin] skip # no pty support
|
||||
[darwin] [go1.20] skip # https://go.dev/issue/61779
|
||||
|
||||
# encrypt with a provided passphrase
|
||||
stdin input
|
||||
|
||||
1
cmd/age/testdata/terminal.txt
vendored
1
cmd/age/testdata/terminal.txt
vendored
@@ -1,5 +1,4 @@
|
||||
[!linux] [!darwin] skip # no pty support
|
||||
[darwin] [go1.20] skip # https://go.dev/issue/61779
|
||||
|
||||
# controlling terminal is used instead of stdin/stderr
|
||||
ttyin terminal
|
||||
|
||||
Reference in New Issue
Block a user