Commit Graph
116 Commits
Author SHA1 Message Date
Tobias Nießen 563b2ed000 crypto: use RFC2253 format in PrintGeneralName
For backward compatibility, node uses X509_NAME_oneline to format
X509_NAME entries in PrintGeneralName. However, the format produced by
this function is non-standard and its use is discouraged. It also does
not handle Unicode names correctly.

This change switches to X509_NAME_print_ex with flags that produce an
RFC2253-compatible format. Non-ASCII strings are converted to UTF-8 and
preserved in the output. Control characters are not escaped by OpenSSL
when producing the RFC2253 format because they will be escaped by node
in a JSON-compatible manner afterwards.

PR-URL: https://github.com/nodejs/node/pull/42002
Refs: https://github.com/nodejs/node/pull/42001
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2022-02-22 15:27:01 +00:00
Tobias Nießen bd0474974a crypto: check result of BIO_new in X509ToObject
Match other call sites of BIO_new(BIO_s_mem()) and CHECK the result of
the call.

Refs: https://github.com/nodejs/node/commit/fb3a9cd0d8e8cf5f3120012a28643230b31c1f83

PR-URL: https://github.com/nodejs/node/pull/41979
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
2022-02-17 23:11:54 +00:00
Tobias Nießen 19370b3176 crypto: rename X509_NAME_FLAGS
Rename X509_NAME_FLAGS to kX509NameFlagsMultiline to better align with
the naming conventions we use for constexpr values, to distinguish it
from OpenSSL's built-in X509 constants, and to clarify what specific
X509 name flags the constant represents.

PR-URL: https://github.com/nodejs/node/pull/42001
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
2022-02-17 23:11:46 +00:00
Brian White cde35ea51b crypto: do not advertise unsupported algorithms
Fixes: https://github.com/nodejs/node/issues/41857

PR-URL: https://github.com/nodejs/node/pull/41864
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
2022-02-08 10:22:31 +01:00
Michael Dawson 674a9556e4 crypto: check return code from EVP_DigestUpdate
Coverity was complaining that we did not check the
return code. We seem to check in the other place it
is called and the method already handles returning
a result.

Signed-off-by: Michael Dawson <mdawson@devrus.com>

PR-URL: https://github.com/nodejs/node/pull/41800
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
2022-02-03 14:17:56 -05:00
Tobias Nießen 65910c0d6c tls: represent registeredID numerically always
Refs: https://github.com/nodejs/node/commit/466e5415a2b7b3574ab5403acb87e89a94a980d1

PR-URL: https://github.com/nodejs/node/pull/41561
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2022-01-18 20:00:18 +01:00
Tobias NießenandAnna Henningsen 4dd1f42df6 src: gracefully handle errors in GetX509NameObject
PR-URL: https://github.com/nodejs/node/pull/41490
Co-authored-by: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2022-01-14 15:08:05 +01:00
Tobias Nießen a336444c7f tls: fix handling of x509 subject and issuer
When subject and verifier are represented as strings, escape special
characters (such as '+') to guarantee unambiguity. Previously, different
distinguished names could result in the same string when encoded. In
particular, inserting a '+' in a single-value Relative Distinguished
Name (e.g., L or OU) would produce a string that is indistinguishable
from a multi-value Relative Distinguished Name. Third-party code that
correctly interprets the generated string representation as a
multi-value Relative Distinguished Name could then be vulnerable to an
injection attack, e.g., when an attacker includes a single-value RDN
with type OU and value 'HR + CN=example.com', the string representation
produced by unpatched versions of Node.js would be
'OU=HR + CN=example.com', which represents a multi-value RDN.

Node.js itself is not vulnerable to this attack because the current
implementation that parses such strings into objects does not handle '+'
at all. This oversight leads to incorrect results, but at the same time
appears to prevent injection attacks (as described above).

With this change, the JavaScript objects representing the subject and
issuer Relative Distinguished Names are constructed in C++ directly,
instead of (incorrectly) encoding them as strings and then (incorrectly)
decoding the strings in JavaScript.

