Skip to content

Commit

Permalink
first commit
Browse files Browse the repository at this point in the history
  • Loading branch information
conorpp committed May 17, 2019
1 parent f55d18b commit 5bf5a3e
Show file tree
Hide file tree
Showing 9 changed files with 655 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
Expand Down Expand Up @@ -102,3 +103,7 @@ venv.bak/

# mypy
.mypy_cache/


main
*.o
16 changes: 16 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@


SRC := src/main.c src/util.c pc/device.c
INC := -I. -Ipc/ -Isrc/

OBJ=$(SRC:.c=.o)

CFLAGS=-O2 $(INC)

TARGET=main

all: $(OBJ)
$(CC) -o main $(OBJ)

clean:
rm -rf $(OBJ) $(TARGET)
61 changes: 61 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
This repository contains a portable implementation for OpenPGP and will be
able to run on PC for testing and development, and can run on Solo.

# Requirements

This should run fine on Linux, OS X, or Ubuntu on Windows.

# Set up

Clone Gnuk to get their testing suite. Note, there are symlinks in the repo, so
make sure you clone using a \*nix environment!

```
git clone https://salsa.debian.org/gnuk-team/gnuk/gnuk
```

Install Python test tools to run Gnuk tests.

```
sudo apt install python3-pytest python3-usb python3-cffi
```

Replace the normal card reader class, with our testing class to connect
the CCID/OpenPGP application over UDP to our local application.

```
cp card_reader.py gnuk/tests/card_reader.py
```

Build our `CCID/OpenPGP` application

```
make
```

# Running

In one terminal, run our `CCID/OpenPGP` application.

```
./main
```

In another terminal, run the Gnuk test suite.

```
cd gnuk/tests && py.test-3 -x
```

# Progress

Currently, no CCID or OpenPGP functionality is implemented. If the application
is run with tests, you will see the tests fail and the application output this.

```
Hello CCID/OpenPGP
Init CCID
>> 6f 0b 00 00 00 00 00 00 00 00 00 a4 04 00 06 d2 76 00 01 24 01
```

These `6f 0b 00 00 00 00 00 00 00 00 00 a4 04 00 06 d2 76 00 01 24 01` bytes come from `card.cmd_select_openpgp()` in the tests.
Loading

0 comments on commit 5bf5a3e

Please sign in to comment.