From 657fbcd62c6cb1e15692ad471bc94cfe6efd8a5f Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Tue, 10 Feb 2026 03:11:38 +0100 Subject: tls: implement server code function old new delta tls_handshake_as_server 7 852 +845 .rodata 107103 107764 +661 psRsaCrypt - 577 +577 load_rsa_priv_key - 329 +329 psRsaDecryptPriv - 200 +200 derive_master_secret_and_keys - 154 +154 send_finished - 95 +95 get_change_cipher_spec - 88 +88 der_binary_to_pstm - 50 +50 get_finished - 42 +42 tls_xread_record 681 708 +27 ssl_server_main 285 288 +3 psRsaEncryptPub 395 199 -196 tls_handshake 2069 1690 -379 ------------------------------------------------------------------------------ (add/remove: 8/0 grow/shrink: 4/2 up/down: 3071/-575) Total: 2496 bytes Signed-off-by: Denys Vlasenko --- include/libbb.h | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'include') diff --git a/include/libbb.h b/include/libbb.h index ecdbd9234..434a660bd 100644 --- a/include/libbb.h +++ b/include/libbb.h @@ -870,8 +870,11 @@ typedef struct tls_state { int ofd; int ifd; - unsigned min_encrypted_len_on_read; +#if ENABLE_SSL_SERVER // || ENABLE_FEATURE_HTTPD_SSL + smallint expecting_first_packet; +#endif uint16_t cipher_id; + unsigned min_encrypted_len_on_read; unsigned MAC_size; unsigned key_size; unsigned IV_size; @@ -913,8 +916,8 @@ typedef struct tls_state { uint8_t H[16]; //used by AES_GCM #if ENABLE_SSL_SERVER // || ENABLE_FEATURE_HTTPD_SSL - const char *privkey_in_der_format; - const char *cert_in_der_format; + /* For ECDHE: server's ephemeral EC private key */ + //uint8_t ecc_priv_key32[32]; #endif } tls_state_t; -- cgit v1.2.3-55-g6feb