This addresses CVE-2021-44533.

CVE-ID: CVE-2021-44533
PR-URL: https://github.com/nodejs-private/node-private/pull/300
Reviewed-By: Michael Dawson <midawson@redhat.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2022-01-10 22:38:05 +00:00
Tobias Nießen 466e5415a2 crypto,tls: implement safe x509 GeneralName format
This change introduces JSON-compatible escaping rules for strings that
include X.509 GeneralName components (see RFC 5280). This non-standard
format avoids ambiguities and prevents injection attacks that could
previously lead to X.509 certificates being accepted even though they
were not valid for the target hostname.

These changes affect the format of subject alternative names and the
format of authority information access. The checkServerIdentity function
has been modified to safely handle the new format, eliminating the
possibility of injecting subject alternative names into the verification
logic.

Because each subject alternative name is only encoded as a JSON string
literal if necessary for security purposes, this change will only be
visible in rare cases.

This addresses CVE-2021-44532.

CVE-ID: CVE-2021-44532
PR-URL: https://github.com/nodejs-private/node-private/pull/300
Reviewed-By: Michael Dawson <midawson@redhat.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2022-01-10 22:38:05 +00:00
Tobias Nießen 26a5c583ab src: remove unused x509 functions
These functions are currently not being used and their security should
be audited before any potential future use.

PR-URL: https://github.com/nodejs-private/node-private/pull/300
Reviewed-By: Michael Dawson <midawson@redhat.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2022-01-10 22:38:02 +00:00
Tobias Nießen 80b20b87bd crypto: fix error capture when loading engine
PR-URL: https://github.com/nodejs/node/pull/41187
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com>
2021-12-17 17:53:24 +01:00
Jameson NashandMomtchil Momtchev f3fbeafeec tls: improve handling of shutdown
RFC 5246 section-7.2.1 requires that the implementation must immediately
stop reading from the stream, as it is no longer TLS-encrypted. The
underlying stream is permitted to still pump events (and errors) to
other users, but those are now unencrypted, so we should not process
them here. But therefore, we do not want to stop the underlying stream,
as there could be another user of it, but we do need to remove ourselves
as a listener.

Per TLS v1.2, we should have also destroy the TLS state entirely here
(including the writing side), but this was revised in TLS v1.3 to permit
the stream to continue to flush output.

