Skip to content

Commit

Permalink
rename from tpm-ssh-agent to ssh-tpm-agent
Browse files Browse the repository at this point in the history
Signed-off-by: Morten Linderud <[email protected]>
  • Loading branch information
Foxboron committed Jul 28, 2023
1 parent 2ab0b32 commit 4dd9948
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2023 tpm-ssh-agent Authors
Copyright (c) 2023 ssh-tpm-agent Authors

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
SSH agent for TPM
=================

`tpm-ssh-agent` is a ssh-agent that allows keys to be created by the Trusted
`ssh-tpm-agent` is a ssh-agent that allows keys to be created by the Trusted
Platform Module (TPM), sealed outside of it, for authentication towards ssh
servers.

Expand All @@ -21,9 +21,9 @@ The identity format and technical details might change between iterations.
Consider this plugin experimental.

Instead of utilizing the TPM directly, you can use `--swtpm` or `export
TPM_SSH_AGENT_SWTPM=1` to create a identity backed by
SSH_TPM_AGENT_SWTPM=1` to create a identity backed by
[swtpm](https://github.com/stefanberger/swtpm) which will be stored under
`/var/tmp/tpm-agent-ssh`.
`/var/tmp/ssh-tpm-agent`.

Note that `swtpm` provides no security properties and should only be used for
testing.
Expand All @@ -32,19 +32,19 @@ testing.

The simplest way of installing this plugin is by running the follow go command.

`go install github.com/Foxboron/tpm-ssh-agent@latest`
`go install github.com/Foxboron/ssh-tpm-agent@latest`

Alternatively download the [pre-built binaries](https://github.com/foxboron/tpm-ssh-plugin/releases).
Alternatively download the [pre-built binaries](https://github.com/foxboron/ssh-tpm-plugin/releases).

# Usage

```bash
# Create key
$ tpm-ssh-agent --setup
$ ssh-tpm-agent --setup
ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBN9BTy8bdarJoivDAQv0rVdJDvapvaNcFnCzqq8M5MFqQzxSdFEJCMAODngCFnuOnVRt1CCuEvnrfZQNj2XkHhU=

# Using the socket
$ tpm-ssh-agent -l /var/tmp/tpm.sock
$ ssh-tpm-agent -l /var/tmp/tpm.sock

$ export SSH_AUTH_SOCK="/var/tmp/tpm.sock" ssh [email protected]
```
Expand Down
4 changes: 2 additions & 2 deletions agent.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ func getDataHome() string {
}

func getAgentStorage() string {
return path.Join(getDataHome(), "tpm-ssh-agent")
return path.Join(getDataHome(), "ssh-tpm-agent")
}

type Agent struct {
Expand Down Expand Up @@ -204,7 +204,7 @@ func execAgent(socketPath string, tpmFetch func() transport.TPMCloser, pin func(

func runAgent(socketPath string, tpmFetch func() transport.TPMCloser, pin func(*Key) ([]byte, error)) {
if term.IsTerminal(int(os.Stdin.Fd())) {
log.Println("Warning: tpm-ssh-agent is meant to run as a background daemon.")
log.Println("Warning: ssh-tpm-agent is meant to run as a background daemon.")
log.Println("Running multiple instances is likely to lead to conflicts.")
log.Println("Consider using a systemd service.")
}
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module github.com/foxboron/tpm-ssh-agent
module github.com/foxboron/ssh-tpm-agent

go 1.20

Expand Down
4 changes: 2 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@ import (
)

var (
swtpmPath = "/var/tmp/tpm-agent-ssh"
swtpmPath = "/var/tmp/ssh-tpm-agent"
)

// Smaller wrapper for getting the correct TPM instance
func getTPM(f bool) (transport.TPMCloser, error) {
var tpm transport.TPMCloser
var err error
if f || os.Getenv("TPM_SSH_AGENT_SWTPM") != "" {
if f || os.Getenv("SSH_TPM_AGENT_SWTPM") != "" {
if _, err := os.Stat(swtpmPath); errors.Is(err, os.ErrNotExist) {
os.MkdirTemp(path.Dir(swtpmPath), path.Base(swtpmPath))
}
Expand Down
2 changes: 1 addition & 1 deletion pinentry.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ func GetPinentry() ([]byte, error) {
pinentry.WithDesc("Enter PIN for TPM key"),
pinentry.WithGPGTTY(),
pinentry.WithPrompt("PIN:"),
pinentry.WithTitle("tpm-ssh-agent PIN entry"),
pinentry.WithTitle("ssh-tpm-agent PIN entry"),
)
if err != nil {
return nil, err
Expand Down

0 comments on commit 4dd9948

Please sign in to comment.