|
12 | 12 | exit 77 |
13 | 13 | fi |
14 | 14 |
|
| 15 | +# Is this a FIPS build? |
| 16 | +IS_FIPS=0 |
| 17 | +if ./wolfssl -v 2>&1 | grep -q FIPS; then |
| 18 | + IS_FIPS=1 |
| 19 | +fi |
| 20 | + |
15 | 21 | run() { |
16 | 22 | if [ -z "$2" ]; then |
17 | 23 | RESULT=`./wolfssl $1` |
@@ -67,30 +73,35 @@ run_fail "rsa -in ./certs/server-key.pem -pubin" |
67 | 73 |
|
68 | 74 | # Test success cases for -RSAPublicKey_in |
69 | 75 | run "rsa -in ./certs/server-keyPub.pem -RSAPublicKey_in" |
70 | | -run "rsa -in ./certs/server-keyEnc.pem -passin pass:yassl123" |
71 | | -run_fail "rsa -in ./certs/server-keyEnc.pem -passin pass:yassl12" |
72 | 76 |
|
73 | | -run "rsa -in ./certs/server-keyEnc.pem -passin pass:yassl123 -noout -modulus" |
| 77 | +if [ ${IS_FIPS} != "1" ]; then |
| 78 | + run "rsa -in ./certs/server-keyEnc.pem -passin pass:yassl123" |
| 79 | + run_fail "rsa -in ./certs/server-keyEnc.pem -passin pass:yassl12" |
| 80 | + |
| 81 | + run "rsa -in ./certs/server-keyEnc.pem -passin pass:yassl123 -noout -modulus" |
| 82 | +fi |
74 | 83 |
|
75 | 84 | # Test success cases for -pubin |
76 | 85 | run "rsa -in ./certs/server-keyPub.pem -pubin" |
77 | | -run "rsa -in ./certs/server-keyEnc.pem -passin pass:yassl123" |
78 | | -run_fail "rsa -in ./certs/server-keyEnc.pem -passin pass:yassl12" |
| 86 | +if [ ${IS_FIPS} != "1" ]; then |
| 87 | + run "rsa -in ./certs/server-keyEnc.pem -passin pass:yassl123" |
| 88 | + run_fail "rsa -in ./certs/server-keyEnc.pem -passin pass:yassl12" |
79 | 89 |
|
80 | | -run "rsa -in ./certs/server-keyEnc.pem -passin pass:yassl123 -noout -modulus" |
| 90 | + run "rsa -in ./certs/server-keyEnc.pem -passin pass:yassl123 -noout -modulus" |
81 | 91 |
|
82 | | -# Check that modulus was printed |
83 | | -echo $RESULT | grep "Modulus" |
84 | | -if [ $? != 0 ]; then |
85 | | - echo "ERROR with -modulus option" |
86 | | - exit 99 |
87 | | -fi |
| 92 | + # Check that modulus was printed |
| 93 | + echo $RESULT | grep "Modulus" |
| 94 | + if [ $? != 0 ]; then |
| 95 | + echo "ERROR with -modulus option" |
| 96 | + exit 99 |
| 97 | + fi |
88 | 98 |
|
89 | | -# Check that key was not printed |
90 | | -echo $RESULT | grep "BEGIN" |
91 | | -if [ $? == 0 ]; then |
92 | | - echo "ERROR found a key with -modulus option" |
93 | | - exit 99 |
| 99 | + # Check that key was not printed |
| 100 | + echo $RESULT | grep "BEGIN" |
| 101 | + if [ $? == 0 ]; then |
| 102 | + echo "ERROR found a key with -modulus option" |
| 103 | + exit 99 |
| 104 | + fi |
94 | 105 | fi |
95 | 106 |
|
96 | 107 | # Expexted result -RSAPublicKey_in |
|
0 commit comments