Skip to content

Commit

Permalink
Merge branch 'develop' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
lucor committed Mar 29, 2022
2 parents 444a7a3 + 74254c0 commit 6791c8f
Show file tree
Hide file tree
Showing 20 changed files with 518 additions and 45 deletions.
14 changes: 13 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,20 @@
# Changelog - Paw

## 0.17.0 - 29 March 2022

- all: add Ed25519 and RSA SSH keys support
- deps add:
- github.com/mikesmitty/edkey v0.0.0-20170222072505-3356ea4e686a
- deps upgrade:
- fyne.io/fyne v2.1.4
- golang.org/x/crypto v0.0.0-20220321153916-2c7772ba3064
- golang.org/x/image v0.0.0-20220321031419-a8550c1d254a
- golang.org/x/sync v0.0.0-20210220032951-036812b2e83c
- golang.org/x/term v0.0.0-20210927222741-03fcf44c2211

## 0.16.1 - 08 March 2022

gui: fix item creation should show default content on cancel
- gui: fix item creation should show default content on cancel

## 0.16.0 - 28 February 2022

Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ Currently the following items are available:
- login
- note
- password
- ssh_key

## Threat model

Expand Down
11 changes: 6 additions & 5 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@ go 1.16

require (
filippo.io/age v1.0.0
fyne.io/fyne/v2 v2.1.3
github.com/stretchr/testify v1.7.0
fyne.io/fyne/v2 v2.1.4
github.com/mikesmitty/edkey v0.0.0-20170222072505-3356ea4e686a
github.com/stretchr/testify v1.7.1
golang.design/x/clipboard v0.6.0
golang.org/x/crypto v0.0.0-20210817164053-32db794688a5
golang.org/x/image v0.0.0-20211028202545-6944b10bf410
golang.org/x/crypto v0.0.0-20220321153916-2c7772ba3064
golang.org/x/image v0.0.0-20220321031419-a8550c1d254a
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c
golang.org/x/term v0.0.0-20210615171337-6886f2dfbf5b
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211
)
24 changes: 15 additions & 9 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
filippo.io/age v1.0.0 h1:V6q14n0mqYU3qKFkZ6oOaF9oXneOviS3ubXsSVBRSzc=
filippo.io/age v1.0.0/go.mod h1:PaX+Si/Sd5G8LgfCwldsSba3H1DDQZhIhFGkhbHaBq8=
filippo.io/edwards25519 v1.0.0-rc.1/go.mod h1:N1IkdkCkiLB6tki+MYJoSx2JTY9NUlxZE7eHn5EwJns=
fyne.io/fyne/v2 v2.1.3 h1:I5qSeENAcq67hmO5Z2hI7sEJm9bdLMDJx59Fv8qJkX0=
fyne.io/fyne/v2 v2.1.3/go.mod h1:p+E/Dh+wPW8JwR2DVcsZ9iXgR9ZKde80+Y+40Is54AQ=
fyne.io/fyne/v2 v2.1.4 h1:bt1+28++kAzRzPB0GM2EuSV4cnl8rXNX4cjfd8G06Rc=
fyne.io/fyne/v2 v2.1.4/go.mod h1:p+E/Dh+wPW8JwR2DVcsZ9iXgR9ZKde80+Y+40Is54AQ=
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
github.com/BurntSushi/toml v0.4.1/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ=
github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo=
Expand Down Expand Up @@ -31,6 +31,8 @@ github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE=
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
github.com/lucor/goinfo v0.0.0-20210802170112-c078a2b0f08b/go.mod h1:PRq09yoB+Q2OJReAmwzKivcYyremnibWGbK7WfftHzc=
github.com/mikesmitty/edkey v0.0.0-20170222072505-3356ea4e686a h1:eU8j/ClY2Ty3qdHnn0TyW3ivFoPC/0F1gQZz8yTxbbE=
github.com/mikesmitty/edkey v0.0.0-20170222072505-3356ea4e686a/go.mod h1:v8eSC2SMp9/7FTKUncp7fH9IwPfw+ysMObcEz5FWheQ=
github.com/nfnt/resize v0.0.0-20180221191011-83c6a9932646/go.mod h1:jpp1/29i3P1S/RLdc7JQKbRpFeM1dOBd8T9ki5s+AY8=
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWbfPhv4DMiApHyliiK5xCTNVSPiaAs=
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno=
Expand All @@ -49,8 +51,8 @@ github.com/srwiley/rasterx v0.0.0-20200120212402-85cb7272f5e9/go.mod h1:mvWM0+15
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA=
github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY=
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.7.1 h1:5TQK59W5E3v0r2duFAb7P95B6hEeOyEnHRa8MjYSMTY=
github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/urfave/cli/v2 v2.3.0/go.mod h1:LJmUH05zAU44vOAcrfzZQKsZbVcdbOG8rtL3/XcUArI=
github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k=
github.com/yuin/goldmark v1.3.8 h1:Nw158Q8QN+CPgTmVRByhVwapp8Mm1e2blinhmx4wx5E=
Expand All @@ -60,16 +62,17 @@ golang.design/x/clipboard v0.6.0/go.mod h1:ep0pB+/4DGJK3ayLxweWJFHhHGGv3npJJHMXA
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20210817164053-32db794688a5 h1:HWj/xjIHfjYU5nVXpTM0s39J9CbLn7Cc5a7IC5rwsMQ=
golang.org/x/crypto v0.0.0-20210817164053-32db794688a5/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
golang.org/x/crypto v0.0.0-20220321153916-2c7772ba3064 h1:S25/rfnfsMVgORT4/J61MJ7rdyseOZOyvLIrZEZ7s6s=
golang.org/x/crypto v0.0.0-20220321153916-2c7772ba3064/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
golang.org/x/exp v0.0.0-20190731235908-ec7cb31e5a56 h1:estk1glOnSVeJ9tdEZZc5mAMDZk5lNJNyJ6DvrBkTEU=
golang.org/x/exp v0.0.0-20190731235908-ec7cb31e5a56/go.mod h1:JhuoJpWY28nO4Vef9tZUw9qufEGTyX1+7lmHxV5q5G4=
golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js=
golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0=
golang.org/x/image v0.0.0-20200430140353-33d19683fad8/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0=
golang.org/x/image v0.0.0-20210628002857-a66eb6448b8d/go.mod h1:023OzeP/+EPmXeapQh35lcL3II3LrY8Ic+EFFKVhULM=
golang.org/x/image v0.0.0-20211028202545-6944b10bf410 h1:hTftEOvwiOq2+O8k2D5/Q7COC7k5Qcrgc2TFURJYnvQ=
golang.org/x/image v0.0.0-20211028202545-6944b10bf410/go.mod h1:023OzeP/+EPmXeapQh35lcL3II3LrY8Ic+EFFKVhULM=
golang.org/x/image v0.0.0-20220321031419-a8550c1d254a h1:LnH9RNcpPv5Kzi15lXg42lYMPUf0x8CuPv1YnvBWZAg=
golang.org/x/image v0.0.0-20220321031419-a8550c1d254a/go.mod h1:023OzeP/+EPmXeapQh35lcL3II3LrY8Ic+EFFKVhULM=
golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE=
golang.org/x/mobile v0.0.0-20210716004757-34ab1303b554 h1:3In5TnfvnuXTF/uflgpYxSCEGP2NdYT37KsPh3VjZYU=
golang.org/x/mobile v0.0.0-20210716004757-34ab1303b554/go.mod h1:jFTmtFYCV0MFtXBU+J5V/+5AUeVS0ON/0WkE/KSrl6E=
Expand All @@ -79,8 +82,9 @@ golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
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=
golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4 h1:4nGaVu0QrbjT/AK2PRLuQfQuh6DJve+pELhqTdAj3x0=
golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM=
golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2 h1:CIJ76btIcR3eFI5EgSo6k1qKw9KJexJuRLI9G7Hp5wE=
golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c h1:5KslGYwFpkhGh+Q16bwMP3cOontH8FOep7tGV86Y7SQ=
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
Expand All @@ -90,14 +94,16 @@ golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7w
golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20210903071746-97244b99971b h1:3Dq0eVHn0uaQJmPO+/aYPI/fRMqdrVDbu7MQcku54gg=
golang.org/x/sys v0.0.0-20210903071746-97244b99971b/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/term v0.0.0-20210615171337-6886f2dfbf5b h1:9zKuko04nR4gjZ4+DNjHqRlAJqbJETHwiNKDqTfOjfE=
golang.org/x/term v0.0.0-20210615171337-6886f2dfbf5b/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 h1:JGgROgKl9N8DuW20oFS5gxc+lE67/N3FcwmBPMe7ArY=
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
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.6 h1:aRYxNxv6iGQlyVaZmk6ZgYEDa+Jg18DxebPSrd6bg1M=
Expand Down
25 changes: 25 additions & 0 deletions internal/cli/cmd_add.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"os"

