1 /* Automatically generated by generate_ssl_debug_helpers.py. DO NOT EDIT. */ 2 3 /** 4 * \file ssl_debug_helpers_generated.c 5 * 6 * \brief Automatically generated helper functions for debugging 7 */ 8 /* 9 * Copyright The Mbed TLS Contributors 10 * SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later 11 * 12 */ 13 14 #include "common.h" 15 16 #if defined(MBEDTLS_DEBUG_C) 17 18 #include "ssl_debug_helpers.h" 19 20 mbedtls_ssl_named_group_to_str(uint16_t in)21const char *mbedtls_ssl_named_group_to_str( uint16_t in ) 22 { 23 switch( in ) 24 { 25 case MBEDTLS_SSL_IANA_TLS_GROUP_SECP192K1: 26 return "secp192k1"; 27 case MBEDTLS_SSL_IANA_TLS_GROUP_SECP192R1: 28 return "secp192r1"; 29 case MBEDTLS_SSL_IANA_TLS_GROUP_SECP224K1: 30 return "secp224k1"; 31 case MBEDTLS_SSL_IANA_TLS_GROUP_SECP224R1: 32 return "secp224r1"; 33 case MBEDTLS_SSL_IANA_TLS_GROUP_SECP256K1: 34 return "secp256k1"; 35 case MBEDTLS_SSL_IANA_TLS_GROUP_SECP256R1: 36 return "secp256r1"; 37 case MBEDTLS_SSL_IANA_TLS_GROUP_SECP384R1: 38 return "secp384r1"; 39 case MBEDTLS_SSL_IANA_TLS_GROUP_SECP521R1: 40 return "secp521r1"; 41 case MBEDTLS_SSL_IANA_TLS_GROUP_BP256R1: 42 return "bp256r1"; 43 case MBEDTLS_SSL_IANA_TLS_GROUP_BP384R1: 44 return "bp384r1"; 45 case MBEDTLS_SSL_IANA_TLS_GROUP_BP512R1: 46 return "bp512r1"; 47 case MBEDTLS_SSL_IANA_TLS_GROUP_X25519: 48 return "x25519"; 49 case MBEDTLS_SSL_IANA_TLS_GROUP_X448: 50 return "x448"; 51 case MBEDTLS_SSL_IANA_TLS_GROUP_FFDHE2048: 52 return "ffdhe2048"; 53 case MBEDTLS_SSL_IANA_TLS_GROUP_FFDHE3072: 54 return "ffdhe3072"; 55 case MBEDTLS_SSL_IANA_TLS_GROUP_FFDHE4096: 56 return "ffdhe4096"; 57 case MBEDTLS_SSL_IANA_TLS_GROUP_FFDHE6144: 58 return "ffdhe6144"; 59 case MBEDTLS_SSL_IANA_TLS_GROUP_FFDHE8192: 60 return "ffdhe8192"; 61 }; 62 63 return "UNKOWN"; 64 } mbedtls_ssl_sig_alg_to_str(uint16_t in)65const char *mbedtls_ssl_sig_alg_to_str( uint16_t in ) 66 { 67 switch( in ) 68 { 69 case MBEDTLS_TLS1_3_SIG_RSA_PKCS1_SHA256: 70 return "rsa_pkcs1_sha256"; 71 case MBEDTLS_TLS1_3_SIG_RSA_PKCS1_SHA384: 72 return "rsa_pkcs1_sha384"; 73 case MBEDTLS_TLS1_3_SIG_RSA_PKCS1_SHA512: 74 return "rsa_pkcs1_sha512"; 75 case MBEDTLS_TLS1_3_SIG_ECDSA_SECP256R1_SHA256: 76 return "ecdsa_secp256r1_sha256"; 77 case MBEDTLS_TLS1_3_SIG_ECDSA_SECP384R1_SHA384: 78 return "ecdsa_secp384r1_sha384"; 79 case MBEDTLS_TLS1_3_SIG_ECDSA_SECP521R1_SHA512: 80 return "ecdsa_secp521r1_sha512"; 81 case MBEDTLS_TLS1_3_SIG_RSA_PSS_RSAE_SHA256: 82 return "rsa_pss_rsae_sha256"; 83 case MBEDTLS_TLS1_3_SIG_RSA_PSS_RSAE_SHA384: 84 return "rsa_pss_rsae_sha384"; 85 case MBEDTLS_TLS1_3_SIG_RSA_PSS_RSAE_SHA512: 86 return "rsa_pss_rsae_sha512"; 87 case MBEDTLS_TLS1_3_SIG_ED25519: 88 return "ed25519"; 89 case MBEDTLS_TLS1_3_SIG_ED448: 90 return "ed448"; 91 case MBEDTLS_TLS1_3_SIG_RSA_PSS_PSS_SHA256: 92 return "rsa_pss_pss_sha256"; 93 case MBEDTLS_TLS1_3_SIG_RSA_PSS_PSS_SHA384: 94 return "rsa_pss_pss_sha384"; 95 case MBEDTLS_TLS1_3_SIG_RSA_PSS_PSS_SHA512: 96 return "rsa_pss_pss_sha512"; 97 case MBEDTLS_TLS1_3_SIG_RSA_PKCS1_SHA1: 98 return "rsa_pkcs1_sha1"; 99 case MBEDTLS_TLS1_3_SIG_ECDSA_SHA1: 100 return "ecdsa_sha1"; 101 case MBEDTLS_TLS1_3_SIG_NONE: 102 return "none"; 103 }; 104 105 return "UNKNOWN"; 106 } mbedtls_ssl_states_str(mbedtls_ssl_states in)107const char *mbedtls_ssl_states_str( mbedtls_ssl_states in ) 108 { 109 switch (in) { 110 case MBEDTLS_SSL_HELLO_REQUEST: 111 return "MBEDTLS_SSL_HELLO_REQUEST"; 112 case MBEDTLS_SSL_CLIENT_HELLO: 113 return "MBEDTLS_SSL_CLIENT_HELLO"; 114 case MBEDTLS_SSL_SERVER_HELLO: 115 return "MBEDTLS_SSL_SERVER_HELLO"; 116 case MBEDTLS_SSL_SERVER_CERTIFICATE: 117 return "MBEDTLS_SSL_SERVER_CERTIFICATE"; 118 case MBEDTLS_SSL_SERVER_KEY_EXCHANGE: 119 return "MBEDTLS_SSL_SERVER_KEY_EXCHANGE"; 120 case MBEDTLS_SSL_CERTIFICATE_REQUEST: 121 return "MBEDTLS_SSL_CERTIFICATE_REQUEST"; 122 case MBEDTLS_SSL_SERVER_HELLO_DONE: 123 return "MBEDTLS_SSL_SERVER_HELLO_DONE"; 124 case MBEDTLS_SSL_CLIENT_CERTIFICATE: 125 return "MBEDTLS_SSL_CLIENT_CERTIFICATE"; 126 case MBEDTLS_SSL_CLIENT_KEY_EXCHANGE: 127 return "MBEDTLS_SSL_CLIENT_KEY_EXCHANGE"; 128 case MBEDTLS_SSL_CERTIFICATE_VERIFY: 129 return "MBEDTLS_SSL_CERTIFICATE_VERIFY"; 130 case MBEDTLS_SSL_CLIENT_CHANGE_CIPHER_SPEC: 131 return "MBEDTLS_SSL_CLIENT_CHANGE_CIPHER_SPEC"; 132 case MBEDTLS_SSL_CLIENT_FINISHED: 133 return "MBEDTLS_SSL_CLIENT_FINISHED"; 134 case MBEDTLS_SSL_SERVER_CHANGE_CIPHER_SPEC: 135 return "MBEDTLS_SSL_SERVER_CHANGE_CIPHER_SPEC"; 136 case MBEDTLS_SSL_SERVER_FINISHED: 137 return "MBEDTLS_SSL_SERVER_FINISHED"; 138 case MBEDTLS_SSL_FLUSH_BUFFERS: 139 return "MBEDTLS_SSL_FLUSH_BUFFERS"; 140 case MBEDTLS_SSL_HANDSHAKE_WRAPUP: 141 return "MBEDTLS_SSL_HANDSHAKE_WRAPUP"; 142 case MBEDTLS_SSL_NEW_SESSION_TICKET: 143 return "MBEDTLS_SSL_NEW_SESSION_TICKET"; 144 case MBEDTLS_SSL_SERVER_HELLO_VERIFY_REQUEST_SENT: 145 return "MBEDTLS_SSL_SERVER_HELLO_VERIFY_REQUEST_SENT"; 146 case MBEDTLS_SSL_HELLO_RETRY_REQUEST: 147 return "MBEDTLS_SSL_HELLO_RETRY_REQUEST"; 148 case MBEDTLS_SSL_ENCRYPTED_EXTENSIONS: 149 return "MBEDTLS_SSL_ENCRYPTED_EXTENSIONS"; 150 case MBEDTLS_SSL_END_OF_EARLY_DATA: 151 return "MBEDTLS_SSL_END_OF_EARLY_DATA"; 152 case MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY: 153 return "MBEDTLS_SSL_CLIENT_CERTIFICATE_VERIFY"; 154 case MBEDTLS_SSL_CLIENT_CCS_AFTER_SERVER_FINISHED: 155 return "MBEDTLS_SSL_CLIENT_CCS_AFTER_SERVER_FINISHED"; 156 case MBEDTLS_SSL_CLIENT_CCS_BEFORE_2ND_CLIENT_HELLO: 157 return "MBEDTLS_SSL_CLIENT_CCS_BEFORE_2ND_CLIENT_HELLO"; 158 case MBEDTLS_SSL_SERVER_CCS_AFTER_SERVER_HELLO: 159 return "MBEDTLS_SSL_SERVER_CCS_AFTER_SERVER_HELLO"; 160 case MBEDTLS_SSL_CLIENT_CCS_AFTER_CLIENT_HELLO: 161 return "MBEDTLS_SSL_CLIENT_CCS_AFTER_CLIENT_HELLO"; 162 case MBEDTLS_SSL_SERVER_CCS_AFTER_HELLO_RETRY_REQUEST: 163 return "MBEDTLS_SSL_SERVER_CCS_AFTER_HELLO_RETRY_REQUEST"; 164 case MBEDTLS_SSL_HANDSHAKE_OVER: 165 return "MBEDTLS_SSL_HANDSHAKE_OVER"; 166 case MBEDTLS_SSL_TLS1_3_NEW_SESSION_TICKET: 167 return "MBEDTLS_SSL_TLS1_3_NEW_SESSION_TICKET"; 168 case MBEDTLS_SSL_TLS1_3_NEW_SESSION_TICKET_FLUSH: 169 return "MBEDTLS_SSL_TLS1_3_NEW_SESSION_TICKET_FLUSH"; 170 default: 171 return "UNKNOWN_VALUE"; 172 } 173 } 174 175 #if defined(MBEDTLS_SSL_EARLY_DATA) && defined(MBEDTLS_SSL_CLI_C) mbedtls_ssl_early_data_status_str(mbedtls_ssl_early_data_status in)176const char *mbedtls_ssl_early_data_status_str( mbedtls_ssl_early_data_status in ) 177 { 178 switch (in) { 179 case MBEDTLS_SSL_EARLY_DATA_STATUS_NOT_INDICATED: 180 return "MBEDTLS_SSL_EARLY_DATA_STATUS_NOT_INDICATED"; 181 case MBEDTLS_SSL_EARLY_DATA_STATUS_ACCEPTED: 182 return "MBEDTLS_SSL_EARLY_DATA_STATUS_ACCEPTED"; 183 case MBEDTLS_SSL_EARLY_DATA_STATUS_REJECTED: 184 return "MBEDTLS_SSL_EARLY_DATA_STATUS_REJECTED"; 185 default: 186 return "UNKNOWN_VALUE"; 187 } 188 } 189 190 #endif /* defined(MBEDTLS_SSL_EARLY_DATA) && defined(MBEDTLS_SSL_CLI_C) */ mbedtls_ssl_protocol_version_str(mbedtls_ssl_protocol_version in)191const char *mbedtls_ssl_protocol_version_str( mbedtls_ssl_protocol_version in ) 192 { 193 switch (in) { 194 case MBEDTLS_SSL_VERSION_UNKNOWN: 195 return "MBEDTLS_SSL_VERSION_UNKNOWN"; 196 case MBEDTLS_SSL_VERSION_TLS1_2: 197 return "MBEDTLS_SSL_VERSION_TLS1_2"; 198 case MBEDTLS_SSL_VERSION_TLS1_3: 199 return "MBEDTLS_SSL_VERSION_TLS1_3"; 200 default: 201 return "UNKNOWN_VALUE"; 202 } 203 } 204 mbedtls_tls_prf_types_str(mbedtls_tls_prf_types in)205const char *mbedtls_tls_prf_types_str( mbedtls_tls_prf_types in ) 206 { 207 switch (in) { 208 case MBEDTLS_SSL_TLS_PRF_NONE: 209 return "MBEDTLS_SSL_TLS_PRF_NONE"; 210 case MBEDTLS_SSL_TLS_PRF_SHA384: 211 return "MBEDTLS_SSL_TLS_PRF_SHA384"; 212 case MBEDTLS_SSL_TLS_PRF_SHA256: 213 return "MBEDTLS_SSL_TLS_PRF_SHA256"; 214 case MBEDTLS_SSL_HKDF_EXPAND_SHA384: 215 return "MBEDTLS_SSL_HKDF_EXPAND_SHA384"; 216 case MBEDTLS_SSL_HKDF_EXPAND_SHA256: 217 return "MBEDTLS_SSL_HKDF_EXPAND_SHA256"; 218 default: 219 return "UNKNOWN_VALUE"; 220 } 221 } 222 mbedtls_ssl_key_export_type_str(mbedtls_ssl_key_export_type in)223const char *mbedtls_ssl_key_export_type_str( mbedtls_ssl_key_export_type in ) 224 { 225 switch (in) { 226 case MBEDTLS_SSL_KEY_EXPORT_TLS12_MASTER_SECRET: 227 return "MBEDTLS_SSL_KEY_EXPORT_TLS12_MASTER_SECRET"; 228 #if defined(MBEDTLS_SSL_PROTO_TLS1_3) 229 case MBEDTLS_SSL_KEY_EXPORT_TLS1_3_CLIENT_EARLY_SECRET: 230 return "MBEDTLS_SSL_KEY_EXPORT_TLS1_3_CLIENT_EARLY_SECRET"; 231 case MBEDTLS_SSL_KEY_EXPORT_TLS1_3_EARLY_EXPORTER_SECRET: 232 return "MBEDTLS_SSL_KEY_EXPORT_TLS1_3_EARLY_EXPORTER_SECRET"; 233 case MBEDTLS_SSL_KEY_EXPORT_TLS1_3_CLIENT_HANDSHAKE_TRAFFIC_SECRET: 234 return "MBEDTLS_SSL_KEY_EXPORT_TLS1_3_CLIENT_HANDSHAKE_TRAFFIC_SECRET"; 235 case MBEDTLS_SSL_KEY_EXPORT_TLS1_3_SERVER_HANDSHAKE_TRAFFIC_SECRET: 236 return "MBEDTLS_SSL_KEY_EXPORT_TLS1_3_SERVER_HANDSHAKE_TRAFFIC_SECRET"; 237 case MBEDTLS_SSL_KEY_EXPORT_TLS1_3_CLIENT_APPLICATION_TRAFFIC_SECRET: 238 return "MBEDTLS_SSL_KEY_EXPORT_TLS1_3_CLIENT_APPLICATION_TRAFFIC_SECRET"; 239 case MBEDTLS_SSL_KEY_EXPORT_TLS1_3_SERVER_APPLICATION_TRAFFIC_SECRET: 240 return "MBEDTLS_SSL_KEY_EXPORT_TLS1_3_SERVER_APPLICATION_TRAFFIC_SECRET"; 241 #endif 242 default: 243 return "UNKNOWN_VALUE"; 244 } 245 } 246 247 248 249 #endif /* MBEDTLS_DEBUG_C */ 250 /* End of automatically generated file. */ 251 252