Skip to content

Commit 96c51e3

Browse files
authored
Merge pull request #18 from bandi13/IDE-XCODE
Ide xcode
2 parents d39af6f + fc854ea commit 96c51e3

8 files changed

Lines changed: 25 additions & 25 deletions

File tree

IDE/XCODE/build-all.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ cd ${WOLFPROV_DIR}/wolfssl-source && ${XCODE_SCRIPTS_DIR}/build-wolfssl-framewor
2121

2222
cd ${WOLFPROV_DIR} && ${XCODE_SCRIPTS_DIR}/build-wolfprovider-framework.sh
2323

24-
clang ${WOLFPROV_DIR}/examples/openssl_example.c -I ${WOLFPROV_DIR}/openssl-source/artifacts/xcframework/libopenssl.xcframework/macos-arm64_x86_64/Headers -L ${WOLFPROV_DIR}/openssl-source/artifacts/xcframework/libopenssl.xcframework/macos-arm64_x86_64/ -lcrypto -o ${WOLFPROV_DIR}/artifacts/openssl_example
24+
ARCH=$(uname -m)
25+
clang ${WOLFPROV_DIR}/examples/openssl_example.c -I ${OPENSSL_SOURCE_DIR}/artifacts/openssl-install-macosx-${ARCH}/include -L ${OPENSSL_SOURCE_DIR}/artifacts/openssl-install-macosx-${ARCH}/lib -lcrypto -o ${OUTDIR}/openssl_example
2526

2627
echo "Script ran for $SECONDS seconds"

IDE/XCODE/build-openssl-framework.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ SDK_OUTPUT_DIR=${OUTDIR}/xcframework
3030
CFLAGS_COMMON=""
3131
# Base configure flags
3232
CONF_OPTS=""
33+
NUMCPU=$(sysctl -n hw.ncpu)
3334

