-
Notifications
You must be signed in to change notification settings - Fork 28
Update command line tests #245
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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,26 @@ | ||
| #!/bin/bash | ||
| # | ||
| # Copyright (C) 2006-2025 wolfSSL Inc. | ||
| # | ||
| # This file is part of wolfProvider. | ||
| # | ||
| # wolfProvider is free software; you can redistribute it and/or modify | ||
| # it under the terms of the GNU General Public License as published by | ||
| # the Free Software Foundation; either version 3 of the License, or | ||
| # (at your option) any later version. | ||
| # | ||
| # wolfProvider is distributed in the hope that it will be useful, | ||
| # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| # GNU General Public License for more details. | ||
| # | ||
| # You should have received a copy of the GNU General Public License | ||
| # along with wolfProvider. If not, see <http://www.gnu.org/licenses/>. | ||
|
|
||
| # Clean up command test artifacts | ||
| rm -rf ./scripts/cmd_test/*.log | ||
| rm -rf ./aes_outputs | ||
| rm -rf ./ecc_outputs | ||
| rm -rf ./hash_outputs | ||
| rm -rf ./rsa_outputs | ||
| rm -rf ./test.txt |
This file contains hidden or 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,83 @@ | ||
| #!/bin/bash | ||
| # | ||
| # Copyright (C) 2006-2025 wolfSSL Inc. | ||
| # | ||
| # This file is part of wolfProvider. | ||
| # | ||
| # wolfProvider is free software; you can redistribute it and/or modify | ||
| # it under the terms of the GNU General Public License as published by | ||
| # the Free Software Foundation; either version 3 of the License, or | ||
| # (at your option) any later version. | ||
| # | ||
| # wolfProvider is distributed in the hope that it will be useful, | ||
| # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| # GNU General Public License for more details. | ||
| # | ||
| # You should have received a copy of the GNU General Public License | ||
| # along with wolfProvider. If not, see <http://www.gnu.org/licenses/>. | ||
|
|
||
| cmd_test_env_setup() { | ||
| local log_file_name=$1 | ||
| SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )" | ||
| # Set up environment | ||
| export LOG_FILE="${SCRIPT_DIR}/${log_file_name}" | ||
| touch "$LOG_FILE" | ||
|
|
||
| # OPENSSL_BIN must be set by the caller | ||
| if [ -z "${OPENSSL_BIN:-}" ]; then | ||
| echo "Error: OPENSSL_BIN environment variable is not set" | tee -a "$LOG_FILE" | ||
| exit 1 | ||
| fi | ||
|
|
||
| # Fail flags | ||
| FAIL=0 | ||
| FORCE_FAIL_PASSED=0 | ||
|
|
||
| # Get the force fail parameter | ||
| if [ "${WOLFPROV_FORCE_FAIL}" = "1" ]; then | ||
| echo "Force fail mode enabled" | ||
| fi | ||
| if [ "${WOLFSSL_ISFIPS}" = "1" ]; then | ||
| echo "FIPS mode enabled" | ||
| fi | ||
|
|
||
| # Print environment for verification | ||
| echo "Environment variables:" | ||
| echo "OPENSSL_MODULES: ${OPENSSL_MODULES}" | ||
| echo "OPENSSL_BIN: ${OPENSSL_BIN}" | ||
| } | ||
|
|
||
| # Function to use default provider only | ||
| use_default_provider() { | ||
| unset OPENSSL_MODULES | ||
| unset OPENSSL_CONF | ||
|
|
||
| # Verify that we are using the default provider | ||
| if ${OPENSSL_BIN} list -providers | grep -q "wolfprov"; then | ||
| echo "FAIL: unable to switch to default provider, wolfProvider is still active" | ||
| exit 1 | ||
| fi | ||
| echo "Switched to default provider" | ||
| } | ||
|
|
||
| # Function to use wolf provider only | ||
| use_wolf_provider() { | ||
| export OPENSSL_MODULES=$WOLFPROV_PATH | ||
| export OPENSSL_CONF=${WOLFPROV_CONFIG} | ||
|
|
||
| # Verify that we are using wolfProvider | ||
| if ! ${OPENSSL_BIN} list -providers | grep -q "wolfprov"; then | ||
| echo "FAIL: unable to switch to wolfProvider, default provider is still active" | ||
| exit 1 | ||
| fi | ||
| echo "Switched to wolfProvider" | ||
| } | ||
|
|
||
| # Helper function to handle force fail checks | ||
| check_force_fail() { | ||
| if [ "${WOLFPROV_FORCE_FAIL}" = "1" ]; then | ||
| echo "[PASS] Test passed when force fail was enabled" | ||
| FORCE_FAIL_PASSED=1 | ||
| fi | ||
| } |
This file contains hidden or 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
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.