[PATCH 1/2] test: update error code in tls-psk-circuit for for OpenSSL 3.4
authorSebastian Andrzej Siewior <sebastian@breakpoint.cc>
Tue, 31 Dec 2024 15:44:17 +0000 (16:44 +0100)
committerJérémy Lal <kapouer@melix.org>
Wed, 1 Jan 2025 13:34:52 +0000 (14:34 +0100)
Update parallel/test-tls-psk-circuit.js to account for error code
changes in OpenSSL 3.4 and probably later.

https://github.com/nodejs/node/pull/56420

Signed-off-by: Sebastian Andrzej Siewior <sebastian@breakpoint.cc>
Gbp-Pq: Topic build
Gbp-Pq: Name openssl-3.4-test-tls-psk-circuit.patch

test/common/index.js
test/parallel/test-tls-psk-circuit.js

index dd8e3cedb9aec58d95985fc9e724edbaf9e1500e..7c062109af6eb60837c9a8a4edbc3257dd033546 100644 (file)
@@ -1021,6 +1021,10 @@ const common = {
     return hasOpenSSL(3, 2);
   },
 
+  get hasOpenSSL34() {
+    return hasOpenSSL(3, 4);
+  },
+
   get inFreeBSDJail() {
     if (inFreeBSDJail !== null) return inFreeBSDJail;
 
index 2b49161df8326cd3346dea60be3eea6a0b3fe3db..491eaecd4b4ed6cf0e5b9d13ce0190dcf5d4f215 100644 (file)
@@ -66,7 +66,8 @@ const expectedHandshakeErr = common.hasOpenSSL32 ?
   'ERR_SSL_SSL/TLS_ALERT_HANDSHAKE_FAILURE' : 'ERR_SSL_SSLV3_ALERT_HANDSHAKE_FAILURE';
 test({ psk: USERS.UserB, identity: 'UserC' }, {}, expectedHandshakeErr);
 // Recognized user but incorrect secret should fail handshake
-const expectedIllegalParameterErr = common.hasOpenSSL32 ?
-  'ERR_SSL_SSL/TLS_ALERT_ILLEGAL_PARAMETER' : 'ERR_SSL_SSLV3_ALERT_ILLEGAL_PARAMETER';
+const expectedIllegalParameterErr = common.hasOpenSSL34 ? 'ERR_SSL_TLSV1_ALERT_DECRYPT_ERROR' :
+       common.hasOpenSSL32 ?
+       'ERR_SSL_SSL/TLS_ALERT_ILLEGAL_PARAMETER' : 'ERR_SSL_SSLV3_ALERT_ILLEGAL_PARAMETER';
 test({ psk: USERS.UserA, identity: 'UserB' }, {}, expectedIllegalParameterErr);
 test({ psk: USERS.UserB, identity: 'UserB' });