-
Notifications
You must be signed in to change notification settings - Fork 39
fix(ci): DSPX-3499 skip PQC key config when platform lacks keygen support #3595
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -145,6 +145,13 @@ runs: | |||||||||||||||||||||||||||||||||||||||
| LOG_TYPE: ${{ inputs.log-type }} | ||||||||||||||||||||||||||||||||||||||||
| with: | ||||||||||||||||||||||||||||||||||||||||
| run: | | ||||||||||||||||||||||||||||||||||||||||
| # If PQC is requested but key files were not generated, the platform | ||||||||||||||||||||||||||||||||||||||||
| # version likely does not support PQC key types. Disable PQC to avoid | ||||||||||||||||||||||||||||||||||||||||
| # referencing missing key files in the config. | ||||||||||||||||||||||||||||||||||||||||
| if [ "${PQC_ENABLED}" == "true" ] && [ ! -f kas-xwing-private.pem ]; then | ||||||||||||||||||||||||||||||||||||||||
| echo "::warning::PQC enabled but key files not found (platform version may not support PQC). Disabling PQC key configuration for KAS ${KAS_NAME}." | ||||||||||||||||||||||||||||||||||||||||
| export PQC_ENABLED="false" | ||||||||||||||||||||||||||||||||||||||||
| fi | ||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+151
to
+154
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Guard all required PQC key files, not only xwing. This check only tests Suggested fix- if [ "${PQC_ENABLED}" == "true" ] && [ ! -f kas-xwing-private.pem ]; then
- echo "::warning::PQC enabled but key files not found (platform version may not support PQC). Disabling PQC key configuration for KAS ${KAS_NAME}."
- export PQC_ENABLED="false"
- fi
+ if [ "${PQC_ENABLED}" == "true" ]; then
+ required_pqc_files=(
+ kas-xwing-private.pem kas-xwing-public.pem
+ kas-p256mlkem768-private.pem kas-p256mlkem768-public.pem
+ kas-p384mlkem1024-private.pem kas-p384mlkem1024-public.pem
+ )
+ missing=0
+ for f in "${required_pqc_files[@]}"; do
+ [ -f "$f" ] || missing=1
+ done
+ if [ "$missing" -eq 1 ]; then
+ echo "::warning::PQC enabled but required PQC key files are incomplete. Disabling PQC key configuration for KAS ${KAS_NAME}."
+ export PQC_ENABLED="false"
+ fi
+ fi📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||||||
| yq e ' | ||||||||||||||||||||||||||||||||||||||||
| (.server.port = env(KAS_PORT)) | ||||||||||||||||||||||||||||||||||||||||
| | (.mode = ["kas"]) | ||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In POSIX standard
[(test) command, the equality operator is=rather than==. Whilebashsupports==inside[, some environments or runners might execute this step usingsh(which defaults todashon Ubuntu), leading to a syntax error like[: unexpected operator. Using=ensures maximum compatibility and robustness across different shell environments.if [ "${PQC_ENABLED}" = "true" ] && [ ! -f kas-xwing-private.pem ]; then