mirror of
https://github.com/polhenarejos/pico-hsm.git
synced 2026-01-17 09:28:05 +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,9 +1,14 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
OK="\033[32mok\033[0m"
|
OK="\t\033[32mok\033[0m"
|
||||||
FAIL="\033[31mfail\033[0m"
|
FAIL="\t\033[31mfail\033[0m"
|
||||||
|
|
||||||
echo -n "Start PCSC... "
|
fail() {
|
||||||
|
echo -e "${FAIL}"
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
|
||||||
|
echo -n "Start PCSC..."
|
||||||
/usr/sbin/pcscd &
|
/usr/sbin/pcscd &
|
||||||
test $? -eq 0 && echo -e "${OK}" || {
|
test $? -eq 0 && echo -e "${OK}" || {
|
||||||
echo -e "${FAIL}"
|
echo -e "${FAIL}"
|
||||||
|
|
@ -12,10 +17,11 @@ test $? -eq 0 && echo -e "${OK}" || {
|
||||||
sleep 2
|
sleep 2
|
||||||
rm -f memory.flash
|
rm -f memory.flash
|
||||||
tar -xf tests/memory.tar.gz
|
tar -xf tests/memory.tar.gz
|
||||||
echo -n "Start Pico HSM... "
|
echo -n "Start Pico HSM..."
|
||||||
./build_in_docker/pico_hsm &
|
/pico_hsm > /dev/null 2>&1 &
|
||||||
test $? -eq 0 && echo -e "${OK}" || {
|
test $? -eq 0 && echo -n "." || fail
|
||||||
echo -e "${FAIL}"
|
|
||||||
exit 1
|
|
||||||
}
|
|
||||||
sleep 2
|
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