20 lines
1.0 KiB
Bash
Executable File
20 lines
1.0 KiB
Bash
Executable File
#!/bin/bash
|
||
# 复现宿主 + MIPS 版 HTTPS/加密 demo 与 RSA raw 校验。
|
||
# 依赖:先运行 build_mbedtls.sh(产出 out/mbedtls/{host,mipsel}/*.a)。
|
||
# 宿主 = 本机(此工作区为 aarch64);MIPS = qemu-mipsel 可跑(静态链)。
|
||
. ./libs_common.sh
|
||
|
||
INC="-I$VENDOR/mbedtls/include -I$VENDOR/jsmn"
|
||
HOST_LIBS="-L$OUT/mbedtls/host -lmbedtls -lmbedx509 -lmbedcrypto"
|
||
MIPS_LIBS="$OUT/mbedtls/mipsel/libmbedtls.a $OUT/mbedtls/mipsel/libmbedx509.a $OUT/mbedtls/mipsel/libmbedcrypto.a"
|
||
|
||
echo "==> host https_unikey"
|
||
$CC_HOST -O2 $INC demo/https_unikey.c $HOST_LIBS -o demo/https_unikey -lpthread -lm \
|
||
&& echo " built demo/https_unikey" \
|
||
&& { [ -f /etc/ssl/certs/ca-certificates.crt ] && timeout 45 ./demo/https_unikey | tail -4; }
|
||
|
||
echo "==> mipsel https_unikey (静态)"
|
||
$CC_MIPS -O2 -static -Wl,--gc-sections $INC demo/https_unikey.c $MIPS_LIBS -o out/https_unikey_mipsel -lpthread -lm \
|
||
&& echo " built out/https_unikey_mipsel" && size out/https_unikey_mipsel \
|
||
&& timeout 90 qemu-mipsel ./out/https_unikey_mipsel | tail -4
|