From 6272f82c07e913a76a316a786c9aadbc09f953ff Mon Sep 17 00:00:00 2001 From: Anton Gerasimov Date: Wed, 18 Sep 2019 16:48:44 +0200 Subject: [PATCH] tls: add option to override signature algorithms Passes the list down to SSL_CTX_set1_sigalgs_list. Option to get the list of shared signature algorithms from a TLS socket added as well for testing. Signed-off-by: Anton Gerasimov PR-URL: https://github.com/nodejs/node/pull/29598 Reviewed-By: Sam Roberts Reviewed-By: Ben Noordhuis Reviewed-By: Anna Henningsen --- doc/api/tls.md | 24 +++++- lib/_tls_common.js | 13 ++++ lib/_tls_wrap.js | 7 ++ src/node_crypto.cc | 101 ++++++++++++++++++++++++++ src/node_crypto.h | 2 + test/parallel/test-tls-set-sigalgs.js | 74 +++++++++++++++++++ 6 files changed, 220 insertions(+), 1 deletion(-) create mode 100644 test/parallel/test-tls-set-sigalgs.js diff --git a/doc/api/tls.md b/doc/api/tls.md index 34f7aecca8475f..c9a30d97d72bcc 100644 --- a/doc/api/tls.md +++ b/doc/api/tls.md @@ -839,7 +839,19 @@ Returns an object containing information on the negotiated cipher suite. For example: `{ name: 'AES256-SHA', version: 'TLSv1.2' }`. See -[OpenSSL](https://www.openssl.org/docs/man1.1.1/man3/SSL_CIPHER_get_name.html) +[SSL_CIPHER_get_name](https://www.openssl.org/docs/man1.1.1/man3/SSL_CIPHER_get_name.html) +for more information. + +### tlsSocket.getSharedSigalgs() + + +* Returns: {Array} List of signature algorithms shared between the server and +the client in the order of decreasing preference. + +See +[SSL_get_shared_sigalgs](https://www.openssl.org/docs/man1.1.1/man3/SSL_get_shared_sigalgs.html) for more information. ### tlsSocket.getEphemeralKeyInfo() @@ -1346,6 +1358,10 @@ argument.