aboutsummaryrefslogtreecommitdiff
path: root/include/libbb.h
diff options
context:
space:
mode:
authorRon Yorston <rmy@pobox.com>2018-11-28 10:28:18 +0000
committerRon Yorston <rmy@pobox.com>2018-11-28 10:28:18 +0000
commit2a69a2200a141c1504b662eca64b802cdab71b12 (patch)
treeeab0cc01852db237a26052a83c8f582ed92b7cd9 /include/libbb.h
parent97ca1f4b955f486cd26461cb09185335483d2921 (diff)
parent572dfb8e78323b9837f7c5e3369ee233a440b8f2 (diff)
downloadbusybox-w32-2a69a2200a141c1504b662eca64b802cdab71b12.tar.gz
busybox-w32-2a69a2200a141c1504b662eca64b802cdab71b12.tar.bz2
busybox-w32-2a69a2200a141c1504b662eca64b802cdab71b12.zip
Merge branch 'busybox' into merge
Diffstat (limited to 'include/libbb.h')
-rw-r--r--include/libbb.h33
1 files changed, 31 insertions, 2 deletions
diff --git a/include/libbb.h b/include/libbb.h
index 90fdd1178..405c929a2 100644
--- a/include/libbb.h
+++ b/include/libbb.h
@@ -777,18 +777,25 @@ struct hostent *xgethostbyname(const char *name) FAST_FUNC;
777// + inet_common.c has additional IPv4-only stuff 777// + inet_common.c has additional IPv4-only stuff
778 778
779 779
780struct tls_aes {
781 uint32_t key[60];
782 unsigned rounds;
783};
780#define TLS_MAX_MAC_SIZE 32 784#define TLS_MAX_MAC_SIZE 32
781#define TLS_MAX_KEY_SIZE 32 785#define TLS_MAX_KEY_SIZE 32
786#define TLS_MAX_IV_SIZE 4
782struct tls_handshake_data; /* opaque */ 787struct tls_handshake_data; /* opaque */
783typedef struct tls_state { 788typedef struct tls_state {
789 unsigned flags;
790
784 int ofd; 791 int ofd;
785 int ifd; 792 int ifd;
786 793
787 unsigned min_encrypted_len_on_read; 794 unsigned min_encrypted_len_on_read;
788 uint16_t cipher_id; 795 uint16_t cipher_id;
789 uint8_t encrypt_on_write;
790 unsigned MAC_size; 796 unsigned MAC_size;
791 unsigned key_size; 797 unsigned key_size;
798 unsigned IV_size;
792 799
793 uint8_t *outbuf; 800 uint8_t *outbuf;
794 int outbuf_size; 801 int outbuf_size;
@@ -810,12 +817,21 @@ typedef struct tls_state {
810 /*uint64_t read_seq64_be;*/ 817 /*uint64_t read_seq64_be;*/
811 uint64_t write_seq64_be; 818 uint64_t write_seq64_be;
812 819
820 /*uint8_t *server_write_MAC_key;*/
813 uint8_t *client_write_key; 821 uint8_t *client_write_key;
814 uint8_t *server_write_key; 822 uint8_t *server_write_key;
823 uint8_t *client_write_IV;
824 uint8_t *server_write_IV;
815 uint8_t client_write_MAC_key[TLS_MAX_MAC_SIZE]; 825 uint8_t client_write_MAC_key[TLS_MAX_MAC_SIZE];
816 uint8_t server_write_MAC_k__[TLS_MAX_MAC_SIZE]; 826 uint8_t server_write_MAC_k__[TLS_MAX_MAC_SIZE];
817 uint8_t client_write_k__[TLS_MAX_KEY_SIZE]; 827 uint8_t client_write_k__[TLS_MAX_KEY_SIZE];
818 uint8_t server_write_k__[TLS_MAX_KEY_SIZE]; 828 uint8_t server_write_k__[TLS_MAX_KEY_SIZE];
829 uint8_t client_write_I_[TLS_MAX_IV_SIZE];
830 uint8_t server_write_I_[TLS_MAX_IV_SIZE];
831
832 struct tls_aes aes_encrypt;
833 struct tls_aes aes_decrypt;
834 uint8_t H[16]; //used by AES_GCM
819} tls_state_t; 835} tls_state_t;
820 836
821static inline tls_state_t *new_tls_state(void) 837static inline tls_state_t *new_tls_state(void)
@@ -1366,9 +1382,22 @@ void bb_logenv_override(void) FAST_FUNC;
1366#define MAIN_EXTERNALLY_VISIBLE 1382#define MAIN_EXTERNALLY_VISIBLE
1367#endif 1383#endif
1368 1384
1385/* Embedded script support */
1386char *get_script_content(unsigned n) FAST_FUNC;
1387int scripted_main(int argc, char** argv);
1369 1388
1370/* Applets which are useful from another applets */ 1389/* Applets which are useful from another applets */
1371int bb_cat(char** argv) FAST_FUNC; 1390int bb_cat(char** argv) FAST_FUNC;
1391int ash_main(int argc, char** argv)
1392#if ENABLE_ASH || ENABLE_SH_IS_ASH || ENABLE_BASH_IS_ASH
1393 MAIN_EXTERNALLY_VISIBLE
1394#endif
1395;
1396int hush_main(int argc, char** argv)
1397#if ENABLE_HUSH || ENABLE_SH_IS_HUSH || ENABLE_BASH_IS_HUSH
1398 MAIN_EXTERNALLY_VISIBLE
1399#endif
1400;
1372/* If shell needs them, they exist even if not enabled as applets */ 1401/* If shell needs them, they exist even if not enabled as applets */
1373int echo_main(int argc, char** argv) IF_ECHO(MAIN_EXTERNALLY_VISIBLE); 1402int echo_main(int argc, char** argv) IF_ECHO(MAIN_EXTERNALLY_VISIBLE);
1374int printf_main(int argc, char **argv) IF_PRINTF(MAIN_EXTERNALLY_VISIBLE); 1403int printf_main(int argc, char **argv) IF_PRINTF(MAIN_EXTERNALLY_VISIBLE);
@@ -2041,7 +2070,7 @@ typedef struct bb_progress_t {
2041 (p)->curfile = NULL; \ 2070 (p)->curfile = NULL; \
2042} while (0) 2071} while (0)
2043void bb_progress_init(bb_progress_t *p, const char *curfile) FAST_FUNC; 2072void bb_progress_init(bb_progress_t *p, const char *curfile) FAST_FUNC;
2044void bb_progress_update(bb_progress_t *p, 2073int bb_progress_update(bb_progress_t *p,
2045 uoff_t beg_range, 2074 uoff_t beg_range,
2046 uoff_t transferred, 2075 uoff_t transferred,
2047 uoff_t totalsize) FAST_FUNC; 2076 uoff_t totalsize) FAST_FUNC;