There appears to be some inconsistencies in the way nodejs handles
ownership of the underlying stream, with `TLS.close()` on the write side
also calling shutdown on the underlying stream (thus assuming other
users of the underlying stream are not permitted), while receiving EOF
on the read side leaves the underlying channel open. These
inconsistencies are left for a later person to resolve, if the extra
functionality is needed (as described in #35904). The current goal here
is to the fix the occasional CI exceptions depending on the timing of
these kernel messages through the TCP stack.

PR-URL: https://github.com/nodejs/node/pull/36111
Fixes: https://github.com/nodejs/node/pull/35946
Refs: https://github.com/libuv/libuv/pull/3036
Refs: https://github.com/nodejs/node/issues/35904
Co-authored-by: Momtchil Momtchev <momtchil@momtchev.com>
Reviewed-By: Robert Nagy <ronagy@icloud.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2021-12-08 07:29:55 +01:00
Michael Dawson 8e7fd7291b crypto: add missing null check
Add null check before using result of
ERR_reason_error_string. Coverity reported as an issue
and we seem to do a null check in other places we call
the function.

Signed-off-by: Michael Dawson <mdawson@devrus.com>

PR-URL: https://github.com/nodejs/node/pull/40598
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com>
2021-11-29 09:02:47 -05:00
Darshan Sen 90faf55510 src,crypto: remove uses of AllocatedBuffer from crypto_sig
Signed-off-by: Darshan Sen <darshan.sen@postman.com>

PR-URL: https://github.com/nodejs/node/pull/40895
Reviewed-By: James M Snell <jasnell@gmail.com>
2021-11-27 15:55:25 +00:00
Darshan Sen 50f3428e21 src,crypto: use ByteSource::ToBuffer() in crypto_dh
Signed-off-by: Darshan Sen <darshan.sen@postman.com>

PR-URL: https://github.com/nodejs/node/pull/40903
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
2021-11-25 00:14:49 +00:00
Shelley Vohr f7668fa2aa crypto: trim input for NETSCAPE_SPKI_b64_decode
PR-URL: https://github.com/nodejs/node/pull/40757
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Minwoo Jung <nodecorelab@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2021-11-17 12:29:00 +01:00
Tobias Nießen d049a52204 crypto: throw errors in SignTraits::DeriveBits
Fixes: https://github.com/nodejs/node/issues/40794

PR-URL: https://github.com/nodejs/node/pull/40796
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2021-11-15 15:50:20 +00:00
Darshan Sen 3e5a5e8e1a src,crypto: remove AllocatedBuffers from crypto_spkac
Signed-off-by: Darshan Sen <darshan.sen@postman.com>

PR-URL: https://github.com/nodejs/node/pull/40752
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Minwoo Jung <nodecorelab@gmail.com>
2021-11-13 08:14:49 +00:00
Darshan Sen 8ee9e1a1aa src,crypto: refactor crypto_tls.*
By the design of `GetSSLError()`, the V8 API was unnecessarily being
accessed in places where it eventually didn't get used. So this refactor
inlines the function appropriately in places where it was being used.
Also, this replaces uses of `AllocatedBuffers` with `BackingStore`s.

Signed-off-by: Darshan Sen <darshan.sen@postman.com>

PR-URL: https://github.com/nodejs/node/pull/40675
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2021-11-12 21:47:53 +00:00
Martin Jansa a9b2d85a48 crypto: fix build without scrypt
* add missing semicolon to fix:
  In file included from ../src/node_crypto.h:47,
                   from ../src/node.cc:46:
  ../src/crypto/crypto_scrypt.h:80:2:
  error: expected ';' after struct definition
     80 | }
        |  ^
        |  ;

  and fix typo in the comment

Signed-off-by: Martin Jansa <martin.jansa@lge.com>

PR-URL: https://github.com/nodejs/node/pull/40613
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Voltrex <mohammadkeyvanzade94@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2021-11-11 18:59:12 +01:00
3nprob 79d681501d src: add x509.fingerprint512 to crypto module
PR-URL: https://github.com/nodejs/node/pull/39809
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2021-11-10 15:26:28 +01:00
Tobias Nießen 5e0dd79a3c src: add and fix some preprocessor comments
PR-URL: https://github.com/nodejs/node/pull/40701
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Minwoo Jung <nodecorelab@gmail.com>
2021-11-10 15:24:22 +01:00
Tobias Nießen f3125cf301 src: fix #endif description in crypto_keygen.h
PR-URL: https://github.com/nodejs/node/pull/40639
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Voltrex <mohammadkeyvanzade94@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2021-10-28 07:59:47 -07:00
Darshan Sen 5c7af3f8e6 src,crypto: use std::variant in DH params
Signed-off-by: Darshan Sen <darshan.sen@postman.com>

PR-URL: https://github.com/nodejs/node/pull/40457
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
2021-10-22 14:43:58 +00:00
Darshan Sen e1d598c8f2 src,crypto: remove AllocatedBuffer from crypto_cipher.cc
Signed-off-by: Darshan Sen <darshan.sen@postman.com>

PR-URL: https://github.com/nodejs/node/pull/40400
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2021-10-20 12:08:20 +00:00
Michael Dawson 732add6e60 crypto: avoid double free
Coverity scan reported a free after use and I think its
right. Tweak to avoid double free.

Signed-off-by: Michael Dawson <mdawson@devrus.com>

