Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Code import into new repository (long overdue)
- Loading branch information
0 parents
commit bc85b80
Showing
40 changed files
with
22,127 additions
and
0 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
# Hardpass Prototype, v.1 | ||
A Raspberry Pi Zero based WiFi Enabled Hardware Password Manager | ||
|
||
## Currently Implemented: | ||
- OLED (demo) | ||
- USB Gadgets (full) | ||
- USB HID send keys progam | ||
|
||
## TODO | ||
- OLED: Menu program | ||
- WiFi: compile & install driver | ||
- Button Matrix (same program as OLED) | ||
|
||
## Install ESP driver | ||
If you want to use the ESP8266 on the SDIO pins of the Pi, download and install the driver from Andrew Litt. | ||
```sh | ||
# on the pi: | ||
git clone https://github.com/al177/esp8089.git | ||
make && sudo make install | ||
``` | ||
|
||
## In this repository | ||
This repository contains: | ||
* USB HID progam `scan` with examples in `./send_hid` | ||
* OLED menu system in `./oled`, using the `ArduiPi_OLED` driver from http://hallard.me | ||
* Patcher and installer for `pass` in `./pass` | ||
* KiCAD schematic and PCB layout in `./kicad` | ||
|
||
|
||
## Setting up | ||
To automatically load necessary kernel modules for the OLED on boot, run as root on the Pi: | ||
```sh | ||
echo "i2c-dev">>/etc/modules | ||
echo "dwc2">>/etc/modules | ||
``` | ||
|
||
A small systemd unit file is included; place it in `/etc/systemd/system/` and modify it, so it points to `init_usb.sh`, which you can also modify to your needs. | ||
|
||
## License | ||
I hereby release my work under the GNU GPLv3 where applicable. The complete license text, if not included, can be read at `https://www.gnu.org/licenses/gpl-3.0.txt`. Where the GPLv3 isn't applicable, the work is released under the Creative Commons Attribution-ShareAlike 4.0 International. | ||
This repository also includes the ArduiPi_OLED library from [hallard](https://github.com/hallard); see [this website](http://hallard.me/adafruit-oled-display-driver-for-pi/) for details. | ||
and the kicad-ESP8266 library from [jdunmire](https://github.com/jdunmire/kicad-ESP8266), which is released under the Creative Commons Attribution-ShareAlike 4.0 International License. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
[Unit] | ||
Description=Hardpass Initialisation | ||
DefaultDependencies=true | ||
|
||
[Service] | ||
Type=simple | ||
ExecStart=/home/pi/hardpass/init_usb.sh | ||
WordkingDirectory=/home/pi/ | ||
|
||
[Install] | ||
WantedBy=local-fs.target |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
#!/bin/bash | ||
# this file is from: https://github.com/ckuethe/usbarmory/wiki/USB-Gadgets | ||
echo "creating composite mass-storage, serial, ethernet, hid..." | ||
modprobe libcomposite | ||
|
||
# assumes a disk image exists here... | ||
FILE=/home/pi/hardpass/usbdisk.img | ||
mkdir -p ${FILE/img/d} | ||
mount -o loop,ro,offset=2048 -t vfat $FILE ${FILE/img/d} | ||
cd /sys/kernel/config/usb_gadget/ | ||
|
||
mkdir -p g1 | ||
cd g1 | ||
#echo '' > UDC | ||
|
||
echo 0x1d6b > idVendor # Linux Foundation | ||
echo 0x0104 > idProduct # Multifunction Composite Gadget | ||
echo 0x0100 > bcdDevice # v1.0.0 | ||
echo 0x0200 > bcdUSB # USB2 | ||
|
||
mkdir -p strings/0x409 | ||
echo "fedcba9876543210" > strings/0x409/serialnumber | ||
echo "girst" > strings/0x409/manufacturer | ||
echo "Hardpass" > strings/0x409/product | ||
|
||
N="usb0" | ||
mkdir -p functions/acm.$N | ||
mkdir -p functions/ecm.$N | ||
mkdir -p functions/hid.$N | ||
mkdir -p functions/mass_storage.$N | ||
|
||
# first byte of address must be even | ||
HOST="48:6f:73:74:50:43" # "HostPC" | ||
SELF="42:61:64:55:53:42" # "BadUSB" | ||
echo $HOST > functions/ecm.$N/host_addr | ||
echo $SELF > functions/ecm.$N/dev_addr | ||
|
||
echo 1 > functions/mass_storage.$N/stall | ||
echo 0 > functions/mass_storage.$N/lun.0/cdrom | ||
echo 0 > functions/mass_storage.$N/lun.0/ro | ||
echo 0 > functions/mass_storage.$N/lun.0/nofua | ||
echo $FILE > functions/mass_storage.$N/lun.0/file | ||
|
||
echo 1 > functions/hid.usb0/protocol | ||
echo 1 > functions/hid.usb0/subclass | ||
echo 8 > functions/hid.usb0/report_length | ||
echo -ne \\x05\\x01\\x09\\x06\\xa1\\x01\\x05\\x07\\x19\\xe0\\x29\\xe7\\x15\\x00\\x25\\x01\\x75\\x01\\x95\\x08\\x81\\x02\\x95\\x01\\x75\\x08\\x81\\x03\\x95\\x05\\x75\\x01\\x05\\x08\\x19\\x01\\x29\\x05\\x91\\x02\\x95\\x01\\x75\\x03\\x91\\x03\\x95\\x06\\x75\\x08\\x15\\x00\\x25\\x65\\x05\\x07\\x19\\x00\\x29\\x65\\x81\\x00\\xc0 > functions/hid.usb0/report_desc | ||
|
||
|
||
C=1 | ||
mkdir -p configs/c.$C/strings/0x409 | ||
echo "Config $C: ECM network" > configs/c.$C/strings/0x409/configuration | ||
echo 250 > configs/c.$C/MaxPower | ||
ln -s functions/acm.$N configs/c.$C/ | ||
ln -s functions/ecm.$N configs/c.$C/ | ||
ln -s functions/mass_storage.$N configs/c.$C/ | ||
ln -s functions/hid.$N configs/c.$C/ | ||
|
||
# this lists available UDC drivers | ||
ls /sys/class/udc > UDC | ||
|
||
ifconfig $N 10.0.0.1 netmask 255.255.255.252 up | ||
route add -net default gw 10.0.0.2 | ||
echo "done. " | ||
#echo "initializing demo menu..." | ||
#while 1; do | ||
# /home/pi/hardpass/oled/run.sh | ||
#done & | ||
echo "starting shutdown 'daemon'" | ||
/home/pi/hardpass/shutdown/shutdown-button.sh & |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
hardpass PCB files | ||
Copyright 2016 Tobias Girstmair, github.com/girst | ||
Released as GPLv3, with exception to the libraries included. | ||
|
||
written on KiCad 4.0.3 on Ubuntu 16.04 | ||
|
||
Included are the following Libraries: | ||
ESP-12 Footprint: | ||
https://github.com/jdunmire/kicad-ESP8266 | ||
Copyright 2015 J.Dunmire | ||
Creative Commons Attribution-ShareAlike 4.0 | ||
hardpass.pretty: | ||
(C) 2015/2016 github.com/girst | ||
CC-BY-SA | ||
My own library, slightly modifying some default parts and the ESP-12E footprint from J.Dunmire. | ||
|
||
(not included) FPC connector: | ||
https://www.snapeda.com/parts/XF2M-2015-1A-R100/Omron/view-part/ | ||
CC-BY-SA w/ Design Exclusion | ||
This is probably a good connector, but I haven't tried it yet. | ||
|
||
There are TWO PCB designs included: | ||
To use the default one without the ESP12E, keep the naming as it is. | ||
To use the one with the ESP12E footprint, rename hardpass-esp12e.kicad_pcb to hardpass-pcb.kicad_pcb | ||
|
||
To the best of my knowledge, nothing but the above listed material in this folder is copyrighted. If your work has been included against the term of its license, please contact me through the github issue tracker at http://github.com/girst/<NAME-OF-PROJECT>/issues. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
** Drc report for /home/tobias/Documents/kicad/hardpass-pcb/hardpass-pcb.kicad_pcb ** | ||
** Created on 2016-08-20 16:13:17 ** | ||
|
||
** Found 1 DRC errors ** | ||
ErrType(4): Track near pad | ||
@ (128,750 mm,131,000 mm): Via 0,600 mm net [OLED_SCL] (5) on layers F.Cu/B.Cu | ||
@ (131,000 mm,131,550 mm): Pad 6 on B.Cu, Non-copper of U2 | ||
|
||
** Found 15 unconnected pads ** | ||
ErrType(2): Unconnected pads | ||
@ (127,270 mm,136,130 mm): Pad 1 on B.Cu, Non-copper of P1 net +3V3 | ||
@ (131,000 mm,127,550 mm): Pad 8 on B.Cu, Non-copper of U2 | ||
ErrType(2): Unconnected pads | ||
@ (127,270 mm,128,510 mm): Pad 7 on B.Cu, Non-copper of P1 net ESP_CHPD | ||
@ (131,000 mm,137,550 mm): Pad 3 on B.Cu, Non-copper of U2 | ||
ErrType(2): Unconnected pads | ||
@ (127,270 mm,120,890 mm): Pad 13 on B.Cu, Non-copper of P1 net SD_D3 | ||
@ (173,875 mm,78,425 mm): Pad 2 on B.Cu, Non-copper of R15 | ||
ErrType(2): Unconnected pads | ||
@ (127,270 mm,118,350 mm): Pad 15 on B.Cu, Non-copper of P1 net ESP_CLK | ||
@ (178,875 mm,78,425 mm): Pad 2 on B.Cu, Non-copper of R17 | ||
ErrType(2): Unconnected pads | ||
@ (166,375 mm,78,425 mm): Pad 2 on B.Cu, Non-copper of R12 net SD_CMD | ||
@ (124,730 mm,118,350 mm): Pad 16 on B.Cu, Non-copper of P1 | ||
ErrType(2): Unconnected pads | ||
@ (124,730 mm,115,810 mm): Pad 18 on B.Cu, Non-copper of P1 net SD_D0 | ||
@ (168,875 mm,78,425 mm): Pad 2 on B.Cu, Non-copper of R13 | ||
ErrType(2): Unconnected pads | ||
@ (176,375 mm,78,425 mm): Pad 2 on B.Cu, Non-copper of R16 net SD_D1 | ||
@ (124,730 mm,110,730 mm): Pad 22 on B.Cu, Non-copper of P1 | ||
ErrType(2): Unconnected pads | ||
@ (127,270 mm,90,410 mm): Pad 37 on B.Cu, Non-copper of P1 net SD_D2 | ||
@ (171,375 mm,78,425 mm): Pad 2 on B.Cu, Non-copper of R14 | ||
ErrType(2): Unconnected pads | ||
@ (151,575 mm,137,450 mm): Pad 2 on F.Cu, Non-copper of SW12 net ROW_4 | ||
@ (143,625 mm,137,450 mm): Pad 2 on F.Cu, Non-copper of SW12 | ||
ErrType(2): Unconnected pads | ||
@ (132,990 mm,125,800 mm): Pad 9 on B.Cu, Non-copper of U2 net Net-(R12-Pad1) | ||
@ (166,375 mm,81,325 mm): Pad 1 on B.Cu, Non-copper of R12 | ||
ErrType(2): Unconnected pads | ||
@ (168,875 mm,81,325 mm): Pad 1 on B.Cu, Non-copper of R13 net Net-(R13-Pad1) | ||
@ (134,990 mm,125,800 mm): Pad 10 on B.Cu, Non-copper of U2 | ||
ErrType(2): Unconnected pads | ||
@ (171,375 mm,81,325 mm): Pad 1 on B.Cu, Non-copper of R14 net Net-(R14-Pad1) | ||
@ (136,990 mm,125,800 mm): Pad 11 on B.Cu, Non-copper of U2 | ||
ErrType(2): Unconnected pads | ||
@ (173,875 mm,81,325 mm): Pad 1 on B.Cu, Non-copper of R15 net Net-(R15-Pad1) | ||
@ (138,990 mm,125,800 mm): Pad 12 on B.Cu, Non-copper of U2 | ||
ErrType(2): Unconnected pads | ||
@ (176,375 mm,81,325 mm): Pad 1 on B.Cu, Non-copper of R16 net Net-(R16-Pad1) | ||
@ (140,990 mm,125,800 mm): Pad 13 on B.Cu, Non-copper of U2 | ||
ErrType(2): Unconnected pads | ||
@ (178,875 mm,81,325 mm): Pad 1 on B.Cu, Non-copper of R17 net Net-(R17-Pad1) | ||
@ (142,990 mm,125,800 mm): Pad 14 on B.Cu, Non-copper of U2 | ||
|
||
** End of Report ** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
** Drc report for /home/tobias/Documents/kicad/hardpass-pcb/hardpass-pcb.kicad_pcb ** | ||
** Created on 2016-08-20 16:14:00 ** | ||
|
||
** Found 0 DRC errors ** | ||
|
||
** Found 15 unconnected pads ** | ||
ErrType(2): Unconnected pads | ||
@ (127,270 mm,136,130 mm): Pad 1 on B.Cu, Non-copper of P1 net +3V3 | ||
@ (131,000 mm,127,550 mm): Pad 8 on B.Cu, Non-copper of U2 | ||
ErrType(2): Unconnected pads | ||
@ (127,270 mm,128,510 mm): Pad 7 on B.Cu, Non-copper of P1 net ESP_CHPD | ||
@ (131,000 mm,137,550 mm): Pad 3 on B.Cu, Non-copper of U2 | ||
ErrType(2): Unconnected pads | ||
@ (127,270 mm,120,890 mm): Pad 13 on B.Cu, Non-copper of P1 net SD_D3 | ||
@ (173,875 mm,78,425 mm): Pad 2 on B.Cu, Non-copper of R15 | ||
ErrType(2): Unconnected pads | ||
@ (127,270 mm,118,350 mm): Pad 15 on B.Cu, Non-copper of P1 net ESP_CLK | ||
@ (178,875 mm,78,425 mm): Pad 2 on B.Cu, Non-copper of R17 | ||
ErrType(2): Unconnected pads | ||
@ (166,375 mm,78,425 mm): Pad 2 on B.Cu, Non-copper of R12 net SD_CMD | ||
@ (124,730 mm,118,350 mm): Pad 16 on B.Cu, Non-copper of P1 | ||
ErrType(2): Unconnected pads | ||
@ (124,730 mm,115,810 mm): Pad 18 on B.Cu, Non-copper of P1 net SD_D0 | ||
@ (168,875 mm,78,425 mm): Pad 2 on B.Cu, Non-copper of R13 | ||
ErrType(2): Unconnected pads | ||
@ (176,375 mm,78,425 mm): Pad 2 on B.Cu, Non-copper of R16 net SD_D1 | ||
@ (124,730 mm,110,730 mm): Pad 22 on B.Cu, Non-copper of P1 | ||
ErrType(2): Unconnected pads | ||
@ (127,270 mm,90,410 mm): Pad 37 on B.Cu, Non-copper of P1 net SD_D2 | ||
@ (171,375 mm,78,425 mm): Pad 2 on B.Cu, Non-copper of R14 | ||
ErrType(2): Unconnected pads | ||
@ (151,575 mm,137,450 mm): Pad 2 on F.Cu, Non-copper of SW12 net ROW_4 | ||
@ (143,625 mm,137,450 mm): Pad 2 on F.Cu, Non-copper of SW12 | ||
ErrType(2): Unconnected pads | ||
@ (132,990 mm,125,800 mm): Pad 9 on B.Cu, Non-copper of U2 net Net-(R12-Pad1) | ||
@ (166,375 mm,81,325 mm): Pad 1 on B.Cu, Non-copper of R12 | ||
ErrType(2): Unconnected pads | ||
@ (168,875 mm,81,325 mm): Pad 1 on B.Cu, Non-copper of R13 net Net-(R13-Pad1) | ||
@ (134,990 mm,125,800 mm): Pad 10 on B.Cu, Non-copper of U2 | ||
ErrType(2): Unconnected pads | ||
@ (171,375 mm,81,325 mm): Pad 1 on B.Cu, Non-copper of R14 net Net-(R14-Pad1) | ||
@ (136,990 mm,125,800 mm): Pad 11 on B.Cu, Non-copper of U2 | ||
ErrType(2): Unconnected pads | ||
@ (173,875 mm,81,325 mm): Pad 1 on B.Cu, Non-copper of R15 net Net-(R15-Pad1) | ||
@ (138,990 mm,125,800 mm): Pad 12 on B.Cu, Non-copper of U2 | ||
ErrType(2): Unconnected pads | ||
@ (176,375 mm,81,325 mm): Pad 1 on B.Cu, Non-copper of R16 net Net-(R16-Pad1) | ||
@ (140,990 mm,125,800 mm): Pad 13 on B.Cu, Non-copper of U2 | ||
ErrType(2): Unconnected pads | ||
@ (178,875 mm,81,325 mm): Pad 1 on B.Cu, Non-copper of R17 net Net-(R17-Pad1) | ||
@ (142,990 mm,125,800 mm): Pad 14 on B.Cu, Non-copper of U2 | ||
|
||
** End of Report ** |
Oops, something went wrong.