aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2022-09-08 16:56:54 +0200
committerDenys Vlasenko <vda.linux@googlemail.com>2022-09-08 16:56:54 +0200
commitc8c1fcdba163f264a503380bc63485aacd09214c (patch)
treee7bc3a9e54ae846242f0f253335923a237b88fab
parent9bab580cd4337a3b9daf7d63f1fc863b7a569ae0 (diff)
downloadbusybox-w32-c8c1fcdba163f264a503380bc63485aacd09214c.tar.gz
busybox-w32-c8c1fcdba163f264a503380bc63485aacd09214c.tar.bz2
busybox-w32-c8c1fcdba163f264a503380bc63485aacd09214c.zip
tls: move definitions around, no code changes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r--networking/tls.c34
1 files changed, 12 insertions, 22 deletions
diff --git a/networking/tls.c b/networking/tls.c
index 935ca76a4..8d074c058 100644
--- a/networking/tls.c
+++ b/networking/tls.c
@@ -1566,6 +1566,18 @@ static void send_client_hello_and_alloc_hsd(tls_state_t *tls, const char *sni)
1566#endif 1566#endif
1567 0x01,0x00, //not a cipher - comprtypes_len, comprtype 1567 0x01,0x00, //not a cipher - comprtypes_len, comprtype
1568 }; 1568 };
1569 struct client_hello {
1570 uint8_t type;
1571 uint8_t len24_hi, len24_mid, len24_lo;
1572 uint8_t proto_maj, proto_min;
1573 uint8_t rand32[32];
1574 uint8_t session_id_len;
1575 /* uint8_t session_id[]; */
1576 uint8_t cipherid_len16_hi, cipherid_len16_lo;
1577 uint8_t cipherid[2 * (1 + NUM_CIPHERS)]; /* actually variable */
1578 uint8_t comprtypes_len;
1579 uint8_t comprtypes[1]; /* actually variable */
1580 };
1569 // https://www.iana.org/assignments/tls-extensiontype-values/tls-extensiontype-values.xhtml 1581 // https://www.iana.org/assignments/tls-extensiontype-values/tls-extensiontype-values.xhtml
1570 static const uint8_t extensions[] = { 1582 static const uint8_t extensions[] = {
1571 // is.gd responds with "handshake failure" to our hello if there's no supported_groups 1583 // is.gd responds with "handshake failure" to our hello if there's no supported_groups
@@ -1606,28 +1618,6 @@ static void send_client_hello_and_alloc_hsd(tls_state_t *tls, const char *sni)
1606 0x04,0x01, //sha256 + rsa - kojipkgs.fedoraproject.org wants this 1618 0x04,0x01, //sha256 + rsa - kojipkgs.fedoraproject.org wants this
1607 0x04,0x02, //sha256 + dsa 1619 0x04,0x02, //sha256 + dsa
1608 0x04,0x03, //sha256 + ecdsa 1620 0x04,0x03, //sha256 + ecdsa
1609 };
1610
1611 struct client_hello {
1612 uint8_t type;
1613 uint8_t len24_hi, len24_mid, len24_lo;
1614 uint8_t proto_maj, proto_min;
1615 uint8_t rand32[32];
1616 uint8_t session_id_len;
1617 /* uint8_t session_id[]; */
1618 uint8_t cipherid_len16_hi, cipherid_len16_lo;
1619 uint8_t cipherid[2 * (1 + NUM_CIPHERS)]; /* actually variable */
1620 uint8_t comprtypes_len;
1621 uint8_t comprtypes[1]; /* actually variable */
1622 /* Extensions (SNI shown):
1623 * hi,lo // len of all extensions
1624 * 00,00 // extension_type: "Server Name"
1625 * 00,0e // list len (there can be more than one SNI)
1626 * 00,0c // len of 1st Server Name Indication
1627 * 00 // name type: host_name
1628 * 00,09 // name len
1629 * "localhost" // name
1630 */
1631// GNU Wget 1.18 to cdn.kernel.org sends these extensions: 1621// GNU Wget 1.18 to cdn.kernel.org sends these extensions:
1632// 0055 1622// 0055
1633// 0005 0005 0100000000 - status_request 1623// 0005 0005 0100000000 - status_request