PR-URL: https://github.com/nodejs/node/pull/40380
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Minwoo Jung <nodecorelab@gmail.com>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
2021-10-19 18:22:58 -04:00
Joyee Cheung 3a7b2d7e51 src: register external references in crypto bindings
PR-URL: https://github.com/nodejs/node/pull/40239
Refs: https://github.com/nodejs/node/pull/38905
Refs: https://github.com/nodejs/node/issues/37476
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Minwoo Jung <nodecorelab@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2021-10-19 17:44:53 +08:00
Daniel BeveniusandRichard Lau 1d2f37d970 src: add --openssl-legacy-provider option
This commit adds an option to Node.js named --openssl-legacy-provider
and if specified will load OpenSSL 3.0 Legacy provider.

$ ./node --help
...
--openssl-legacy-provider  enable OpenSSL 3.0 legacy provider

Example usage:

$ ./node --openssl-legacy-provider  -p 'crypto.createHash("md4")'
Hash {
  _options: undefined,
  [Symbol(kHandle)]: Hash {},
  [Symbol(kState)]: { [Symbol(kFinalized)]: false }
}

Co-authored-by: Richard Lau <rlau@redhat.com>

Refs: https://github.com/nodejs/node/issues/40455
PR-URL: https://github.com/nodejs/node/pull/40478
Refs: https://github.com/nodejs/node/issues/40455
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
2021-10-18 15:43:16 +02:00
Rich Trott 88e82b890b doc: format general markdown files
Use `make format-md` to format general markdown files.

PR-URL: https://github.com/nodejs/node/pull/40322
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Zijian Liu <lxxyxzj@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2021-10-06 21:20:55 -07:00
Tobias Nießen 055311ae18 doc,src: update crypto/README.md
Refs: https://github.com/nodejs/node/pull/37048

PR-URL: https://github.com/nodejs/node/pull/40332
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
Reviewed-By: Zijian Liu <lxxyxzj@gmail.com>
Reviewed-By: Qingyu Deng <i@ayase-lab.com>
2021-10-06 21:15:46 -07:00
kokke 4f3eda66cc src: implement changes suggested by @addaleax
Refs: #40128

PR-URL: https://github.com/nodejs/node/pull/40128
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2021-09-30 14:41:39 +00:00
kokke b66c2e150c src: fix time-of-use vs time-of-check "bugs"
Refs: https://github.com/nodejs/node/pull/40128

PR-URL: https://github.com/nodejs/node/pull/40128
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2021-09-30 14:41:38 +00:00
Darshan Sen 2caa308485 src: remove AllocatedBuffer from crypto_common.cc
Signed-off-by: Darshan Sen <darshan.sen@postman.com>

PR-URL: https://github.com/nodejs/node/pull/40213
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Khaidi Chu <i@2333.moe>
2021-09-28 11:31:48 +08:00
Darshan Sen 5ba7fbb731 src,crypto: eliminate code duplication between StatelessDiffieHellman*
Signed-off-by: Darshan Sen <darshan.sen@postman.com>

PR-URL: https://github.com/nodejs/node/pull/40084
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Minwoo Jung <nodecorelab@gmail.com>
2021-09-25 07:46:06 -07:00
Rich Trott 5ca5499c87 doc: update markdown files in src for upcoming linting/formatting
PR-URL: https://github.com/nodejs/node/pull/40159
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Harshitha K P <harshitha014@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2021-09-21 17:04:06 -07:00
Darshan Sen 604c1dfd0f src: remove unnecessary comment and add a CHECK in crypto_tls.cc
Signed-off-by: Darshan Sen <darshan.sen@postman.com>

PR-URL: https://github.com/nodejs/node/pull/39991
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2021-09-16 22:35:18 +00:00
Tobias Nießen a42bd7e944 crypto: fix RSA-PSS default saltLength
PR-URL: https://github.com/nodejs/node/pull/39999
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
2021-09-09 21:13:19 +02:00
Tobias Nießen 5fd7a72e1c crypto: fix default MGF1 hash for OpenSSL 3
Refs: https://github.com/nodejs/node/pull/39999

PR-URL: https://github.com/nodejs/node/pull/40031
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
2021-09-09 17:24:55 +02:00
Michaël Zasso dadea4ab12 src: fix C4805 MSVC warning
'==' : unsafe mix of type 'bool' and type 'int' in operation

PR-URL: https://github.com/nodejs/node/pull/39998
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
2021-09-07 12:22:51 +02:00
Tobias Nießen 73d5f8a843 crypto: fix regression in RSA-PSS keygen
Fixes: https://github.com/nodejs/node/issues/39936
Refs: https://github.com/nodejs/node/pull/35093

PR-URL: https://github.com/nodejs/node/pull/39937
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2021-09-01 08:21:36 +02:00
Tobias Nießen b6b638bdd6 crypto: add RSA-PSS params to asymmetricKeyDetails
Fixes: https://github.com/nodejs/node/issues/39837
Refs: https://github.com/openssl/openssl/pull/10568

PR-URL: https://github.com/nodejs/node/pull/39851
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
2021-08-29 20:23:18 +02:00
Filip Skokan b5816cddbc crypto: fix rsa-pss one-shot sign/verify error handling
fixes #39822

PR-URL: https://github.com/nodejs/node/pull/39830
Reviewed-By: James M Snell <jasnell@gmail.com>
2021-08-28 11:59:22 +00:00
Filip Skokan 4441c3e3b5 crypto: fix JWK RSA-PSS SubtleCrypto.exportKey
PR-URL: https://github.com/nodejs/node/pull/39828
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
2021-08-25 08:24:41 -07:00
himself65 257312ac75 crypto: fix generateKeyPair with encoding 'jwk'
Fixes: https://github.com/nodejs/node/issues/39205

PR-URL: https://github.com/nodejs/node/pull/39319
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2021-07-26 08:48:54 -07:00
Daniel Bevenius 44e382290a src: set SSL_OP_ALLOW_CLIENT_RENEGOTIATION
This commit sets SSL_OP_ALLOW_CLIENT_RENEGOTIATION for OpenSSL 3.0 as
this option is not set by default as it was in  previous versions.

Without this option set there are a few tests that fail when linked
against OpenSSl 3.0.0-alpha-17, for example
test-https-client-renegotiation-limit.js.

I'm not sure we should be setting this for OpenSSL 3.0 or not, but
I'll take a closer look at the implications but if nothing else this
would allow for us to update to alpha-17 in the mean time.

PR-URL: https://github.com/nodejs/node/pull/38753
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Richard Lau <rlau@redhat.com>
2021-07-16 13:42:43 +00:00
Shelley Vohr a9f9d2b3b7 crypto: move OPENSSL_IS_BORINGSSL guard
PR-URL: https://github.com/nodejs/node/pull/39136
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
2021-06-30 11:47:39 +02:00
Shelley Vohr 5830449a45 crypto: use compatible ecdh function
PR-URL: https://github.com/nodejs/node/pull/39054
Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
2021-06-30 10:14:17 +02:00
XadillaX 8954e03ad9 src,crypto: fix 0-length output crash in webcrypto
Fixes: https://github.com/nodejs/node/issues/38883

PR-URL: https://github.com/nodejs/node/pull/38913
Refs: https://github.com/nodejs/node/issues/38883
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
2021-06-26 14:21:49 +00:00
Daniel Bevenius 1997aa3b40 src,test: raise error for --enable-fips when no FIPS
This commit moves the check for FIPS from the crypto module
initialization to process startup.

The motivation for this is that when OpenSSL is not FIPS enabled and the
command line options --enable-fips, or --force-fips are used, there will
only be an error raised if the crypto module is used. This can be
surprising and we have gotten feedback that users assumed that there
would be an error if these options were specified and FIPS is not
available.

PR-URL: https://github.com/nodejs/node/pull/38859
Reviewed-By: Michael Dawson <midawson@redhat.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Richard Lau <rlau@redhat.com>
2021-06-08 11:42:00 +02:00
Shelley Vohr 911ff34255 crypto: use compatible version of EVP_CIPHER_name
PR-URL: https://github.com/nodejs/node/pull/38925
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>
2021-06-08 10:58:53 +02:00