mirror of
https://github.com/FiloSottile/age.git
synced 2026-03-11 08:55:41 +00:00
Compare commits
9 commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4a3a4ef00a | ||
|
|
10561a774f | ||
|
|
c918a2c113 | ||
|
|
beb5dfa28c | ||
|
|
0293aca1d7 | ||
|
|
e7601d8a67 | ||
|
|
acfa73142b | ||
|
|
b8564adb6d | ||
|
|
e4c611f778 |
13 changed files with 124 additions and 30 deletions
6
.github/workflows/build.yml
vendored
6
.github/workflows/build.yml
vendored
|
|
@ -17,6 +17,7 @@ jobs:
|
||||||
- {GOOS: linux, GOARCH: arm, GOARM: 6}
|
- {GOOS: linux, GOARCH: arm, GOARM: 6}
|
||||||
- {GOOS: linux, GOARCH: arm64}
|
- {GOOS: linux, GOARCH: arm64}
|
||||||
- {GOOS: darwin, GOARCH: arm64}
|
- {GOOS: darwin, GOARCH: arm64}
|
||||||
|
- {GOOS: darwin, GOARCH: amd64}
|
||||||
- {GOOS: windows, GOARCH: amd64}
|
- {GOOS: windows, GOARCH: amd64}
|
||||||
- {GOOS: freebsd, GOARCH: amd64}
|
- {GOOS: freebsd, GOARCH: amd64}
|
||||||
steps:
|
steps:
|
||||||
|
|
@ -86,6 +87,11 @@ jobs:
|
||||||
mkdir "$DIR/age"
|
mkdir "$DIR/age"
|
||||||
git archive --format=tar.gz HEAD | tar -xz -C "$DIR/age"
|
git archive --format=tar.gz HEAD | tar -xz -C "$DIR/age"
|
||||||
( cd "$DIR/age"; go mod vendor )
|
( cd "$DIR/age"; go mod vendor )
|
||||||
|
for cmd in "$DIR"/age/{cmd,extra}/*; do
|
||||||
|
echo "package main" >> "$cmd/version.go"
|
||||||
|
echo "" >> "$cmd/version.go"
|
||||||
|
echo "func init() { Version = \"$VERSION\" }" >> "$cmd/version.go"
|
||||||
|
done
|
||||||
tar -cvzf "age-$VERSION-source.tar.gz" -C "$DIR" age
|
tar -cvzf "age-$VERSION-source.tar.gz" -C "$DIR" age
|
||||||
- name: Upload workflow artifacts
|
- name: Upload workflow artifacts
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
|
|
|
||||||
|
|
@ -151,7 +151,7 @@ On Windows, Linux, macOS, and FreeBSD you can use the pre-built binaries.
|
||||||
|
|
||||||
```
|
```
|
||||||
https://dl.filippo.io/age/latest?for=linux/amd64
|
https://dl.filippo.io/age/latest?for=linux/amd64
|
||||||
https://dl.filippo.io/age/v1.3.0?for=darwin/arm64
|
https://dl.filippo.io/age/v1.3.1?for=darwin/arm64
|
||||||
...
|
...
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
|
||||||
26
SIGSUM.md
26
SIGSUM.md
|
|
@ -11,13 +11,33 @@ ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIM1WpnEswJLPzvXJDiswowy48U+G+G1kmgwUE2eaRHZG
|
||||||
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIAz2WM5CyPLqiNjk7CLl4roDXwKhQ0QExXLebukZEZFS
|
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIAz2WM5CyPLqiNjk7CLl4roDXwKhQ0QExXLebukZEZFS
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
curl -JLO "https://dl.filippo.io/age/v1.3.0?for=darwin/arm64"
|
curl -JLO "https://dl.filippo.io/age/v1.3.1?for=darwin/arm64"
|
||||||
curl -JLO "https://dl.filippo.io/age/v1.3.0?for=darwin/arm64&proof"
|
curl -JLO "https://dl.filippo.io/age/v1.3.1?for=darwin/arm64&proof"
|
||||||
|
|
||||||
go install sigsum.org/sigsum-go/cmd/sigsum-verify@v0.13.1
|
go install sigsum.org/sigsum-go/cmd/sigsum-verify@v0.13.1
|
||||||
sigsum-verify -k age-sigsum-key.pub -P sigsum-generic-2025-1 \
|
sigsum-verify -k age-sigsum-key.pub -P sigsum-generic-2025-1 \
|
||||||
age-v1.3.0-darwin-arm64.tar.gz.proof < age-v1.3.0-darwin-arm64.tar.gz
|
age-v1.3.1-darwin-arm64.tar.gz.proof < age-v1.3.1-darwin-arm64.tar.gz
|
||||||
```
|
```
|
||||||
|
|
||||||
You can learn more about what's happening above in the [Sigsum
|
You can learn more about what's happening above in the [Sigsum
|
||||||
docs](https://www.sigsum.org/getting-started/).
|
docs](https://www.sigsum.org/getting-started/).
|
||||||
|
|
||||||
|
### Release playbook
|
||||||
|
|
||||||
|
Dear future me, to sign a new release and produce Sigsum proofs, run the following
|
||||||
|
|
||||||
|
```
|
||||||
|
VERSION=v1.3.1
|
||||||
|
go install sigsum.org/sigsum-go/cmd/sigsum-verify@latest
|
||||||
|
go install github.com/tillitis/tkey-ssh-agent/cmd/tkey-ssh-agent@main
|
||||||
|
tkey-ssh-agent --agent-socket tkey-ssh-agent.sock --uss
|
||||||
|
passage -c other/tkey-ssh-sigsum-age
|
||||||
|
SSH_AUTH_SOCK=tkey-ssh-agent.sock ssh-add -L > tkey-ssh-agent.pub
|
||||||
|
passage other/sigsum-ratelimit > sigsum-ratelimit
|
||||||
|
gh release download $VERSION --repo FiloSottile/age --dir artifacts/
|
||||||
|
SSH_AUTH_SOCK=tkey-ssh-agent.sock sigsum-submit -k tkey-ssh-agent.pub -P sigsum-generic-2025-1 -a sigsum-ratelimit -d filippo.io artifacts/*
|
||||||
|
gh release upload $VERSION --repo FiloSottile/age artifacts/*.proof
|
||||||
|
```
|
||||||
|
|
||||||
|
In the future, we will move to reproducing the artifacts locally, and signing
|
||||||
|
those instead of the ones built by GitHub Actions.
|
||||||
|
|
|
||||||
|
|
@ -24,6 +24,10 @@ Options:
|
||||||
INPUT defaults to standard input. "-" may be used as INPUT to explicitly
|
INPUT defaults to standard input. "-" may be used as INPUT to explicitly
|
||||||
read from standard input.`
|
read from standard input.`
|
||||||
|
|
||||||
|
// Version can be set at link time to override debug.BuildInfo.Main.Version when
|
||||||
|
// building manually without git history. It should look like "v1.2.3".
|
||||||
|
var Version string
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
flag.Usage = func() { fmt.Fprintf(os.Stderr, "%s\n", usage) }
|
flag.Usage = func() { fmt.Fprintf(os.Stderr, "%s\n", usage) }
|
||||||
|
|
||||||
|
|
@ -37,11 +41,10 @@ func main() {
|
||||||
flag.Parse()
|
flag.Parse()
|
||||||
|
|
||||||
if versionFlag {
|
if versionFlag {
|
||||||
if buildInfo, ok := debug.ReadBuildInfo(); ok {
|
if buildInfo, ok := debug.ReadBuildInfo(); ok && Version == "" {
|
||||||
fmt.Println(buildInfo.Main.Version)
|
Version = buildInfo.Main.Version
|
||||||
return
|
|
||||||
}
|
}
|
||||||
fmt.Println("(unknown)")
|
fmt.Println(Version)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -56,6 +56,10 @@ Examples:
|
||||||
$ age-keygen -y key.txt
|
$ age-keygen -y key.txt
|
||||||
age1ql3z7hjy54pw3hyww5ayyfg7zqgvc7w3j2elw8zmrj2kg5sfn9aqmcac8p`
|
age1ql3z7hjy54pw3hyww5ayyfg7zqgvc7w3j2elw8zmrj2kg5sfn9aqmcac8p`
|
||||||
|
|
||||||
|
// Version can be set at link time to override debug.BuildInfo.Main.Version when
|
||||||
|
// building manually without git history. It should look like "v1.2.3".
|
||||||
|
var Version string
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
log.SetFlags(0)
|
log.SetFlags(0)
|
||||||
flag.Usage = func() { fmt.Fprintf(os.Stderr, "%s\n", usage) }
|
flag.Usage = func() { fmt.Fprintf(os.Stderr, "%s\n", usage) }
|
||||||
|
|
@ -69,6 +73,15 @@ func main() {
|
||||||
flag.StringVar(&outFlag, "o", "", "output to `FILE` (default stdout)")
|
flag.StringVar(&outFlag, "o", "", "output to `FILE` (default stdout)")
|
||||||
flag.StringVar(&outFlag, "output", "", "output to `FILE` (default stdout)")
|
flag.StringVar(&outFlag, "output", "", "output to `FILE` (default stdout)")
|
||||||
flag.Parse()
|
flag.Parse()
|
||||||
|
|
||||||
|
if versionFlag {
|
||||||
|
if buildInfo, ok := debug.ReadBuildInfo(); ok && Version == "" {
|
||||||
|
Version = buildInfo.Main.Version
|
||||||
|
}
|
||||||
|
fmt.Println(Version)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
if len(flag.Args()) != 0 && !convertFlag {
|
if len(flag.Args()) != 0 && !convertFlag {
|
||||||
errorf("too many arguments")
|
errorf("too many arguments")
|
||||||
}
|
}
|
||||||
|
|
@ -78,14 +91,6 @@ func main() {
|
||||||
if pqFlag && convertFlag {
|
if pqFlag && convertFlag {
|
||||||
errorf("-pq cannot be used with -y")
|
errorf("-pq cannot be used with -y")
|
||||||
}
|
}
|
||||||
if versionFlag {
|
|
||||||
if buildInfo, ok := debug.ReadBuildInfo(); ok {
|
|
||||||
fmt.Println(buildInfo.Main.Version)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
fmt.Println("(unknown)")
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
out := os.Stdout
|
out := os.Stdout
|
||||||
if outFlag != "" {
|
if outFlag != "" {
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,7 @@ import (
|
||||||
"io"
|
"io"
|
||||||
"log"
|
"log"
|
||||||
"os"
|
"os"
|
||||||
|
"runtime/debug"
|
||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
|
|
@ -73,6 +74,10 @@ When decrypting, you can set AGE_PASSPHRASE_MAX_WORK_FACTOR to limit the
|
||||||
maximum scrypt work factor accepted (between 1 and 30, default 30). This can
|
maximum scrypt work factor accepted (between 1 and 30, default 30). This can
|
||||||
be used to avoid very slow decryptions.`
|
be used to avoid very slow decryptions.`
|
||||||
|
|
||||||
|
// Version can be set at link time to override debug.BuildInfo.Main.Version when
|
||||||
|
// building manually without git history. It should look like "v1.2.3".
|
||||||
|
var Version string
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
flag.Usage = func() { fmt.Fprintf(os.Stderr, "%s\n", usage) }
|
flag.Usage = func() { fmt.Fprintf(os.Stderr, "%s\n", usage) }
|
||||||
|
|
||||||
|
|
@ -80,6 +85,19 @@ func main() {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatal(err)
|
log.Fatal(err)
|
||||||
}
|
}
|
||||||
|
p.RegisterFlags(nil)
|
||||||
|
|
||||||
|
versionFlag := flag.Bool("version", false, "print the version")
|
||||||
|
flag.Parse()
|
||||||
|
|
||||||
|
if *versionFlag {
|
||||||
|
if buildInfo, ok := debug.ReadBuildInfo(); ok && Version == "" {
|
||||||
|
Version = buildInfo.Main.Version
|
||||||
|
}
|
||||||
|
fmt.Println(Version)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
p.HandleIdentityAsRecipient(func(data []byte) (age.Recipient, error) {
|
p.HandleIdentityAsRecipient(func(data []byte) (age.Recipient, error) {
|
||||||
if len(data) != 0 {
|
if len(data) != 0 {
|
||||||
return nil, fmt.Errorf("batchpass identity does not take any payload")
|
return nil, fmt.Errorf("batchpass identity does not take any payload")
|
||||||
|
|
|
||||||
|
|
@ -98,6 +98,10 @@ func (f *identityFlags) addPluginFlag(value string) error {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Version can be set at link time to override debug.BuildInfo.Main.Version when
|
||||||
|
// building manually without git history. It should look like "v1.2.3".
|
||||||
|
var Version string
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
flag.Usage = func() { fmt.Fprintf(os.Stderr, "%s\n", usage) }
|
flag.Usage = func() { fmt.Fprintf(os.Stderr, "%s\n", usage) }
|
||||||
|
|
||||||
|
|
@ -136,13 +140,10 @@ func main() {
|
||||||
flag.Parse()
|
flag.Parse()
|
||||||
|
|
||||||
if versionFlag {
|
if versionFlag {
|
||||||
if buildInfo, ok := debug.ReadBuildInfo(); ok {
|
if buildInfo, ok := debug.ReadBuildInfo(); ok && Version == "" {
|
||||||
// TODO: use buildInfo.Settings to prepare a pseudoversion such as
|
Version = buildInfo.Main.Version
|
||||||
// v0.0.0-20210817164053-32db794688a5+dirty on Go 1.18+.
|
|
||||||
fmt.Println(buildInfo.Main.Version)
|
|
||||||
return
|
|
||||||
}
|
}
|
||||||
fmt.Println("(unknown)")
|
fmt.Println(Version)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -53,7 +53,7 @@ AGE\-SECRET\-KEY\-1N9JEPW6DWJ0ZQUDX63F5A03GX8QUW7PXDE39N8UYF82VZ9PC8UFS3M7XA9
|
||||||
Write a new post\-quantum identity to \fBkey\.txt\fR:
|
Write a new post\-quantum identity to \fBkey\.txt\fR:
|
||||||
.IP "" 4
|
.IP "" 4
|
||||||
.nf
|
.nf
|
||||||
$ age\-keygen \-o key\.txt
|
$ age\-keygen \-pq \-o key\.txt
|
||||||
Public key: age1pq1cd[\|\.\|\.\|\. 1950 more characters \|\.\|\.\|\.]
|
Public key: age1pq1cd[\|\.\|\.\|\. 1950 more characters \|\.\|\.\|\.]
|
||||||
.fi
|
.fi
|
||||||
.IP "" 0
|
.IP "" 0
|
||||||
|
|
|
||||||
|
|
@ -130,7 +130,7 @@ AGE-SECRET-KEY-1N9JEPW6DWJ0ZQUDX63F5A03GX8QUW7PXDE39N8UYF82VZ9PC8UFS3M7XA9
|
||||||
|
|
||||||
<p>Write a new post-quantum identity to <code>key.txt</code>:</p>
|
<p>Write a new post-quantum identity to <code>key.txt</code>:</p>
|
||||||
|
|
||||||
<pre><code>$ age-keygen -o key.txt
|
<pre><code>$ age-keygen -pq -o key.txt
|
||||||
Public key: age1pq1cd[... 1950 more characters ...]
|
Public key: age1pq1cd[... 1950 more characters ...]
|
||||||
</code></pre>
|
</code></pre>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -52,7 +52,7 @@ Generate a new traditional identity:
|
||||||
|
|
||||||
Write a new post-quantum identity to `key.txt`:
|
Write a new post-quantum identity to `key.txt`:
|
||||||
|
|
||||||
$ age-keygen -o key.txt
|
$ age-keygen -pq -o key.txt
|
||||||
Public key: age1pq1cd[... 1950 more characters ...]
|
Public key: age1pq1cd[... 1950 more characters ...]
|
||||||
|
|
||||||
Convert an identity to a recipient:
|
Convert an identity to a recipient:
|
||||||
|
|
|
||||||
|
|
@ -30,12 +30,16 @@ implementation of age that supports plugins.
|
||||||
Recipients work out of the box, while identities need to be converted to plugin
|
Recipients work out of the box, while identities need to be converted to plugin
|
||||||
identities with -identity. If OUTPUT already exists, it is not overwritten.`
|
identities with -identity. If OUTPUT already exists, it is not overwritten.`
|
||||||
|
|
||||||
|
// Version can be set at link time to override debug.BuildInfo.Main.Version when
|
||||||
|
// building manually without git history. It should look like "v1.2.3".
|
||||||
|
var Version string
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
log.SetFlags(0)
|
log.SetFlags(0)
|
||||||
|
|
||||||
p, err := plugin.New("pq")
|
p, err := plugin.New("pq")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatal(err)
|
errorf("failed to create plugin: %v", err)
|
||||||
}
|
}
|
||||||
p.RegisterFlags(nil)
|
p.RegisterFlags(nil)
|
||||||
|
|
||||||
|
|
@ -50,11 +54,10 @@ func main() {
|
||||||
flag.Parse()
|
flag.Parse()
|
||||||
|
|
||||||
if versionFlag {
|
if versionFlag {
|
||||||
if buildInfo, ok := debug.ReadBuildInfo(); ok {
|
if buildInfo, ok := debug.ReadBuildInfo(); ok && Version == "" {
|
||||||
fmt.Println(buildInfo.Main.Version)
|
Version = buildInfo.Main.Version
|
||||||
return
|
|
||||||
}
|
}
|
||||||
fmt.Println("(unknown)")
|
fmt.Println(Version)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,7 @@ import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"log"
|
"log"
|
||||||
"os"
|
"os"
|
||||||
|
"runtime/debug"
|
||||||
|
|
||||||
"filippo.io/age"
|
"filippo.io/age"
|
||||||
"filippo.io/age/plugin"
|
"filippo.io/age/plugin"
|
||||||
|
|
@ -18,6 +19,10 @@ support to any version and implementation of age that supports plugins.
|
||||||
Usually, tagged recipients are the public side of private keys held in hardware,
|
Usually, tagged recipients are the public side of private keys held in hardware,
|
||||||
where the identity side is handled by a different plugin.`
|
where the identity side is handled by a different plugin.`
|
||||||
|
|
||||||
|
// Version can be set at link time to override debug.BuildInfo.Main.Version when
|
||||||
|
// building manually without git history. It should look like "v1.2.3".
|
||||||
|
var Version string
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
flag.Usage = func() { fmt.Fprintf(os.Stderr, "%s\n", usage) }
|
flag.Usage = func() { fmt.Fprintf(os.Stderr, "%s\n", usage) }
|
||||||
|
|
||||||
|
|
@ -25,8 +30,22 @@ func main() {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatal(err)
|
log.Fatal(err)
|
||||||
}
|
}
|
||||||
|
p.RegisterFlags(nil)
|
||||||
|
|
||||||
|
versionFlag := flag.Bool("version", false, "print the version")
|
||||||
|
flag.Parse()
|
||||||
|
|
||||||
|
if *versionFlag {
|
||||||
|
if buildInfo, ok := debug.ReadBuildInfo(); ok && Version == "" {
|
||||||
|
Version = buildInfo.Main.Version
|
||||||
|
}
|
||||||
|
fmt.Println(Version)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
p.HandleRecipient(func(b []byte) (age.Recipient, error) {
|
p.HandleRecipient(func(b []byte) (age.Recipient, error) {
|
||||||
return tag.NewClassicRecipient(b)
|
return tag.NewClassicRecipient(b)
|
||||||
})
|
})
|
||||||
|
|
||||||
os.Exit(p.Main())
|
os.Exit(p.Main())
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,7 @@ import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"log"
|
"log"
|
||||||
"os"
|
"os"
|
||||||
|
"runtime/debug"
|
||||||
|
|
||||||
"filippo.io/age"
|
"filippo.io/age"
|
||||||
"filippo.io/age/plugin"
|
"filippo.io/age/plugin"
|
||||||
|
|
@ -19,6 +20,10 @@ implementation of age that supports plugins.
|
||||||
Usually, tagged recipients are the public side of private keys held in hardware,
|
Usually, tagged recipients are the public side of private keys held in hardware,
|
||||||
where the identity side is handled by a different plugin.`
|
where the identity side is handled by a different plugin.`
|
||||||
|
|
||||||
|
// Version can be set at link time to override debug.BuildInfo.Main.Version when
|
||||||
|
// building manually without git history. It should look like "v1.2.3".
|
||||||
|
var Version string
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
flag.Usage = func() { fmt.Fprintf(os.Stderr, "%s\n", usage) }
|
flag.Usage = func() { fmt.Fprintf(os.Stderr, "%s\n", usage) }
|
||||||
|
|
||||||
|
|
@ -26,8 +31,22 @@ func main() {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatal(err)
|
log.Fatal(err)
|
||||||
}
|
}
|
||||||
|
p.RegisterFlags(nil)
|
||||||
|
|
||||||
|
versionFlag := flag.Bool("version", false, "print the version")
|
||||||
|
flag.Parse()
|
||||||
|
|
||||||
|
if *versionFlag {
|
||||||
|
if buildInfo, ok := debug.ReadBuildInfo(); ok && Version == "" {
|
||||||
|
Version = buildInfo.Main.Version
|
||||||
|
}
|
||||||
|
fmt.Println(Version)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
p.HandleRecipient(func(b []byte) (age.Recipient, error) {
|
p.HandleRecipient(func(b []byte) (age.Recipient, error) {
|
||||||
return tag.NewHybridRecipient(b)
|
return tag.NewHybridRecipient(b)
|
||||||
})
|
})
|
||||||
|
|
||||||
os.Exit(p.Main())
|
os.Exit(p.Main())
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue