Use central variable to define system PKCS library location

Signed-off-by: Timothy Pearson <kb9vqf@pearsoncomputing.net>
pull/3/head
Timothy Pearson 4 years ago
parent ef2c98aa2b
commit 6c785628a1

@ -21,6 +21,9 @@
#
# Updated by Timothy Pearson <kb9vqf@pearsoncomputing.net> 9/15/2015
# Rewrite to use on-card RSA encryption
#
# Updated by Timothy Pearson <kb9vqf@pearsoncomputing.net> 6/02/2020
# Use central variable for PKCS library location
# define counter-intuitive shell logic values (based on /bin/true & /bin/false)
TRUE=0
@ -37,6 +40,9 @@ fi
# Find plymouth
PLYDIR=/bin/plymouth
# Set system PKCS library path
SYSTEM_PKCS_LIBRARY=/usr/lib/opensc-pkcs11.so
# print message to usplash or stderr
# usage: msg <command> "message" [switch]
# command: TEXT | STATUS | SUCCESS | FAILURE | CLEAR (see 'man usplash_write' for all commands)
@ -143,14 +149,14 @@ if [ $LUKS_KEY_COUNT -gt 0 ]; then
rm -f /tmp/kmsg
fi
PIN=$(cardpincheck /usr/lib/opensc-pkcs11.so)
PIN=$(cardpincheck $SYSTEM_PKCS_LIBRARY)
RET=$?
if [ $RET -eq 0 ]; then
# PIN valid
msg "SmartCard unlocked"
for KEYFILE in ${LUKS_KEY_DIR}/${DISK_UUID}_slot*; do
# Try decrypting
echo "$PIN" | cardpincheck /usr/lib/opensc-pkcs11.so $KEYFILE 2> /dev/null
echo "$PIN" | cardpincheck $SYSTEM_PKCS_LIBRARY $KEYFILE 2> /dev/null
RET=$?
if [ $RET -eq 0 ]; then
OPENED=$TRUE

Loading…
Cancel
Save