Skip to content

Commit

Permalink
ssh-tpm-add: include remote user
Browse files Browse the repository at this point in the history
Signed-off-by: Morten Linderud <[email protected]>
  • Loading branch information
Foxboron committed Jul 14, 2024
1 parent a63a4b3 commit 1a148c8
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
8 changes: 4 additions & 4 deletions cmd/ssh-tpm-add/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,15 @@ func main() {
}

var (
caURL string
host string
caURL, host, user string
)

flag.StringVar(&caURL, "ca", "", "ca authority")
flag.StringVar(&host, "host", "", "ssh hot")
flag.StringVar(&user, "user", "", "remote ssh user")
flag.Parse()

if (caURL == "" || host == "") || len(os.Args) == 1 {
if (caURL == "" || host == "" || user == "") || len(os.Args) == 1 {
fmt.Println(usage)
return
}
Expand All @@ -70,7 +70,7 @@ func main() {
if err != nil {
log.Fatal(err)
}
k, cert, err := c.GetKey(rwc, host)
k, cert, err := c.GetKey(rwc, user, host)
if err != nil {
log.Fatal(err)
}
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ toolchain go1.22.5

require (
github.com/foxboron/go-tpm-keyfiles v0.0.0-20240620184055-b891af1cbc88
github.com/foxboron/ssh-tpm-ca-authority v0.0.0-20240714145738-6f734f0ad470
github.com/foxboron/ssh-tpm-ca-authority v0.0.0-20240714160518-efbdf2e250b6
github.com/foxboron/swtpm_test v0.0.0-20230726224112-46aaafdf7006
github.com/google/go-tpm v0.9.2-0.20240625170440-991b038b62b6
golang.org/x/crypto v0.25.0
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ github.com/foxboron/go-tpm-keyfiles v0.0.0-20240620184055-b891af1cbc88 h1:MXG/QP
github.com/foxboron/go-tpm-keyfiles v0.0.0-20240620184055-b891af1cbc88/go.mod h1:uAyTlAUxchYuiFjTHmuIEJ4nGSm7iOPaGcAyA81fJ80=
github.com/foxboron/ssh-tpm-ca-authority v0.0.0-20240714145738-6f734f0ad470 h1:PptPc75ws+nuqfBZCwMyVfbxMovScGHLi8pLmBFnBMQ=
github.com/foxboron/ssh-tpm-ca-authority v0.0.0-20240714145738-6f734f0ad470/go.mod h1:hb8N6P0bYx+mckzpsaz8jOECGWZ2C4qdAjuXQEngoEc=
github.com/foxboron/ssh-tpm-ca-authority v0.0.0-20240714160518-efbdf2e250b6 h1:Z8sm8LzT0C/uPAgKNprkg1bvMiH38s5L0YR/WN0kUz8=
github.com/foxboron/ssh-tpm-ca-authority v0.0.0-20240714160518-efbdf2e250b6/go.mod h1:qceNH6X8OXaszczVleTyEUYLMSp/kYKgcMfAYGxW1Bs=
github.com/foxboron/swtpm_test v0.0.0-20230726224112-46aaafdf7006 h1:50sW4r0PcvlpG4PV8tYh2RVCapszJgaOLRCS2subvV4=
github.com/foxboron/swtpm_test v0.0.0-20230726224112-46aaafdf7006/go.mod h1:eIXCMsMYCaqq9m1KSSxXwQG11krpuNPGP3k0uaWrbas=
github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg=
Expand Down

0 comments on commit 1a148c8

Please sign in to comment.