"lucor.dev/paw/internal/paw"
"lucor.dev/paw/internal/sshkey"
)

// Add adds an item to the vault
Expand Down Expand Up @@ -83,6 +84,8 @@ func (cmd *AddCmd) Run(s paw.Storage) error {
cmd.addNoteItem(item)
case paw.PasswordItemType:
cmd.addPasswordItem(vault.Key(), item)
case paw.SSHKeyItemType:
cmd.addSSHKeyItem(item)
default:
return fmt.Errorf("unsupported item type: %q", cmd.itemType)
}
Expand Down Expand Up @@ -185,3 +188,25 @@ func (cmd *AddCmd) addPasswordItem(key *paw.Key, item paw.Item) error {
item = v
return nil
}

func (cmd *AddCmd) addSSHKeyItem(item paw.Item) error {
v := item.(*paw.SSHKey)

k, err := sshkey.GenerateKey()
if err != nil {
return err
}

v.PrivateKey = string(k.PrivateKey())
v.PublicKey = string(k.PublicKey())
v.Fingerprint = k.Fingerprint()

note, err := ask("Note")
if err != nil {
return err
}

v.Note.Value = note
item = v
return nil
}
15 changes: 15 additions & 0 deletions internal/cli/cmd_edit.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,8 @@ func (cmd *EditCmd) Run(s paw.Storage) error {
cmd.editNoteItem(item)
case paw.PasswordItemType:
cmd.editPasswordItem(vault.Key(), item)
case paw.SSHKeyItemType:
cmd.editSSHKeyItem(item)
default:
return fmt.Errorf("unsupported item type: %q", cmd.itemType)
}
Expand Down Expand Up @@ -189,3 +191,16 @@ func (cmd *EditCmd) editPasswordItem(key *paw.Key, item paw.Item) error {
item = v
return nil
}

