mirror of
https://github.com/polhenarejos/pico-hsm.git
synced 2026-01-17 01:18:06 +00:00
Check Pico HSM PCSC connectivity.
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
This commit is contained in:
parent
78cbe59e64
commit
a7770a7e57
1 changed files with 15 additions and 9 deletions
|
|
@ -1,7 +1,12 @@
|
|||
#!/bin/bash
|
||||
|
||||
OK="\033[32mok\033[0m"
|
||||
FAIL="\033[31mfail\033[0m"
|
||||
OK="\t\033[32mok\033[0m"
|
||||
FAIL="\t\033[31mfail\033[0m"
|
||||
|
||||
fail() {
|
||||
echo -e "${FAIL}"
|
||||
exit 1
|
||||
}
|
||||
|
||||
echo -n "Start PCSC..."
|
||||
/usr/sbin/pcscd &
|
||||
|
|
@ -13,9 +18,10 @@ sleep 2
|
|||
rm -f memory.flash
|
||||
tar -xf tests/memory.tar.gz
|
||||
echo -n "Start Pico HSM..."
|
||||
./build_in_docker/pico_hsm &
|
||||
test $? -eq 0 && echo -e "${OK}" || {
|
||||
echo -e "${FAIL}"
|
||||
exit 1
|
||||
}
|
||||
/pico_hsm > /dev/null 2>&1 &
|
||||
test $? -eq 0 && echo -n "." || fail
|
||||
sleep 2
|
||||
ATR="3b:fe:18:00:00:81:31:fe:45:80:31:81:54:48:53:4d:31:73:80:21:40:81:07:fa"
|
||||
e=$(opensc-tool -an 2>&1)
|
||||
grep -q "${ATR}" <<< $e && echo -n "." || fail
|
||||
test $? -eq 0 && echo -e "${OK}" || fail
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue