Skip to content

Commit 14b314d

Browse files
committed
update gosn-v2 dependency to fix export key length issue.
1 parent bbc0dcc commit 14b314d

File tree

4 files changed

+47
-3
lines changed

4 files changed

+47
-3
lines changed

cmd/sncli/main.go

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1179,6 +1179,38 @@ func startCLI(args []string) (msg string, useStdOut bool, err error) {
11791179
return err
11801180
},
11811181
},
1182+
{
1183+
Name: "create-itemskey",
1184+
Usage: "creates and displays an items key without syncing",
1185+
BashComplete: func(c *cli.Context) {
1186+
hcKeysOpts := []string{"--master-key"}
1187+
if c.NArg() > 0 {
1188+
return
1189+
}
1190+
for _, ano := range hcKeysOpts {
1191+
fmt.Println(ano)
1192+
}
1193+
},
1194+
Flags: []cli.Flag{
1195+
cli.StringFlag{
1196+
Name: "master-key",
1197+
Usage: "master key to encrypt the encrypted item key with",
1198+
},
1199+
},
1200+
Action: func(c *cli.Context) error {
1201+
var opts configOptsOutput
1202+
opts, err = getOpts(c)
1203+
if err != nil {
1204+
return err
1205+
}
1206+
useStdOut = opts.useStdOut
1207+
1208+
return sncli.CreateItemsKey(sncli.CreateItemsKeyInput{
1209+
Debug: opts.debug,
1210+
MasterKey: c.String("master-key"),
1211+
})
1212+
},
1213+
},
11821214
},
11831215
},
11841216
}

debug.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,18 @@ func OutputSession(input OutputSessionInput) error {
9292
return nil
9393
}
9494

95+
type CreateItemsKeyInput struct {
96+
Debug bool
97+
MasterKey string
98+
}
99+
100+
func CreateItemsKey(input CreateItemsKeyInput) error {
101+
ik := gosn.NewItemsKey()
102+
fmt.Printf("%+v\n", ik.ItemsKey)
103+
104+
return nil
105+
}
106+
95107
func splitContent(in string) (version, nonce, cipherText, authenticatedData string) {
96108
components := strings.Split(in, ":")
97109
if len(components) < 3 {

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ require (
99
github.com/fatih/color v1.13.0
1010
github.com/fsnotify/fsnotify v1.5.1 // indirect
1111
github.com/godbus/dbus/v5 v5.0.6 // indirect
12-
github.com/jonhadfield/gosn-v2 v0.0.0-20220212173031-f2c38cf621a7
12+
github.com/jonhadfield/gosn-v2 v0.0.0-20220212181018-1437ff898864
1313
github.com/ryanuber/columnize v2.1.2+incompatible
1414
github.com/spf13/viper v1.10.1
1515
github.com/stretchr/testify v1.7.0

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -255,8 +255,8 @@ github.com/hashicorp/serf v0.9.6/go.mod h1:TXZNMjZQijwlDvp+r0b63xZ45H7JmCmgg4gpT
255255
github.com/iancoleman/strcase v0.2.0/go.mod h1:iwCmte+B7n89clKwxIoIXy/HfoL7AsD47ZCWhYzw7ho=
256256
github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc=
257257
github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc=
258-
github.com/jonhadfield/gosn-v2 v0.0.0-20220212173031-f2c38cf621a7 h1:quP8Xe8GcGvjhz76N+a8QaS2sO4BtA8wgpUvYWKmTH0=
259-
github.com/jonhadfield/gosn-v2 v0.0.0-20220212173031-f2c38cf621a7/go.mod h1:rTfgTqRFhhPnFfhKNcliGNzIjDIrzHmZNvHmios9ckk=
258+
github.com/jonhadfield/gosn-v2 v0.0.0-20220212181018-1437ff898864 h1:sIue9gVQdIjaWQJszrklpDpY3DJdGiXudq0jWY5LmAw=
259+
github.com/jonhadfield/gosn-v2 v0.0.0-20220212181018-1437ff898864/go.mod h1:rTfgTqRFhhPnFfhKNcliGNzIjDIrzHmZNvHmios9ckk=
260260
github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU=
261261
github.com/json-iterator/go v1.1.9/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4=
262262
github.com/json-iterator/go v1.1.11/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4=

0 commit comments

Comments
 (0)