mirror of
https://github.com/trezor/trezor-firmware.git
synced 2025-01-18 11:21:11 +00:00
add set -e to shell scripts
This commit is contained in:
parent
fdbae0b0e0
commit
3ce756b692
@ -1,4 +1,6 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
IMAGETAG=trezor-mcu-build
|
||||
FIRMWARETAG=${1:-master}
|
||||
|
||||
|
@ -1,4 +1,6 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
IMAGETAG=trezor-mcu-build
|
||||
FIRMWARETAG=${1:-master}
|
||||
|
||||
|
@ -1,4 +1,5 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
if [ -z "$1" ]; then
|
||||
echo "Please provide filename as argument"
|
||||
|
9
firmware/u2f/genkeys.sh
Normal file → Executable file
9
firmware/u2f/genkeys.sh
Normal file → Executable file
@ -1,4 +1,5 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
cat > u2f_keys.h <<EOF
|
||||
#ifndef __U2F_KEYS_H_INCLUDED__
|
||||
@ -13,13 +14,13 @@ if [ \! -e trezordevkey.pem ]; then
|
||||
openssl ecparam -genkey -out trezordevkey.pem -name prime256v1
|
||||
fi
|
||||
openssl ec -in trezordevkey.pem -text |
|
||||
perl -e '$key = "\t"; while (<>) {
|
||||
perl -e '$key = "\t"; while (<>) {
|
||||
if (/priv:/) { $priv = 1 }
|
||||
elsif (/pub:/) { $priv = 0 }
|
||||
elsif ($priv) {
|
||||
while ($_ =~ s/.*?([0-9a-f]{2})//) {
|
||||
$key .= "0x$1,";
|
||||
if ($num++ % 8 == 7) { $key .= "\n\t"; }
|
||||
$key .= "0x$1,";
|
||||
if ($num++ % 8 == 7) { $key .= "\n\t"; }
|
||||
else {$key .= " ";}
|
||||
}
|
||||
}
|
||||
@ -32,7 +33,7 @@ cat >> u2f_keys.h <<EOF
|
||||
const uint8_t U2F_ATT_CERT[] = {
|
||||
EOF
|
||||
|
||||
openssl req -new -key trezordevkey.pem -out trezordevcert.req -subj "/CN=Trezor U2F"
|
||||
openssl req -new -key trezordevkey.pem -out trezordevcert.req -subj "/CN=Trezor U2F"
|
||||
openssl x509 -req -in trezordevcert.req -signkey trezordevkey.pem -days 3650 -out trezordevcert.pem
|
||||
openssl x509 -in trezordevcert.pem -outform der | od -tx1 -w12 -Anone | perl -pe 's/ ([0-9a-f]{2})/ 0x$1,/g; $_ =~ s/^ /\t/;' >> u2f_keys.h
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user