0
0
mirror of https://github.com/nodejs/node.git synced 2024-12-01 16:10:02 +01:00
nodejs/doc
David Benjamin 5fe81c8aff crypto: hard-code tlsSocket.getCipher().version
This aligns the documentation with reality. This API never did what Node
claims it did.

The SSL_CIPHER_get_version function just isn't useful. In OpenSSL 1.0.2,
it always returned the string "TLSv1/SSLv3" for anything but SSLv2
ciphers, which Node does not support. Note how test-tls-multi-pfx.js
claims that ECDHE-ECDSA-AES256-GCM-SHA384 was added in TLSv1/SSLv3 which
is not true. That cipher is new as of TLS 1.2. The OpenSSL 1.0.2
implementation is:

char *SSL_CIPHER_get_version(const SSL_CIPHER *c)
{
    int i;

    if (c == NULL)
        return ("(NONE)");
    i = (int)(c->id >> 24L);
    if (i == 3)
        return ("TLSv1/SSLv3");
    else if (i == 2)
        return ("SSLv2");
    else
        return ("unknown");
}

In OpenSSL 1.1.0, SSL_CIPHER_get_version changed to actually behave as
Node documented it, but this changes the semantics of the function and
breaks tests. The cipher's minimum protocol version is not a useful
notion to return to the caller here, so just hardcode the string at
"TLSv1/SSLv3" and document it as legacy.

PR-URL: https://github.com/nodejs/node/pull/16130
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Rod Vagg <rod@vagg.org>
2017-11-11 20:42:49 +11:00
..
api crypto: hard-code tlsSocket.getCipher().version 2017-11-11 20:42:49 +11:00
api_assets doc: fix paragraph line-height issue 2017-10-15 12:39:49 +02:00
changelogs 2017-11-07, Version 8.9.1 'Carbon' (LTS) 2017-11-07 22:36:43 +00:00
guides doc: add multiple build guide to benchmarking doc 2017-10-26 21:22:54 -04:00
.eslintrc.yaml tools: enable additional eslint rules 2017-10-19 13:54:14 -04:00
first_timer_badge.png doc: add recommendations for first timers 2017-10-24 10:26:20 -04:00
full-white-stripe.jpg
node.1 async_hooks: enable runtime checks by default 2017-10-30 11:27:42 +01:00
onboarding-extras.md doc: add nodejs/gyp team for GYP related issues 2017-11-02 22:37:14 +00:00
onboarding.md doc: mention collaboration summit in onboarding.md 2017-10-09 23:06:18 +08:00
osx_installer_logo.png
releases.md doc: add note to releases.md 2017-10-28 21:18:07 +02:00
STYLE_GUIDE.md doc: remove bold typography from STYLE_GUIDE.md 2017-10-10 16:13:50 -07:00
template.html doc: responsive docs, rewrite font sizes 2017-10-10 21:28:15 +02:00
thin-white-stripe.jpg