Lines Matching full:if

12 #if defined(MBEDTLS_USE_PSA_CRYPTO) || defined(MBEDTLS_SSL_PROTO_TLS1_3)
16 #if defined(MBEDTLS_SSL_TEST_IMPOSSIBLE)
114 #if defined(MBEDTLS_SSL_HANDSHAKE_WITH_CERT_ENABLED)
124 #if defined(MBEDTLS_SSL_HANDSHAKE_WITH_CERT_ENABLED)
125 #if defined(MBEDTLS_FS_IO)
145 #if defined(MBEDTLS_USE_PSA_CRYPTO) && defined(MBEDTLS_SSL_HANDSHAKE_WITH_CERT_ENABLED)
147 " key_opaque=%%d Handle your private key as if it were opaque\n" \
153 #if defined(MBEDTLS_SSL_DTLS_CONNECTION_ID)
167 #if defined(MBEDTLS_SSL_HANDSHAKE_WITH_PSK_ENABLED)
172 #if defined(MBEDTLS_USE_PSA_CRYPTO)
191 #if defined(MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK)
199 #if defined(MBEDTLS_SSL_SESSION_TICKETS)
213 #if defined(MBEDTLS_SSL_DTLS_SRTP)
229 #if defined(MBEDTLS_SSL_MAX_FRAGMENT_LENGTH)
237 #if defined(MBEDTLS_DHM_C)
244 #if defined(MBEDTLS_SSL_ALPN)
252 #if defined(MBEDTLS_PK_HAVE_ECC_KEYS) || \
268 #if defined(MBEDTLS_SSL_HANDSHAKE_WITH_CERT_ENABLED)
276 #if defined(MBEDTLS_SSL_PROTO_DTLS)
289 #if defined(MBEDTLS_SSL_EXTENDED_MASTER_SECRET)
296 #if defined(MBEDTLS_SSL_ENCRYPT_THEN_MAC)
306 #if defined(MBEDTLS_SSL_RENEGOTIATION)
314 #if defined(MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED)
315 #if defined(MBEDTLS_USE_PSA_CRYPTO)
327 #if defined(MBEDTLS_ECP_RESTARTABLE)
334 #if defined(MBEDTLS_SSL_CONTEXT_SERIALIZATION)
348 #if defined(MBEDTLS_SSL_EARLY_DATA)
364 #if defined(MBEDTLS_SSL_PROTO_TLS1_3)
384 … " If 0, in the first exchange only an empty\n" \
440 #if defined(MBEDTLS_SSL_PROTO_TLS1_3)
455 " query_config=<name> return 0 if the specified\n" \
458 " is printed if it is defined\n" \
480 int key_opaque; /* handle private key as if it were opaque */
481 #if defined(MBEDTLS_USE_PSA_CRYPTO)
484 #if defined(MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK)
491 #if defined(MBEDTLS_USE_PSA_CRYPTO)
496 #if defined(MBEDTLS_SSL_PROTO_TLS1_3)
545 #if defined(MBEDTLS_SSL_EARLY_DATA)
558 #if defined(MBEDTLS_SSL_HANDSHAKE_WITH_CERT_ENABLED)
562 * Enabled if debug_level > 1 in code below
572 #if !defined(MBEDTLS_X509_REMOVE_INFO) in my_verify()
574 if (depth == 0) { in my_verify()
578 if (opt.debug_level == 0) { in my_verify()
588 if ((*flags) == 0) { in my_verify()
599 #if defined(MBEDTLS_SSL_DTLS_CONNECTION_ID)
608 if (opt.transport != MBEDTLS_SSL_TRANSPORT_DATAGRAM) { in report_cid_usage()
612 /* Check if the use of a CID has been negotiated, in report_cid_usage()
624 if (ret != 0) { in report_cid_usage()
630 if (cid_negotiated == MBEDTLS_SSL_CID_DISABLED) { in report_cid_usage()
631 if (opt.cid_enabled == MBEDTLS_SSL_CID_ENABLED) { in report_cid_usage()
643 if (ret != 0) { in report_cid_usage()
652 if (ret != 0) { in report_cid_usage()
679 if (*session_data != NULL) { in ssl_save_session_serialize()
688 if (ret != 0) { in ssl_save_session_serialize()
698 if (*session_data == NULL) { in ssl_save_session_serialize()
706 if ((ret = mbedtls_ssl_session_save(&exported_session, in ssl_save_session_serialize()
726 #if defined(MBEDTLS_SSL_HANDSHAKE_WITH_CERT_ENABLED) in main()
732 #if defined(MBEDTLS_SSL_HANDSHAKE_WITH_PSK_ENABLED) in main()
737 #if defined(MBEDTLS_SSL_DTLS_CONNECTION_ID) in main()
744 #if defined(MBEDTLS_SSL_ALPN) in main()
748 #if defined(MBEDTLS_MEMORY_BUFFER_ALLOC_C) in main()
752 #if defined(MBEDTLS_SSL_DTLS_SRTP) in main()
759 #if defined(MBEDTLS_USE_PSA_CRYPTO) in main()
760 #if defined(MBEDTLS_SSL_HANDSHAKE_WITH_PSK_ENABLED) in main()
776 #if defined(MBEDTLS_TIMING_C) in main()
779 #if defined(MBEDTLS_SSL_HANDSHAKE_WITH_CERT_ENABLED) in main()
785 #if defined(MBEDTLS_USE_PSA_CRYPTO) in main()
791 #if defined(MBEDTLS_SSL_CONTEXT_SERIALIZATION) in main()
799 #if defined(MBEDTLS_SSL_DTLS_SRTP) in main()
812 #if defined(MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED) && \ in main()
817 #if defined(MBEDTLS_MEMORY_BUFFER_ALLOC_C) in main()
821 #if defined(MBEDTLS_TEST_HOOKS) in main()
833 #if defined(MBEDTLS_SSL_HANDSHAKE_WITH_CERT_ENABLED) in main()
838 #if defined(MBEDTLS_SSL_ALPN) in main()
842 #if defined(MBEDTLS_USE_PSA_CRYPTO) || defined(MBEDTLS_SSL_PROTO_TLS1_3) in main()
844 if (status != PSA_SUCCESS) { in main()
851 #if defined(MBEDTLS_PSA_CRYPTO_EXTERNAL_RNG) in main()
855 if (argc < 2) { in main()
857 if (ret == 0) { in main()
870 if (!*list) { in main()
902 #if defined(MBEDTLS_USE_PSA_CRYPTO) in main()
905 #if defined(MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK) in main()
910 #if defined(MBEDTLS_USE_PSA_CRYPTO) in main()
915 #if defined(MBEDTLS_SSL_PROTO_TLS1_3) in main()
939 #if defined(MBEDTLS_SSL_EARLY_DATA) in main()
966 if ((q = strchr(p, '=')) == NULL) { in main()
971 if (strcmp(p, "server_name") == 0) { in main()
973 } else if (strcmp(p, "server_addr") == 0) { in main()
975 } else if (strcmp(p, "server_port") == 0) { in main()
977 } else if (strcmp(p, "dtls") == 0) { in main()
979 if (t == 0) { in main()
981 } else if (t == 1) { in main()
986 } else if (strcmp(p, "debug_level") == 0) { in main()
988 if (opt.debug_level < 0 || opt.debug_level > 65535) { in main()
991 } else if (strcmp(p, "build_version") == 0) { in main()
992 if (strcmp(q, "1") == 0) { in main()
998 } else if (strcmp(p, "context_crt_cb") == 0) { in main()
1000 if (opt.context_crt_cb != 0 && opt.context_crt_cb != 1) { in main()
1003 } else if (strcmp(p, "nbio") == 0) { in main()
1005 if (opt.nbio < 0 || opt.nbio > 2) { in main()
1008 } else if (strcmp(p, "event") == 0) { in main()
1010 if (opt.event < 0 || opt.event > 2) { in main()
1013 } else if (strcmp(p, "read_timeout") == 0) { in main()
1015 } else if (strcmp(p, "max_resend") == 0) { in main()
1017 if (opt.max_resend < 0) { in main()
1020 } else if (strcmp(p, "request_page") == 0) { in main()
1022 } else if (strcmp(p, "request_size") == 0) { in main()
1024 if (opt.request_size < 0 || in main()
1028 } else if (strcmp(p, "ca_file") == 0) { in main()
1030 } else if (strcmp(p, "ca_path") == 0) { in main()
1032 } else if (strcmp(p, "crt_file") == 0) { in main()
1034 } else if (strcmp(p, "key_file") == 0) { in main()
1036 } else if (strcmp(p, "key_pwd") == 0) { in main()
1039 #if defined(MBEDTLS_USE_PSA_CRYPTO) && defined(MBEDTLS_SSL_HANDSHAKE_WITH_CERT_ENABLED) in main()
1040 else if (strcmp(p, "key_opaque") == 0) { in main()
1044 #if defined(MBEDTLS_SSL_DTLS_CONNECTION_ID) in main()
1045 else if (strcmp(p, "cid") == 0) { in main()
1047 if (opt.cid_enabled != 0 && opt.cid_enabled != 1) { in main()
1050 } else if (strcmp(p, "cid_renego") == 0) { in main()
1052 if (opt.cid_enabled_renego != 0 && opt.cid_enabled_renego != 1) { in main()
1055 } else if (strcmp(p, "cid_val") == 0) { in main()
1057 } else if (strcmp(p, "cid_val_renego") == 0) { in main()
1061 else if (strcmp(p, "psk") == 0) { in main()
1064 #if defined(MBEDTLS_USE_PSA_CRYPTO) in main()
1065 else if (strcmp(p, "psk_opaque") == 0) { in main()
1069 #if defined(MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK) in main()
1070 else if (strcmp(p, "ca_callback") == 0) { in main()
1074 else if (strcmp(p, "psk_identity") == 0) { in main()
1076 } else if (strcmp(p, "ecjpake_pw") == 0) { in main()
1079 #if defined(MBEDTLS_USE_PSA_CRYPTO) in main()
1080 else if (strcmp(p, "ecjpake_pw_opaque") == 0) { in main()
1084 else if (strcmp(p, "ec_max_ops") == 0) { in main()
1086 } else if (strcmp(p, "force_ciphersuite") == 0) { in main()
1089 if (opt.force_ciphersuite[0] == 0) { in main()
1094 } else if (strcmp(p, "renegotiation") == 0) { in main()
1098 } else if (strcmp(p, "allow_legacy") == 0) { in main()
1111 } else if (strcmp(p, "renegotiate") == 0) { in main()
1113 if (opt.renegotiate < 0 || opt.renegotiate > 1) { in main()
1116 } else if (strcmp(p, "exchanges") == 0) { in main()
1118 if (opt.exchanges < 1) { in main()
1121 } else if (strcmp(p, "reconnect") == 0) { in main()
1123 if (opt.reconnect < 0 || opt.reconnect > 2) { in main()
1126 } else if (strcmp(p, "reco_server_name") == 0) { in main()
1128 } else if (strcmp(p, "reco_delay") == 0) { in main()
1130 if (opt.reco_delay < 0) { in main()
1133 } else if (strcmp(p, "reco_mode") == 0) { in main()
1135 if (opt.reco_mode < 0) { in main()
1138 } else if (strcmp(p, "reconnect_hard") == 0) { in main()
1140 if (opt.reconnect_hard < 0 || opt.reconnect_hard > 1) { in main()
1143 } else if (strcmp(p, "tickets") == 0) { in main()
1145 if (opt.tickets < 0) { in main()
1148 } else if (strcmp(p, "alpn") == 0) { in main()
1150 } else if (strcmp(p, "extended_ms") == 0) { in main()
1160 } else if (strcmp(p, "groups") == 0) { in main()
1163 #if defined(MBEDTLS_SSL_HANDSHAKE_WITH_CERT_ENABLED) in main()
1164 else if (strcmp(p, "sig_algs") == 0) { in main()
1168 else if (strcmp(p, "etm") == 0) { in main()
1176 #if defined(MBEDTLS_SSL_PROTO_TLS1_3) in main()
1177 #if defined(MBEDTLS_SSL_EARLY_DATA) in main()
1178 else if (strcmp(p, "early_data") == 0) { in main()
1191 else if (strcmp(p, "tls13_kex_modes") == 0) { in main()
1192 if (strcmp(q, "psk") == 0) { in main()
1194 } else if (strcmp(q, "psk_ephemeral") == 0) { in main()
1196 } else if (strcmp(q, "ephemeral") == 0) { in main()
1198 } else if (strcmp(q, "ephemeral_all") == 0) { in main()
1200 } else if (strcmp(q, "psk_all") == 0) { in main()
1202 } else if (strcmp(q, "all") == 0) { in main()
1204 } else if (strcmp(q, "psk_or_ephemeral") == 0) { in main()
1212 else if (strcmp(p, "min_version") == 0) { in main()
1213 if (strcmp(q, "tls12") == 0 || in main()
1217 #if defined(MBEDTLS_SSL_PROTO_TLS1_3) in main()
1218 else if (strcmp(q, "tls13") == 0) { in main()
1225 } else if (strcmp(p, "max_version") == 0) { in main()
1226 if (strcmp(q, "tls12") == 0 || in main()
1230 #if defined(MBEDTLS_SSL_PROTO_TLS1_3) in main()
1231 else if (strcmp(q, "tls13") == 0) { in main()
1238 } else if (strcmp(p, "allow_sha1") == 0) { in main()
1244 } else if (strcmp(p, "force_version") == 0) { in main()
1245 if (strcmp(q, "tls12") == 0) { in main()
1248 } else if (strcmp(q, "dtls12") == 0) { in main()
1253 #if defined(MBEDTLS_SSL_PROTO_TLS1_3) in main()
1254 else if (strcmp(q, "tls13") == 0) { in main()
1262 } else if (strcmp(p, "auth_mode") == 0) { in main()
1263 if (strcmp(q, "none") == 0) { in main()
1265 } else if (strcmp(q, "optional") == 0) { in main()
1267 } else if (strcmp(q, "required") == 0) { in main()
1272 } else if (strcmp(p, "max_frag_len") == 0) { in main()
1273 if (strcmp(q, "512") == 0) { in main()
1275 } else if (strcmp(q, "1024") == 0) { in main()
1277 } else if (strcmp(q, "2048") == 0) { in main()
1279 } else if (strcmp(q, "4096") == 0) { in main()
1284 } else if (strcmp(p, "trunc_hmac") == 0) { in main()
1290 } else if (strcmp(p, "hs_timeout") == 0) { in main()
1291 if ((p = strchr(q, '-')) == NULL) { in main()
1297 if (opt.hs_to_min == 0 || opt.hs_to_max < opt.hs_to_min) { in main()
1300 } else if (strcmp(p, "mtu") == 0) { in main()
1302 if (opt.dtls_mtu < 0) { in main()
1305 } else if (strcmp(p, "dgram_packing") == 0) { in main()
1307 if (opt.dgram_packing != 0 && in main()
1311 } else if (strcmp(p, "recsplit") == 0) { in main()
1313 if (opt.recsplit < 0 || opt.recsplit > 1) { in main()
1316 } else if (strcmp(p, "dhmlen") == 0) { in main()
1318 if (opt.dhmlen < 0) { in main()
1321 } else if (strcmp(p, "query_config") == 0) { in main()
1325 } else if (strcmp(p, "serialize") == 0) { in main()
1327 if (opt.serialize < 0 || opt.serialize > 2) { in main()
1330 } else if (strcmp(p, "context_file") == 0) { in main()
1332 } else if (strcmp(p, "eap_tls") == 0) { in main()
1334 if (opt.eap_tls < 0 || opt.eap_tls > 1) { in main()
1337 } else if (strcmp(p, "reproducible") == 0) { in main()
1339 } else if (strcmp(p, "nss_keylog") == 0) { in main()
1341 if (opt.nss_keylog < 0 || opt.nss_keylog > 1) { in main()
1344 } else if (strcmp(p, "nss_keylog_file") == 0) { in main()
1346 } else if (strcmp(p, "skip_close_notify") == 0) { in main()
1348 if (opt.skip_close_notify < 0 || opt.skip_close_notify > 1) { in main()
1351 } else if (strcmp(p, "use_srtp") == 0) { in main()
1353 } else if (strcmp(p, "srtp_force_profile") == 0) { in main()
1355 } else if (strcmp(p, "mki") == 0) { in main()
1357 } else if (strcmp(p, "key_opaque_algs") == 0) { in main()
1358 if (key_opaque_alg_parse(q, &opt.key_opaque_alg1, in main()
1367 if (opt.nss_keylog != 0 && opt.eap_tls != 0) { in main()
1375 if (opt.event == 1 && opt.nbio != 1) { in main()
1380 #if defined(MBEDTLS_DEBUG_C) in main()
1384 #if defined(MBEDTLS_SSL_HANDSHAKE_WITH_PSK_ENABLED) in main()
1386 * Unhexify the pre-shared key if any is given in main()
1388 if (strlen(opt.psk)) { in main()
1389 if (mbedtls_test_unhexify(psk, sizeof(psk), in main()
1397 #if defined(MBEDTLS_USE_PSA_CRYPTO) in main()
1398 if (opt.psk_opaque != 0) { in main()
1399 if (opt.psk == NULL) { in main()
1405 if (opt.force_ciphersuite[0] <= 0) { in main()
1414 if (opt.force_ciphersuite[0] > 0) { in main()
1419 if (opt.max_version != -1 && in main()
1425 if (opt.min_version != -1 && in main()
1432 /* If the server selects a version that's not supported by in main()
1434 if (opt.max_version == -1 || in main()
1438 if (opt.min_version < ciphersuite_info->min_tls_version) { in main()
1441 if (opt.transport == MBEDTLS_SSL_TRANSPORT_DATAGRAM && in main()
1447 #if defined(MBEDTLS_USE_PSA_CRYPTO) in main()
1448 #if defined(MBEDTLS_SSL_HANDSHAKE_WITH_PSK_ENABLED) in main()
1449 if (opt.psk_opaque != 0) { in main()
1451 #if defined(MBEDTLS_MD_CAN_SHA384) in main()
1452 if (ciphersuite_info->mac == MBEDTLS_MD_SHA384) { in main()
1462 #if defined(MBEDTLS_SSL_DTLS_CONNECTION_ID) in main()
1463 if (mbedtls_test_unhexify(cid, sizeof(cid), in main()
1471 if (opt.cid_enabled_renego == DFL_CID_ENABLED_RENEGO) { in main()
1474 if (opt.cid_val_renego == DFL_CID_VALUE_RENEGO) { in main()
1478 if (mbedtls_test_unhexify(cid_renego, sizeof(cid_renego), in main()
1485 if (opt.groups != NULL) { in main()
1486 if (parse_groups(opt.groups, group_list, GROUP_LIST_SIZE) != 0) { in main()
1491 #if defined(MBEDTLS_SSL_HANDSHAKE_WITH_CERT_ENABLED) in main()
1492 if (opt.sig_algs != NULL) { in main()
1504 if (*p == ',') { in main()
1508 if (strcmp(q, "rsa_pkcs1_sha256") == 0) { in main()
1510 } else if (strcmp(q, "rsa_pkcs1_sha384") == 0) { in main()
1512 } else if (strcmp(q, "rsa_pkcs1_sha512") == 0) { in main()
1514 } else if (strcmp(q, "ecdsa_secp256r1_sha256") == 0) { in main()
1516 } else if (strcmp(q, "ecdsa_secp384r1_sha384") == 0) { in main()
1518 } else if (strcmp(q, "ecdsa_secp521r1_sha512") == 0) { in main()
1520 } else if (strcmp(q, "rsa_pss_rsae_sha256") == 0) { in main()
1522 } else if (strcmp(q, "rsa_pss_rsae_sha384") == 0) { in main()
1524 } else if (strcmp(q, "rsa_pss_rsae_sha512") == 0) { in main()
1526 } else if (strcmp(q, "ed25519") == 0) { in main()
1528 } else if (strcmp(q, "ed448") == 0) { in main()
1530 } else if (strcmp(q, "rsa_pss_pss_sha256") == 0) { in main()
1532 } else if (strcmp(q, "rsa_pss_pss_sha384") == 0) { in main()
1534 } else if (strcmp(q, "rsa_pss_pss_sha512") == 0) { in main()
1536 } else if (strcmp(q, "rsa_pkcs1_sha1") == 0) { in main()
1538 } else if (strcmp(q, "ecdsa_sha1") == 0) { in main()
1548 if (i == (SIG_ALG_LIST_SIZE - 1) && *p != '\0') { in main()
1558 #if defined(MBEDTLS_SSL_ALPN) in main()
1559 if (opt.alpn_string != NULL) { in main()
1571 if (*p == ',') { in main()
1588 if (ret != 0) { in main()
1593 #if defined(MBEDTLS_SSL_HANDSHAKE_WITH_CERT_ENABLED) in main()
1600 if (strcmp(opt.ca_path, "none") == 0 || in main()
1604 #if defined(MBEDTLS_FS_IO) in main()
1605 if (strlen(opt.ca_path)) { in main()
1607 } else if (strlen(opt.ca_file)) { in main()
1612 #if defined(MBEDTLS_PEM_PARSE_C) in main()
1617 if (ret != 0) { in main()
1622 if (ret == 0) { in main()
1627 if (ret != 0) { in main()
1633 if (ret < 0) { in main()
1644 * (can be skipped if client authentication is not required) in main()
1649 if (strcmp(opt.crt_file, "none") == 0) { in main()
1652 #if defined(MBEDTLS_FS_IO) in main()
1653 if (strlen(opt.crt_file)) { in main()
1660 if (ret != 0) { in main()
1666 if (strcmp(opt.key_file, "none") == 0) { in main()
1669 #if defined(MBEDTLS_FS_IO) in main()
1670 if (strlen(opt.key_file)) { in main()
1677 if (ret != 0) { in main()
1683 #if defined(MBEDTLS_USE_PSA_CRYPTO) in main()
1684 if (opt.key_opaque != 0) { in main()
1688 if (key_opaque_set_alg_usage(opt.key_opaque_alg1, in main()
1695 if (ret != 0) { in main()
1716 if ((ret = mbedtls_ssl_config_defaults(&conf, in main()
1725 #if defined(MBEDTLS_SSL_HANDSHAKE_WITH_CERT_ENABLED) in main()
1728 if (opt.allow_sha1 > 0) { in main()
1733 if (opt.context_crt_cb == 0) { in main()
1740 #if defined(MBEDTLS_SSL_DTLS_CONNECTION_ID) in main()
1741 if (opt.cid_enabled == 1 || opt.cid_enabled_renego == 1) { in main()
1742 if (opt.cid_enabled == 1 && in main()
1749 if (opt.cid_enabled == 1) { in main()
1757 if (ret != 0) { in main()
1765 if (opt.auth_mode != DFL_AUTH_MODE) { in main()
1769 #if defined(MBEDTLS_SSL_PROTO_DTLS) in main()
1770 if (opt.hs_to_min != DFL_HS_TO_MIN || opt.hs_to_max != DFL_HS_TO_MAX) { in main()
1775 if (opt.dgram_packing != DFL_DGRAM_PACKING) { in main()
1780 #if defined(MBEDTLS_SSL_MAX_FRAGMENT_LENGTH) in main()
1781 if ((ret = mbedtls_ssl_conf_max_frag_len(&conf, opt.mfl_code)) != 0) { in main()
1788 #if defined(MBEDTLS_SSL_DTLS_SRTP) in main()
1791 if (opt.use_srtp == 1) { in main()
1792 if (opt.force_srtp_profile != 0) { in main()
1798 if (ret != 0) { in main()
1805 } else if (opt.force_srtp_profile != 0) { in main()
1811 #if defined(MBEDTLS_SSL_EXTENDED_MASTER_SECRET) in main()
1812 if (opt.extended_ms != DFL_EXTENDED_MS) { in main()
1817 #if defined(MBEDTLS_SSL_ENCRYPT_THEN_MAC) in main()
1818 if (opt.etm != DFL_ETM) { in main()
1823 #if defined(MBEDTLS_DHM_C) in main()
1824 if (opt.dhmlen != DFL_DHMLEN) { in main()
1829 #if defined(MBEDTLS_SSL_ALPN) in main()
1830 if (opt.alpn_string != NULL) { in main()
1831 if ((ret = mbedtls_ssl_conf_alpn_protocols(&conf, alpn_list)) != 0) { in main()
1839 if (opt.reproducible) { in main()
1840 #if defined(MBEDTLS_HAVE_TIME) in main()
1841 #if defined(MBEDTLS_PLATFORM_TIME_ALT) in main()
1853 #if defined(MBEDTLS_SSL_SESSION_TICKETS) in main()
1857 if (opt.force_ciphersuite[0] != DFL_FORCE_CIPHER) { in main()
1861 #if defined(MBEDTLS_SSL_PROTO_TLS1_3) in main()
1865 if (opt.allow_legacy != DFL_ALLOW_LEGACY) { in main()
1868 #if defined(MBEDTLS_SSL_RENEGOTIATION) in main()
1872 #if defined(MBEDTLS_SSL_HANDSHAKE_WITH_CERT_ENABLED) in main()
1873 if (strcmp(opt.ca_path, "none") != 0 && in main()
1875 #if defined(MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK) in main()
1876 if (opt.ca_callback != 0) { in main()
1882 if (strcmp(opt.crt_file, "none") != 0 && in main()
1884 if ((ret = mbedtls_ssl_conf_own_cert(&conf, &clicert, &pkey)) != 0) { in main()
1892 #if defined(MBEDTLS_PK_HAVE_ECC_KEYS) || \ in main()
1895 if (opt.groups != NULL && in main()
1901 #if defined(MBEDTLS_SSL_HANDSHAKE_WITH_CERT_ENABLED) in main()
1902 if (opt.sig_algs != NULL) { in main()
1907 #if defined(MBEDTLS_SSL_HANDSHAKE_WITH_PSK_ENABLED) in main()
1908 #if defined(MBEDTLS_USE_PSA_CRYPTO) in main()
1909 if (opt.psk_opaque != 0) { in main()
1916 if (status != PSA_SUCCESS) { in main()
1921 if ((ret = mbedtls_ssl_conf_psk_opaque(&conf, slot, in main()
1930 if (psk_len > 0) { in main()
1934 if (ret != 0) { in main()
1941 if (opt.min_version != DFL_MIN_VERSION) { in main()
1945 if (opt.max_version != DFL_MAX_VERSION) { in main()
1949 #if defined(MBEDTLS_SSL_EARLY_DATA) in main()
1953 if ((ret = mbedtls_ssl_setup(&ssl, &conf)) != 0) { in main()
1959 if (opt.eap_tls != 0) { in main()
1962 } else if (opt.nss_keylog != 0) { in main()
1967 #if defined(MBEDTLS_SSL_DTLS_SRTP) in main()
1968 else if (opt.use_srtp != 0) { in main()
1974 #if defined(MBEDTLS_SSL_HANDSHAKE_WITH_CERT_ENABLED) in main()
1975 if ((ret = mbedtls_ssl_set_hostname(&ssl, opt.server_name)) != 0) { in main()
1982 #if defined(MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED) in main()
1983 if (opt.ecjpake_pw != DFL_ECJPAKE_PW) { in main()
1984 #if defined(MBEDTLS_USE_PSA_CRYPTO) in main()
1985 if (opt.ecjpake_pw_opaque != DFL_ECJPAKE_PW_OPAQUE) { in main()
1996 if (status != PSA_SUCCESS) { in main()
2001 if ((ret = mbedtls_ssl_set_hs_ecjpake_password_opaque(&ssl, in main()
2012 if ((ret = mbedtls_ssl_set_hs_ecjpake_password(&ssl, in main()
2023 #if defined(MBEDTLS_SSL_HANDSHAKE_WITH_CERT_ENABLED) in main()
2024 if (opt.context_crt_cb == 1) { in main()
2034 #if defined(MBEDTLS_SSL_DTLS_CONNECTION_ID) in main()
2035 if (opt.transport == MBEDTLS_SSL_TRANSPORT_DATAGRAM) { in main()
2036 if ((ret = mbedtls_ssl_set_cid(&ssl, opt.cid_enabled, in main()
2045 #if defined(MBEDTLS_SSL_PROTO_DTLS) in main()
2046 if (opt.dtls_mtu != DFL_DTLS_MTU) { in main()
2051 #if defined(MBEDTLS_TIMING_C) in main()
2056 #if defined(MBEDTLS_ECP_RESTARTABLE) in main()
2057 if (opt.ec_max_ops != DFL_EC_MAX_OPS) { in main()
2062 #if defined(MBEDTLS_SSL_DTLS_SRTP) in main()
2063 if (opt.use_srtp != 0 && strlen(opt.mki) != 0) { in main()
2064 if (mbedtls_test_unhexify(mki, sizeof(mki), in main()
2071 if ((ret = mbedtls_ssl_dtls_srtp_set_mki_value(&ssl, mki, in main()
2084 if (opt.server_addr == NULL) { in main()
2093 if ((ret = mbedtls_net_connect(&server_fd, in main()
2102 if (opt.nbio > 0) { in main()
2107 if (ret != 0) { in main()
2122 if (ret != MBEDTLS_ERR_SSL_WANT_READ && in main()
2127 if (ret == MBEDTLS_ERR_X509_CERT_VERIFY_FAILED) { in main()
2134 "auth_mode=optional for testing purposes if " in main()
2143 #if defined(MBEDTLS_ECP_RESTARTABLE) in main()
2144 if (ret == MBEDTLS_ERR_SSL_CRYPTO_IN_PROGRESS) { in main()
2150 if (opt.event == 1 /* level triggered IO */) { in main()
2151 #if defined(MBEDTLS_TIMING_C) in main()
2156 if (ret != 0) { in main()
2176 if ((ret = mbedtls_ssl_get_record_expansion(&ssl)) >= 0) { in main()
2182 #if defined(MBEDTLS_SSL_MAX_FRAGMENT_LENGTH) in main()
2189 #if defined(MBEDTLS_SSL_ALPN) in main()
2190 if (opt.alpn_string != NULL) { in main()
2197 if (opt.eap_tls != 0) { in main()
2200 if ((ret = mbedtls_ssl_tls_prf(eap_tls_keying.tls_prf_type, in main()
2216 if (j % 8 == 0) { in main()
2223 if ((ret = mbedtls_ssl_tls_prf(eap_tls_keying.tls_prf_type, NULL, 0, in main()
2236 if (j % 8 == 0) { in main()
2244 #if defined(MBEDTLS_SSL_DTLS_SRTP) in main()
2245 else if (opt.use_srtp != 0) { in main()
2250 if (dtls_srtp_negotiation_result.chosen_dtls_srtp_profile in main()
2255 if ((ret = mbedtls_ssl_tls_prf(dtls_srtp_keying.tls_prf_type, in main()
2271 if (j % 8 == 0) { in main()
2288 if (dtls_srtp_negotiation_result.mki_len > 0) { in main()
2300 if (opt.reconnect != 0 && ssl.tls_version != MBEDTLS_SSL_VERSION_TLS1_3) { in main()
2304 if (opt.reco_mode == 1) { in main()
2305 if ((ret = ssl_save_session_serialize(&ssl, in main()
2313 if ((ret = mbedtls_ssl_get_session(&ssl, &saved_session)) != 0) { in main()
2322 if (opt.reco_mode == 1) { in main()
2328 #if defined(MBEDTLS_SSL_HANDSHAKE_WITH_CERT_ENABLED) in main()
2334 if ((flags = mbedtls_ssl_get_verify_result(&ssl)) != 0) { in main()
2346 #if !defined(MBEDTLS_X509_REMOVE_INFO) in main()
2352 #if defined(MBEDTLS_SSL_DTLS_CONNECTION_ID) in main()
2354 if (ret != 0) { in main()
2358 if (opt.transport == MBEDTLS_SSL_TRANSPORT_DATAGRAM) { in main()
2359 if ((ret = mbedtls_ssl_set_cid(&ssl, opt.cid_enabled_renego, in main()
2369 #if defined(MBEDTLS_SSL_RENEGOTIATION) in main()
2370 if (opt.renegotiate) { in main()
2378 if (ret != MBEDTLS_ERR_SSL_WANT_READ && in main()
2386 #if defined(MBEDTLS_ECP_RESTARTABLE) in main()
2387 if (ret == MBEDTLS_ERR_SSL_CRYPTO_IN_PROGRESS) { in main()
2393 if (opt.event == 1 /* level triggered IO */) { in main()
2394 #if defined(MBEDTLS_TIMING_C) in main()
2406 #if defined(MBEDTLS_SSL_DTLS_CONNECTION_ID) in main()
2408 if (ret != 0) { in main()
2426 if (opt.request_size != DFL_REQUEST_SIZE && in main()
2435 /* Truncate if request size is smaller than the "natural" size */ in main()
2436 if (opt.request_size != DFL_REQUEST_SIZE && in main()
2441 if (len >= 2) { in main()
2444 if (len >= 1) { in main()
2449 if (opt.transport == MBEDTLS_SSL_TRANSPORT_STREAM) { in main()
2456 if (ret != MBEDTLS_ERR_SSL_WANT_READ && in main()
2465 if (opt.event == 1 /* level triggered IO */) { in main()
2466 #if defined(MBEDTLS_TIMING_C) in main()
2481 #if defined(MBEDTLS_ECP_RESTARTABLE) in main()
2482 if (ret == MBEDTLS_ERR_SSL_CRYPTO_IN_PROGRESS) { in main()
2487 if (ret != MBEDTLS_ERR_SSL_WANT_READ && in main()
2493 if (opt.event == 1 /* level triggered IO */) { in main()
2494 #if defined(MBEDTLS_TIMING_C) in main()
2502 if (ret < 0) { in main()
2511 if (written < len) { in main()
2521 /* Send a non-empty request if request_size == 0 */ in main()
2522 if (len == 0) { in main()
2534 if (opt.transport == MBEDTLS_SSL_TRANSPORT_STREAM) { in main()
2535 #if defined(MBEDTLS_SSL_PROTO_TLS1_3) && defined(MBEDTLS_SSL_SESSION_TICKETS) in main()
2543 #if defined(MBEDTLS_ECP_RESTARTABLE) in main()
2544 if (ret == MBEDTLS_ERR_SSL_CRYPTO_IN_PROGRESS) { in main()
2549 if (ret == MBEDTLS_ERR_SSL_WANT_READ || in main()
2552 if (opt.event == 1 /* level triggered IO */) { in main()
2553 #if defined(MBEDTLS_TIMING_C) in main()
2562 if (ret <= 0) { in main()
2575 #if defined(MBEDTLS_SSL_PROTO_TLS1_3) in main()
2577 #if defined(MBEDTLS_SSL_SESSION_TICKETS) in main()
2583 if (opt.reconnect != 0) { in main()
2587 if (opt.reco_mode == 1) { in main()
2588 if ((ret = ssl_save_session_serialize(&ssl, in main()
2597 if ((ret = mbedtls_ssl_get_session(&ssl, &saved_session)) != 0) { in main()
2607 if (opt.reco_mode == 1) { in main()
2630 if (ret > 0 && buf[len-1] == '\n') { in main()
2642 #if defined(MBEDTLS_ECP_RESTARTABLE) in main()
2643 if (ret == MBEDTLS_ERR_SSL_CRYPTO_IN_PROGRESS) { in main()
2648 if (ret != MBEDTLS_ERR_SSL_WANT_READ && in main()
2654 if (opt.event == 1 /* level triggered IO */) { in main()
2655 #if defined(MBEDTLS_TIMING_C) in main()
2663 if (ret <= 0) { in main()
2667 if (retry_left-- > 0) { in main()
2692 if (opt.reconnect_hard != 0) { in main()
2698 #if defined(MBEDTLS_SSL_HANDSHAKE_WITH_CERT_ENABLED) in main()
2702 if ((ret = mbedtls_ssl_session_reset(&ssl)) != 0) { in main()
2709 if (ret != MBEDTLS_ERR_SSL_WANT_READ && in main()
2718 if (opt.event == 1 /* level triggered IO */) { in main()
2719 #if defined(MBEDTLS_TIMING_C) in main()
2735 #if defined(MBEDTLS_SSL_CONTEXT_SERIALIZATION) in main()
2736 if (opt.serialize != 0) { in main()
2742 if (ret != MBEDTLS_ERR_SSL_BUFFER_TOO_SMALL) { in main()
2749 if ((context_buf = mbedtls_calloc(1, buf_len)) == NULL) { in main()
2757 if ((ret = mbedtls_ssl_context_save(&ssl, context_buf, in main()
2768 if (0 < strlen(opt.context_file)) { in main()
2777 if ((b64_buf = mbedtls_calloc(1, b64_len)) == NULL) { in main()
2783 if ((ret = mbedtls_base64_encode(b64_buf, b64_len, &b64_len, in main()
2791 if ((b64_file = fopen(opt.context_file, "w")) == NULL) { in main()
2798 if (b64_len != fwrite(b64_buf, 1, b64_len, b64_file)) { in main()
2812 if (opt.serialize == 1) { in main()
2817 if (opt.serialize == 2) { in main()
2824 if ((ret = mbedtls_ssl_setup(&ssl, &conf)) != 0) { in main()
2830 if (opt.nbio == 2) { in main()
2839 #if defined(MBEDTLS_TIMING_C) in main()
2850 if ((ret = mbedtls_ssl_context_load(&ssl, context_buf, in main()
2869 if (--opt.exchanges > 0) { in main()
2892 if (opt.skip_close_notify == 0) { in main()
2906 if (opt.reconnect != 0) { in main()
2911 #if defined(MBEDTLS_TIMING_C) in main()
2912 if (opt.reco_delay > 0) { in main()
2919 #if defined(MBEDTLS_SSL_HANDSHAKE_WITH_CERT_ENABLED) in main()
2923 if ((ret = mbedtls_ssl_session_reset(&ssl)) != 0) { in main()
2929 if (opt.reco_mode == 1) { in main()
2930 if ((ret = mbedtls_ssl_session_load(&saved_session, in main()
2939 if ((ret = mbedtls_ssl_set_session(&ssl, &saved_session)) != 0) { in main()
2945 #if defined(MBEDTLS_X509_CRT_PARSE_C) in main()
2946 if (opt.reco_server_name != NULL && in main()
2955 if ((ret = mbedtls_net_connect(&server_fd, in main()
2964 if (opt.nbio > 0) { in main()
2969 if (ret != 0) { in main()
2976 if (ret != MBEDTLS_ERR_SSL_WANT_READ && in main()
2995 if (ret != 0) { in main()
3008 if (session_data != NULL) { in main()
3012 #if defined(MBEDTLS_SSL_CONTEXT_SERIALIZATION) in main()
3013 if (context_buf != NULL) { in main()
3019 #if defined(MBEDTLS_SSL_HANDSHAKE_WITH_CERT_ENABLED) in main()
3023 #if defined(MBEDTLS_USE_PSA_CRYPTO) in main()
3028 #if defined(MBEDTLS_SSL_HANDSHAKE_WITH_PSK_ENABLED) && \ in main()
3030 if (opt.psk_opaque != 0) { in main()
3031 /* This is ok even if the slot hasn't been in main()
3036 if ((status != PSA_SUCCESS) && in main()
3041 if (ret == 0) { in main()
3049 #if defined(MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED) && \ in main()
3055 if ((opt.ecjpake_pw_opaque != DFL_ECJPAKE_PW_OPAQUE)) { in main()
3059 if (psa_get_key_attributes(ecjpake_pw_slot, &check_attributes) != in main()
3061 if (ret == 0) { in main()
3071 #if defined(MBEDTLS_USE_PSA_CRYPTO) || defined(MBEDTLS_SSL_PROTO_TLS1_3) in main()
3073 if (message) { in main()
3074 if (ret == 0) { in main()
3083 #if (defined(MBEDTLS_USE_PSA_CRYPTO) || defined(MBEDTLS_SSL_PROTO_TLS1_3)) && \ in main()
3090 #if defined(MBEDTLS_TEST_HOOKS) in main()
3091 if (test_hooks_failure_detected()) { in main()
3092 if (ret == 0) { in main()
3100 #if defined(MBEDTLS_MEMORY_BUFFER_ALLOC_C) in main()
3101 #if defined(MBEDTLS_MEMORY_DEBUG) in main()
3108 if (ret < 0) { in main()
3112 if (opt.query_config_mode == DFL_QUERY_CONFIG_MODE) { in main()