-
Notifications
You must be signed in to change notification settings - Fork 28
added sscep tests #229
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
added sscep tests #229
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,83 @@ | ||
| #!/bin/bash | ||
| # test_sscep.sh | ||
| # | ||
| # 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 this program; if not, write to the Free Software | ||
| # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA | ||
| TEST_SSCEP_FAIL=0 | ||
|
|
||
| cleanup(){ | ||
| [ -f ca.crt ] && rm -f ca.crt | ||
| [ -d ca-dir ] && rm -rf ca-dir | ||
| } | ||
|
|
||
| killall scepserver &> /dev/null | ||
| cleanup | ||
|
|
||
| # begin by setting up and starting the scep server | ||
| OPENSSL_CONF="" OPENSSL_MODULES="" scepserver ca -depot ca-dir -init | ||
| OPENSSL_CONF="" OPENSSL_MODULES="" scepserver -depot ca-dir -port 8080 -debug & | ||
|
|
||
| sleep 1 | ||
|
|
||
| # now test sscep | ||
|
|
||
| # getca | ||
| sscep getca -u "http://localhost:8080/scep" -c ca.crt -v -d | ||
|
|
||
| if [ $? -eq 0 ] && [ -f ca.crt ] \ | ||
| && diff -y ca.crt ca-dir/ca.pem | ||
| then | ||
| echo "[ PASSED ] getca" | ||
| else | ||
| echo "[ FAILED ] getca" | ||
| TEST_SSCEP_FAIL=1 | ||
| fi | ||
|
|
||
| # getnextca | ||
| # could not get certificate chaining to work. Not sure if it's the servers fault | ||
| # or mine. | ||
|
|
||
| # enroll | ||
| # first generate ca request (sscep has a script for this) | ||
| timeout 10 ./mkrequest -ip 1.2.3.4 | ||
|
|
||
| if [ $? -eq 0 ]; then | ||
| # then enroll -> sscep WILL fail this. | ||
| # scepserver uses des-cbc (which is not supported) when sending a cert back, so | ||
padelsbach marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| # to test just check that the .csr got over to the server. This way at least | ||
| # some of its functionality can be tested | ||
| sscep enroll -u "http://localhost:8080/scep" -c ca.crt -k local.key -r local.csr -l local.crt -v -d | ||
|
|
||
| if [ -f ca-dir/1.2.3.4*.pem ]; | ||
| then | ||
| echo "[ PASSED ] enroll" | ||
| else | ||
| echo "[ FAILED ] enroll" | ||
| TEST_SSCEP_FAIL=1 | ||
| fi | ||
| else | ||
| echo "[ FAILED ] enroll" | ||
| TEST_SSCEP_FAIL=1 | ||
| fi | ||
|
|
||
| killall scepserver &> /dev/null | ||
|
|
||
| cleanup | ||
|
|
||
| $GITHUB_WORKSPACE/.github/scripts/check-workflow-result.sh $TEST_SSCEP_FAIL "$WOLFPROV_FORCE_FAIL_STR" sscep | ||
| exit $? | ||
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,90 @@ | ||
| name: sscep Tests | ||
|
|
||
| # START OF COMMON SECTION | ||
| on: | ||
| push: | ||
| branches: [ 'master', 'main', 'release/**' ] | ||
| pull_request: | ||
| branches: [ '*' ] | ||
|
|
||
| concurrency: | ||
| group: ${{ github.workflow }}-${{ github.ref }} | ||
| cancel-in-progress: true | ||
| # END OF COMMON SECTION | ||
|
|
||
| jobs: | ||
| build_wolfprovider: | ||
| uses: ./.github/workflows/build-wolfprovider.yml | ||
| with: | ||
| wolfssl_ref: ${{ matrix.wolfssl_ref }} | ||
| openssl_ref: ${{ matrix.openssl_ref }} | ||
| strategy: | ||
| matrix: | ||
| wolfssl_ref: [ 'master', 'v5.8.0-stable' ] | ||
| openssl_ref: [ 'openssl-3.5.0' ] | ||
|
|
||
| test_sscep: | ||
| runs-on: ubuntu-22.04 | ||
| needs: build_wolfprovider | ||
| timeout-minutes: 10 | ||
| strategy: | ||
| matrix: | ||
| sscep_ref: [ 'master', 'v0.10.0' ] | ||
| wolfssl_ref: [ 'master', 'v5.8.0-stable' ] | ||
| openssl_ref: [ 'openssl-3.5.0' ] | ||
| force_fail: [ 'WOLFPROV_FORCE_FAIL=1', '' ] | ||
|
|
||
| steps: | ||
| - name: Checkout wolfProvider | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| fetch-depth: 1 | ||
|
|
||
| - name: Retrieving wolfSSL/wolfProvider from cache | ||
| uses: actions/cache/restore@v4 | ||
| id: wolfprov-cache | ||
| with: | ||
| path: | | ||
| wolfssl-install | ||
| wolfprov-install | ||
| openssl-install/lib64 | ||
| openssl-install/include | ||
| openssl-install/bin | ||
|
|
||
| key: wolfprov-${{ matrix.wolfssl_ref }}-${{ matrix.openssl_ref }}-${{ github.sha }} | ||
| fail-on-cache-miss: true | ||
|
|
||
| - name: Install sscep dependencies | ||
| run: | | ||
| sudo apt-get update | ||
|
|
||
| sudo apt-get install -y scep psmisc | ||
|
|
||
| - name: Download sscep | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| repository: certnanny/sscep | ||
| ref: ${{ matrix.sscep_ref }} | ||
| path: sscep | ||
|
|
||
| - name: Build sscep | ||
| working-directory: sscep | ||
| run: | | ||
| # force sscep to use the openssl binary in wolfProvider | ||
| sudo ln -sf $GITHUB_WORKSPACE/openssl-install/bin/openssl /usr/bin/openssl | ||
|
|
||
| export openssl_CFLAGS="-I$GITHUB_WORKSPACE/openssl-install/include/" | ||
| export openssl_LIBS="-L$GITHUB_WORKSPACE/openssl-install/lib64 -lssl -lcrypto" | ||
|
|
||
| autoreconf -vfi | ||
| ./configure | ||
| make -j $(nproc) | ||
| sudo make install | ||
|
|
||
| - name: Run sscep tests | ||
| run: | | ||
| source $GITHUB_WORKSPACE/scripts/env-setup | ||
| export ${{ matrix.force_fail }} | ||
| export WOLFPROV_FORCE_FAIL_STR="${{ matrix.force_fail }}" | ||
|
|
||
| cd sscep && $GITHUB_WORKSPACE/.github/scripts/test_sscep.sh |
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.