Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions scripts/env-setup
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ else
exit 1
fi

pushd $SCRIPT_DIR
pushd $SCRIPT_DIR >/dev/null
if [ -n "${GITHUB_WORKSPACE:-}" ]; then
# In a GitHub Actions workflow, GITHUB_WORKSPACE is set to the root of the repository
REPO_ROOT="$GITHUB_WORKSPACE"
Expand All @@ -34,7 +34,7 @@ else
# Fallback: use parent directory of scripts folder
REPO_ROOT="$(dirname "$SCRIPT_DIR")"
fi
popd
popd >/dev/null

echo "SCRIPT_DIR: $SCRIPT_DIR"
echo "REPO_ROOT: $REPO_ROOT"
Expand Down
24 changes: 21 additions & 3 deletions scripts/utils-openssl.sh
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,27 @@ clone_openssl() {
DEPTH_ARG=${WOLFPROV_DEBUG:+""}
DEPTH_ARG=${DEPTH_ARG:---depth=1}

printf "\tClone OpenSSL ${CLONE_TAG} from ${OPENSSL_GIT_URL} ... "
git clone ${DEPTH_ARG} -b ${CLONE_TAG} ${OPENSSL_GIT_URL} ${OPENSSL_SOURCE_DIR} >>$LOG_FILE 2>&1
RET=$?
# Check if tag is actually a commit hash
if [[ "$CLONE_TAG" =~ ^[0-9a-fA-F]{40}$ ]]; then
git clone ${OPENSSL_GIT_URL} ${OPENSSL_SOURCE_DIR} >>$LOG_FILE 2>&1
RET=$?
pushd ${OPENSSL_SOURCE_DIR} >/dev/null
printf "\tCheckout OpenSSL commit ${CLONE_TAG} ... "
git checkout ${CLONE_TAG}
RET=$?
if [ $RET != 0 ]; then
printf "ERROR.\n"
tail -n 100 $LOG_FILE
do_cleanup
exit 1
fi
printf "Done.\n"
popd >/dev/null
else
printf "\tClone OpenSSL ${CLONE_TAG} from ${OPENSSL_GIT_URL} ... "
git clone ${DEPTH_ARG} -b ${CLONE_TAG} ${OPENSSL_GIT_URL} ${OPENSSL_SOURCE_DIR} >>$LOG_FILE 2>&1
RET=$?
fi

if [ $RET != 0 ]; then
printf "ERROR.\n"
Expand Down
2 changes: 1 addition & 1 deletion scripts/utils-wolfssl.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
source ${SCRIPT_DIR}/utils-general.sh

WOLFSSL_GIT=${WOLFSSL_GIT:-"https://github.com/wolfSSL/wolfssl.git"}
WOLFSSL_TAG=${WOLFSSL_TAG:-"v5.8.2-stable"}
WOLFSSL_TAG=${WOLFSSL_TAG:-"v5.8.4-stable"}
WOLFSSL_SOURCE_DIR=${SCRIPT_DIR}/../wolfssl-source
WOLFSSL_INSTALL_DIR=${SCRIPT_DIR}/../wolfssl-install
WOLFSSL_ISFIPS=${WOLFSSL_ISFIPS:-0}
Expand Down
20 changes: 10 additions & 10 deletions test/test_ecc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1688,7 +1688,7 @@ static int test_ec_decode1(void)
EVP_PKEY_CTX *ctx = NULL;
PKCS8_PRIV_KEY_INFO* p8inf = NULL;
const unsigned char *p = NULL;
int len = 0;
size_t len = 0;
EVP_PKEY* pkey1 = NULL;
EC_KEY* eckey1 = NULL;
const EC_GROUP* grp1 = NULL;
Expand Down Expand Up @@ -1828,7 +1828,7 @@ int test_ec_decode(void* data)
static int test_ec_import_priv(void)
{
int err = 0;
int len = 0;
size_t len = 0;
EVP_PKEY_CTX *ctx1 = NULL;
EVP_PKEY_CTX *ctx2 = NULL;
EVP_PKEY* pkey1 = NULL;
Expand Down Expand Up @@ -1896,27 +1896,27 @@ static int test_ec_import_priv(void)
/* Verify public key is available */
if (err == 0) {
if (EVP_PKEY_get_octet_string_param(pkey1,
OSSL_PKEY_PARAM_PUB_KEY, NULL, 0, (size_t *)&len) != 1) {
OSSL_PKEY_PARAM_PUB_KEY, NULL, 0, &len) != 1) {
err = 1;
}
}
if (err == 0) {
if (EVP_PKEY_get_octet_string_param(pkey2,
OSSL_PKEY_PARAM_PUB_KEY, NULL, 0, (size_t *)&len) != 1) {
OSSL_PKEY_PARAM_PUB_KEY, NULL, 0, &len) != 1) {
err = 1;
}
}

/* Verify encoded public key is available */
if (err == 0) {
if (EVP_PKEY_get_octet_string_param(pkey1,
OSSL_PKEY_PARAM_ENCODED_PUBLIC_KEY, NULL, 0, (size_t *)&len) != 1) {
OSSL_PKEY_PARAM_ENCODED_PUBLIC_KEY, NULL, 0, &len) != 1) {
err = 1;
}
}
if (err == 0) {
if (EVP_PKEY_get_octet_string_param(pkey2,
OSSL_PKEY_PARAM_ENCODED_PUBLIC_KEY, NULL, 0, (size_t *)&len) != 1) {
OSSL_PKEY_PARAM_ENCODED_PUBLIC_KEY, NULL, 0, &len) != 1) {
err = 1;
}
}
Expand All @@ -1938,27 +1938,27 @@ static int test_ec_import_priv(void)
/* Attempts to get the public key len should fail */
if (err == 0) {
if (EVP_PKEY_get_octet_string_param(pkey1,
OSSL_PKEY_PARAM_PUB_KEY, NULL, 0, (size_t *)&len) != 0) {
OSSL_PKEY_PARAM_PUB_KEY, NULL, 0, &len) != 0) {
err = 1;
}
}
if (err == 0) {
if (EVP_PKEY_get_octet_string_param(pkey2,
OSSL_PKEY_PARAM_PUB_KEY, NULL, 0, (size_t *)&len) != 0) {
OSSL_PKEY_PARAM_PUB_KEY, NULL, 0, &len) != 0) {
err = 1;
}
}
/* Older versions of OpenSSL will segfault on this */
#if OPENSSL_VERSION_NUMBER >= 0x30006000L
if (err == 0) {
if (EVP_PKEY_get_octet_string_param(pkey1,
OSSL_PKEY_PARAM_ENCODED_PUBLIC_KEY, NULL, 0, (size_t *)&len) != 0) {
OSSL_PKEY_PARAM_ENCODED_PUBLIC_KEY, NULL, 0, &len) != 0) {
err = 1;
}
}
if (err == 0) {
if (EVP_PKEY_get_octet_string_param(pkey2,
OSSL_PKEY_PARAM_ENCODED_PUBLIC_KEY, NULL, 0, (size_t *)&len) != 0) {
OSSL_PKEY_PARAM_ENCODED_PUBLIC_KEY, NULL, 0, &len) != 0) {
err = 1;
}
}
Expand Down
Loading