func (cmd *EditCmd) editSSHKeyItem(item paw.Item) error {
v := item.(*paw.SSHKey)

note, err := askWithDefault("Note", v.Note.Value)
if err != nil {
return err
}

v.Note.Value = note
item = v
return nil
}
4 changes: 4 additions & 0 deletions internal/cli/cmd_list.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ func (cmd *ListCmd) items(s paw.Storage) ([]tree.Node, error) {
loginNode := tree.Node{Value: paw.LoginItemType.String()}
noteNode := tree.Node{Value: paw.NoteItemType.String()}
passwordNode := tree.Node{Value: paw.PasswordItemType.String()}
sshkeyNode := tree.Node{Value: paw.SSHKeyItemType.String()}
for _, v := range meta {
switch v.Type {
case paw.LoginItemType:
Expand All @@ -121,13 +122,16 @@ func (cmd *ListCmd) items(s paw.Storage) ([]tree.Node, error) {
noteNode.Child = append(noteNode.Child, tree.Node{Value: v.Name})
case paw.PasswordItemType:
passwordNode.Child = append(passwordNode.Child, tree.Node{Value: v.Name})
case paw.SSHKeyItemType:
sshkeyNode.Child = append(sshkeyNode.Child, tree.Node{Value: v.Name})
}
}

return []tree.Node{
loginNode,
noteNode,
passwordNode,
sshkeyNode,
}, nil
}

Expand Down
18 changes: 17 additions & 1 deletion internal/cli/cmd_show.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ func (cmd *ShowCmd) Run(s paw.Storage) error {
}

var pclip []byte
var pclipMsg string
switch cmd.itemType {
case paw.LoginItemType:
v := item.(*paw.Login)
Expand All @@ -103,6 +104,7 @@ func (cmd *ShowCmd) Run(s paw.Storage) error {
fmt.Printf("Password: %s\n", v.Password.Value)
} else {
pclip = []byte(v.Password.Value)
pclipMsg = "[✓] password copied to clipboard"
}
if v.Note != nil {
fmt.Printf("Note: %s\n", v.Note.Value)
Expand All @@ -113,10 +115,24 @@ func (cmd *ShowCmd) Run(s paw.Storage) error {
fmt.Printf("Password: %s\n", v.Value)
} else {
pclip = []byte(v.Value)
pclipMsg = "[✓] password copied to clipboard"
}
if v.Note != nil {
fmt.Printf("Note: %s\n", v.Note.Value)
}
case paw.SSHKeyItemType:
v := item.(*paw.SSHKey)
if !cmd.clipboard {
fmt.Printf("Private key: %s\n", v.PrivateKey)
} else {
pclip = []byte(v.PrivateKey)
pclipMsg = "[✓] private key copied to clipboard"
}
fmt.Printf("Public key: %s\n", v.PublicKey)
fmt.Printf("Fingerprint: %s\n", v.Fingerprint)
if v.Note != nil {
fmt.Printf("Note: %s\n", v.Note.Value)
}
case paw.NoteItemType:
v := item.(*paw.Note)
fmt.Printf("Note: %s\n", v.Value)
Expand All @@ -132,7 +148,7 @@ func (cmd *ShowCmd) Run(s paw.Storage) error {
if err != nil {
return nil
}
fmt.Println("[✓] password copied to clipboard")
fmt.Println(pclipMsg)
}
return nil
}
18 changes: 18 additions & 0 deletions internal/icon/download_outlined.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 18 additions & 0 deletions internal/icon/upload_outlined.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions internal/paw/item.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ const (
PasswordItemType
// LoginItemType is the Website Item type
LoginItemType
// SSHKeyItemType is the SSH Key Item type
SSHKeyItemType
)

func (it ItemType) String() string {
Expand All @@ -28,6 +30,8 @@ func (it ItemType) String() string {
return "password"
case LoginItemType:
return "login"
case SSHKeyItemType:
return "ssh_key"
}
return "invalid"
}
Expand All @@ -42,6 +46,8 @@ func ItemTypeFromString(v string) (ItemType, error) {
itemType = NoteItemType
case PasswordItemType.String():
itemType = PasswordItemType
case SSHKeyItemType.String():
itemType = SSHKeyItemType
default:
err = fmt.Errorf("invalid item type %q", v)
}
Expand All @@ -67,6 +73,8 @@ func NewItem(name string, itemType ItemType) (Item, error) {
item = NewNote()
case PasswordItemType:
item = NewPassword()
case SSHKeyItemType:
item = NewSSHKey()
default:
return nil, fmt.Errorf("invalid item type %q", itemType)
}
Expand Down
29 changes: 29 additions & 0 deletions internal/paw/item_ssh_key.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
package paw

import (
"time"
)

// Declare conformity to Item interface
var _ Item = (*SSHKey)(nil)

type SSHKey struct {
*Metadata `json:"metadata,omitempty"`
*Note `json:"note,omitempty"`

Fingerprint string `json:"fingerprint,omitempty"`
PrivateKey string `json:"private_key,omitempty"`
PublicKey string `json:"public_key,omitempty"`
}

func NewSSHKey() *SSHKey {
now := time.Now()
return &SSHKey{
Metadata: &Metadata{
Type: SSHKeyItemType,
Created: now,
Modified: now,
},
Note: &Note{},
}
}
2 changes: 1 addition & 1 deletion internal/paw/paw.go
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ func (k *Key) Secret(seeder Seeder) (string, error) {
// decode the age identity to be used as secret for HKDF function
_, data, err := bech32.Decode(k.ageIdentity.String())
if err != nil {
return "", fmt.Errorf("could not decode the age identity %w", err)
panic(fmt.Sprintf("could not decode the age identity %s", err))
}

// reader to derive a key
Expand Down
2 changes: 2 additions & 0 deletions internal/paw/storage_os.go
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,8 @@ func (s *OSStorage) LoadItem(vault *Vault, itemMetadata *Metadata) (Item, error)
item = &Password{}
case LoginItemType:
item = &Login{}
case SSHKeyItemType:
item = &SSHKey{}
}

itemFile := itemPath(s, vault.Name, itemMetadata.ID())
Expand Down
Loading

0 comments on commit 6791c8f

Please sign in to comment.