3435
helpFunction()
3536
{
@@ -67,7 +68,7 @@ build() { # <ARCH=arm64|x86_64> <TYPE=iphonesimulator|iphoneos|macosx|watchos|wa
6768
mkdir -p ${OUTDIR}/${TYPE}-${ARCH} && cd ${OUTDIR}/${TYPE}-${ARCH}
6869

6970
CC="clang" CXX="clang" CFLAGS="${CFLAGS_COMMON} -Os -arch ${ARCH} -isysroot ${SDK_ROOT}" LDFLAGS="-arch ${ARCH} -isysroot ${SDK_ROOT}" ${WOLFSSL_DIR}/Configure no-asm ${TARGET} --prefix=${OUTDIR}/openssl-install-${TYPE}-${ARCH} ${CONF_OPTS}
70-
make -j
71+
make -j${NUMCPU}
7172
make install
7273

7374
popd

IDE/XCODE/build-wolfprovider-framework.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ build() { # <ARCH=arm64|x86_64> <TYPE=iphonesimulator|iphoneos|macosx|watchos|wa
6565
TYPE=$2
6666
SDK_ROOT=$(xcrun --sdk ${TYPE} --show-sdk-path)
6767

68-
./configure -prefix=${OUTDIR}/wolfprov-${TYPE}-${ARCH} ${CONF_OPTS} --host=${HOST} \
68+
./configure -prefix=${OUTDIR}/wolfprov-install-${TYPE}-${ARCH} ${CONF_OPTS} --host=${HOST} \
6969
--with-openssl=${WOLFPROV_DIR}/openssl-source/artifacts/openssl-install-${TYPE}-${ARCH} \
7070
--with-wolfssl=${WOLFPROV_DIR}/wolfssl-source/artifacts/wolfssl-install-${TYPE}-${ARCH} \
7171
CFLAGS="${CFLAGS_COMMON} -arch ${ARCH} -isysroot ${SDK_ROOT}" \
@@ -84,8 +84,8 @@ for type in iphonesimulator macosx ; do
8484

8585
# Create universal binaries from architecture-specific static libraries
8686
lipo \
87-
"$OUTDIR/wolfprov-${type}-x86_64/lib/libwolfprov.dylib" \
88-
"$OUTDIR/wolfprov-${type}-arm64/lib/libwolfprov.dylib" \
87+
"$OUTDIR/wolfprov-install-${type}-x86_64/lib/libwolfprov.dylib" \
88+
"$OUTDIR/wolfprov-install-${type}-arm64/lib/libwolfprov.dylib" \
8989
-create -output $LIPODIR/libwolfprov-${type}.dylib
9090

9191
echo "Checking libraries"
@@ -98,7 +98,7 @@ for type in iphoneos ; do
9898

9999
# Create universal binaries from architecture-specific static libraries
100100
lipo \
101-
"$OUTDIR/wolfprov-${type}-arm64/lib/libwolfprov.dylib" \
101+
"$OUTDIR/wolfprov-install-${type}-arm64/lib/libwolfprov.dylib" \
102102
-create -output $LIPODIR/libwolfprov-${type}.dylib
103103

104104
echo "Checking libraries"

IDE/XCODE/run_openssl.sh

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,14 @@
33
set -e
44

55
RUNDIR=$(pwd)
6-
OPENSSL_DIR=${RUNDIR}/openssl-source/artifacts/macosx-x86_64
7-
WOLFPROV_LIB=${RUNDIR}/artifacts/xcframework/libwolfprov.xcframework/macos-arm64_x86_64
8-
export LD_LIBRARY_PATH=${WOLFPROV_LIB}:${OPENSSL_DIR}
6+
ARCH=$(uname -m)
7+
OPENSSL_DIR=${RUNDIR}/openssl-source/artifacts/openssl-install-macosx-${ARCH}/
8+
WOLFPROV_LIB=${RUNDIR}/artifacts/wolfprov-install-macosx-${ARCH}/lib
9+
export LD_LIBRARY_PATH=${WOLFPROV_LIB}:${OPENSSL_DIR}/lib
910
export OPENSSL_MODULES=${WOLFPROV_LIB}
1011
export OPENSSL_CONF=${RUNDIR}/provider.conf
1112

12-
# Most places expect the file to be called 'libwolfprov.so/dll/dylib'
13-
ln -s ${WOLFPROV_LIB}/libwolfprov-macosx.dylib ${WOLFPROV_LIB}/libwolfprov.dylib || true
14-
1513
# Run the tests
16-
${OPENSSL_DIR}/apps/openssl list -verbose -provider-path ${WOLFPROV_LIB} -providers
14+
${OPENSSL_DIR}/bin/openssl list -verbose -provider-path ${WOLFPROV_LIB} -providers
1715

1816
${RUNDIR}/artifacts/openssl_example

src/wp_fips.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ void wolfProvider_SetFipsChecks(long checksMask)
4242
*
4343
* @return The FIPS checks mask.
4444
*/
45-
long wolfProvider_GetFipsChecks()
45+
long wolfProvider_GetFipsChecks(void)
4646
{
4747
return fipsChecks;
4848
}

src/wp_rsa_asym.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ typedef struct wp_RsaAsymCtx {
7676
/** wolfSSL id of MGF operation to perform when padding mode is PSS. */
7777
int mgf;
7878
/** Indicates that the MGF id has been set explicitly. */
79-
int mgfSet:1;
79+
unsigned int mgfSet:1;
8080
/** Label to use with OAEP. */
8181
unsigned char* label;
8282
/** Length of label. */

src/wp_rsa_sig.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ typedef struct wp_RsaSigCtx {
8989
/** wolfSSL id of MGF operation to perform when padding mode is PSS. */
9090
int mgf;
9191
/** Indicates that the MGF id has been set explicitly. */
92-
int mgfSet:1;
92+
unsigned int mgfSet:1;
9393

9494
/** Property query string. */
9595
char* propQuery;

test/unit.h

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -64,16 +64,16 @@ void print_buffer(const char *desc, const unsigned char *buffer, size_t len);
6464

6565
typedef int (*TEST_FUNC)(void *data);
6666
typedef struct TEST_CASE {
67-
const char *name;
68-
TEST_FUNC func;
69-
void *data;
70-
int err;
71-
int run:1;
72-
int done:1;
67+
const char *name;
68+
TEST_FUNC func;
69+
void *data;
70+
int err;
71+
unsigned int run:1;
72+
unsigned int done:1;
7373
#ifdef TEST_MULTITHREADED
74-
int attempted:1;
75-
pthread_t thread;
76-
int cnt;
74+
unsigned int attempted:1;
75+
pthread_t thread;
76+
int cnt;
7777
#endif
7878
} TEST_CASE;
7979

0 commit comments

Comments
 (0)