Lines Matching refs:opt

353 } opt;  variable
582 opt.server_name = DFL_SERVER_NAME; in main()
583 opt.server_addr = DFL_SERVER_ADDR; in main()
584 opt.server_port = DFL_SERVER_PORT; in main()
585 opt.debug_level = DFL_DEBUG_LEVEL; in main()
586 opt.nbio = DFL_NBIO; in main()
587 opt.event = DFL_EVENT; in main()
588 opt.read_timeout = DFL_READ_TIMEOUT; in main()
589 opt.max_resend = DFL_MAX_RESEND; in main()
590 opt.request_page = DFL_REQUEST_PAGE; in main()
591 opt.request_size = DFL_REQUEST_SIZE; in main()
592 opt.ca_file = DFL_CA_FILE; in main()
593 opt.ca_path = DFL_CA_PATH; in main()
594 opt.crt_file = DFL_CRT_FILE; in main()
595 opt.key_file = DFL_KEY_FILE; in main()
596 opt.psk = DFL_PSK; in main()
597 opt.psk_identity = DFL_PSK_IDENTITY; in main()
598 opt.ecjpake_pw = DFL_ECJPAKE_PW; in main()
599 opt.force_ciphersuite[0]= DFL_FORCE_CIPHER; in main()
600 opt.renegotiation = DFL_RENEGOTIATION; in main()
601 opt.allow_legacy = DFL_ALLOW_LEGACY; in main()
602 opt.renegotiate = DFL_RENEGOTIATE; in main()
603 opt.exchanges = DFL_EXCHANGES; in main()
604 opt.min_version = DFL_MIN_VERSION; in main()
605 opt.max_version = DFL_MAX_VERSION; in main()
606 opt.arc4 = DFL_ARC4; in main()
607 opt.allow_sha1 = DFL_SHA1; in main()
608 opt.auth_mode = DFL_AUTH_MODE; in main()
609 opt.mfl_code = DFL_MFL_CODE; in main()
610 opt.trunc_hmac = DFL_TRUNC_HMAC; in main()
611 opt.recsplit = DFL_RECSPLIT; in main()
612 opt.dhmlen = DFL_DHMLEN; in main()
613 opt.reconnect = DFL_RECONNECT; in main()
614 opt.reco_delay = DFL_RECO_DELAY; in main()
615 opt.reconnect_hard = DFL_RECONNECT_HARD; in main()
616 opt.tickets = DFL_TICKETS; in main()
617 opt.alpn_string = DFL_ALPN_STRING; in main()
618 opt.curves = DFL_CURVES; in main()
619 opt.transport = DFL_TRANSPORT; in main()
620 opt.hs_to_min = DFL_HS_TO_MIN; in main()
621 opt.hs_to_max = DFL_HS_TO_MAX; in main()
622 opt.fallback = DFL_FALLBACK; in main()
623 opt.extended_ms = DFL_EXTENDED_MS; in main()
624 opt.etm = DFL_ETM; in main()
634 opt.server_name = q; in main()
636 opt.server_addr = q; in main()
638 opt.server_port = q; in main()
643 opt.transport = MBEDTLS_SSL_TRANSPORT_STREAM; in main()
645 opt.transport = MBEDTLS_SSL_TRANSPORT_DATAGRAM; in main()
651 opt.debug_level = atoi( q ); in main()
652 if( opt.debug_level < 0 || opt.debug_level > 65535 ) in main()
657 opt.nbio = atoi( q ); in main()
658 if( opt.nbio < 0 || opt.nbio > 2 ) in main()
663 opt.event = atoi( q ); in main()
664 if( opt.event < 0 || opt.event > 2 ) in main()
668 opt.read_timeout = atoi( q ); in main()
671 opt.max_resend = atoi( q ); in main()
672 if( opt.max_resend < 0 ) in main()
676 opt.request_page = q; in main()
679 opt.request_size = atoi( q ); in main()
680 if( opt.request_size < 0 || in main()
681 opt.request_size > MAX_REQUEST_SIZE ) in main()
685 opt.ca_file = q; in main()
687 opt.ca_path = q; in main()
689 opt.crt_file = q; in main()
691 opt.key_file = q; in main()
693 opt.psk = q; in main()
695 opt.psk_identity = q; in main()
697 opt.ecjpake_pw = q; in main()
700 opt.force_ciphersuite[0] = mbedtls_ssl_get_ciphersuite_id( q ); in main()
702 if( opt.force_ciphersuite[0] == 0 ) in main()
707 opt.force_ciphersuite[1] = 0; in main()
711 opt.renegotiation = (atoi( q )) ? in main()
720 opt.allow_legacy = MBEDTLS_SSL_LEGACY_BREAK_HANDSHAKE; in main()
723 opt.allow_legacy = MBEDTLS_SSL_LEGACY_NO_RENEGOTIATION; in main()
726 opt.allow_legacy = MBEDTLS_SSL_LEGACY_ALLOW_RENEGOTIATION; in main()
733 opt.renegotiate = atoi( q ); in main()
734 if( opt.renegotiate < 0 || opt.renegotiate > 1 ) in main()
739 opt.exchanges = atoi( q ); in main()
740 if( opt.exchanges < 1 ) in main()
745 opt.reconnect = atoi( q ); in main()
746 if( opt.reconnect < 0 || opt.reconnect > 2 ) in main()
751 opt.reco_delay = atoi( q ); in main()
752 if( opt.reco_delay < 0 ) in main()
757 opt.reconnect_hard = atoi( q ); in main()
758 if( opt.reconnect_hard < 0 || opt.reconnect_hard > 1 ) in main()
763 opt.tickets = atoi( q ); in main()
764 if( opt.tickets < 0 || opt.tickets > 2 ) in main()
769 opt.alpn_string = q; in main()
775 case 0: opt.fallback = MBEDTLS_SSL_IS_NOT_FALLBACK; break; in main()
776 case 1: opt.fallback = MBEDTLS_SSL_IS_FALLBACK; break; in main()
785 opt.extended_ms = MBEDTLS_SSL_EXTENDED_MS_DISABLED; in main()
788 opt.extended_ms = MBEDTLS_SSL_EXTENDED_MS_ENABLED; in main()
794 opt.curves = q; in main()
799 case 0: opt.etm = MBEDTLS_SSL_ETM_DISABLED; break; in main()
800 case 1: opt.etm = MBEDTLS_SSL_ETM_ENABLED; break; in main()
807 opt.min_version = MBEDTLS_SSL_MINOR_VERSION_0; in main()
809 opt.min_version = MBEDTLS_SSL_MINOR_VERSION_1; in main()
812 opt.min_version = MBEDTLS_SSL_MINOR_VERSION_2; in main()
815 opt.min_version = MBEDTLS_SSL_MINOR_VERSION_3; in main()
822 opt.max_version = MBEDTLS_SSL_MINOR_VERSION_0; in main()
824 opt.max_version = MBEDTLS_SSL_MINOR_VERSION_1; in main()
827 opt.max_version = MBEDTLS_SSL_MINOR_VERSION_2; in main()
830 opt.max_version = MBEDTLS_SSL_MINOR_VERSION_3; in main()
838 case 0: opt.arc4 = MBEDTLS_SSL_ARC4_DISABLED; break; in main()
839 case 1: opt.arc4 = MBEDTLS_SSL_ARC4_ENABLED; break; in main()
847 case 0: opt.allow_sha1 = 0; break; in main()
848 case 1: opt.allow_sha1 = 1; break; in main()
856 opt.min_version = MBEDTLS_SSL_MINOR_VERSION_0; in main()
857 opt.max_version = MBEDTLS_SSL_MINOR_VERSION_0; in main()
861 opt.min_version = MBEDTLS_SSL_MINOR_VERSION_1; in main()
862 opt.max_version = MBEDTLS_SSL_MINOR_VERSION_1; in main()
866 opt.min_version = MBEDTLS_SSL_MINOR_VERSION_2; in main()
867 opt.max_version = MBEDTLS_SSL_MINOR_VERSION_2; in main()
871 opt.min_version = MBEDTLS_SSL_MINOR_VERSION_3; in main()
872 opt.max_version = MBEDTLS_SSL_MINOR_VERSION_3; in main()
876 opt.min_version = MBEDTLS_SSL_MINOR_VERSION_2; in main()
877 opt.max_version = MBEDTLS_SSL_MINOR_VERSION_2; in main()
878 opt.transport = MBEDTLS_SSL_TRANSPORT_DATAGRAM; in main()
882 opt.min_version = MBEDTLS_SSL_MINOR_VERSION_3; in main()
883 opt.max_version = MBEDTLS_SSL_MINOR_VERSION_3; in main()
884 opt.transport = MBEDTLS_SSL_TRANSPORT_DATAGRAM; in main()
892 opt.auth_mode = MBEDTLS_SSL_VERIFY_NONE; in main()
894 opt.auth_mode = MBEDTLS_SSL_VERIFY_OPTIONAL; in main()
896 opt.auth_mode = MBEDTLS_SSL_VERIFY_REQUIRED; in main()
903 opt.mfl_code = MBEDTLS_SSL_MAX_FRAG_LEN_512; in main()
905 opt.mfl_code = MBEDTLS_SSL_MAX_FRAG_LEN_1024; in main()
907 opt.mfl_code = MBEDTLS_SSL_MAX_FRAG_LEN_2048; in main()
909 opt.mfl_code = MBEDTLS_SSL_MAX_FRAG_LEN_4096; in main()
917 case 0: opt.trunc_hmac = MBEDTLS_SSL_TRUNC_HMAC_DISABLED; break; in main()
918 case 1: opt.trunc_hmac = MBEDTLS_SSL_TRUNC_HMAC_ENABLED; break; in main()
927 opt.hs_to_min = atoi( q ); in main()
928 opt.hs_to_max = atoi( p ); in main()
929 if( opt.hs_to_min == 0 || opt.hs_to_max < opt.hs_to_min ) in main()
934 opt.recsplit = atoi( q ); in main()
935 if( opt.recsplit < 0 || opt.recsplit > 1 ) in main()
940 opt.dhmlen = atoi( q ); in main()
941 if( opt.dhmlen < 0 ) in main()
951 if( opt.event == 1 && opt.nbio != 1 ) in main()
954 opt.nbio = 1; in main()
958 mbedtls_debug_set_threshold( opt.debug_level ); in main()
961 if( opt.force_ciphersuite[0] > 0 ) in main()
965 mbedtls_ssl_ciphersuite_from_id( opt.force_ciphersuite[0] ); in main()
967 if( opt.max_version != -1 && in main()
968 ciphersuite_info->min_minor_ver > opt.max_version ) in main()
974 if( opt.min_version != -1 && in main()
975 ciphersuite_info->max_minor_ver < opt.min_version ) in main()
984 if( opt.max_version == -1 || in main()
985 opt.max_version > ciphersuite_info->max_minor_ver ) in main()
987 opt.max_version = ciphersuite_info->max_minor_ver; in main()
989 if( opt.min_version < ciphersuite_info->min_minor_ver ) in main()
991 opt.min_version = ciphersuite_info->min_minor_ver; in main()
993 if( opt.transport == MBEDTLS_SSL_TRANSPORT_DATAGRAM && in main()
994 opt.min_version < MBEDTLS_SSL_MINOR_VERSION_2 ) in main()
995 opt.min_version = MBEDTLS_SSL_MINOR_VERSION_2; in main()
1001 if( opt.arc4 == MBEDTLS_SSL_ARC4_DISABLED ) in main()
1008 opt.arc4 = MBEDTLS_SSL_ARC4_ENABLED; in main()
1016 if( strlen( opt.psk ) ) in main()
1021 if( strlen( opt.psk ) % 2 != 0 ) in main()
1027 psk_len = strlen( opt.psk ) / 2; in main()
1029 for( j = 0; j < strlen( opt.psk ); j += 2 ) in main()
1031 c = opt.psk[j]; in main()
1045 c = opt.psk[j + 1]; in main()
1063 if( opt.curves != NULL ) in main()
1065 p = (char *) opt.curves; in main()
1119 if( opt.alpn_string != NULL ) in main()
1121 p = (char *) opt.alpn_string; in main()
1164 if( strlen( opt.ca_path ) ) in main()
1165 if( strcmp( opt.ca_path, "none" ) == 0 ) in main()
1168 ret = mbedtls_x509_crt_parse_path( &cacert, opt.ca_path ); in main()
1169 else if( strlen( opt.ca_file ) ) in main()
1170 if( strcmp( opt.ca_file, "none" ) == 0 ) in main()
1173 ret = mbedtls_x509_crt_parse_file( &cacert, opt.ca_file ); in main()
1209 if( strlen( opt.crt_file ) ) in main()
1210 if( strcmp( opt.crt_file, "none" ) == 0 ) in main()
1213 ret = mbedtls_x509_crt_parse_file( &clicert, opt.crt_file ); in main()
1234 if( strlen( opt.key_file ) ) in main()
1235 if( strcmp( opt.key_file, "none" ) == 0 ) in main()
1238 ret = mbedtls_pk_parse_keyfile( &pkey, opt.key_file, "" ); in main()
1264 if( opt.server_addr == NULL) in main()
1265 opt.server_addr = opt.server_name; in main()
1268 opt.transport == MBEDTLS_SSL_TRANSPORT_STREAM ? "tcp" : "udp", in main()
1269 opt.server_addr, opt.server_port ); in main()
1273 opt.server_addr, opt.server_port, in main()
1274 opt.transport == MBEDTLS_SSL_TRANSPORT_STREAM ? in main()
1282 if( opt.nbio > 0 ) in main()
1303 opt.transport, in main()
1314 if( opt.allow_sha1 > 0 ) in main()
1321 if( opt.debug_level > 0 ) in main()
1325 if( opt.auth_mode != DFL_AUTH_MODE ) in main()
1326 mbedtls_ssl_conf_authmode( &conf, opt.auth_mode ); in main()
1329 if( opt.hs_to_min != DFL_HS_TO_MIN || opt.hs_to_max != DFL_HS_TO_MAX ) in main()
1330 mbedtls_ssl_conf_handshake_timeout( &conf, opt.hs_to_min, in main()
1331 opt.hs_to_max ); in main()
1335 if( ( ret = mbedtls_ssl_conf_max_frag_len( &conf, opt.mfl_code ) ) != 0 ) in main()
1344 if( opt.trunc_hmac != DFL_TRUNC_HMAC ) in main()
1345 mbedtls_ssl_conf_truncated_hmac( &conf, opt.trunc_hmac ); in main()
1349 if( opt.extended_ms != DFL_EXTENDED_MS ) in main()
1350 mbedtls_ssl_conf_extended_master_secret( &conf, opt.extended_ms ); in main()
1354 if( opt.etm != DFL_ETM ) in main()
1355 mbedtls_ssl_conf_encrypt_then_mac( &conf, opt.etm ); in main()
1359 if( opt.recsplit != DFL_RECSPLIT ) in main()
1360 mbedtls_ssl_conf_cbc_record_splitting( &conf, opt.recsplit in main()
1366 if( opt.dhmlen != DFL_DHMLEN ) in main()
1367 mbedtls_ssl_conf_dhm_min_bitlen( &conf, opt.dhmlen ); in main()
1371 if( opt.alpn_string != NULL ) in main()
1383 mbedtls_ssl_conf_read_timeout( &conf, opt.read_timeout ); in main()
1386 mbedtls_ssl_conf_session_tickets( &conf, opt.tickets ); in main()
1389 if( opt.force_ciphersuite[0] != DFL_FORCE_CIPHER ) in main()
1390 mbedtls_ssl_conf_ciphersuites( &conf, opt.force_ciphersuite ); in main()
1393 if( opt.arc4 != DFL_ARC4 ) in main()
1394 mbedtls_ssl_conf_arc4_support( &conf, opt.arc4 ); in main()
1397 if( opt.allow_legacy != DFL_ALLOW_LEGACY ) in main()
1398 mbedtls_ssl_conf_legacy_renegotiation( &conf, opt.allow_legacy ); in main()
1400 mbedtls_ssl_conf_renegotiation( &conf, opt.renegotiation ); in main()
1404 if( strcmp( opt.ca_path, "none" ) != 0 && in main()
1405 strcmp( opt.ca_file, "none" ) != 0 ) in main()
1409 if( strcmp( opt.crt_file, "none" ) != 0 && in main()
1410 strcmp( opt.key_file, "none" ) != 0 ) in main()
1422 if( opt.curves != NULL && in main()
1423 strcmp( opt.curves, "default" ) != 0 ) in main()
1431 (const unsigned char *) opt.psk_identity, in main()
1432 strlen( opt.psk_identity ) ) ) != 0 ) in main()
1440 if( opt.min_version != DFL_MIN_VERSION ) in main()
1442 opt.min_version ); in main()
1444 if( opt.max_version != DFL_MAX_VERSION ) in main()
1446 opt.max_version ); in main()
1449 if( opt.fallback != DFL_FALLBACK ) in main()
1450 mbedtls_ssl_conf_fallback( &conf, opt.fallback ); in main()
1461 if( ( ret = mbedtls_ssl_set_hostname( &ssl, opt.server_name ) ) != 0 ) in main()
1470 if( opt.ecjpake_pw != DFL_ECJPAKE_PW ) in main()
1473 (const unsigned char *) opt.ecjpake_pw, in main()
1474 strlen( opt.ecjpake_pw ) ) ) != 0 ) in main()
1483 if( opt.nbio == 2 ) in main()
1488 opt.nbio == 0 ? mbedtls_net_recv_timeout : NULL ); in main()
1523 if( opt.event == 1 /* level triggered IO */ ) in main()
1550 if( opt.alpn_string != NULL ) in main()
1558 if( opt.reconnect != 0 ) in main()
1603 if( opt.renegotiate ) in main()
1622 if( opt.event == 1 /* level triggered IO */ ) in main()
1639 retry_left = opt.max_resend; in main()
1645 opt.request_page ); in main()
1649 if( opt.request_size != DFL_REQUEST_SIZE && in main()
1650 len + tail_len < opt.request_size ) in main()
1652 memset( buf + len, 'A', opt.request_size - len - tail_len ); in main()
1653 len += opt.request_size - len - tail_len; in main()
1660 if( opt.request_size != DFL_REQUEST_SIZE && in main()
1661 len > opt.request_size ) in main()
1663 len = opt.request_size; in main()
1670 if( opt.transport == MBEDTLS_SSL_TRANSPORT_STREAM ) in main()
1689 if( opt.event == 1 /* level triggered IO */ ) in main()
1715 if( opt.event == 1 /* level triggered IO */ ) in main()
1749 opt.request_size = DFL_REQUEST_SIZE; in main()
1762 if( opt.transport == MBEDTLS_SSL_TRANSPORT_STREAM ) in main()
1774 if( opt.event == 1 /* level triggered IO */ ) in main()
1835 if( opt.event == 1 /* level triggered IO */ ) in main()
1875 if( opt.reconnect_hard != 0 ) in main()
1877 opt.reconnect_hard = 0; in main()
1900 if( opt.event == 1 /* level triggered IO */ ) in main()
1918 if( --opt.exchanges > 0 ) in main()
1939 if( opt.reconnect != 0 ) in main()
1941 --opt.reconnect; in main()
1946 if( opt.reco_delay > 0 ) in main()
1947 mbedtls_net_usleep( 1000000 * opt.reco_delay ); in main()
1967 opt.server_addr, opt.server_port, in main()
1968 opt.transport == MBEDTLS_SSL_TRANSPORT_STREAM ? in main()
1976 if( opt.nbio > 0 ) in main()