Lines Matching refs:opt
403 } opt; variable
902 opt.server_addr = DFL_SERVER_ADDR; in main()
903 opt.server_port = DFL_SERVER_PORT; in main()
904 opt.debug_level = DFL_DEBUG_LEVEL; in main()
905 opt.nbio = DFL_NBIO; in main()
906 opt.read_timeout = DFL_READ_TIMEOUT; in main()
907 opt.ca_file = DFL_CA_FILE; in main()
908 opt.ca_path = DFL_CA_PATH; in main()
909 opt.crt_file = DFL_CRT_FILE; in main()
910 opt.key_file = DFL_KEY_FILE; in main()
911 opt.crt_file2 = DFL_CRT_FILE2; in main()
912 opt.key_file2 = DFL_KEY_FILE2; in main()
913 opt.psk = DFL_PSK; in main()
914 opt.psk_identity = DFL_PSK_IDENTITY; in main()
915 opt.psk_list = DFL_PSK_LIST; in main()
916 opt.ecjpake_pw = DFL_ECJPAKE_PW; in main()
917 opt.force_ciphersuite[0]= DFL_FORCE_CIPHER; in main()
918 opt.version_suites = DFL_VERSION_SUITES; in main()
919 opt.renegotiation = DFL_RENEGOTIATION; in main()
920 opt.allow_legacy = DFL_ALLOW_LEGACY; in main()
921 opt.renegotiate = DFL_RENEGOTIATE; in main()
922 opt.renego_delay = DFL_RENEGO_DELAY; in main()
923 opt.renego_period = DFL_RENEGO_PERIOD; in main()
924 opt.exchanges = DFL_EXCHANGES; in main()
925 opt.min_version = DFL_MIN_VERSION; in main()
926 opt.max_version = DFL_MAX_VERSION; in main()
927 opt.arc4 = DFL_ARC4; in main()
928 opt.auth_mode = DFL_AUTH_MODE; in main()
929 opt.mfl_code = DFL_MFL_CODE; in main()
930 opt.trunc_hmac = DFL_TRUNC_HMAC; in main()
931 opt.tickets = DFL_TICKETS; in main()
932 opt.ticket_timeout = DFL_TICKET_TIMEOUT; in main()
933 opt.cache_max = DFL_CACHE_MAX; in main()
934 opt.cache_timeout = DFL_CACHE_TIMEOUT; in main()
935 opt.sni = DFL_SNI; in main()
936 opt.alpn_string = DFL_ALPN_STRING; in main()
937 opt.dhm_file = DFL_DHM_FILE; in main()
938 opt.transport = DFL_TRANSPORT; in main()
939 opt.cookies = DFL_COOKIES; in main()
940 opt.anti_replay = DFL_ANTI_REPLAY; in main()
941 opt.hs_to_min = DFL_HS_TO_MIN; in main()
942 opt.hs_to_max = DFL_HS_TO_MAX; in main()
943 opt.badmac_limit = DFL_BADMAC_LIMIT; in main()
944 opt.extended_ms = DFL_EXTENDED_MS; in main()
945 opt.etm = DFL_ETM; in main()
955 opt.server_port = q; in main()
957 opt.server_addr = q; in main()
962 opt.transport = MBEDTLS_SSL_TRANSPORT_STREAM; in main()
964 opt.transport = MBEDTLS_SSL_TRANSPORT_DATAGRAM; in main()
970 opt.debug_level = atoi( q ); in main()
971 if( opt.debug_level < 0 || opt.debug_level > 65535 ) in main()
976 opt.nbio = atoi( q ); in main()
977 if( opt.nbio < 0 || opt.nbio > 2 ) in main()
981 opt.read_timeout = atoi( q ); in main()
983 opt.ca_file = q; in main()
985 opt.ca_path = q; in main()
987 opt.crt_file = q; in main()
989 opt.key_file = q; in main()
991 opt.crt_file2 = q; in main()
993 opt.key_file2 = q; in main()
995 opt.dhm_file = q; in main()
997 opt.psk = q; in main()
999 opt.psk_identity = q; in main()
1001 opt.psk_list = q; in main()
1003 opt.ecjpake_pw = q; in main()
1006 opt.force_ciphersuite[0] = mbedtls_ssl_get_ciphersuite_id( q ); in main()
1008 if( opt.force_ciphersuite[0] == 0 ) in main()
1013 opt.force_ciphersuite[1] = 0; in main()
1016 opt.version_suites = q; in main()
1019 opt.renegotiation = (atoi( q )) ? MBEDTLS_SSL_RENEGOTIATION_ENABLED : in main()
1026 case -1: opt.allow_legacy = MBEDTLS_SSL_LEGACY_BREAK_HANDSHAKE; break; in main()
1027 case 0: opt.allow_legacy = MBEDTLS_SSL_LEGACY_NO_RENEGOTIATION; break; in main()
1028 case 1: opt.allow_legacy = MBEDTLS_SSL_LEGACY_ALLOW_RENEGOTIATION; break; in main()
1034 opt.renegotiate = atoi( q ); in main()
1035 if( opt.renegotiate < 0 || opt.renegotiate > 1 ) in main()
1040 opt.renego_delay = atoi( q ); in main()
1044 opt.renego_period = atoi( q ); in main()
1045 if( opt.renego_period < 2 || opt.renego_period > 255 ) in main()
1050 opt.exchanges = atoi( q ); in main()
1051 if( opt.exchanges < 0 ) in main()
1057 opt.min_version = MBEDTLS_SSL_MINOR_VERSION_0; in main()
1059 opt.min_version = MBEDTLS_SSL_MINOR_VERSION_1; in main()
1062 opt.min_version = MBEDTLS_SSL_MINOR_VERSION_2; in main()
1065 opt.min_version = MBEDTLS_SSL_MINOR_VERSION_3; in main()
1072 opt.max_version = MBEDTLS_SSL_MINOR_VERSION_0; in main()
1074 opt.max_version = MBEDTLS_SSL_MINOR_VERSION_1; in main()
1077 opt.max_version = MBEDTLS_SSL_MINOR_VERSION_2; in main()
1080 opt.max_version = MBEDTLS_SSL_MINOR_VERSION_3; in main()
1088 case 0: opt.arc4 = MBEDTLS_SSL_ARC4_DISABLED; break; in main()
1089 case 1: opt.arc4 = MBEDTLS_SSL_ARC4_ENABLED; break; in main()
1097 opt.min_version = MBEDTLS_SSL_MINOR_VERSION_0; in main()
1098 opt.max_version = MBEDTLS_SSL_MINOR_VERSION_0; in main()
1102 opt.min_version = MBEDTLS_SSL_MINOR_VERSION_1; in main()
1103 opt.max_version = MBEDTLS_SSL_MINOR_VERSION_1; in main()
1107 opt.min_version = MBEDTLS_SSL_MINOR_VERSION_2; in main()
1108 opt.max_version = MBEDTLS_SSL_MINOR_VERSION_2; in main()
1112 opt.min_version = MBEDTLS_SSL_MINOR_VERSION_3; in main()
1113 opt.max_version = MBEDTLS_SSL_MINOR_VERSION_3; in main()
1117 opt.min_version = MBEDTLS_SSL_MINOR_VERSION_2; in main()
1118 opt.max_version = MBEDTLS_SSL_MINOR_VERSION_2; in main()
1119 opt.transport = MBEDTLS_SSL_TRANSPORT_DATAGRAM; in main()
1123 opt.min_version = MBEDTLS_SSL_MINOR_VERSION_3; in main()
1124 opt.max_version = MBEDTLS_SSL_MINOR_VERSION_3; in main()
1125 opt.transport = MBEDTLS_SSL_TRANSPORT_DATAGRAM; in main()
1132 if( ( opt.auth_mode = get_auth_mode( q ) ) < 0 ) in main()
1138 opt.mfl_code = MBEDTLS_SSL_MAX_FRAG_LEN_512; in main()
1140 opt.mfl_code = MBEDTLS_SSL_MAX_FRAG_LEN_1024; in main()
1142 opt.mfl_code = MBEDTLS_SSL_MAX_FRAG_LEN_2048; in main()
1144 opt.mfl_code = MBEDTLS_SSL_MAX_FRAG_LEN_4096; in main()
1150 opt.alpn_string = q; in main()
1156 case 0: opt.trunc_hmac = MBEDTLS_SSL_TRUNC_HMAC_DISABLED; break; in main()
1157 case 1: opt.trunc_hmac = MBEDTLS_SSL_TRUNC_HMAC_ENABLED; break; in main()
1165 case 0: opt.extended_ms = MBEDTLS_SSL_EXTENDED_MS_DISABLED; break; in main()
1166 case 1: opt.extended_ms = MBEDTLS_SSL_EXTENDED_MS_ENABLED; break; in main()
1174 case 0: opt.etm = MBEDTLS_SSL_ETM_DISABLED; break; in main()
1175 case 1: opt.etm = MBEDTLS_SSL_ETM_ENABLED; break; in main()
1181 opt.tickets = atoi( q ); in main()
1182 if( opt.tickets < 0 || opt.tickets > 1 ) in main()
1187 opt.ticket_timeout = atoi( q ); in main()
1188 if( opt.ticket_timeout < 0 ) in main()
1193 opt.cache_max = atoi( q ); in main()
1194 if( opt.cache_max < 0 ) in main()
1199 opt.cache_timeout = atoi( q ); in main()
1200 if( opt.cache_timeout < 0 ) in main()
1205 opt.cookies = atoi( q ); in main()
1206 if( opt.cookies < -1 || opt.cookies > 1) in main()
1211 opt.anti_replay = atoi( q ); in main()
1212 if( opt.anti_replay < 0 || opt.anti_replay > 1) in main()
1217 opt.badmac_limit = atoi( q ); in main()
1218 if( opt.badmac_limit < 0 ) in main()
1226 opt.hs_to_min = atoi( q ); in main()
1227 opt.hs_to_max = atoi( p ); in main()
1228 if( opt.hs_to_min == 0 || opt.hs_to_max < opt.hs_to_min ) in main()
1233 opt.sni = q; in main()
1240 mbedtls_debug_set_threshold( opt.debug_level ); in main()
1243 if( opt.force_ciphersuite[0] > 0 ) in main()
1246 ciphersuite_info = mbedtls_ssl_ciphersuite_from_id( opt.force_ciphersuite[0] ); in main()
1248 if( opt.max_version != -1 && in main()
1249 ciphersuite_info->min_minor_ver > opt.max_version ) in main()
1255 if( opt.min_version != -1 && in main()
1256 ciphersuite_info->max_minor_ver < opt.min_version ) in main()
1265 if( opt.max_version == -1 || in main()
1266 opt.max_version > ciphersuite_info->max_minor_ver ) in main()
1268 opt.max_version = ciphersuite_info->max_minor_ver; in main()
1270 if( opt.min_version < ciphersuite_info->min_minor_ver ) in main()
1272 opt.min_version = ciphersuite_info->min_minor_ver; in main()
1274 if( opt.transport == MBEDTLS_SSL_TRANSPORT_DATAGRAM && in main()
1275 opt.min_version < MBEDTLS_SSL_MINOR_VERSION_2 ) in main()
1276 opt.min_version = MBEDTLS_SSL_MINOR_VERSION_2; in main()
1282 if( opt.arc4 == MBEDTLS_SSL_ARC4_DISABLED ) in main()
1289 opt.arc4 = MBEDTLS_SSL_ARC4_ENABLED; in main()
1293 if( opt.version_suites != NULL ) in main()
1298 for( i = 0, p = (char *) opt.version_suites; in main()
1338 if( unhexify( psk, opt.psk, &psk_len ) != 0 ) in main()
1344 if( opt.psk_list != NULL ) in main()
1346 if( ( psk_info = psk_parse( opt.psk_list ) ) == NULL ) in main()
1355 if( opt.alpn_string != NULL ) in main()
1357 p = (char *) opt.alpn_string; in main()
1399 if( strlen( opt.ca_path ) ) in main()
1400 if( strcmp( opt.ca_path, "none" ) == 0 ) in main()
1403 ret = mbedtls_x509_crt_parse_path( &cacert, opt.ca_path ); in main()
1404 else if( strlen( opt.ca_file ) ) in main()
1405 if( strcmp( opt.ca_file, "none" ) == 0 ) in main()
1408 ret = mbedtls_x509_crt_parse_file( &cacert, opt.ca_file ); in main()
1441 if( strlen( opt.crt_file ) && strcmp( opt.crt_file, "none" ) != 0 ) in main()
1444 if( ( ret = mbedtls_x509_crt_parse_file( &srvcert, opt.crt_file ) ) != 0 ) in main()
1451 if( strlen( opt.key_file ) && strcmp( opt.key_file, "none" ) != 0 ) in main()
1454 if( ( ret = mbedtls_pk_parse_keyfile( &pkey, opt.key_file, "" ) ) != 0 ) in main()
1466 if( strlen( opt.crt_file2 ) && strcmp( opt.crt_file2, "none" ) != 0 ) in main()
1469 if( ( ret = mbedtls_x509_crt_parse_file( &srvcert2, opt.crt_file2 ) ) != 0 ) in main()
1476 if( strlen( opt.key_file2 ) && strcmp( opt.key_file2, "none" ) != 0 ) in main()
1479 if( ( ret = mbedtls_pk_parse_keyfile( &pkey2, opt.key_file2, "" ) ) != 0 ) in main()
1493 strcmp( opt.crt_file, "none" ) != 0 && in main()
1494 strcmp( opt.key_file, "none" ) != 0 && in main()
1496 strcmp( opt.crt_file2, "none" ) != 0 && in main()
1497 strcmp( opt.key_file2, "none" ) != 0 ) in main()
1545 if( opt.dhm_file != NULL ) in main()
1550 if( ( ret = mbedtls_dhm_parse_dhmfile( &dhm, opt.dhm_file ) ) != 0 ) in main()
1562 if( opt.sni != NULL ) in main()
1567 if( ( sni_info = sni_parse( opt.sni ) ) == NULL ) in main()
1581 opt.transport == MBEDTLS_SSL_TRANSPORT_STREAM ? "tcp" : "udp", in main()
1582 opt.server_addr ? opt.server_addr : "*", in main()
1583 opt.server_port ); in main()
1586 if( ( ret = mbedtls_net_bind( &listen_fd, opt.server_addr, opt.server_port, in main()
1587 opt.transport == MBEDTLS_SSL_TRANSPORT_STREAM ? in main()
1604 opt.transport, in main()
1611 if( opt.auth_mode != DFL_AUTH_MODE ) in main()
1612 mbedtls_ssl_conf_authmode( &conf, opt.auth_mode ); in main()
1615 if( opt.hs_to_min != DFL_HS_TO_MIN || opt.hs_to_max != DFL_HS_TO_MAX ) in main()
1616 mbedtls_ssl_conf_handshake_timeout( &conf, opt.hs_to_min, opt.hs_to_max ); in main()
1620 if( ( ret = mbedtls_ssl_conf_max_frag_len( &conf, opt.mfl_code ) ) != 0 ) in main()
1628 if( opt.trunc_hmac != DFL_TRUNC_HMAC ) in main()
1629 mbedtls_ssl_conf_truncated_hmac( &conf, opt.trunc_hmac ); in main()
1633 if( opt.extended_ms != DFL_EXTENDED_MS ) in main()
1634 mbedtls_ssl_conf_extended_master_secret( &conf, opt.extended_ms ); in main()
1638 if( opt.etm != DFL_ETM ) in main()
1639 mbedtls_ssl_conf_encrypt_then_mac( &conf, opt.etm ); in main()
1643 if( opt.alpn_string != NULL ) in main()
1655 if( opt.cache_max != -1 ) in main()
1656 mbedtls_ssl_cache_set_max_entries( &cache, opt.cache_max ); in main()
1658 if( opt.cache_timeout != -1 ) in main()
1659 mbedtls_ssl_cache_set_timeout( &cache, opt.cache_timeout ); in main()
1667 if( opt.tickets == MBEDTLS_SSL_SESSION_TICKETS_ENABLED ) in main()
1672 opt.ticket_timeout ) ) != 0 ) in main()
1686 if( opt.transport == MBEDTLS_SSL_TRANSPORT_DATAGRAM ) in main()
1689 if( opt.cookies > 0 ) in main()
1704 if( opt.cookies == 0 ) in main()
1715 if( opt.anti_replay != DFL_ANTI_REPLAY ) in main()
1716 mbedtls_ssl_conf_dtls_anti_replay( &conf, opt.anti_replay ); in main()
1720 if( opt.badmac_limit != DFL_BADMAC_LIMIT ) in main()
1721 mbedtls_ssl_conf_dtls_badmac_limit( &conf, opt.badmac_limit ); in main()
1726 if( opt.force_ciphersuite[0] != DFL_FORCE_CIPHER ) in main()
1727 mbedtls_ssl_conf_ciphersuites( &conf, opt.force_ciphersuite ); in main()
1730 if( opt.arc4 != DFL_ARC4 ) in main()
1731 mbedtls_ssl_conf_arc4_support( &conf, opt.arc4 ); in main()
1734 if( opt.version_suites != NULL ) in main()
1750 if( opt.allow_legacy != DFL_ALLOW_LEGACY ) in main()
1751 mbedtls_ssl_conf_legacy_renegotiation( &conf, opt.allow_legacy ); in main()
1753 mbedtls_ssl_conf_renegotiation( &conf, opt.renegotiation ); in main()
1755 if( opt.renego_delay != DFL_RENEGO_DELAY ) in main()
1756 mbedtls_ssl_conf_renegotiation_enforced( &conf, opt.renego_delay ); in main()
1758 if( opt.renego_period != DFL_RENEGO_PERIOD ) in main()
1760 renego_period[7] = opt.renego_period; in main()
1766 if( strcmp( opt.ca_path, "none" ) != 0 && in main()
1767 strcmp( opt.ca_file, "none" ) != 0 ) in main()
1786 if( opt.sni != NULL ) in main()
1791 if( strlen( opt.psk ) != 0 && strlen( opt.psk_identity ) != 0 ) in main()
1794 (const unsigned char *) opt.psk_identity, in main()
1795 strlen( opt.psk_identity ) ); in main()
1803 if( opt.psk_list != NULL ) in main()
1812 if( opt.dhm_file != NULL ) in main()
1822 if( opt.min_version != DFL_MIN_VERSION ) in main()
1823 mbedtls_ssl_conf_min_version( &conf, MBEDTLS_SSL_MAJOR_VERSION_3, opt.min_version ); in main()
1825 if( opt.max_version != DFL_MIN_VERSION ) in main()
1826 mbedtls_ssl_conf_max_version( &conf, MBEDTLS_SSL_MAJOR_VERSION_3, opt.max_version ); in main()
1834 if( opt.nbio == 2 ) in main()
1838 opt.nbio == 0 ? mbedtls_net_recv_timeout : NULL ); in main()
1898 if( opt.nbio > 0 ) in main()
1908 mbedtls_ssl_conf_read_timeout( &conf, opt.read_timeout ); in main()
1911 if( opt.transport == MBEDTLS_SSL_TRANSPORT_DATAGRAM ) in main()
1924 if( opt.ecjpake_pw != DFL_ECJPAKE_PW ) in main()
1927 (const unsigned char *) opt.ecjpake_pw, in main()
1928 strlen( opt.ecjpake_pw ) ) ) != 0 ) in main()
1990 if( opt.alpn_string != NULL ) in main()
2028 if( opt.exchanges == 0 ) in main()
2031 exchanges_left = opt.exchanges; in main()
2042 if( opt.transport == MBEDTLS_SSL_TRANSPORT_STREAM ) in main()
2171 if( opt.renegotiate && exchanges_left == opt.exchanges ) in main()
2199 if( opt.transport == MBEDTLS_SSL_TRANSPORT_STREAM ) in main()