forked from openwrt/openwrt
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
wolfssl: add libwolfssl-cpu-crypto package
libwolfssl-cpu-crypto is a variant of libwolfssl with support for cryptographic CPU instructions on x86_64 and aarch64. On aarch64, wolfSSL does not perform run-time detection, so the library will crash when the AES functions are called. A preinst script attempts to check for support by querying /proc/cpuinfo, if installed in a running system. When building an image, the script will check the DISTRIB_TARGET value in /etc/openwrt_release, and will abort installation if target is bcm27xx. Signed-off-by: Eneas U de Queiroz <cotequeiroz@gmail.com>
- Loading branch information
1 parent
94129cb
commit c3e7d86
Showing
3 changed files
with
98 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#!/bin/sh | ||
exec >&2 | ||
printf "[libwolfssl-cpu-crypto] Checking for Arm v8-A Cryptographic Extension support: " | ||
if [ -n "${IPKG_INSTROOT}" ]; then | ||
printf "...[offline]... " | ||
eval "$(grep '^DISTRIB_TARGET=' "${IPKG_INSTROOT}/etc/openwrt_release")" | ||
### @@WOLFSSL_NOASM_REGEX@@ is expanded from WOLFSSL_NOASM_REGEX in the Makefile | ||
echo "${DISTRIB_TARGET}" | grep '@@WOLFSSL_NOASM_REGEX@@' > /dev/null && { | ||
echo "not supported" | ||
echo "Error: Target ${DISTRIB_TARGET} does not support Arm Cryptographic Extension." | ||
echo "Install the regular libwolfssl package instead of libwolfssl-cpu-crypto." | ||
exit 1 | ||
} | ||
else | ||
grep -q '^Features.*\baes\b' /proc/cpuinfo || { | ||
echo "not supported" | ||
echo "Error: Arm v8-A Cryptographic Extension not supported." | ||
echo "Install the regular libwolfssl package instead of libwolfssl-cpu-crypto." | ||
echo "Contents of /proc/cpuinfo:" | ||
cat /proc/cpuinfo | ||
exit 1 | ||
} | ||
fi | ||
echo OK | ||
exit 0 |