From 8eb1e88af29bf28e9b122c9f221ab04a5ad5fcbf Mon Sep 17 00:00:00 2001 From: Filipa Andrade Date: Fri, 16 Oct 2026 08:31:07 +0100 Subject: [PATCH] Pad EC coordinates in the status test JWK to fix a flaky test --- tests/SupertabConnectStatusTest.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/SupertabConnectStatusTest.php b/tests/SupertabConnectStatusTest.php index 48d7d0f..54e2a5a 100644 --- a/tests/SupertabConnectStatusTest.php +++ b/tests/SupertabConnectStatusTest.php @@ -243,8 +243,9 @@ private function jwkFromKey(\OpenSSLAsymmetricKey $key, string $kid): array return [ 'kty' => 'EC', 'crv' => 'P-256', - 'x' => $this->base64UrlEncode($details['ec']['x']), - 'y' => $this->base64UrlEncode($details['ec']['y']), + // OpenSSL strips leading zero bytes; a JWK coordinate must be the full 32 bytes. + 'x' => $this->base64UrlEncode(str_pad($details['ec']['x'], 32, "\0", STR_PAD_LEFT)), + 'y' => $this->base64UrlEncode(str_pad($details['ec']['y'], 32, "\0", STR_PAD_LEFT)), 'kid' => $kid, 'alg' => 'ES256', 'use' => 'sig',