~vcs-imports/busybox/trunk

« back to all changes in this revision

Viewing changes to networking/tls.c

  • Committer: Denys Vlasenko
  • Date: 2022-09-08 14:56:54 UTC
  • Revision ID: git-v1:c8c1fcdba163f264a503380bc63485aacd09214c
tls: move definitions around, no code changes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>

Show diffs side-by-side

added added

removed removed

Lines of Context:
1566
1566
#endif
1567
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
1581
        // https://www.iana.org/assignments/tls-extensiontype-values/tls-extensiontype-values.xhtml
1570
1582
        static const uint8_t extensions[] = {
1571
1583
                // is.gd responds with "handshake failure" to our hello if there's no supported_groups
1606
1618
                        0x04,0x01, //sha256 + rsa - kojipkgs.fedoraproject.org wants this
1607
1619
                        0x04,0x02, //sha256 + dsa
1608
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
1621
// GNU Wget 1.18 to cdn.kernel.org sends these extensions:
1632
1622
// 0055
1633
1623
//   0005 0005 0100000000 - status_request