From f8aed0aad6d64241f81540d2cf61519689eeb445 Mon Sep 17 00:00:00 2001 From: mtriSE Date: Sat, 31 Oct 2026 12:28:19 +0700 Subject: [PATCH] ci: check the code-signing usage without openssl verify -purpose The openssl on ubuntu-24.04 is 3.0 and has no "codesign" purpose name, so `openssl verify -purpose codesign` failed with "Invalid purpose". Verify the chain alone and read the extended key usage of the signing certificate instead. Co-Authored-By: Claude Sonnet 5.5 --- .github/workflows/build.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 9655553..26170f0 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -97,7 +97,9 @@ jobs: printf '%s\n' "$OTA_SIGNING_CERT_PEM" > keys/dev/dev-signing.cert.pem printf '%s\n' "$OTA_SIGNING_KEY_PEM" > keys/dev/dev-signing.key.pem # Fails here, not an hour into the build, if a secret holds something other than the pair. - openssl verify -CAfile keys/dev/dev-ca.cert.pem -purpose codesign keys/dev/dev-signing.cert.pem + # No `-purpose codesign`: the openssl on ubuntu-24.04 (3.0) has no such purpose name. + openssl verify -CAfile keys/dev/dev-ca.cert.pem keys/dev/dev-signing.cert.pem + openssl x509 -in keys/dev/dev-signing.cert.pem -noout -ext extendedKeyUsage | grep -q 'Code Signing' test "$(openssl x509 -in keys/dev/dev-signing.cert.pem -noout -pubkey)" \ = "$(openssl pkey -in keys/dev/dev-signing.key.pem -pubout)"