From: Dmitry Volyntsev Date: Wed, 12 Aug 2026 00:13:13 +0000 (-0700) Subject: Webcrypto: fix QuickJS build with OpenSSL < 1.1.0 X-Git-Tag: 1.0.1~19 X-Git-Url: https://git.kaiwu.me/%7B@url%7D?a=commitdiff_plain;h=4bce5f0e7739984b1fb995625baf8ba698f231b5;p=njs.git Webcrypto: fix QuickJS build with OpenSSL < 1.1.0 The issue was introduced in 75ca26f83471 (0.8.10). The QuickJS WebCrypto implementation called BN_bn2binpad() and ECDSA_SIG_set0() directly, although compatibility wrappers were already used by the njs implementation. It also referenced an njs-only string_info variable when HKDF was unavailable. Use the shared OpenSSL compatibility wrappers and remove the stale reference. --- diff --git a/external/qjs_webcrypto_module.c b/external/qjs_webcrypto_module.c index 3da69e19..29f1931c 100644 --- a/external/qjs_webcrypto_module.c +++ b/external/qjs_webcrypto_module.c @@ -2401,7 +2401,6 @@ free: #else (void) pctx; (void) olen; - (void) &string_info; (void) &info; #endif @@ -4484,11 +4483,11 @@ qjs_convert_der_to_p1363(JSContext *cx, EVP_PKEY *pkey, const u_char *der, s = ec_sig->s; #endif - if (BN_bn2binpad(r, data, n) <= 0) { + if (njs_bn_bn2binpad(r, data, n) <= 0) { goto fail; } - if (BN_bn2binpad(s, &data[n], n) <= 0) { + if (njs_bn_bn2binpad(s, &data[n], n) <= 0) { goto fail; } @@ -4548,7 +4547,7 @@ qjs_convert_p1363_to_der(JSContext *cx, EVP_PKEY *pkey, u_char *p1363, goto fail; } - if (ECDSA_SIG_set0(ec_sig, r, s) != 1) { + if (njs_ecdsa_sig_set0(ec_sig, r, s) != 1) { BN_free(r); BN_free(s); JS_ThrowOutOfMemory(cx);