separate TLS code into a library, use in in wget
authorDenys Vlasenko <vda.linux@googlemail.com>
Mon, 23 Jan 2017 00:08:16 +0000 (01:08 +0100)
committerDenys Vlasenko <vda.linux@googlemail.com>
Mon, 23 Jan 2017 00:08:16 +0000 (01:08 +0100)
commit9a647c326a41e8160d53e6cb5470161a44c0e8cf
tree1fef73df291e5c5897aef1bb32b65206caacf879
parente1f90d13fa07d2974908470ce818ef956b7740f2
separate TLS code into a library, use in in wget

A new applet, ssl_client, is the TLS debug thing now.
It doubles as wget's NOMMU helper.
In MMU mode, wget still forks, but then directly calls TLS code,
without execing.

This can also be applied to sendmail/popmail (SMTPS / SMTP+starttls support)
and nc --ssl (ncat, nmap's nc clone, has such option).

function                                             old     new   delta
tls_handshake                                          -    1691   +1691
tls_run_copy_loop                                      -     443    +443
ssl_client_main                                        -     128    +128
packed_usage                                       30978   31007     +29
wget_main                                           2508    2535     +27
applet_names                                        2553    2560      +7
...
xwrite_encrypted                                     360     342     -18
tls_main                                            2127       -   -2127
------------------------------------------------------------------------------
(add/remove: 4/1 grow/shrink: 13/8 up/down: 2351/-2195)       Total: 156 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
include/libbb.h
networking/ssl_client.c [new file with mode: 0644]
networking/tls.c
networking/wget.c