| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent bc23dfe commit 3f1e4a0
6 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -827,16 +827,27 @@ changes: | |||
| 827 | 827 | pr-url: https://github.com/nodejs/node/pull/26625 | |
| 828 | 828 | description: Return the minimum cipher version, instead of a fixed string | |
| 829 | 829 | (`'TLSv1/SSLv3'`). | |
| 830 | + - version: REPLACEME | ||
| 831 | + pr-url: https://github.com/nodejs/node/pull/30637 | ||
| 832 | + description: Return the IETF cipher name as `standardName`. | ||
| 830 | 833 | --> | |
| 831 | 834 | ||
| 832 | 835 | * Returns: {Object} | |
| 833 | - * `name` {string} The name of the cipher suite. | ||
| 836 | + * `name` {string} OpenSSL name for the cipher suite. | ||
| 837 | + * `standardName` {string} IETF name for the cipher suite. | ||
| 834 | 838 | * `version` {string} The minimum TLS protocol version supported by this cipher | |
| 835 | 839 | suite. | |
| 836 | 840 | ||
| 837 | 841 | Returns an object containing information on the negotiated cipher suite. | |
| 838 | 842 | ||
| 839 | - For example: `{ name: 'AES256-SHA', version: 'TLSv1.2' }`. | ||
| 843 | + For example: | ||
| 844 | + ```json | ||
| 845 | + { | ||
| 846 | + "name": "AES128-SHA256", | ||
| 847 | + "standardName": "TLS_RSA_WITH_AES_128_CBC_SHA256", | ||
| 848 | + "version": "TLSv1.2" | ||
| 849 | + } | ||
| 850 | + ``` | ||
| 840 | 851 | ||
| 841 | 852 | See | |
| 842 | 853 | [SSL_CIPHER_get_name](https://www.openssl.org/docs/man1.1.1/man3/SSL_CIPHER_get_name.html) | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -352,6 +352,7 @@ constexpr size_t kFsStatsBufferLength = | |||
| 352 | 352 | V(sni_context_string, "sni_context") \ | |
| 353 | 353 | V(source_string, "source") \ | |
| 354 | 354 | V(stack_string, "stack") \ | |
| 355 | + V(standard_name_string, "standardName") \ | ||
| 355 | 356 | V(start_time_string, "startTime") \ | |
| 356 | 357 | V(status_string, "status") \ | |
| 357 | 358 | V(stdio_string, "stdio") \ | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -2685,6 +2685,9 @@ void SSLWrap<Base>::GetCipher(const FunctionCallbackInfo<Value>& args) { | |||
| 2685 | 2685 | const char* cipher_name = SSL_CIPHER_get_name(c); | |
| 2686 | 2686 | info->Set(context, env->name_string(), | |
| 2687 | 2687 | OneByteString(args.GetIsolate(), cipher_name)).Check(); | |
| 2688 | + const char* cipher_standard_name = SSL_CIPHER_standard_name(c); | ||
| 2689 | + info->Set(context, env->standard_name_string(), | ||
| 2690 | + OneByteString(args.GetIsolate(), cipher_standard_name)).Check(); | ||
| 2688 | 2691 | const char* cipher_version = SSL_CIPHER_get_version(c); | |
| 2689 | 2692 | info->Set(context, env->version_string(), | |
| 2690 | 2693 | OneByteString(args.GetIsolate(), cipher_version)).Check(); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -52,6 +52,7 @@ server.listen(0, '127.0.0.1', common.mustCall(function() { | |||
| 52 | 52 | }, common.mustCall(function() { | |
| 53 | 53 | const cipher = this.getCipher(); | |
| 54 | 54 | assert.strictEqual(cipher.name, 'AES128-SHA256'); | |
| 55 | + assert.strictEqual(cipher.standardName, 'TLS_RSA_WITH_AES_128_CBC_SHA256'); | ||
| 55 | 56 | assert.strictEqual(cipher.version, 'TLSv1.2'); | |
| 56 | 57 | this.end(); | |
| 57 | 58 | })); | |
@@ -65,6 +66,8 @@ server.listen(0, '127.0.0.1', common.mustCall(function() { | |||
| 65 | 66 | }, common.mustCall(function() { | |
| 66 | 67 | const cipher = this.getCipher(); | |
| 67 | 68 | assert.strictEqual(cipher.name, 'ECDHE-RSA-AES128-GCM-SHA256'); | |
| 69 | + assert.strictEqual(cipher.standardName, | ||
| 70 | + 'TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256'); | ||
| 68 | 71 | assert.strictEqual(cipher.version, 'TLSv1.2'); | |
| 69 | 72 | this.end(); | |
| 70 | 73 | })); | |
@@ -86,6 +89,7 @@ tls.createServer({ | |||
| 86 | 89 | }, common.mustCall(() => { | |
| 87 | 90 | const cipher = client.getCipher(); | |
| 88 | 91 | assert.strictEqual(cipher.name, 'TLS_AES_128_CCM_8_SHA256'); | |
| 92 | + assert.strictEqual(cipher.standardName, cipher.name); | ||
| 89 | 93 | assert.strictEqual(cipher.version, 'TLSv1.3'); | |
| 90 | 94 | client.end(); | |
| 91 | 95 | })); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -157,6 +157,7 @@ function test(options) { | |||
| 157 | 157 | }, common.mustCall(function() { | |
| 158 | 158 | assert.deepStrictEqual(ecdsa.getCipher(), { | |
| 159 | 159 | name: 'ECDHE-ECDSA-AES256-GCM-SHA384', | |
| 160 | + standardName: 'TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384', | ||
| 160 | 161 | version: 'TLSv1.2' | |
| 161 | 162 | }); | |
| 162 | 163 | assert.strictEqual(ecdsa.getPeerCertificate().subject.CN, eccCN); | |
@@ -175,6 +176,7 @@ function test(options) { | |||
| 175 | 176 | }, common.mustCall(function() { | |
| 176 | 177 | assert.deepStrictEqual(rsa.getCipher(), { | |
| 177 | 178 | name: 'ECDHE-RSA-AES256-GCM-SHA384', | |
| 179 | + standardName: 'TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384', | ||
| 178 | 180 | version: 'TLSv1.2' | |
| 179 | 181 | }); | |
| 180 | 182 | assert.strictEqual(rsa.getPeerCertificate().subject.CN, rsaCN); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -42,9 +42,11 @@ const server = tls.createServer(options, function(conn) { | |||
| 42 | 42 | process.on('exit', function() { | |
| 43 | 43 | assert.deepStrictEqual(ciphers, [{ | |
| 44 | 44 | name: 'ECDHE-ECDSA-AES256-GCM-SHA384', | |
| 45 | + standardName: 'TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384', | ||
| 45 | 46 | version: 'TLSv1.2' | |
| 46 | 47 | }, { | |
| 47 | 48 | name: 'ECDHE-RSA-AES256-GCM-SHA384', | |
| 49 | + standardName: 'TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384', | ||
| 48 | 50 | version: 'TLSv1.2' | |
| 49 | 51 | }]); | |
| 50 | 52 | }); | |
| Back | FazBrowse Home | New Git URL |
0 commit comments