aboutsummaryrefslogtreecommitdiff
path: root/networking/tls.c
diff options
context:
space:
mode:
authorRon Yorston <rmy@pobox.com>2019-08-16 09:42:39 +0100
committerRon Yorston <rmy@pobox.com>2019-08-16 09:45:21 +0100
commit517cf74f6265ec4308b790b637b3f9778cbdc6e0 (patch)
treebe9337069b60ca1bb03565d8575bacfc71181003 /networking/tls.c
parentae65dc37bcc9b1d9cef0b111131c79dc4ba1bf51 (diff)
parentac78f2ac96b3efd6551a08e7dc609efa1fb69481 (diff)
downloadbusybox-w32-517cf74f6265ec4308b790b637b3f9778cbdc6e0.tar.gz
busybox-w32-517cf74f6265ec4308b790b637b3f9778cbdc6e0.tar.bz2
busybox-w32-517cf74f6265ec4308b790b637b3f9778cbdc6e0.zip
Merge branch 'busybox' into merge
Diffstat (limited to 'networking/tls.c')
-rw-r--r--networking/tls.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/networking/tls.c b/networking/tls.c
index d1a0204ed..9e81afbad 100644
--- a/networking/tls.c
+++ b/networking/tls.c
@@ -452,7 +452,7 @@ static void hmac_begin(hmac_precomputed_t *pre, uint8_t *key, unsigned key_size,
452 // than INSIZE bytes will first hash the key using H and then use the 452 // than INSIZE bytes will first hash the key using H and then use the
453 // resultant OUTSIZE byte string as the actual key to HMAC." 453 // resultant OUTSIZE byte string as the actual key to HMAC."
454 if (key_size > SHA_INSIZE) { 454 if (key_size > SHA_INSIZE) {
455 bb_error_msg_and_die("HMAC key>64"); //does not happen (yet?) 455 bb_simple_error_msg_and_die("HMAC key>64"); //does not happen (yet?)
456// md5sha_ctx_t ctx; 456// md5sha_ctx_t ctx;
457// begin(&ctx); 457// begin(&ctx);
458// md5sha_hash(&ctx, key, key_size); 458// md5sha_hash(&ctx, key, key_size);
@@ -1138,7 +1138,7 @@ static int tls_xread_record(tls_state_t *tls, const char *expected)
1138 } 1138 }
1139 } 1139 }
1140 if (sz < 0) 1140 if (sz < 0)
1141 bb_error_msg_and_die("encrypted data too short"); 1141 bb_simple_error_msg_and_die("encrypted data too short");
1142 1142
1143 //dump_hex("<< %s\n", tls->inbuf, RECHDR_LEN + sz); 1143 //dump_hex("<< %s\n", tls->inbuf, RECHDR_LEN + sz);
1144 1144
@@ -1417,7 +1417,7 @@ static void find_key_in_der_cert(tls_state_t *tls, uint8_t *der, int len)
1417 dbg("ECDSA key\n"); 1417 dbg("ECDSA key\n");
1418 //UNUSED: tls->flags |= GOT_CERT_ECDSA_KEY_ALG; 1418 //UNUSED: tls->flags |= GOT_CERT_ECDSA_KEY_ALG;
1419 } else 1419 } else
1420 bb_error_msg_and_die("not RSA or ECDSA cert"); 1420 bb_simple_error_msg_and_die("not RSA or ECDSA cert");
1421 } 1421 }
1422 1422
1423 if (tls->flags & GOT_CERT_RSA_KEY_ALG) { 1423 if (tls->flags & GOT_CERT_RSA_KEY_ALG) {
@@ -1888,7 +1888,7 @@ static void process_server_key(tls_state_t *tls, int len)
1888 /* So far we only support curve_x25519 */ 1888 /* So far we only support curve_x25519 */
1889 move_from_unaligned32(t32, keybuf); 1889 move_from_unaligned32(t32, keybuf);
1890 if (t32 != htonl(0x03001d20)) 1890 if (t32 != htonl(0x03001d20))
1891 bb_error_msg_and_die("elliptic curve is not x25519"); 1891 bb_simple_error_msg_and_die("elliptic curve is not x25519");
1892 1892
1893 memcpy(tls->hsd->ecc_pub_key32, keybuf + 4, 32); 1893 memcpy(tls->hsd->ecc_pub_key32, keybuf + 4, 32);
1894 tls->flags |= GOT_EC_KEY; 1894 tls->flags |= GOT_EC_KEY;
@@ -1935,7 +1935,7 @@ static void send_client_key_exchange(tls_state_t *tls)
1935 if (!(tls->flags & NEED_EC_KEY)) { 1935 if (!(tls->flags & NEED_EC_KEY)) {
1936 /* RSA */ 1936 /* RSA */
1937 if (!(tls->flags & GOT_CERT_RSA_KEY_ALG)) 1937 if (!(tls->flags & GOT_CERT_RSA_KEY_ALG))
1938 bb_error_msg("server cert is not RSA"); 1938 bb_simple_error_msg("server cert is not RSA");
1939 1939
1940 tls_get_random(rsa_premaster, sizeof(rsa_premaster)); 1940 tls_get_random(rsa_premaster, sizeof(rsa_premaster));
1941 if (TLS_DEBUG_FIXED_SECRETS) 1941 if (TLS_DEBUG_FIXED_SECRETS)
@@ -1965,7 +1965,7 @@ static void send_client_key_exchange(tls_state_t *tls)
1965 uint8_t privkey[CURVE25519_KEYSIZE]; //[32] 1965 uint8_t privkey[CURVE25519_KEYSIZE]; //[32]
1966 1966
1967 if (!(tls->flags & GOT_EC_KEY)) 1967 if (!(tls->flags & GOT_EC_KEY))
1968 bb_error_msg("server did not provide EC key"); 1968 bb_simple_error_msg("server did not provide EC key");
1969 1969
1970 /* Generate random private key, see RFC 7748 */ 1970 /* Generate random private key, see RFC 7748 */
1971 tls_get_random(privkey, sizeof(privkey)); 1971 tls_get_random(privkey, sizeof(privkey));
@@ -2328,7 +2328,7 @@ void FAST_FUNC tls_run_copy_loop(tls_state_t *tls, unsigned flags)
2328 int nread; 2328 int nread;
2329 2329
2330 if (safe_poll(pfds, 2, -1) < 0) 2330 if (safe_poll(pfds, 2, -1) < 0)
2331 bb_perror_msg_and_die("poll"); 2331 bb_simple_perror_msg_and_die("poll");
2332 2332
2333 if (pfds[0].revents) { 2333 if (pfds[0].revents) {
2334 void *buf; 2334 void *buf;