kopia lustrzana https://github.com/conorpp/u2f-zero
some cleanup/fixes
rodzic
8182c28ca3
commit
6d6c0d2d1d
|
@ -15,6 +15,9 @@ pub=$2
|
|||
cert=$3
|
||||
|
||||
hex2pubkey $pub pubkey.pem
|
||||
[[ "$?" -ne "0" ]] && exit 1
|
||||
signcert $key pubkey.pem $cert
|
||||
[[ "$?" -ne "0" ]] && exit 1
|
||||
cbytes.py $cert
|
||||
[[ "$?" -ne "0" ]] && exit 1
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#!/bin/bash
|
||||
|
||||
SETUP_HEX=../firmware/release/SETUP.hex
|
||||
SETUP_HEX=../firmware/SETUP.hex
|
||||
FINAL_HEX=../firmware/release/u2f-firmware.hex
|
||||
|
||||
if [[ $# != "1" ]]
|
||||
|
@ -13,19 +13,24 @@ fi
|
|||
|
||||
export PATH=$PATH:gencert:u2f_zero_client:flashing
|
||||
|
||||
# setup atecc
|
||||
echo "erasing..."
|
||||
erase.sh
|
||||
if [[ "$(python -c 'import os,sys; sys.stdout.write(os.name)')" == "nt" ]]
|
||||
then
|
||||
|
||||
while [[ "$?" -ne "0" ]] ; do
|
||||
# setup atecc
|
||||
echo "erasing..."
|
||||
erase.sh
|
||||
|
||||
while [[ "$?" -ne "0" ]] ; do
|
||||
sleep .1
|
||||
erase.sh
|
||||
done
|
||||
done
|
||||
|
||||
echo "programming setup..."
|
||||
program.sh $SETUP_HEX
|
||||
echo "programming setup..."
|
||||
program.sh $SETUP_HEX
|
||||
|
||||
[[ "$?" -ne "0" ]] && exit 1
|
||||
[[ "$?" -ne "0" ]] && exit 1
|
||||
|
||||
fi
|
||||
|
||||
echo "configuring..."
|
||||
client.py configure pubkey.hex >/dev/null
|
||||
|
@ -41,6 +46,7 @@ gencert.sh "$1" "$(cat pubkey.hex)" attest.der > ../firmware/src/cert.c
|
|||
|
||||
[[ "$?" -ne "0" ]] && exit 1
|
||||
|
||||
echo "done."
|
||||
echo "building..."
|
||||
|
||||
if [[ "$(python -c 'import os,sys; sys.stdout.write(os.name)')" != "nt" ]]
|
||||
|
|
|
@ -18,9 +18,7 @@ except:
|
|||
sys.exit(1)
|
||||
|
||||
|
||||
cmd_prefix = [0xff,0xff,0xff,0xff]
|
||||
if os.name == 'ns':
|
||||
cmd_prefix.insert(0,0)
|
||||
cmd_prefix = [0, 0xff,0xff,0xff,0xff]
|
||||
|
||||
class commands:
|
||||
U2F_CONFIG_GET_SERIAL_NUM = 0x80
|
||||
|
|
Ładowanie…
Reference in New Issue