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