forked from MicrochipTech/cryptoauth-openssl-engine
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcmd_openssl
69 lines (58 loc) · 1.34 KB
/
cmd_openssl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#!/bin/bash
set -e
set -x
GDB=
if [ $# -gt 0 ]; then
if [ $1 = "gdb" ]; then
GDB="gdb --args "
shift 1
ARGS="$@"
else
ARGS=$*
fi
fi
#echo "GDB: ${GDB}"
#echo "ARGS: ${ARGS}"
#exit 0
function upfind() {
dir=`pwd`
while [ "$dir" != "/" ]; do
p=`find "$dir" -maxdepth 1 -name $1`
if [ ! -z $p ]; then
echo "$dir"
return
fi
dir=`dirname "$dir"`
done
}
BASEDIR="$(upfind .git)"
# These moved to Makefile, install_openssl target
#rm -f ${BASEDIR}/install_dir/install_dir/openssl.cnf
#ln -s ${BASEDIR}/openssl.cnf ${BASEDIR}/install_dir/install_dir/openssl.cnf
#Debug
#/usr/bin/openssl ${ARGS}
#exit 0
#Works with client/server test application
#n${GDB} ${BASEDIR}/install_dir/bin/openssl ${ARGS}
ARCH=`arch`
if [ ${ARCH} != "armv7l" ]; then
LD_PRELOAD=/lib/x86_64-linux-gnu/libpthread.so.0 ${GDB} ${BASEDIR}/install_dir/bin/openssl ${ARGS}
else
LD_PRELOAD=/lib/arm-linux-gnueabihf/libpthread.so.0 ${GDB} ${BASEDIR}/install_dir/bin/openssl ${ARGS}
fi
exit 0
### NOT REACHED ###
# Debug
${BASEDIR}/install_dir/bin/openssl \
engine ateccx08 \
${ARGS}
exit 0
# Command line engine configure, not from openssl.cnf
${BASEDIR}/install_dir/bin/openssl \
engine dynamic \
-pre SO_PATH:${BASEDIR}/ecc-crypto/ecc-crypto.so \
-pre ID:ateccx08 \
-pre LIST_ADD:1 \
-pre LOAD \
; \
${ARGS}