|
| 1 | +name: Empty PIN Token Store Test |
| 2 | + |
| 3 | +# This test verifies that encrypted objects can be stored and loaded correctly |
| 4 | +# when using an empty user PIN. It tests whether HashPIN needs to be called |
| 5 | +# before decoding objects in the empty PIN case. |
| 6 | + |
| 7 | +on: |
| 8 | + push: |
| 9 | + branches: [ 'master', 'main', 'release/**' ] |
| 10 | + pull_request: |
| 11 | + branches: [ '*' ] |
| 12 | + |
| 13 | +env: |
| 14 | + WOLFSSL_VERSION: master |
| 15 | + |
| 16 | +jobs: |
| 17 | + empty-pin-store-test: |
| 18 | + runs-on: ubuntu-latest |
| 19 | + |
| 20 | + steps: |
| 21 | + - name: Checkout wolfPKCS11 |
| 22 | + uses: actions/checkout@v4 |
| 23 | + with: |
| 24 | + submodules: true |
| 25 | + |
| 26 | + - name: Cache wolfSSL |
| 27 | + id: cache-wolfssl |
| 28 | + uses: actions/cache@v4 |
| 29 | + with: |
| 30 | + path: wolfssl |
| 31 | + key: wolfssl-${{ env.WOLFSSL_VERSION }}-empty-pin-test |
| 32 | + |
| 33 | + - name: Checkout wolfSSL |
| 34 | + if: steps.cache-wolfssl.outputs.cache-hit != 'true' |
| 35 | + uses: actions/checkout@v4 |
| 36 | + with: |
| 37 | + repository: wolfssl/wolfssl |
| 38 | + path: wolfssl |
| 39 | + ref: ${{ env.WOLFSSL_VERSION }} |
| 40 | + |
| 41 | + - name: Build wolfSSL |
| 42 | + if: steps.cache-wolfssl.outputs.cache-hit != 'true' |
| 43 | + working-directory: ./wolfssl |
| 44 | + run: | |
| 45 | + ./autogen.sh |
| 46 | + ./configure --enable-cryptocb --enable-aescfb --enable-rsapss \ |
| 47 | + --enable-keygen --enable-pwdbased --enable-scrypt \ |
| 48 | + C_EXTRA_FLAGS="-DWOLFSSL_PUBLIC_MP -DWC_RSA_DIRECT" |
| 49 | + make |
| 50 | +
|
| 51 | + - name: Install wolfSSL |
| 52 | + working-directory: ./wolfssl |
| 53 | + run: | |
| 54 | + sudo make install |
| 55 | + sudo ldconfig |
| 56 | +
|
| 57 | + - name: Build wolfPKCS11 |
| 58 | + run: | |
| 59 | + ./autogen.sh |
| 60 | + # Enable empty PIN by setting WP11_MIN_PIN_LEN=0 |
| 61 | + ./configure --enable-debug C_EXTRA_FLAGS="-DWP11_MIN_PIN_LEN=0" |
| 62 | + make |
| 63 | +
|
| 64 | + - name: Create test store directory |
| 65 | + run: mkdir -p store/empty_pin_test |
| 66 | + |
| 67 | + - name: Run empty PIN store test |
| 68 | + run: | |
| 69 | + echo "=== Running Empty PIN Token Store Test ===" |
| 70 | + echo "This test verifies that encrypted objects can be stored and" |
| 71 | + echo "loaded correctly when using an empty user PIN." |
| 72 | + echo "" |
| 73 | + ./tests/empty_pin_store_test |
| 74 | + echo "" |
| 75 | + echo "=== Test completed ===" |
| 76 | +
|
| 77 | + - name: Show store directory contents on failure |
| 78 | + if: failure() |
| 79 | + run: | |
| 80 | + echo "=== Store directory contents ===" |
| 81 | + ls -la store/empty_pin_test/ 2>/dev/null || echo "Directory not found or empty" |
| 82 | + echo "" |
| 83 | + echo "=== Hexdump of token file (if exists) ===" |
| 84 | + hexdump -C store/empty_pin_test/wp11_token_0000000000000001 2>/dev/null | head -100 || echo "Token file not found" |
| 85 | +
|
| 86 | + - name: Upload failure logs |
| 87 | + if: failure() || cancelled() |
| 88 | + uses: actions/upload-artifact@v4 |
| 89 | + with: |
| 90 | + name: empty-pin-store-test-logs |
| 91 | + path: | |
| 92 | + test-suite.log |
| 93 | + config.log |
| 94 | + store/ |
| 95 | + retention-days: 5 |
0 commit comments