Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move test apps to their own repo - leaving just ssh agent #101

Merged
merged 1 commit into from
Jun 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 0 additions & 15 deletions .clang-format

This file was deleted.

3 changes: 0 additions & 3 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,5 @@ jobs:
- name: lint go code
run: make lint

- name: check fmt of c code
run: make -C apps checkfmt

- name: check for SPDX tags
run: ./tools/spdx-ensure
25 changes: 3 additions & 22 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
.PHONY: all
all: apps tkey-ssh-agent runtimer
all: tkey-ssh-agent

.PHONY: windows
windows: tkey-ssh-agent.exe tkey-ssh-agent-tray.exe
make -C apps

DESTDIR=/
PREFIX=/usr/local
Expand Down Expand Up @@ -37,30 +36,14 @@ reload-rules:
podman:
podman run --rm --mount type=bind,source=$(CURDIR),target=/src --mount type=bind,source=$(CURDIR)/../tkey-libs,target=/tkey-libs -w /src -it ghcr.io/tillitis/tkey-builder:2 make -j

.PHONY: apps
apps:
$(MAKE) -C apps

# .PHONY to let go-build handle deps and rebuilds
.PHONY: tkey-sign
tkey-sign:
go build -ldflags "-X main.signerAppNoTouch=$(TKEY_SIGNER_APP_NO_TOUCH)" ./cmd/tkey-sign

runsign.sh: apps/signer/runsign.sh
cp -af $< $@

.PHONY: runtimer
runtimer:
go build ./cmd/runtimer
mchack-work marked this conversation as resolved.
Show resolved Hide resolved

.PHONY: check-signer-hash
check-signer-hash:
cd cmd/tkey-ssh-agent && sha512sum -c app.bin.sha512

TKEY_SSH_AGENT_VERSION ?=
# .PHONY to let go-build handle deps and rebuilds
.PHONY: tkey-ssh-agent
tkey-ssh-agent: apps check-signer-hash
tkey-ssh-agent: check-signer-hash
CGO_ENABLED=0 go build -ldflags "-X main.version=$(TKEY_SSH_AGENT_VERSION) -X main.signerAppNoTouch=$(TKEY_SIGNER_APP_NO_TOUCH)" -trimpath ./cmd/tkey-ssh-agent

.PHONY: tkey-ssh-agent.exe
Expand All @@ -81,9 +64,7 @@ clean:
rm -f \
tkey-ssh-agent cmd/tkey-ssh-agent/app.bin \
tkey-ssh-agent.exe cmd/tkey-ssh-agent/rsrc_windows_amd64.syso \
tkey-ssh-agent-tray.exe cmd/tkey-ssh-agent-tray/rsrc_windows_amd64.syso \
runtimer runrandom cmd/runrandom/app.bin
$(MAKE) -C apps clean
tkey-ssh-agent-tray.exe cmd/tkey-ssh-agent-tray/rsrc_windows_amd64.syso

.PHONY: lint
lint:
Expand Down
65 changes: 22 additions & 43 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,49 +1,27 @@

[![ci](https://github.com/tillitis/tillitis-key1-apps/actions/workflows/ci.yaml/badge.svg?branch=main&event=push)](https://github.com/tillitis/tillitis-key1-apps/actions/workflows/ci.yaml)

# Tillitis TKey Apps

This repository contains some applications for the
[Tillitis](https://tillitis.se/) TKey USB security stick.

Client apps:

- `tkey-ssh-agent`: An OpenSSH compatible agent.
- `runtimer`: Control the `timer` device app.

Device apps:

- `rng_stream`: Outputs high quality random numbers directly. You can
`cat` directly from the TKey device but see also
[tkey-random-generator](https://github.com/tillitis/tkey-random-generator)
for something more polished.
- `blink`: A minimalistic example in assembly.
- `nx`: Test program for the execution monitor.
- `timer`: Example/test app on how to use the hardware timer.
- `touch`: Example/test app for the touch sensor. Cycles between
colours when touching.

See the [TKey Developer Handbook](https://dev.tillitis.se/) for how to
develop your own apps, how to run and debug them in the emulator or on
real hardware.

[Current list of known projects](https://dev.tillitis.se/projects/).

Go packages used with the client apps reside in their own
repositories:
# TKey SSH Agent

- https://github.com/tillitis/tkeyclient [Go doc](https://pkg.go.dev/github.com/tillitis/tkeyclient)
- https://github.com/tillitis/tkeysign [Go doc](https://pkg.go.dev/github.com/tillitis/tkeysign)
This repository contains the `tkey-ssh-agent`, an OpenSSH-compatible
agent for use with the [Tillitis](https://tillitis.se/) TKey USB
security token.

Note that development is ongoing. For example, changes might be made
to [the signer device
app](https://github.com/tillitis/tkey-device-signer), causing the
public/private key it provides to change. To avoid unexpected changes
please use a tagged release.


See [Release notes](docs/release_notes.md).

## Developing

See the [TKey Developer Handbook](https://dev.tillitis.se/) for how to
develop your own TKey apps, how to run and debug them in the emulator
or on real hardware.

[Current list of known projects](https://dev.tillitis.se/projects/).

## Building

You have two options, either our OCI image
Expand Down Expand Up @@ -110,11 +88,11 @@ is not the expected binary.

This client app is a complete, alternative SSH agent with practical
use. The needed signer device app binary gets built into the
tkey-ssh-agent, which will load it onto USB stick when started. Like
the other client apps, tkey-ssh-agent tries to auto-detect serial
ports of TKey USB sticks. If more than one is found, or if you're
running on QEMU, then you'll need to use the `--port` flag. An example
of that:
tkey-ssh-agent, which will load it onto USB stick when started.

`tkey-ssh-agent` tries to auto-detect the TKey. If more than one is
found, or if you're running on QEMU, then you'll need to use the
`--port` flag:

```
$ ./tkey-ssh-agent -a ./agent.sock --port /dev/pts/1
Expand All @@ -124,10 +102,10 @@ This will start the SSH agent and tell it to listen on the specified
socket `./agent.sock`.

It will also output the SSH ed25519 public key for this instance of
the app on this specific TKey USB stick. So again; if the signer app
binary, the USS, or the UDS in the physical USB stick change, then the
private key will also change -- and thus the derived public key, your
public identity in the world of SSH.
the app on this specific TKey USB stick.

**Nota bene**: If the signer app binary, the USS, or the UDS in the
physical USB stick change your key pair will change.

If you copy-paste the public key into your `~/.ssh/authorized_keys`
you can try to log onto your local computer (if sshd is running
Expand Down Expand Up @@ -274,3 +252,4 @@ the SPDX License List at:
https://spdx.org/licenses/

All contributors must adhere to the [Developer Certificate of Origin](dco.md).

78 changes: 0 additions & 78 deletions apps/Makefile

This file was deleted.

19 changes: 0 additions & 19 deletions apps/blink/blink.S

This file was deleted.

77 changes: 0 additions & 77 deletions apps/nx/main.c

This file was deleted.

Loading