Welcome! Log In Create A New Profile

Advanced

[njs] Tests: adapted WebCrypto tests to RHEL9.

Dmitry Volyntsev
May 24, 2022 01:34AM
details: https://hg.nginx.org/njs/rev/169f20b8a3e8
branches:
changeset: 1863:169f20b8a3e8
user: Dmitry Volyntsev <xeioex@nginx.com>
date: Mon May 23 22:26:51 2022 -0700
description:
Tests: adapted WebCrypto tests to RHEL9.

diffstat:

test/webcrypto/sign.t.js | 12 +++++++++++-
test/webcrypto/verify.t.js | 12 +++++++++++-
2 files changed, 22 insertions(+), 2 deletions(-)

diffs (44 lines):

diff -r 98959158fe23 -r 169f20b8a3e8 test/webcrypto/sign.t.js
--- a/test/webcrypto/sign.t.js Mon May 23 22:26:50 2022 -0700
+++ b/test/webcrypto/sign.t.js Mon May 23 22:26:51 2022 -0700
@@ -11,7 +11,17 @@ async function test(params) {
false, [ "sign" ]);

let sig = await crypto.subtle.sign(params.sign_alg, sign_key,
- encoder.encode(params.text));
+ encoder.encode(params.text))
+ .catch (e => {
+ if (e.toString().startsWith("Error: EVP_PKEY_CTX_set_signature_md() failed")) {
+ /* Red Hat Enterprise Linux: SHA-1 is disabled */
+ return "SKIPPED";
+ }
+ });
+
+ if (sig == "SKIPPED") {
+ return sig;
+ }

if (params.verify) {
let verify_key = await crypto.subtle.importKey(params.verify_key.fmt,
diff -r 98959158fe23 -r 169f20b8a3e8 test/webcrypto/verify.t.js
--- a/test/webcrypto/verify.t.js Mon May 23 22:26:50 2022 -0700
+++ b/test/webcrypto/verify.t.js Mon May 23 22:26:51 2022 -0700
@@ -11,7 +11,17 @@ async function test(params) {

let r = await crypto.subtle.verify(params.verify_alg,
key, params.signature,
- params.text);
+ params.text)
+ .catch (e => {
+ if (e.toString().startsWith("Error: EVP_PKEY_CTX_set_signature_md() failed")) {
+ /* Red Hat Enterprise Linux: SHA-1 is disabled */
+ return "SKIPPED";
+ }
+ });
+
+ if (r == "SKIPPED") {
+ return r;
+ }

if (params.expected !== r) {
throw Error(`${params.import_alg.name} failed expected: "${params.expected}" vs "${r}"`);
_______________________________________________
nginx-devel mailing list -- nginx-devel@nginx.org
To unsubscribe send an email to nginx-devel-leave@nginx.org
Subject Author Views Posted

[njs] Tests: adapted WebCrypto tests to RHEL9.

Dmitry Volyntsev 207 May 24, 2022 01:34AM



Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 76
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready