Skip to content

Commit 8a34d73

Browse files
committed
chore(openssl): Include legacy providers for GlobalPlatform crypto
GlobalPlatform crypto needs the legacy providers. While it will potentially work OOTB with android since we're using dynamic linking, for IOS we need to compile with `no-module`. This will bundle the providers in the lib.
1 parent c3095fc commit 8a34d73

File tree

1 file changed

+24
-1
lines changed

1 file changed

+24
-1
lines changed

mobile/scripts/ios/buildOpenSSL.sh

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,30 @@ mkdir -p ${SSL_BUILD_DIR}
5656

5757
(
5858
cd ${SSL_BUILD_DIR}
59-
${OPENSSL}/Configure --release "$TARGET" $PLATFORM_CONFIG_ARGS
59+
60+
# - no-module: Makes legacy provider built-in to libcrypto (not a separate module)
61+
# - enable-legacy: Enables legacy algorithms including DES
62+
# This is required for GlobalPlatform SCP02 which uses single-DES
63+
# Reference: https://github.com/openssl/openssl/discussions/25793
64+
65+
# Platform-specific config
66+
if [[ "$OS" == "ios" ]]; then
67+
# iOS uses static libraries (.a files)
68+
SHARED_FLAG="no-shared"
69+
else
70+
# Android uses shared libraries (.so files)
71+
SHARED_FLAG="shared"
72+
fi
73+
74+
${OPENSSL}/Configure --release "$TARGET" $PLATFORM_CONFIG_ARGS \
75+
no-module \
76+
enable-legacy \
77+
enable-des \
78+
enable-md2 \
79+
enable-rc5 \
80+
$SHARED_FLAG \
81+
no-tests \
82+
no-ui-console
6083
# Rebuilding isn't working with the default target, so we need to clean and build again
6184
make clean
6285
make -j$(sysctl -n hw.ncpu) $PLATFORM_BUILD_ARGS build_libs

0 commit comments

Comments
 (0)