From 4fbce7d649f3b2cc88da9c8a1d31d0cd1fad5c7a Mon Sep 17 00:00:00 2001 From: Daniel Date: Mon, 24 Jun 2024 09:48:48 +0200 Subject: [PATCH] Switch from portbase to structures lib, update build and version system --- cmd/build | 60 +++++++---------------------- cmd/cmd-open.go | 2 +- cmd/cmd-verify.go | 2 +- cmd/cmd-version.go | 77 +++++++++++++++++++++++++++++++++++--- cmd/main.go | 13 +------ core-wire_test.go | 2 +- core.go | 2 +- envelope.go | 2 +- filesig/format_armor.go | 2 +- filesig/main.go | 2 +- go.mod | 28 +++++++------- go.sum | 57 +++++++++++++++------------- letter-file.go | 4 +- letter-wire.go | 2 +- letter.go | 4 +- lhash/labeledhash.go | 2 +- signet.go | 2 +- tools/ecdh/nist.go | 2 +- tools/ecdh/x25519.go | 2 +- tools/gostdlib/ed25519.go | 2 +- tools/gostdlib/hkdf.go | 2 +- tools/gostdlib/rsa-keys.go | 2 +- truststores/io.go | 2 +- 23 files changed, 152 insertions(+), 123 deletions(-) diff --git a/cmd/build b/cmd/build index 36b9ff6..7036913 100755 --- a/cmd/build +++ b/cmd/build @@ -1,61 +1,29 @@ #!/bin/bash +set -eo pipefail baseDir="$( cd "$(dirname "$0")" && pwd )" cd "$baseDir" -# get build data -if [[ "$BUILD_COMMIT" == "" ]]; then - BUILD_COMMIT=$(git describe --all --long --abbrev=99 --dirty 2>/dev/null) -fi -if [[ "$BUILD_USER" == "" ]]; then - BUILD_USER=$(id -un) -fi -if [[ "$BUILD_HOST" == "" ]]; then - BUILD_HOST=$(hostname) -fi -if [[ "$BUILD_DATE" == "" ]]; then - BUILD_DATE=$(date +%d.%m.%Y) -fi -if [[ "$BUILD_SOURCE" == "" ]]; then - BUILD_SOURCE=$(git remote -v | grep origin | cut -f2 | cut -d" " -f1 | head -n 1) -fi -if [[ "$BUILD_SOURCE" == "" ]]; then - BUILD_SOURCE=$(git remote -v | cut -f2 | cut -d" " -f1 | head -n 1) -fi -BUILD_BUILDOPTIONS=$(echo $* | sed "s/ /ยง/g") - -# check -if [[ "$BUILD_COMMIT" == "" ]]; then - echo "could not automatically determine BUILD_COMMIT, please supply manually as environment variable." - exit 1 -fi -if [[ "$BUILD_USER" == "" ]]; then - echo "could not automatically determine BUILD_USER, please supply manually as environment variable." - exit 1 -fi -if [[ "$BUILD_HOST" == "" ]]; then - echo "could not automatically determine BUILD_HOST, please supply manually as environment variable." - exit 1 -fi -if [[ "$BUILD_DATE" == "" ]]; then - echo "could not automatically determine BUILD_DATE, please supply manually as environment variable." - exit 1 -fi -if [[ "$BUILD_SOURCE" == "" ]]; then - echo "could not automatically determine BUILD_SOURCE, please supply manually as environment variable." - exit 1 -fi - echo "Please notice, that this build script includes metadata into the build." echo "This information is useful for debugging and license compliance." echo "Run the compiled binary with the version command to see the information included." +# Get version. +VERSION="$(git tag --points-at)" || true +test -z "$VERSION" && DEV_VERSION="$(git describe --tags --first-parent --abbrev=0)" || true +test -n "$DEV_VERSION" && VERSION="${DEV_VERSION}_dev_build" +test -z "$VERSION" && VERSION="dev_build" +BUILD_SOURCE=$( ( git remote -v | cut -f2 | cut -d" " -f1 | head -n 1 ) || echo "unknown" ) +BUILD_TIME=$(date -u "+%Y-%m-%dT%H:%M:%SZ" || echo "unknown") + +LDFLAGS="-X main.Version=${VERSION} -X main.BuildSource=${BUILD_SOURCE} -X main.BuildTime=${BUILD_TIME}" + # build output name BIN_NAME="jess" if [[ "$GOOS" == "windows" ]]; then BIN_NAME="${BIN_NAME}.exe" fi -# build -BUILD_PATH="github.com/safing/portbase/info" -go build -o "${BIN_NAME}" -ldflags "-X ${BUILD_PATH}.commit=${BUILD_COMMIT} -X ${BUILD_PATH}.buildOptions=${BUILD_BUILDOPTIONS} -X ${BUILD_PATH}.buildUser=${BUILD_USER} -X ${BUILD_PATH}.buildHost=${BUILD_HOST} -X ${BUILD_PATH}.buildDate=${BUILD_DATE} -X ${BUILD_PATH}.buildSource=${BUILD_SOURCE}" "$@" +# Build. +export CGO_ENABLED=0 +go build -o "${BIN_NAME}" -ldflags "$LDFLAGS" "$@" diff --git a/cmd/cmd-open.go b/cmd/cmd-open.go index 650173e..0f28a8a 100644 --- a/cmd/cmd-open.go +++ b/cmd/cmd-open.go @@ -11,7 +11,7 @@ import ( "github.com/spf13/cobra" "github.com/safing/jess" - "github.com/safing/portbase/container" + "github.com/safing/structures/container" ) func init() { diff --git a/cmd/cmd-verify.go b/cmd/cmd-verify.go index bd0401f..fda083d 100644 --- a/cmd/cmd-verify.go +++ b/cmd/cmd-verify.go @@ -13,7 +13,7 @@ import ( "github.com/safing/jess" "github.com/safing/jess/filesig" - "github.com/safing/portbase/container" + "github.com/safing/structures/container" ) func init() { diff --git a/cmd/cmd-version.go b/cmd/cmd-version.go index 0ea5ee8..e55fd32 100644 --- a/cmd/cmd-version.go +++ b/cmd/cmd-version.go @@ -2,20 +2,85 @@ package main import ( "fmt" + "runtime" + "runtime/debug" + "strings" "github.com/spf13/cobra" +) + +func init() { + rootCmd.AddCommand(versionCmd) +} - "github.com/safing/portbase/info" +var ( + // Version is the version of this command. + Version = "dev build" + // BuildSource holds the primary source repo used to build. + BuildSource = "unknown" + // BuildTime holds the time when the binary was built. + BuildTime = "unknown" ) func init() { + // Convert version string space placeholders. + Version = strings.ReplaceAll(Version, "_", " ") + BuildSource = strings.ReplaceAll(BuildSource, "_", " ") + BuildTime = strings.ReplaceAll(BuildTime, "_", " ") + + // Get build info. + buildInfo, _ := debug.ReadBuildInfo() + buildSettings := make(map[string]string) + for _, setting := range buildInfo.Settings { + buildSettings[setting.Key] = setting.Value + } + + // Add "dev build" to version if repo is dirty. + if buildSettings["vcs.modified"] == "true" && + !strings.HasSuffix(Version, "dev build") { + Version += " dev build" + } + rootCmd.AddCommand(versionCmd) } var versionCmd = &cobra.Command{ - Use: "version", - Short: "print version information", - Run: func(cmd *cobra.Command, args []string) { - fmt.Println(info.FullVersion()) - }, + Use: "version", + Run: version, +} + +func version(cmd *cobra.Command, args []string) { + builder := new(strings.Builder) + + // Get build info. + buildInfo, _ := debug.ReadBuildInfo() + buildSettings := make(map[string]string) + for _, setting := range buildInfo.Settings { + buildSettings[setting.Key] = setting.Value + } + + // Print version info. + builder.WriteString(fmt.Sprintf("Jess %s\n", Version)) + + // Build info. + cgoInfo := "-cgo" + if buildSettings["CGO_ENABLED"] == "1" { + cgoInfo = "+cgo" + } + builder.WriteString(fmt.Sprintf("\nbuilt with %s (%s %s) for %s/%s\n", runtime.Version(), runtime.Compiler, cgoInfo, runtime.GOOS, runtime.GOARCH)) + builder.WriteString(fmt.Sprintf(" at %s\n", BuildTime)) + + // Commit info. + dirtyInfo := "clean" + if buildSettings["vcs.modified"] == "true" { + dirtyInfo = "dirty" + } + builder.WriteString(fmt.Sprintf("\ncommit %s (%s)\n", buildSettings["vcs.revision"], dirtyInfo)) + builder.WriteString(fmt.Sprintf(" at %s\n", buildSettings["vcs.time"])) + builder.WriteString(fmt.Sprintf(" from %s\n", BuildSource)) + + // License info. + builder.WriteString("\nLicensed under the GPLv3 license.") + + _, _ = fmt.Println(builder.String()) } diff --git a/cmd/main.go b/cmd/main.go index bf944ae..a46c4d9 100644 --- a/cmd/main.go +++ b/cmd/main.go @@ -2,7 +2,6 @@ package main import ( "errors" - "fmt" "os" "github.com/spf13/cobra" @@ -10,7 +9,6 @@ import ( "github.com/safing/jess" _ "github.com/safing/jess/tools/all" "github.com/safing/jess/truststores" - "github.com/safing/portbase/info" ) const ( @@ -41,14 +39,6 @@ var ( ) func main() { - info.Set("jess", "0.3.3", "GPLv3", true) - - err := info.CheckVersion() - if err != nil { - fmt.Println(err) - os.Exit(1) - } - rootCmd.PersistentFlags().StringVarP(&trustStoreDir, "tsdir", "d", "", "specify a truststore directory (default loaded from JESS_TS_DIR env variable)", ) @@ -62,8 +52,7 @@ func main() { rootCmd.PersistentFlags().IntVarP(&minimumSecurityLevel, "seclevel", "s", 0, "specify a minimum security level") rootCmd.PersistentFlags().IntVarP(&defaultSymmetricKeySize, "symkeysize", "k", 0, "specify a default symmetric key size (only applies in certain conditions, use when prompted)") - err = rootCmd.Execute() - if err != nil { + if rootCmd.Execute() != nil { os.Exit(1) } os.Exit(0) diff --git a/core-wire_test.go b/core-wire_test.go index a2e0f51..85e6eac 100644 --- a/core-wire_test.go +++ b/core-wire_test.go @@ -5,7 +5,7 @@ import ( "testing" "time" - "github.com/safing/portbase/container" + "github.com/safing/structures/container" ) func TestWire(t *testing.T) { diff --git a/core.go b/core.go index 04bd7f8..28da977 100644 --- a/core.go +++ b/core.go @@ -5,7 +5,7 @@ import ( "errors" "fmt" - "github.com/safing/portbase/container" + "github.com/safing/structures/container" ) // Close encrypts (and possibly signs) the given data and returns a Letter. Storyline: Close takes an envelope, inserts the message and closes it, resulting in a letter. diff --git a/envelope.go b/envelope.go index 71c2aa8..40928c8 100644 --- a/envelope.go +++ b/envelope.go @@ -6,7 +6,7 @@ import ( "github.com/mr-tron/base58" - "github.com/safing/portbase/formats/dsd" + "github.com/safing/structures/dsd" ) // Envelope holds configuration for jess to put data into a letter. diff --git a/filesig/format_armor.go b/filesig/format_armor.go index 78e38e9..d30f2a2 100644 --- a/filesig/format_armor.go +++ b/filesig/format_armor.go @@ -7,7 +7,7 @@ import ( "regexp" "github.com/safing/jess" - "github.com/safing/portbase/formats/dsd" + "github.com/safing/structures/dsd" ) const ( diff --git a/filesig/main.go b/filesig/main.go index b71ad87..9934422 100644 --- a/filesig/main.go +++ b/filesig/main.go @@ -6,7 +6,7 @@ import ( "github.com/safing/jess" "github.com/safing/jess/lhash" - "github.com/safing/portbase/formats/dsd" + "github.com/safing/structures/dsd" ) // Extension holds the default file extension to be used for signature files. diff --git a/go.mod b/go.mod index 365518c..2245aaf 100644 --- a/go.mod +++ b/go.mod @@ -1,36 +1,38 @@ module github.com/safing/jess -go 1.20 +go 1.21.1 + +toolchain go1.22.3 require ( github.com/AlecAivazis/survey/v2 v2.3.7 github.com/aead/ecdh v0.2.0 github.com/mr-tron/base58 v1.2.0 - github.com/safing/portbase v0.18.6 + github.com/safing/structures v1.1.0 github.com/satori/go.uuid v1.2.0 - github.com/spf13/cobra v1.8.0 + github.com/spf13/cobra v1.8.1 github.com/stretchr/testify v1.8.4 github.com/tevino/abool v1.2.0 - github.com/tidwall/gjson v1.17.0 + github.com/tidwall/gjson v1.17.1 github.com/tidwall/pretty v1.2.1 github.com/tidwall/sjson v1.2.5 - github.com/zalando/go-keyring v0.2.3 + github.com/zalando/go-keyring v0.2.5 github.com/zeebo/blake3 v0.2.3 - golang.org/x/crypto v0.17.0 - golang.org/x/exp v0.0.0-20231214170342-aacd6d4b4611 + golang.org/x/crypto v0.24.0 + golang.org/x/exp v0.0.0-20240613232115-7f521ea00fb8 ) require ( github.com/alessio/shellescape v1.4.2 // indirect github.com/danieljoos/wincred v1.2.1 // indirect github.com/davecgh/go-spew v1.1.1 // indirect - github.com/fxamacker/cbor/v2 v2.5.0 // indirect + github.com/fxamacker/cbor/v2 v2.7.0 // indirect github.com/ghodss/yaml v1.0.0 // indirect github.com/godbus/dbus/v5 v5.1.0 // indirect - github.com/gofrs/uuid v4.4.0+incompatible // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 // indirect - github.com/klauspost/cpuid/v2 v2.2.6 // indirect + github.com/klauspost/cpuid/v2 v2.2.8 // indirect + github.com/kr/text v0.2.0 // indirect github.com/mattn/go-colorable v0.1.13 // indirect github.com/mattn/go-isatty v0.0.20 // indirect github.com/mgutz/ansi v0.0.0-20200706080929-d51e80ef957d // indirect @@ -40,9 +42,9 @@ require ( github.com/vmihailenco/msgpack/v5 v5.4.1 // indirect github.com/vmihailenco/tagparser/v2 v2.0.0 // indirect github.com/x448/float16 v0.8.4 // indirect - golang.org/x/sys v0.15.0 // indirect - golang.org/x/term v0.15.0 // indirect - golang.org/x/text v0.14.0 // indirect + golang.org/x/sys v0.21.0 // indirect + golang.org/x/term v0.21.0 // indirect + golang.org/x/text v0.16.0 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/go.sum b/go.sum index 30108cb..99237ac 100644 --- a/go.sum +++ b/go.sum @@ -6,7 +6,8 @@ github.com/aead/ecdh v0.2.0 h1:pYop54xVaq/CEREFEcukHRZfTdjiWvYIsZDXXrBapQQ= github.com/aead/ecdh v0.2.0/go.mod h1:a9HHtXuSo8J1Js1MwLQx2mBhkXMT6YwUmVVEY4tTB8U= github.com/alessio/shellescape v1.4.2 h1:MHPfaU+ddJ0/bYWpgIeUnQUqKrlJ1S7BfEYPM4uEoM0= github.com/alessio/shellescape v1.4.2/go.mod h1:PZAiSCk0LJaZkiCSkPv8qIobYglO3FPpyFjDCtHLS30= -github.com/cpuguy83/go-md2man/v2 v2.0.3/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= +github.com/cpuguy83/go-md2man/v2 v2.0.4/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= +github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/creack/pty v1.1.17 h1:QeVUsEDNrLBW4tMgZHvxy18sKtr6VI492kBhUfhDJNI= github.com/creack/pty v1.1.17/go.mod h1:MOBLtS5ELjhRRrroQr9kyvTxUAFNvYEK993ew/Vr4O4= github.com/danieljoos/wincred v1.2.1 h1:dl9cBrupW8+r5250DYkYxocLeZ1Y4vB1kxgtjxw8GQs= @@ -14,14 +15,12 @@ github.com/danieljoos/wincred v1.2.1/go.mod h1:uGaFL9fDn3OLTvzCGulzE+SzjEe5NGlh5 github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/fxamacker/cbor/v2 v2.5.0 h1:oHsG0V/Q6E/wqTS2O1Cozzsy69nqCiguo5Q1a1ADivE= -github.com/fxamacker/cbor/v2 v2.5.0/go.mod h1:TA1xS00nchWmaBnEIxPSE5oHLuJBAVvqrtAnWBwBCVo= +github.com/fxamacker/cbor/v2 v2.7.0 h1:iM5WgngdRBanHcxugY4JySA0nk1wZorNOpTgCMedv5E= +github.com/fxamacker/cbor/v2 v2.7.0/go.mod h1:pxXPTn3joSm21Gbwsv0w9OSA2y1HFR9qXEeXQVeNoDQ= github.com/ghodss/yaml v1.0.0 h1:wQHKEahhL6wmXdzwWG11gIVCkOv05bNOh+Rxn0yngAk= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/godbus/dbus/v5 v5.1.0 h1:4KLkAxT3aOY8Li4FRJe/KvhoNFFxo0m6fNuFUO8QJUk= github.com/godbus/dbus/v5 v5.1.0/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= -github.com/gofrs/uuid v4.4.0+incompatible h1:3qXRTX8/NbyulANqlc0lchS1gqAVxRgsuW1YrTJupqA= -github.com/gofrs/uuid v4.4.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= github.com/hinshun/vt10x v0.0.0-20220119200601-820417d04eec h1:qv2VnGeEQHchGaZ/u7lxST/RaJw+cv273q79D81Xbog= github.com/hinshun/vt10x v0.0.0-20220119200601-820417d04eec/go.mod h1:Q48J4R4DvxnHolD5P8pOtXigYlRuPLGl6moFx3ulM68= github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= @@ -29,8 +28,12 @@ github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLf github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 h1:Z9n2FFNUXsshfwJMBgNA0RU6/i7WVaAegv3PtuIHPMs= github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51/go.mod h1:CzGEWj7cYgsdH8dAjBGEr58BoE7ScuLd+fwFZ44+/x8= github.com/klauspost/cpuid/v2 v2.0.12/go.mod h1:g2LTdtYhdyuGPqyWyv7qRAmj1WBqxuObKfj5c0PQa7c= -github.com/klauspost/cpuid/v2 v2.2.6 h1:ndNyv040zDGIDh8thGkXYjnFtiN02M1PVVF+JE/48xc= -github.com/klauspost/cpuid/v2 v2.2.6/go.mod h1:Lcz8mBdAVJIBVzewtcLocK12l3Y+JytZYpaMropDUws= +github.com/klauspost/cpuid/v2 v2.2.8 h1:+StwCXwm9PdpiEkPyzBXIy+M9KUb4ODm0Zarf1kS5BM= +github.com/klauspost/cpuid/v2 v2.2.8/go.mod h1:Lcz8mBdAVJIBVzewtcLocK12l3Y+JytZYpaMropDUws= +github.com/kr/pretty v0.2.0 h1:s5hAObm+yFO5uHYt5dYjxi2rXrsnmRpJx4OYvIWUaQs= +github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= +github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= +github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/mattn/go-colorable v0.1.2/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA= github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg= @@ -46,24 +49,25 @@ github.com/mr-tron/base58 v1.2.0/go.mod h1:BinMc/sQntlIE1frQmRFPUoPA1Zkr8VRgBdjW github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= -github.com/safing/portbase v0.18.6 h1:uMZOG4C0K61QJE7I4fI+55r1I/eV42TJdI1xA02U1yo= -github.com/safing/portbase v0.18.6/go.mod h1:qhhLjrr5iEGU9r7RZ6hJdtulOeycJ0d0jq95ZxGJ9Hs= +github.com/safing/structures v1.1.0 h1:QzHBQBjaZSLzw2f6PM4ibSmPcfBHAOB5CKJ+k4FYkhQ= +github.com/safing/structures v1.1.0/go.mod h1:QUrB74FcU41ahQ5oy3YNFCoSq+twE/n3+vNZc2K35II= github.com/satori/go.uuid v1.2.0 h1:0uYX9dsZ2yD7q2RtLRtPSdGDWzjeM3TbMJP9utgA0ww= github.com/satori/go.uuid v1.2.0/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0= -github.com/spf13/cobra v1.8.0 h1:7aJaZx1B85qltLMc546zn58BxxfZdR/W22ej9CFoEf0= -github.com/spf13/cobra v1.8.0/go.mod h1:WXLWApfZ71AjXPya3WOlMsY9yMs7YeiHhFVlvLyhcho= +github.com/spf13/cobra v1.8.1 h1:e5/vxKd/rZsfSJMUX1agtjeTDf+qv1/JdBF8gg5k9ZM= +github.com/spf13/cobra v1.8.1/go.mod h1:wHxEcudfqmLYa8iTfL+OuZPbBZkmvliBWKIezN3kD9Y= github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.5.0 h1:1zr/of2m5FGMsad5YfcqgdqdWrIhu+EBEJRhR1U7z/c= +github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= github.com/tevino/abool v1.2.0 h1:heAkClL8H6w+mK5md9dzsuohKeXHUpY7Vw0ZCKW+huA= github.com/tevino/abool v1.2.0/go.mod h1:qc66Pna1RiIsPa7O4Egxxs9OqkuxDX55zznh9K07Tzg= github.com/tidwall/gjson v1.14.2/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk= -github.com/tidwall/gjson v1.17.0 h1:/Jocvlh98kcTfpN2+JzGQWQcqrPQwDrVEMApx/M5ZwM= -github.com/tidwall/gjson v1.17.0/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk= +github.com/tidwall/gjson v1.17.1 h1:wlYEnwqAHgzmhNUFfw7Xalt2JzQvsMx2Se4PcoFCT/U= +github.com/tidwall/gjson v1.17.1/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk= github.com/tidwall/match v1.1.1 h1:+Ho715JplO36QYgwN9PGYNhgZvoUSc9X2c80KVTi+GA= github.com/tidwall/match v1.1.1/go.mod h1:eRSPERbgtNPcGhD8UCthc6PmLEQXEWd3PRB5JTxsfmM= github.com/tidwall/pretty v1.2.0/go.mod h1:ITEVvHYasfjBbM0u2Pg8T2nJnzm8xPwvNhhsoaGGjNU= @@ -78,8 +82,8 @@ github.com/vmihailenco/tagparser/v2 v2.0.0/go.mod h1:Wri+At7QHww0WTrCBeu4J6bNtoV github.com/x448/float16 v0.8.4 h1:qLwI1I70+NjRFUR3zs1JPUCgaCXSh3SW62uAKT1mSBM= github.com/x448/float16 v0.8.4/go.mod h1:14CWIYCyZA/cWjXOioeEpHeN/83MdbZDRQHoFcYsOfg= github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= -github.com/zalando/go-keyring v0.2.3 h1:v9CUu9phlABObO4LPWycf+zwMG7nlbb3t/B5wa97yms= -github.com/zalando/go-keyring v0.2.3/go.mod h1:HL4k+OXQfJUWaMnqyuSOc0drfGPX2b51Du6K+MRgZMk= +github.com/zalando/go-keyring v0.2.5 h1:Bc2HHpjALryKD62ppdEzaFG6VxL6Bc+5v0LYpN8Lba8= +github.com/zalando/go-keyring v0.2.5/go.mod h1:HL4k+OXQfJUWaMnqyuSOc0drfGPX2b51Du6K+MRgZMk= github.com/zeebo/assert v1.1.0 h1:hU1L1vLTHsnO8x8c9KAR5GmM5QscxHg5RNU5z5qbUWY= github.com/zeebo/assert v1.1.0/go.mod h1:Pq9JiuJQpG8JLJdtkwrJESF0Foym2/D9XMU5ciN/wJ0= github.com/zeebo/blake3 v0.2.3 h1:TFoLXsjeXqRNFxSbk35Dk4YtszE/MQQGK10BH4ptoTg= @@ -89,10 +93,10 @@ github.com/zeebo/pcg v1.0.1/go.mod h1:09F0S9iiKrwn9rlI5yjLkmrug154/YRW6KnnXVDM/l golang.org/x/crypto v0.0.0-20190211182817-74369b46fc67/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.17.0 h1:r8bRNjWL3GshPW3gkd+RpvzWrZAwPS49OmTGZ/uhM4k= -golang.org/x/crypto v0.17.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4= -golang.org/x/exp v0.0.0-20231214170342-aacd6d4b4611 h1:qCEDpW1G+vcj3Y7Fy52pEM1AWm3abj8WimGYejI3SC4= -golang.org/x/exp v0.0.0-20231214170342-aacd6d4b4611/go.mod h1:iRJReGqOEeBhDZGkGbynYwcHlctCvnjTYIamk7uXpHI= +golang.org/x/crypto v0.24.0 h1:mnl8DM0o513X8fdIkmyFE/5hTYxbwYOjDS/+rK6qpRI= +golang.org/x/crypto v0.24.0/go.mod h1:Z1PMYSOR5nyMcyAVAIQSKCDwalqy85Aqn1x3Ws4L5DM= +golang.org/x/exp v0.0.0-20240613232115-7f521ea00fb8 h1:yixxcjnhBmY0nkL253HFVIm0JsFHwrHdT3Yh6szTnfY= +golang.org/x/exp v0.0.0-20240613232115-7f521ea00fb8/go.mod h1:jj3sYF3dwk5D+ghuXyeI3r5MFf+NT2An6/9dOA95KSI= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= @@ -108,24 +112,25 @@ golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.15.0 h1:h48lPFYpsTvQJZF4EKyI4aLHaev3CxivZmv7yZig9pc= -golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.21.0 h1:rF+pYz3DAGSQAxAu1CbC7catZg4ebC4UIeIhKxBZvws= +golang.org/x/sys v0.21.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= -golang.org/x/term v0.15.0 h1:y/Oo/a/q3IXu26lQgl04j/gjuBDOBlx7X6Om1j2CPW4= -golang.org/x/term v0.15.0/go.mod h1:BDl952bC7+uMoWR75FIrCDx79TPU9oHkTZ9yRbYOrX0= +golang.org/x/term v0.21.0 h1:WVXCp+/EBEHOj53Rvu+7KiT/iElMrO8ACK16SMZ3jaA= +golang.org/x/term v0.21.0/go.mod h1:ooXLefLobQVslOqselCNF4SxFAaoS6KujMbsGzSDmX0= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= -golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= -golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= +golang.org/x/text v0.16.0 h1:a94ExnEXNtEwYLGJSIUxnWoxoRz/ZcCsV63ROupILh4= +golang.org/x/text v0.16.0/go.mod h1:GhwF1Be+LQoKShO3cGOHzqOgRrGaYc9AvblQOmPVHnI= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo= +gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/letter-file.go b/letter-file.go index ec5f773..fe69883 100644 --- a/letter-file.go +++ b/letter-file.go @@ -3,8 +3,8 @@ package jess import ( "errors" - "github.com/safing/portbase/container" - "github.com/safing/portbase/formats/dsd" + "github.com/safing/structures/container" + "github.com/safing/structures/dsd" ) /* diff --git a/letter-wire.go b/letter-wire.go index c456985..f88851a 100644 --- a/letter-wire.go +++ b/letter-wire.go @@ -3,7 +3,7 @@ package jess import ( "errors" - "github.com/safing/portbase/container" + "github.com/safing/structures/container" ) /* diff --git a/letter.go b/letter.go index edadd7b..ff5395e 100644 --- a/letter.go +++ b/letter.go @@ -10,8 +10,8 @@ import ( "encoding/json" "fmt" - "github.com/safing/portbase/container" - "github.com/safing/portbase/formats/dsd" + "github.com/safing/structures/container" + "github.com/safing/structures/dsd" ) // Letter is the data format for encrypted data at rest or in transit. diff --git a/lhash/labeledhash.go b/lhash/labeledhash.go index 68e5475..caa8361 100644 --- a/lhash/labeledhash.go +++ b/lhash/labeledhash.go @@ -12,7 +12,7 @@ import ( "github.com/mr-tron/base58" - "github.com/safing/portbase/container" + "github.com/safing/structures/container" ) // LabeledHash represents a typed hash value. diff --git a/signet.go b/signet.go index 9a950d8..25a414c 100644 --- a/signet.go +++ b/signet.go @@ -11,7 +11,7 @@ import ( uuid "github.com/satori/go.uuid" "github.com/safing/jess/tools" - "github.com/safing/portbase/formats/dsd" + "github.com/safing/structures/dsd" ) // Special signet types. diff --git a/tools/ecdh/nist.go b/tools/ecdh/nist.go index ae4e466..109a9d4 100644 --- a/tools/ecdh/nist.go +++ b/tools/ecdh/nist.go @@ -9,7 +9,7 @@ import ( "github.com/aead/ecdh" "github.com/safing/jess/tools" - "github.com/safing/portbase/container" + "github.com/safing/structures/container" ) var nistCurveInfo = &tools.ToolInfo{ diff --git a/tools/ecdh/x25519.go b/tools/ecdh/x25519.go index da6ce41..07b88e6 100644 --- a/tools/ecdh/x25519.go +++ b/tools/ecdh/x25519.go @@ -7,7 +7,7 @@ import ( "github.com/aead/ecdh" "github.com/safing/jess/tools" - "github.com/safing/portbase/container" + "github.com/safing/structures/container" ) func init() { diff --git a/tools/gostdlib/ed25519.go b/tools/gostdlib/ed25519.go index d7b3e08..a6207bf 100644 --- a/tools/gostdlib/ed25519.go +++ b/tools/gostdlib/ed25519.go @@ -6,7 +6,7 @@ import ( "errors" "github.com/safing/jess/tools" - "github.com/safing/portbase/container" + "github.com/safing/structures/container" ) func init() { diff --git a/tools/gostdlib/hkdf.go b/tools/gostdlib/hkdf.go index 45d4bb5..6a03bde 100644 --- a/tools/gostdlib/hkdf.go +++ b/tools/gostdlib/hkdf.go @@ -8,7 +8,7 @@ import ( "golang.org/x/crypto/hkdf" "github.com/safing/jess/tools" - "github.com/safing/portbase/container" + "github.com/safing/structures/container" ) func init() { diff --git a/tools/gostdlib/rsa-keys.go b/tools/gostdlib/rsa-keys.go index 8b5b0a4..9e5c053 100644 --- a/tools/gostdlib/rsa-keys.go +++ b/tools/gostdlib/rsa-keys.go @@ -8,7 +8,7 @@ import ( "math/big" "github.com/safing/jess/tools" - "github.com/safing/portbase/container" + "github.com/safing/structures/container" ) type rsaBase struct { diff --git a/truststores/io.go b/truststores/io.go index cb34844..0719eda 100644 --- a/truststores/io.go +++ b/truststores/io.go @@ -6,7 +6,7 @@ import ( "os" "github.com/safing/jess" - "github.com/safing/portbase/formats/dsd" + "github.com/safing/structures/dsd" ) // WriteSignetToFile serializes the signet and writes it to the given file.