@@ -123,3 +123,123 @@ jobs:
123123 run : |
124124 cat test-suite.log
125125 cat scripts/*.log
126+
127+ aws-ca-regression :
128+ # Exercises examples/aws/awsiot.c trust-anchor handling in three
129+ # configurations. Uses the real AWS IoT ATS endpoint hard-coded in
130+ # the demo, so this job needs external network access (same as the
131+ # `build` job's `make check`).
132+ #
133+ # `needs: build` serializes AWS IoT access: the `build` job already
134+ # invokes scripts/awsiot.test via `make check`, and both jobs share
135+ # the same hard-coded MQTT client ID "demoDevice". Running them in
136+ # parallel causes AWS IoT to drop connections ("MQTT Connect: Error
137+ # (Network) (-8)") from client-id collisions, which looks like a
138+ # test failure but is unrelated to the CA changes this job checks.
139+ needs : build
140+ #
141+ # case 1: default bundle (Amazon Root CA 1 + Starfield G2), wolfSSL
142+ # built WITHOUT WOLFSSL_NO_ASN_STRICT. Strict ASN parsing
143+ # drops Starfield G2 (serial=0); the verify callback's
144+ # accept-anyway branch keeps the test passing. Expect PASS.
145+ #
146+ # case 2: default bundle, wolfSSL built WITH WOLFSSL_NO_ASN_STRICT.
147+ # Full bundle loads, chain verifies cleanly, callback
148+ # never has to mask an error. Expect PASS.
149+ #
150+ # case 3: legacy VeriSign G5 bundle (via
151+ # -DWOLFMQTT_AWSIOT_LEGACY_VERISIGN_CA), wolfSSL built WITH
152+ # WOLFSSL_NO_ASN_STRICT. The strict callback rejects the
153+ # unanchored chain. Expect FAIL.
154+ runs-on : ubuntu-22.04
155+ timeout-minutes : 10
156+ steps :
157+ - name : Install dependencies
158+ run : |
159+ export DEBIAN_FRONTEND=noninteractive
160+ sudo apt-get update
161+ sudo apt-get install -y mosquitto bubblewrap
162+ - name : Setup mosquitto broker
163+ run : |
164+ sudo service mosquitto stop
165+ sleep 1
166+
167+ # --- case 1: wolfSSL built with DEFAULT strict ASN parsing ---
168+ - uses : actions/checkout@master
169+ with :
170+ repository : wolfssl/wolfssl
171+ path : wolfssl
172+ - name : wolfssl autogen (strict ASN default)
173+ working-directory : ./wolfssl
174+ run : ./autogen.sh
175+ - name : wolfssl configure (strict ASN default)
176+ working-directory : ./wolfssl
177+ run : ./configure --enable-enckeys
178+ - name : wolfssl make
179+ working-directory : ./wolfssl
180+ run : make
181+ - name : wolfssl make install
182+ working-directory : ./wolfssl
183+ run : sudo make install
184+
185+ - uses : actions/checkout@master
186+ - name : wolfmqtt autogen
187+ run : ./autogen.sh
188+ - name : case 1 - wolfmqtt configure (default bundle, strict ASN)
189+ run : ./configure --enable-tls --enable-examples
190+ - name : case 1 - wolfmqtt make
191+ run : make
192+ - name : case 1 - awsiot.test expect PASS
193+ run : ./scripts/awsiot.test
194+
195+ # --- cases 2 + 3: wolfSSL rebuilt with WOLFSSL_NO_ASN_STRICT ---
196+ # The wolfmqtt checkout above wiped the workspace, so the wolfssl
197+ # source tree is gone even though /usr/local/lib/libwolfssl.* is
198+ # still installed. Re-checkout to get a fresh source tree for the
199+ # NO_ASN_STRICT rebuild.
200+ - uses : actions/checkout@master
201+ with :
202+ repository : wolfssl/wolfssl
203+ path : wolfssl
204+ - name : wolfssl autogen (NO_ASN_STRICT build)
205+ working-directory : ./wolfssl
206+ run : ./autogen.sh
207+ - name : wolfssl configure with -DWOLFSSL_NO_ASN_STRICT
208+ working-directory : ./wolfssl
209+ run : ./configure --enable-enckeys CFLAGS=-DWOLFSSL_NO_ASN_STRICT
210+ - name : wolfssl rebuild
211+ working-directory : ./wolfssl
212+ run : make
213+ - name : wolfssl reinstall
214+ working-directory : ./wolfssl
215+ run : sudo make install
216+
217+ - name : case 2 - wolfmqtt configure (default bundle, WOLFSSL_NO_ASN_STRICT)
218+ run : |
219+ make clean
220+ ./configure --enable-tls --enable-examples
221+ - name : case 2 - wolfmqtt make
222+ run : make
223+ - name : case 2 - awsiot.test expect PASS
224+ run : ./scripts/awsiot.test
225+
226+ - name : case 3 - wolfmqtt configure (legacy VeriSign, WOLFSSL_NO_ASN_STRICT)
227+ run : |
228+ make clean
229+ ./configure --enable-tls --enable-examples \
230+ CPPFLAGS=-DWOLFMQTT_AWSIOT_LEGACY_VERISIGN_CA
231+ - name : case 3 - wolfmqtt make
232+ run : make
233+ - name : case 3 - awsiot.test expect FAIL
234+ run : |
235+ if ./scripts/awsiot.test; then
236+ echo "case 3 unexpectedly PASSED - legacy VeriSign should not verify AWS IoT chain"
237+ exit 1
238+ fi
239+ echo "case 3 FAILED as expected (legacy VeriSign trust anchor rejected)"
240+
241+ - name : Show logs on failure
242+ if : failure() || cancelled()
243+ run : |
244+ cat test-suite.log || true
245+ cat scripts/*.log || true
0 commit comments