summaryrefslogtreecommitdiff
path: root/networking/tls.c
diff options
context:
space:
mode:
authorDenys Vlasenko2022-09-08 16:56:54 +0200
committerDenys Vlasenko2022-09-08 16:56:54 +0200
commitc8c1fcdba163f264a503380bc63485aacd09214c (patch)
treee7bc3a9e54ae846242f0f253335923a237b88fab /networking/tls.c
parent9bab580cd4337a3b9daf7d63f1fc863b7a569ae0 (diff)
downloadbusybox-c8c1fcdba163f264a503380bc63485aacd09214c.zip
busybox-c8c1fcdba163f264a503380bc63485aacd09214c.tar.gz
tls: move definitions around, no code changes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'networking/tls.c')
-rw-r--r--networking/tls.c34
1 files changed, 12 insertions, 22 deletions
diff --git a/networking/tls.c b/networking/tls.c
index 935ca76..8d074c0 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)
#endif
0x01,0x00, //not a cipher - comprtypes_len, comprtype
};
+ struct client_hello {
+ uint8_t type;
+ uint8_t len24_hi, len24_mid, len24_lo;
+ uint8_t proto_maj, proto_min;
+ uint8_t rand32[32];
+ uint8_t session_id_len;
+ /* uint8_t session_id[]; */
+ uint8_t cipherid_len16_hi, cipherid_len16_lo;
+ uint8_t cipherid[2 * (1 + NUM_CIPHERS)]; /* actually variable */
+ uint8_t comprtypes_len;
+ uint8_t comprtypes[1]; /* actually variable */
+ };
// https://www.iana.org/assignments/tls-extensiontype-values/tls-extensiontype-values.xhtml
static const uint8_t extensions[] = {
// 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)
0x04,0x01, //sha256 + rsa - kojipkgs.fedoraproject.org wants this
0x04,0x02, //sha256 + dsa
0x04,0x03, //sha256 + ecdsa
- };
-
- struct client_hello {
- uint8_t type;
- uint8_t len24_hi, len24_mid, len24_lo;
- uint8_t proto_maj, proto_min;
- uint8_t rand32[32];
- uint8_t session_id_len;
- /* uint8_t session_id[]; */
- uint8_t cipherid_len16_hi, cipherid_len16_lo;
- uint8_t cipherid[2 * (1 + NUM_CIPHERS)]; /* actually variable */
- uint8_t comprtypes_len;
- uint8_t comprtypes[1]; /* actually variable */
- /* Extensions (SNI shown):
- * hi,lo // len of all extensions
- * 00,00 // extension_type: "Server Name"
- * 00,0e // list len (there can be more than one SNI)
- * 00,0c // len of 1st Server Name Indication
- * 00 // name type: host_name
- * 00,09 // name len
- * "localhost" // name
- */
// GNU Wget 1.18 to cdn.kernel.org sends these extensions:
// 0055
// 0005 0005 0100000000 - status_request