| 1 |
/* |
| 2 |
* Copyright 2012-2026 The OpenSSL Project Authors. All Rights Reserved. |
| 3 |
* |
| 4 |
* Licensed under the Apache License 2.0 (the "License"). You may not use |
| 5 |
* this file except in compliance with the License. You can obtain a copy |
| 6 |
* in the file LICENSE in the source distribution or at |
| 7 |
* https://www.openssl.org/source/license.html |
| 8 |
*/ |
| 9 |
|
| 10 |
#include "ssl_local.h" |
| 11 |
|
| 12 |
#ifndef OPENSSL_NO_SSL_TRACE |
| 13 |
|
| 14 |
/* Packet trace support for OpenSSL */ |
| 15 |
#include "internal/nelem.h" |
| 16 |
#include "internal/ssl_unwrap.h" |
| 17 |
#include "internal/quic_trace.h" |
| 18 |
|
| 19 |
typedef struct { |
| 20 |
int num; |
| 21 |
const char *name; |
| 22 |
} ssl_trace_tbl; |
| 23 |
|
| 24 |
#define ssl_trace_str(val, tbl) \ |
| 25 |
do_ssl_trace_str(val, tbl, OSSL_NELEM(tbl)) |
| 26 |
|
| 27 |
#define ssl_trace_list(bio, indent, msg, msglen, value, table) \ |
| 28 |
do_ssl_trace_list(bio, indent, msg, msglen, value, \ |
| 29 |
table, OSSL_NELEM(table)) |
| 30 |
|
| 31 |
static const char *do_ssl_trace_str(int val, const ssl_trace_tbl *tbl, |
| 32 |
size_t ntbl) |
| 33 |
{ |
| 34 |
size_t i; |
| 35 |
|
| 36 |
for (i = 0; i < ntbl; i++, tbl++) { |
| 37 |
if (tbl->num == val) |
| 38 |
return tbl->name; |
| 39 |
} |
| 40 |
return "UNKNOWN"; |
| 41 |
} |
| 42 |
|
| 43 |
static int do_ssl_trace_list(BIO *bio, int indent, |
| 44 |
const unsigned char *msg, size_t msglen, |
| 45 |
size_t vlen, const ssl_trace_tbl *tbl, size_t ntbl) |
| 46 |
{ |
| 47 |
int val; |
| 48 |
|
| 49 |
if (msglen % vlen) |
| 50 |
return 0; |
| 51 |
while (msglen) { |
| 52 |
val = msg[0]; |
| 53 |
if (vlen == 2) |
| 54 |
val = (val << 8) | msg[1]; |
| 55 |
BIO_indent(bio, indent, 80); |
| 56 |
BIO_printf(bio, "%s (%d)\n", do_ssl_trace_str(val, tbl, ntbl), val); |
| 57 |
msg += vlen; |
| 58 |
msglen -= vlen; |
| 59 |
} |
| 60 |
return 1; |
| 61 |
} |
| 62 |
|
| 63 |
/* Version number */ |
| 64 |
|
| 65 |
static const ssl_trace_tbl ssl_version_tbl[] = { |
| 66 |
{ SSL3_VERSION, "SSL 3.0" }, |
| 67 |
{ TLS1_VERSION, "TLS 1.0" }, |
| 68 |
{ TLS1_1_VERSION, "TLS 1.1" }, |
| 69 |
{ TLS1_2_VERSION, "TLS 1.2" }, |
| 70 |
{ TLS1_3_VERSION, "TLS 1.3" }, |
| 71 |
{ DTLS1_VERSION, "DTLS 1.0" }, |
| 72 |
{ DTLS1_2_VERSION, "DTLS 1.2" }, |
| 73 |
{ DTLS1_BAD_VER, "DTLS 1.0 (bad)" } |
| 74 |
}; |
| 75 |
|
| 76 |
static const ssl_trace_tbl ssl_content_tbl[] = { |
| 77 |
{ SSL3_RT_CHANGE_CIPHER_SPEC, "ChangeCipherSpec" }, |
| 78 |
{ SSL3_RT_ALERT, "Alert" }, |
| 79 |
{ SSL3_RT_HANDSHAKE, "Handshake" }, |
| 80 |
{ SSL3_RT_APPLICATION_DATA, "ApplicationData" }, |
| 81 |
}; |
| 82 |
|
| 83 |
/* Handshake types, sorted by ascending id */ |
| 84 |
static const ssl_trace_tbl ssl_handshake_tbl[] = { |
| 85 |
{ SSL3_MT_HELLO_REQUEST, "HelloRequest" }, |
| 86 |
{ SSL3_MT_CLIENT_HELLO, "ClientHello" }, |
| 87 |
{ SSL3_MT_SERVER_HELLO, "ServerHello" }, |
| 88 |
{ DTLS1_MT_HELLO_VERIFY_REQUEST, "HelloVerifyRequest" }, |
| 89 |
{ SSL3_MT_NEWSESSION_TICKET, "NewSessionTicket" }, |
| 90 |
{ SSL3_MT_END_OF_EARLY_DATA, "EndOfEarlyData" }, |
| 91 |
{ SSL3_MT_ENCRYPTED_EXTENSIONS, "EncryptedExtensions" }, |
| 92 |
{ SSL3_MT_CERTIFICATE, "Certificate" }, |
| 93 |
{ SSL3_MT_SERVER_KEY_EXCHANGE, "ServerKeyExchange" }, |
| 94 |
{ SSL3_MT_CERTIFICATE_REQUEST, "CertificateRequest" }, |
| 95 |
{ SSL3_MT_SERVER_DONE, "ServerHelloDone" }, |
| 96 |
{ SSL3_MT_CERTIFICATE_VERIFY, "CertificateVerify" }, |
| 97 |
{ SSL3_MT_CLIENT_KEY_EXCHANGE, "ClientKeyExchange" }, |
| 98 |
{ SSL3_MT_FINISHED, "Finished" }, |
| 99 |
{ SSL3_MT_CERTIFICATE_URL, "CertificateUrl" }, |
| 100 |
{ SSL3_MT_CERTIFICATE_STATUS, "CertificateStatus" }, |
| 101 |
{ SSL3_MT_SUPPLEMENTAL_DATA, "SupplementalData" }, |
| 102 |
{ SSL3_MT_KEY_UPDATE, "KeyUpdate" }, |
| 103 |
{ SSL3_MT_COMPRESSED_CERTIFICATE, "CompressedCertificate" }, |
| 104 |
#ifndef OPENSSL_NO_NEXTPROTONEG |
| 105 |
{ SSL3_MT_NEXT_PROTO, "NextProto" }, |
| 106 |
#endif |
| 107 |
{ SSL3_MT_MESSAGE_HASH, "MessageHash" } |
| 108 |
}; |
| 109 |
|
| 110 |
/* Cipher suites */ |
| 111 |
static const ssl_trace_tbl ssl_ciphers_tbl[] = { |
| 112 |
{ 0x0000, "TLS_NULL_WITH_NULL_NULL" }, |
| 113 |
{ 0x0001, "TLS_RSA_WITH_NULL_MD5" }, |
| 114 |
{ 0x0002, "TLS_RSA_WITH_NULL_SHA" }, |
| 115 |
{ 0x0003, "TLS_RSA_EXPORT_WITH_RC4_40_MD5" }, |
| 116 |
{ 0x0004, "TLS_RSA_WITH_RC4_128_MD5" }, |
| 117 |
{ 0x0005, "TLS_RSA_WITH_RC4_128_SHA" }, |
| 118 |
{ 0x0006, "TLS_RSA_EXPORT_WITH_RC2_CBC_40_MD5" }, |
| 119 |
{ 0x0007, "TLS_RSA_WITH_IDEA_CBC_SHA" }, |
| 120 |
{ 0x0008, "TLS_RSA_EXPORT_WITH_DES40_CBC_SHA" }, |
| 121 |
{ 0x0009, "TLS_RSA_WITH_DES_CBC_SHA" }, |
| 122 |
{ 0x000A, "TLS_RSA_WITH_3DES_EDE_CBC_SHA" }, |
| 123 |
{ 0x000B, "TLS_DH_DSS_EXPORT_WITH_DES40_CBC_SHA" }, |
| 124 |
{ 0x000C, "TLS_DH_DSS_WITH_DES_CBC_SHA" }, |
| 125 |
{ 0x000D, "TLS_DH_DSS_WITH_3DES_EDE_CBC_SHA" }, |
| 126 |
{ 0x000E, "TLS_DH_RSA_EXPORT_WITH_DES40_CBC_SHA" }, |
| 127 |
{ 0x000F, "TLS_DH_RSA_WITH_DES_CBC_SHA" }, |
| 128 |
{ 0x0010, "TLS_DH_RSA_WITH_3DES_EDE_CBC_SHA" }, |
| 129 |
{ 0x0011, "TLS_DHE_DSS_EXPORT_WITH_DES40_CBC_SHA" }, |
| 130 |
{ 0x0012, "TLS_DHE_DSS_WITH_DES_CBC_SHA" }, |
| 131 |
{ 0x0013, "TLS_DHE_DSS_WITH_3DES_EDE_CBC_SHA" }, |
| 132 |
{ 0x0014, "TLS_DHE_RSA_EXPORT_WITH_DES40_CBC_SHA" }, |
| 133 |
{ 0x0015, "TLS_DHE_RSA_WITH_DES_CBC_SHA" }, |
| 134 |
{ 0x0016, "TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA" }, |
| 135 |
{ 0x0017, "TLS_DH_anon_EXPORT_WITH_RC4_40_MD5" }, |
| 136 |
{ 0x0018, "TLS_DH_anon_WITH_RC4_128_MD5" }, |
| 137 |
{ 0x0019, "TLS_DH_anon_EXPORT_WITH_DES40_CBC_SHA" }, |
| 138 |
{ 0x001A, "TLS_DH_anon_WITH_DES_CBC_SHA" }, |
| 139 |
{ 0x001B, "TLS_DH_anon_WITH_3DES_EDE_CBC_SHA" }, |
| 140 |
{ 0x001D, "SSL_FORTEZZA_KEA_WITH_FORTEZZA_CBC_SHA" }, |
| 141 |
{ 0x001E, "SSL_FORTEZZA_KEA_WITH_RC4_128_SHA" }, |
| 142 |
{ 0x001F, "TLS_KRB5_WITH_3DES_EDE_CBC_SHA" }, |
| 143 |
{ 0x0020, "TLS_KRB5_WITH_RC4_128_SHA" }, |
| 144 |
{ 0x0021, "TLS_KRB5_WITH_IDEA_CBC_SHA" }, |
| 145 |
{ 0x0022, "TLS_KRB5_WITH_DES_CBC_MD5" }, |
| 146 |
{ 0x0023, "TLS_KRB5_WITH_3DES_EDE_CBC_MD5" }, |
| 147 |
{ 0x0024, "TLS_KRB5_WITH_RC4_128_MD5" }, |
| 148 |
{ 0x0025, "TLS_KRB5_WITH_IDEA_CBC_MD5" }, |
| 149 |
{ 0x0026, "TLS_KRB5_EXPORT_WITH_DES_CBC_40_SHA" }, |
| 150 |
{ 0x0027, "TLS_KRB5_EXPORT_WITH_RC2_CBC_40_SHA" }, |
| 151 |
{ 0x0028, "TLS_KRB5_EXPORT_WITH_RC4_40_SHA" }, |
| 152 |
{ 0x0029, "TLS_KRB5_EXPORT_WITH_DES_CBC_40_MD5" }, |
| 153 |
{ 0x002A, "TLS_KRB5_EXPORT_WITH_RC2_CBC_40_MD5" }, |
| 154 |
{ 0x002B, "TLS_KRB5_EXPORT_WITH_RC4_40_MD5" }, |
| 155 |
{ 0x002C, "TLS_PSK_WITH_NULL_SHA" }, |
| 156 |
{ 0x002D, "TLS_DHE_PSK_WITH_NULL_SHA" }, |
| 157 |
{ 0x002E, "TLS_RSA_PSK_WITH_NULL_SHA" }, |
| 158 |
{ 0x002F, "TLS_RSA_WITH_AES_128_CBC_SHA" }, |
| 159 |
{ 0x0030, "TLS_DH_DSS_WITH_AES_128_CBC_SHA" }, |
| 160 |
{ 0x0031, "TLS_DH_RSA_WITH_AES_128_CBC_SHA" }, |
| 161 |
{ 0x0032, "TLS_DHE_DSS_WITH_AES_128_CBC_SHA" }, |
| 162 |
{ 0x0033, "TLS_DHE_RSA_WITH_AES_128_CBC_SHA" }, |
| 163 |
{ 0x0034, "TLS_DH_anon_WITH_AES_128_CBC_SHA" }, |
| 164 |
{ 0x0035, "TLS_RSA_WITH_AES_256_CBC_SHA" }, |
| 165 |
{ 0x0036, "TLS_DH_DSS_WITH_AES_256_CBC_SHA" }, |
| 166 |
{ 0x0037, "TLS_DH_RSA_WITH_AES_256_CBC_SHA" }, |
| 167 |
{ 0x0038, "TLS_DHE_DSS_WITH_AES_256_CBC_SHA" }, |
| 168 |
{ 0x0039, "TLS_DHE_RSA_WITH_AES_256_CBC_SHA" }, |
| 169 |
{ 0x003A, "TLS_DH_anon_WITH_AES_256_CBC_SHA" }, |
| 170 |
{ 0x003B, "TLS_RSA_WITH_NULL_SHA256" }, |
| 171 |
{ 0x003C, "TLS_RSA_WITH_AES_128_CBC_SHA256" }, |
| 172 |
{ 0x003D, "TLS_RSA_WITH_AES_256_CBC_SHA256" }, |
| 173 |
{ 0x003E, "TLS_DH_DSS_WITH_AES_128_CBC_SHA256" }, |
| 174 |
{ 0x003F, "TLS_DH_RSA_WITH_AES_128_CBC_SHA256" }, |
| 175 |
{ 0x0040, "TLS_DHE_DSS_WITH_AES_128_CBC_SHA256" }, |
| 176 |
{ 0x0041, "TLS_RSA_WITH_CAMELLIA_128_CBC_SHA" }, |
| 177 |
{ 0x0042, "TLS_DH_DSS_WITH_CAMELLIA_128_CBC_SHA" }, |
| 178 |
{ 0x0043, "TLS_DH_RSA_WITH_CAMELLIA_128_CBC_SHA" }, |
| 179 |
{ 0x0044, "TLS_DHE_DSS_WITH_CAMELLIA_128_CBC_SHA" }, |
| 180 |
{ 0x0045, "TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA" }, |
| 181 |
{ 0x0046, "TLS_DH_anon_WITH_CAMELLIA_128_CBC_SHA" }, |
| 182 |
{ 0x0067, "TLS_DHE_RSA_WITH_AES_128_CBC_SHA256" }, |
| 183 |
{ 0x0068, "TLS_DH_DSS_WITH_AES_256_CBC_SHA256" }, |
| 184 |
{ 0x0069, "TLS_DH_RSA_WITH_AES_256_CBC_SHA256" }, |
| 185 |
{ 0x006A, "TLS_DHE_DSS_WITH_AES_256_CBC_SHA256" }, |
| 186 |
{ 0x006B, "TLS_DHE_RSA_WITH_AES_256_CBC_SHA256" }, |
| 187 |
{ 0x006C, "TLS_DH_anon_WITH_AES_128_CBC_SHA256" }, |
| 188 |
{ 0x006D, "TLS_DH_anon_WITH_AES_256_CBC_SHA256" }, |
| 189 |
{ 0x0081, "TLS_GOSTR341001_WITH_28147_CNT_IMIT" }, |
| 190 |
{ 0x0083, "TLS_GOSTR341001_WITH_NULL_GOSTR3411" }, |
| 191 |
{ 0x0084, "TLS_RSA_WITH_CAMELLIA_256_CBC_SHA" }, |
| 192 |
{ 0x0085, "TLS_DH_DSS_WITH_CAMELLIA_256_CBC_SHA" }, |
| 193 |
{ 0x0086, "TLS_DH_RSA_WITH_CAMELLIA_256_CBC_SHA" }, |
| 194 |
{ 0x0087, "TLS_DHE_DSS_WITH_CAMELLIA_256_CBC_SHA" }, |
| 195 |
{ 0x0088, "TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA" }, |
| 196 |
{ 0x0089, "TLS_DH_anon_WITH_CAMELLIA_256_CBC_SHA" }, |
| 197 |
{ 0x008A, "TLS_PSK_WITH_RC4_128_SHA" }, |
| 198 |
{ 0x008B, "TLS_PSK_WITH_3DES_EDE_CBC_SHA" }, |
| 199 |
{ 0x008C, "TLS_PSK_WITH_AES_128_CBC_SHA" }, |
| 200 |
{ 0x008D, "TLS_PSK_WITH_AES_256_CBC_SHA" }, |
| 201 |
{ 0x008E, "TLS_DHE_PSK_WITH_RC4_128_SHA" }, |
| 202 |
{ 0x008F, "TLS_DHE_PSK_WITH_3DES_EDE_CBC_SHA" }, |
| 203 |
{ 0x0090, "TLS_DHE_PSK_WITH_AES_128_CBC_SHA" }, |
| 204 |
{ 0x0091, "TLS_DHE_PSK_WITH_AES_256_CBC_SHA" }, |
| 205 |
{ 0x0092, "TLS_RSA_PSK_WITH_RC4_128_SHA" }, |
| 206 |
{ 0x0093, "TLS_RSA_PSK_WITH_3DES_EDE_CBC_SHA" }, |
| 207 |
{ 0x0094, "TLS_RSA_PSK_WITH_AES_128_CBC_SHA" }, |
| 208 |
{ 0x0095, "TLS_RSA_PSK_WITH_AES_256_CBC_SHA" }, |
| 209 |
{ 0x0096, "TLS_RSA_WITH_SEED_CBC_SHA" }, |
| 210 |
{ 0x0097, "TLS_DH_DSS_WITH_SEED_CBC_SHA" }, |
| 211 |
{ 0x0098, "TLS_DH_RSA_WITH_SEED_CBC_SHA" }, |
| 212 |
{ 0x0099, "TLS_DHE_DSS_WITH_SEED_CBC_SHA" }, |
| 213 |
{ 0x009A, "TLS_DHE_RSA_WITH_SEED_CBC_SHA" }, |
| 214 |
{ 0x009B, "TLS_DH_anon_WITH_SEED_CBC_SHA" }, |
| 215 |
{ 0x009C, "TLS_RSA_WITH_AES_128_GCM_SHA256" }, |
| 216 |
{ 0x009D, "TLS_RSA_WITH_AES_256_GCM_SHA384" }, |
| 217 |
{ 0x009E, "TLS_DHE_RSA_WITH_AES_128_GCM_SHA256" }, |
| 218 |
{ 0x009F, "TLS_DHE_RSA_WITH_AES_256_GCM_SHA384" }, |
| 219 |
{ 0x00A0, "TLS_DH_RSA_WITH_AES_128_GCM_SHA256" }, |
| 220 |
{ 0x00A1, "TLS_DH_RSA_WITH_AES_256_GCM_SHA384" }, |
| 221 |
{ 0x00A2, "TLS_DHE_DSS_WITH_AES_128_GCM_SHA256" }, |
| 222 |
{ 0x00A3, "TLS_DHE_DSS_WITH_AES_256_GCM_SHA384" }, |
| 223 |
{ 0x00A4, "TLS_DH_DSS_WITH_AES_128_GCM_SHA256" }, |
| 224 |
{ 0x00A5, "TLS_DH_DSS_WITH_AES_256_GCM_SHA384" }, |
| 225 |
{ 0x00A6, "TLS_DH_anon_WITH_AES_128_GCM_SHA256" }, |
| 226 |
{ 0x00A7, "TLS_DH_anon_WITH_AES_256_GCM_SHA384" }, |
| 227 |
{ 0x00A8, "TLS_PSK_WITH_AES_128_GCM_SHA256" }, |
| 228 |
{ 0x00A9, "TLS_PSK_WITH_AES_256_GCM_SHA384" }, |
| 229 |
{ 0x00AA, "TLS_DHE_PSK_WITH_AES_128_GCM_SHA256" }, |
| 230 |
{ 0x00AB, "TLS_DHE_PSK_WITH_AES_256_GCM_SHA384" }, |
| 231 |
{ 0x00AC, "TLS_RSA_PSK_WITH_AES_128_GCM_SHA256" }, |
| 232 |
{ 0x00AD, "TLS_RSA_PSK_WITH_AES_256_GCM_SHA384" }, |
| 233 |
{ 0x00AE, "TLS_PSK_WITH_AES_128_CBC_SHA256" }, |
| 234 |
{ 0x00AF, "TLS_PSK_WITH_AES_256_CBC_SHA384" }, |
| 235 |
{ 0x00B0, "TLS_PSK_WITH_NULL_SHA256" }, |
| 236 |
{ 0x00B1, "TLS_PSK_WITH_NULL_SHA384" }, |
| 237 |
{ 0x00B2, "TLS_DHE_PSK_WITH_AES_128_CBC_SHA256" }, |
| 238 |
{ 0x00B3, "TLS_DHE_PSK_WITH_AES_256_CBC_SHA384" }, |
| 239 |
{ 0x00B4, "TLS_DHE_PSK_WITH_NULL_SHA256" }, |
| 240 |
{ 0x00B5, "TLS_DHE_PSK_WITH_NULL_SHA384" }, |
| 241 |
{ 0x00B6, "TLS_RSA_PSK_WITH_AES_128_CBC_SHA256" }, |
| 242 |
{ 0x00B7, "TLS_RSA_PSK_WITH_AES_256_CBC_SHA384" }, |
| 243 |
{ 0x00B8, "TLS_RSA_PSK_WITH_NULL_SHA256" }, |
| 244 |
{ 0x00B9, "TLS_RSA_PSK_WITH_NULL_SHA384" }, |
| 245 |
{ 0x00BA, "TLS_RSA_WITH_CAMELLIA_128_CBC_SHA256" }, |
| 246 |
{ 0x00BB, "TLS_DH_DSS_WITH_CAMELLIA_128_CBC_SHA256" }, |
| 247 |
{ 0x00BC, "TLS_DH_RSA_WITH_CAMELLIA_128_CBC_SHA256" }, |
| 248 |
{ 0x00BD, "TLS_DHE_DSS_WITH_CAMELLIA_128_CBC_SHA256" }, |
| 249 |
{ 0x00BE, "TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA256" }, |
| 250 |
{ 0x00BF, "TLS_DH_anon_WITH_CAMELLIA_128_CBC_SHA256" }, |
| 251 |
{ 0x00C0, "TLS_RSA_WITH_CAMELLIA_256_CBC_SHA256" }, |
| 252 |
{ 0x00C1, "TLS_DH_DSS_WITH_CAMELLIA_256_CBC_SHA256" }, |
| 253 |
{ 0x00C2, "TLS_DH_RSA_WITH_CAMELLIA_256_CBC_SHA256" }, |
| 254 |
{ 0x00C3, "TLS_DHE_DSS_WITH_CAMELLIA_256_CBC_SHA256" }, |
| 255 |
{ 0x00C4, "TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA256" }, |
| 256 |
{ 0x00C5, "TLS_DH_anon_WITH_CAMELLIA_256_CBC_SHA256" }, |
| 257 |
{ 0x00FF, "TLS_EMPTY_RENEGOTIATION_INFO_SCSV" }, |
| 258 |
{ 0x5600, "TLS_FALLBACK_SCSV" }, |
| 259 |
{ 0xC001, "TLS_ECDH_ECDSA_WITH_NULL_SHA" }, |
| 260 |
{ 0xC002, "TLS_ECDH_ECDSA_WITH_RC4_128_SHA" }, |
| 261 |
{ 0xC003, "TLS_ECDH_ECDSA_WITH_3DES_EDE_CBC_SHA" }, |
| 262 |
{ 0xC004, "TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA" }, |
| 263 |
{ 0xC005, "TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA" }, |
| 264 |
{ 0xC006, "TLS_ECDHE_ECDSA_WITH_NULL_SHA" }, |
| 265 |
{ 0xC007, "TLS_ECDHE_ECDSA_WITH_RC4_128_SHA" }, |
| 266 |
{ 0xC008, "TLS_ECDHE_ECDSA_WITH_3DES_EDE_CBC_SHA" }, |
| 267 |
{ 0xC009, "TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA" }, |
| 268 |
{ 0xC00A, "TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA" }, |
| 269 |
{ 0xC00B, "TLS_ECDH_RSA_WITH_NULL_SHA" }, |
| 270 |
{ 0xC00C, "TLS_ECDH_RSA_WITH_RC4_128_SHA" }, |
| 271 |
{ 0xC00D, "TLS_ECDH_RSA_WITH_3DES_EDE_CBC_SHA" }, |
| 272 |
{ 0xC00E, "TLS_ECDH_RSA_WITH_AES_128_CBC_SHA" }, |
| 273 |
{ 0xC00F, "TLS_ECDH_RSA_WITH_AES_256_CBC_SHA" }, |
| 274 |
{ 0xC010, "TLS_ECDHE_RSA_WITH_NULL_SHA" }, |
| 275 |
{ 0xC011, "TLS_ECDHE_RSA_WITH_RC4_128_SHA" }, |
| 276 |
{ 0xC012, "TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA" }, |
| 277 |
{ 0xC013, "TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA" }, |
| 278 |
{ 0xC014, "TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA" }, |
| 279 |
{ 0xC015, "TLS_ECDH_anon_WITH_NULL_SHA" }, |
| 280 |
{ 0xC016, "TLS_ECDH_anon_WITH_RC4_128_SHA" }, |
| 281 |
{ 0xC017, "TLS_ECDH_anon_WITH_3DES_EDE_CBC_SHA" }, |
| 282 |
{ 0xC018, "TLS_ECDH_anon_WITH_AES_128_CBC_SHA" }, |
| 283 |
{ 0xC019, "TLS_ECDH_anon_WITH_AES_256_CBC_SHA" }, |
| 284 |
{ 0xC01A, "TLS_SRP_SHA_WITH_3DES_EDE_CBC_SHA" }, |
| 285 |
{ 0xC01B, "TLS_SRP_SHA_RSA_WITH_3DES_EDE_CBC_SHA" }, |
| 286 |
{ 0xC01C, "TLS_SRP_SHA_DSS_WITH_3DES_EDE_CBC_SHA" }, |
| 287 |
{ 0xC01D, "TLS_SRP_SHA_WITH_AES_128_CBC_SHA" }, |
| 288 |
{ 0xC01E, "TLS_SRP_SHA_RSA_WITH_AES_128_CBC_SHA" }, |
| 289 |
{ 0xC01F, "TLS_SRP_SHA_DSS_WITH_AES_128_CBC_SHA" }, |
| 290 |
{ 0xC020, "TLS_SRP_SHA_WITH_AES_256_CBC_SHA" }, |
| 291 |
{ 0xC021, "TLS_SRP_SHA_RSA_WITH_AES_256_CBC_SHA" }, |
| 292 |
{ 0xC022, "TLS_SRP_SHA_DSS_WITH_AES_256_CBC_SHA" }, |
| 293 |
{ 0xC023, "TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256" }, |
| 294 |
{ 0xC024, "TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384" }, |
| 295 |
{ 0xC025, "TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA256" }, |
| 296 |
{ 0xC026, "TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA384" }, |
| 297 |
{ 0xC027, "TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256" }, |
| 298 |
{ 0xC028, "TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384" }, |
| 299 |
{ 0xC029, "TLS_ECDH_RSA_WITH_AES_128_CBC_SHA256" }, |
| 300 |
{ 0xC02A, "TLS_ECDH_RSA_WITH_AES_256_CBC_SHA384" }, |
| 301 |
{ 0xC02B, "TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256" }, |
| 302 |
{ 0xC02C, "TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384" }, |
| 303 |
{ 0xC02D, "TLS_ECDH_ECDSA_WITH_AES_128_GCM_SHA256" }, |
| 304 |
{ 0xC02E, "TLS_ECDH_ECDSA_WITH_AES_256_GCM_SHA384" }, |
| 305 |
{ 0xC02F, "TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256" }, |
| 306 |
{ 0xC030, "TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384" }, |
| 307 |
{ 0xC031, "TLS_ECDH_RSA_WITH_AES_128_GCM_SHA256" }, |
| 308 |
{ 0xC032, "TLS_ECDH_RSA_WITH_AES_256_GCM_SHA384" }, |
| 309 |
{ 0xC033, "TLS_ECDHE_PSK_WITH_RC4_128_SHA" }, |
| 310 |
{ 0xC034, "TLS_ECDHE_PSK_WITH_3DES_EDE_CBC_SHA" }, |
| 311 |
{ 0xC035, "TLS_ECDHE_PSK_WITH_AES_128_CBC_SHA" }, |
| 312 |
{ 0xC036, "TLS_ECDHE_PSK_WITH_AES_256_CBC_SHA" }, |
| 313 |
{ 0xC037, "TLS_ECDHE_PSK_WITH_AES_128_CBC_SHA256" }, |
| 314 |
{ 0xC038, "TLS_ECDHE_PSK_WITH_AES_256_CBC_SHA384" }, |
| 315 |
{ 0xC039, "TLS_ECDHE_PSK_WITH_NULL_SHA" }, |
| 316 |
{ 0xC03A, "TLS_ECDHE_PSK_WITH_NULL_SHA256" }, |
| 317 |
{ 0xC03B, "TLS_ECDHE_PSK_WITH_NULL_SHA384" }, |
| 318 |
{ 0xC03C, "TLS_RSA_WITH_ARIA_128_CBC_SHA256" }, |
| 319 |
{ 0xC03D, "TLS_RSA_WITH_ARIA_256_CBC_SHA384" }, |
| 320 |
{ 0xC03E, "TLS_DH_DSS_WITH_ARIA_128_CBC_SHA256" }, |
| 321 |
{ 0xC03F, "TLS_DH_DSS_WITH_ARIA_256_CBC_SHA384" }, |
| 322 |
{ 0xC040, "TLS_DH_RSA_WITH_ARIA_128_CBC_SHA256" }, |
| 323 |
{ 0xC041, "TLS_DH_RSA_WITH_ARIA_256_CBC_SHA384" }, |
| 324 |
{ 0xC042, "TLS_DHE_DSS_WITH_ARIA_128_CBC_SHA256" }, |
| 325 |
{ 0xC043, "TLS_DHE_DSS_WITH_ARIA_256_CBC_SHA384" }, |
| 326 |
{ 0xC044, "TLS_DHE_RSA_WITH_ARIA_128_CBC_SHA256" }, |
| 327 |
{ 0xC045, "TLS_DHE_RSA_WITH_ARIA_256_CBC_SHA384" }, |
| 328 |
{ 0xC046, "TLS_DH_anon_WITH_ARIA_128_CBC_SHA256" }, |
| 329 |
{ 0xC047, "TLS_DH_anon_WITH_ARIA_256_CBC_SHA384" }, |
| 330 |
{ 0xC048, "TLS_ECDHE_ECDSA_WITH_ARIA_128_CBC_SHA256" }, |
| 331 |
{ 0xC049, "TLS_ECDHE_ECDSA_WITH_ARIA_256_CBC_SHA384" }, |
| 332 |
{ 0xC04A, "TLS_ECDH_ECDSA_WITH_ARIA_128_CBC_SHA256" }, |
| 333 |
{ 0xC04B, "TLS_ECDH_ECDSA_WITH_ARIA_256_CBC_SHA384" }, |
| 334 |
{ 0xC04C, "TLS_ECDHE_RSA_WITH_ARIA_128_CBC_SHA256" }, |
| 335 |
{ 0xC04D, "TLS_ECDHE_RSA_WITH_ARIA_256_CBC_SHA384" }, |
| 336 |
{ 0xC04E, "TLS_ECDH_RSA_WITH_ARIA_128_CBC_SHA256" }, |
| 337 |
{ 0xC04F, "TLS_ECDH_RSA_WITH_ARIA_256_CBC_SHA384" }, |
| 338 |
{ 0xC050, "TLS_RSA_WITH_ARIA_128_GCM_SHA256" }, |
| 339 |
{ 0xC051, "TLS_RSA_WITH_ARIA_256_GCM_SHA384" }, |
| 340 |
{ 0xC052, "TLS_DHE_RSA_WITH_ARIA_128_GCM_SHA256" }, |
| 341 |
{ 0xC053, "TLS_DHE_RSA_WITH_ARIA_256_GCM_SHA384" }, |
| 342 |
{ 0xC054, "TLS_DH_RSA_WITH_ARIA_128_GCM_SHA256" }, |
| 343 |
{ 0xC055, "TLS_DH_RSA_WITH_ARIA_256_GCM_SHA384" }, |
| 344 |
{ 0xC056, "TLS_DHE_DSS_WITH_ARIA_128_GCM_SHA256" }, |
| 345 |
{ 0xC057, "TLS_DHE_DSS_WITH_ARIA_256_GCM_SHA384" }, |
| 346 |
{ 0xC058, "TLS_DH_DSS_WITH_ARIA_128_GCM_SHA256" }, |
| 347 |
{ 0xC059, "TLS_DH_DSS_WITH_ARIA_256_GCM_SHA384" }, |
| 348 |
{ 0xC05A, "TLS_DH_anon_WITH_ARIA_128_GCM_SHA256" }, |
| 349 |
{ 0xC05B, "TLS_DH_anon_WITH_ARIA_256_GCM_SHA384" }, |
| 350 |
{ 0xC05C, "TLS_ECDHE_ECDSA_WITH_ARIA_128_GCM_SHA256" }, |
| 351 |
{ 0xC05D, "TLS_ECDHE_ECDSA_WITH_ARIA_256_GCM_SHA384" }, |
| 352 |
{ 0xC05E, "TLS_ECDH_ECDSA_WITH_ARIA_128_GCM_SHA256" }, |
| 353 |
{ 0xC05F, "TLS_ECDH_ECDSA_WITH_ARIA_256_GCM_SHA384" }, |
| 354 |
{ 0xC060, "TLS_ECDHE_RSA_WITH_ARIA_128_GCM_SHA256" }, |
| 355 |
{ 0xC061, "TLS_ECDHE_RSA_WITH_ARIA_256_GCM_SHA384" }, |
| 356 |
{ 0xC062, "TLS_ECDH_RSA_WITH_ARIA_128_GCM_SHA256" }, |
| 357 |
{ 0xC063, "TLS_ECDH_RSA_WITH_ARIA_256_GCM_SHA384" }, |
| 358 |
{ 0xC064, "TLS_PSK_WITH_ARIA_128_CBC_SHA256" }, |
| 359 |
{ 0xC065, "TLS_PSK_WITH_ARIA_256_CBC_SHA384" }, |
| 360 |
{ 0xC066, "TLS_DHE_PSK_WITH_ARIA_128_CBC_SHA256" }, |
| 361 |
{ 0xC067, "TLS_DHE_PSK_WITH_ARIA_256_CBC_SHA384" }, |
| 362 |
{ 0xC068, "TLS_RSA_PSK_WITH_ARIA_128_CBC_SHA256" }, |
| 363 |
{ 0xC069, "TLS_RSA_PSK_WITH_ARIA_256_CBC_SHA384" }, |
| 364 |
{ 0xC06A, "TLS_PSK_WITH_ARIA_128_GCM_SHA256" }, |
| 365 |
{ 0xC06B, "TLS_PSK_WITH_ARIA_256_GCM_SHA384" }, |
| 366 |
{ 0xC06C, "TLS_DHE_PSK_WITH_ARIA_128_GCM_SHA256" }, |
| 367 |
{ 0xC06D, "TLS_DHE_PSK_WITH_ARIA_256_GCM_SHA384" }, |
| 368 |
{ 0xC06E, "TLS_RSA_PSK_WITH_ARIA_128_GCM_SHA256" }, |
| 369 |
{ 0xC06F, "TLS_RSA_PSK_WITH_ARIA_256_GCM_SHA384" }, |
| 370 |
{ 0xC070, "TLS_ECDHE_PSK_WITH_ARIA_128_CBC_SHA256" }, |
| 371 |
{ 0xC071, "TLS_ECDHE_PSK_WITH_ARIA_256_CBC_SHA384" }, |
| 372 |
{ 0xC072, "TLS_ECDHE_ECDSA_WITH_CAMELLIA_128_CBC_SHA256" }, |
| 373 |
{ 0xC073, "TLS_ECDHE_ECDSA_WITH_CAMELLIA_256_CBC_SHA384" }, |
| 374 |
{ 0xC074, "TLS_ECDH_ECDSA_WITH_CAMELLIA_128_CBC_SHA256" }, |
| 375 |
{ 0xC075, "TLS_ECDH_ECDSA_WITH_CAMELLIA_256_CBC_SHA384" }, |
| 376 |
{ 0xC076, "TLS_ECDHE_RSA_WITH_CAMELLIA_128_CBC_SHA256" }, |
| 377 |
{ 0xC077, "TLS_ECDHE_RSA_WITH_CAMELLIA_256_CBC_SHA384" }, |
| 378 |
{ 0xC078, "TLS_ECDH_RSA_WITH_CAMELLIA_128_CBC_SHA256" }, |
| 379 |
{ 0xC079, "TLS_ECDH_RSA_WITH_CAMELLIA_256_CBC_SHA384" }, |
| 380 |
{ 0xC07A, "TLS_RSA_WITH_CAMELLIA_128_GCM_SHA256" }, |
| 381 |
{ 0xC07B, "TLS_RSA_WITH_CAMELLIA_256_GCM_SHA384" }, |
| 382 |
{ 0xC07C, "TLS_DHE_RSA_WITH_CAMELLIA_128_GCM_SHA256" }, |
| 383 |
{ 0xC07D, "TLS_DHE_RSA_WITH_CAMELLIA_256_GCM_SHA384" }, |
| 384 |
{ 0xC07E, "TLS_DH_RSA_WITH_CAMELLIA_128_GCM_SHA256" }, |
| 385 |
{ 0xC07F, "TLS_DH_RSA_WITH_CAMELLIA_256_GCM_SHA384" }, |
| 386 |
{ 0xC080, "TLS_DHE_DSS_WITH_CAMELLIA_128_GCM_SHA256" }, |
| 387 |
{ 0xC081, "TLS_DHE_DSS_WITH_CAMELLIA_256_GCM_SHA384" }, |
| 388 |
{ 0xC082, "TLS_DH_DSS_WITH_CAMELLIA_128_GCM_SHA256" }, |
| 389 |
{ 0xC083, "TLS_DH_DSS_WITH_CAMELLIA_256_GCM_SHA384" }, |
| 390 |
{ 0xC084, "TLS_DH_anon_WITH_CAMELLIA_128_GCM_SHA256" }, |
| 391 |
{ 0xC085, "TLS_DH_anon_WITH_CAMELLIA_256_GCM_SHA384" }, |
| 392 |
{ 0xC086, "TLS_ECDHE_ECDSA_WITH_CAMELLIA_128_GCM_SHA256" }, |
| 393 |
{ 0xC087, "TLS_ECDHE_ECDSA_WITH_CAMELLIA_256_GCM_SHA384" }, |
| 394 |
{ 0xC088, "TLS_ECDH_ECDSA_WITH_CAMELLIA_128_GCM_SHA256" }, |
| 395 |
{ 0xC089, "TLS_ECDH_ECDSA_WITH_CAMELLIA_256_GCM_SHA384" }, |
| 396 |
{ 0xC08A, "TLS_ECDHE_RSA_WITH_CAMELLIA_128_GCM_SHA256" }, |
| 397 |
{ 0xC08B, "TLS_ECDHE_RSA_WITH_CAMELLIA_256_GCM_SHA384" }, |
| 398 |
{ 0xC08C, "TLS_ECDH_RSA_WITH_CAMELLIA_128_GCM_SHA256" }, |
| 399 |
{ 0xC08D, "TLS_ECDH_RSA_WITH_CAMELLIA_256_GCM_SHA384" }, |
| 400 |
{ 0xC08E, "TLS_PSK_WITH_CAMELLIA_128_GCM_SHA256" }, |
| 401 |
{ 0xC08F, "TLS_PSK_WITH_CAMELLIA_256_GCM_SHA384" }, |
| 402 |
{ 0xC090, "TLS_DHE_PSK_WITH_CAMELLIA_128_GCM_SHA256" }, |
| 403 |
{ 0xC091, "TLS_DHE_PSK_WITH_CAMELLIA_256_GCM_SHA384" }, |
| 404 |
{ 0xC092, "TLS_RSA_PSK_WITH_CAMELLIA_128_GCM_SHA256" }, |
| 405 |
{ 0xC093, "TLS_RSA_PSK_WITH_CAMELLIA_256_GCM_SHA384" }, |
| 406 |
{ 0xC094, "TLS_PSK_WITH_CAMELLIA_128_CBC_SHA256" }, |
| 407 |
{ 0xC095, "TLS_PSK_WITH_CAMELLIA_256_CBC_SHA384" }, |
| 408 |
{ 0xC096, "TLS_DHE_PSK_WITH_CAMELLIA_128_CBC_SHA256" }, |
| 409 |
{ 0xC097, "TLS_DHE_PSK_WITH_CAMELLIA_256_CBC_SHA384" }, |
| 410 |
{ 0xC098, "TLS_RSA_PSK_WITH_CAMELLIA_128_CBC_SHA256" }, |
| 411 |
{ 0xC099, "TLS_RSA_PSK_WITH_CAMELLIA_256_CBC_SHA384" }, |
| 412 |
{ 0xC09A, "TLS_ECDHE_PSK_WITH_CAMELLIA_128_CBC_SHA256" }, |
| 413 |
{ 0xC09B, "TLS_ECDHE_PSK_WITH_CAMELLIA_256_CBC_SHA384" }, |
| 414 |
{ 0xC09C, "TLS_RSA_WITH_AES_128_CCM" }, |
| 415 |
{ 0xC09D, "TLS_RSA_WITH_AES_256_CCM" }, |
| 416 |
{ 0xC09E, "TLS_DHE_RSA_WITH_AES_128_CCM" }, |
| 417 |
{ 0xC09F, "TLS_DHE_RSA_WITH_AES_256_CCM" }, |
| 418 |
{ 0xC0A0, "TLS_RSA_WITH_AES_128_CCM_8" }, |
| 419 |
{ 0xC0A1, "TLS_RSA_WITH_AES_256_CCM_8" }, |
| 420 |
{ 0xC0A2, "TLS_DHE_RSA_WITH_AES_128_CCM_8" }, |
| 421 |
{ 0xC0A3, "TLS_DHE_RSA_WITH_AES_256_CCM_8" }, |
| 422 |
{ 0xC0A4, "TLS_PSK_WITH_AES_128_CCM" }, |
| 423 |
{ 0xC0A5, "TLS_PSK_WITH_AES_256_CCM" }, |
| 424 |
{ 0xC0A6, "TLS_DHE_PSK_WITH_AES_128_CCM" }, |
| 425 |
{ 0xC0A7, "TLS_DHE_PSK_WITH_AES_256_CCM" }, |
| 426 |
{ 0xC0A8, "TLS_PSK_WITH_AES_128_CCM_8" }, |
| 427 |
{ 0xC0A9, "TLS_PSK_WITH_AES_256_CCM_8" }, |
| 428 |
{ 0xC0AA, "TLS_PSK_DHE_WITH_AES_128_CCM_8" }, |
| 429 |
{ 0xC0AB, "TLS_PSK_DHE_WITH_AES_256_CCM_8" }, |
| 430 |
{ 0xC0AC, "TLS_ECDHE_ECDSA_WITH_AES_128_CCM" }, |
| 431 |
{ 0xC0AD, "TLS_ECDHE_ECDSA_WITH_AES_256_CCM" }, |
| 432 |
{ 0xC0AE, "TLS_ECDHE_ECDSA_WITH_AES_128_CCM_8" }, |
| 433 |
{ 0xC0AF, "TLS_ECDHE_ECDSA_WITH_AES_256_CCM_8" }, |
| 434 |
{ 0xC102, "IANA-GOST2012-GOST8912-GOST8912" }, |
| 435 |
{ 0xCCA8, "TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256" }, |
| 436 |
{ 0xCCA9, "TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256" }, |
| 437 |
{ 0xCCAA, "TLS_DHE_RSA_WITH_CHACHA20_POLY1305_SHA256" }, |
| 438 |
{ 0xCCAB, "TLS_PSK_WITH_CHACHA20_POLY1305_SHA256" }, |
| 439 |
{ 0xCCAC, "TLS_ECDHE_PSK_WITH_CHACHA20_POLY1305_SHA256" }, |
| 440 |
{ 0xCCAD, "TLS_DHE_PSK_WITH_CHACHA20_POLY1305_SHA256" }, |
| 441 |
{ 0xCCAE, "TLS_RSA_PSK_WITH_CHACHA20_POLY1305_SHA256" }, |
| 442 |
{ 0x1301, "TLS_AES_128_GCM_SHA256" }, |
| 443 |
{ 0x1302, "TLS_AES_256_GCM_SHA384" }, |
| 444 |
{ 0x1303, "TLS_CHACHA20_POLY1305_SHA256" }, |
| 445 |
{ 0x1304, "TLS_AES_128_CCM_SHA256" }, |
| 446 |
{ 0x1305, "TLS_AES_128_CCM_8_SHA256" }, |
| 447 |
{ 0xFEFE, "SSL_RSA_FIPS_WITH_DES_CBC_SHA" }, |
| 448 |
{ 0xFEFF, "SSL_RSA_FIPS_WITH_3DES_EDE_CBC_SHA" }, |
| 449 |
{ 0xFF85, "LEGACY-GOST2012-GOST8912-GOST8912" }, |
| 450 |
{ 0xFF87, "GOST2012-NULL-GOST12" }, |
| 451 |
{ 0xC0B4, "TLS_SHA256_SHA256" }, |
| 452 |
{ 0xC0B5, "TLS_SHA384_SHA384" }, |
| 453 |
{ 0xC100, "GOST2012-KUZNYECHIK-KUZNYECHIKOMAC" }, |
| 454 |
{ 0xC101, "GOST2012-MAGMA-MAGMAOMAC" }, |
| 455 |
}; |
| 456 |
|
| 457 |
/* Compression methods */ |
| 458 |
static const ssl_trace_tbl ssl_comp_tbl[] = { |
| 459 |
{ 0x0000, "No Compression" }, |
| 460 |
{ 0x0001, "Zlib Compression" } |
| 461 |
}; |
| 462 |
|
| 463 |
/* Extensions sorted by ascending id */ |
| 464 |
static const ssl_trace_tbl ssl_exts_tbl[] = { |
| 465 |
{ TLSEXT_TYPE_server_name, "server_name" }, |
| 466 |
{ TLSEXT_TYPE_max_fragment_length, "max_fragment_length" }, |
| 467 |
{ TLSEXT_TYPE_client_certificate_url, "client_certificate_url" }, |
| 468 |
{ TLSEXT_TYPE_trusted_ca_keys, "trusted_ca_keys" }, |
| 469 |
{ TLSEXT_TYPE_truncated_hmac, "truncated_hmac" }, |
| 470 |
{ TLSEXT_TYPE_status_request, "status_request" }, |
| 471 |
{ TLSEXT_TYPE_user_mapping, "user_mapping" }, |
| 472 |
{ TLSEXT_TYPE_client_authz, "client_authz" }, |
| 473 |
{ TLSEXT_TYPE_server_authz, "server_authz" }, |
| 474 |
{ TLSEXT_TYPE_cert_type, "cert_type" }, |
| 475 |
{ TLSEXT_TYPE_supported_groups, "supported_groups" }, |
| 476 |
{ TLSEXT_TYPE_ec_point_formats, "ec_point_formats" }, |
| 477 |
{ TLSEXT_TYPE_srp, "srp" }, |
| 478 |
{ TLSEXT_TYPE_signature_algorithms, "signature_algorithms" }, |
| 479 |
{ TLSEXT_TYPE_use_srtp, "use_srtp" }, |
| 480 |
{ TLSEXT_TYPE_application_layer_protocol_negotiation, |
| 481 |
"application_layer_protocol_negotiation" }, |
| 482 |
{ TLSEXT_TYPE_signed_certificate_timestamp, "signed_certificate_timestamps" }, |
| 483 |
{ TLSEXT_TYPE_client_cert_type, "client_cert_type" }, |
| 484 |
{ TLSEXT_TYPE_server_cert_type, "server_cert_type" }, |
| 485 |
{ TLSEXT_TYPE_padding, "padding" }, |
| 486 |
{ TLSEXT_TYPE_encrypt_then_mac, "encrypt_then_mac" }, |
| 487 |
{ TLSEXT_TYPE_extended_master_secret, "extended_master_secret" }, |
| 488 |
{ TLSEXT_TYPE_compress_certificate, "compress_certificate" }, |
| 489 |
{ TLSEXT_TYPE_session_ticket, "session_ticket" }, |
| 490 |
{ TLSEXT_TYPE_psk, "psk" }, |
| 491 |
{ TLSEXT_TYPE_early_data, "early_data" }, |
| 492 |
{ TLSEXT_TYPE_supported_versions, "supported_versions" }, |
| 493 |
{ TLSEXT_TYPE_cookie, "cookie_ext" }, |
| 494 |
{ TLSEXT_TYPE_psk_kex_modes, "psk_key_exchange_modes" }, |
| 495 |
{ TLSEXT_TYPE_certificate_authorities, "certificate_authorities" }, |
| 496 |
{ TLSEXT_TYPE_post_handshake_auth, "post_handshake_auth" }, |
| 497 |
{ TLSEXT_TYPE_signature_algorithms_cert, "signature_algorithms_cert" }, |
| 498 |
{ TLSEXT_TYPE_key_share, "key_share" }, |
| 499 |
{ TLSEXT_TYPE_renegotiate, "renegotiate" }, |
| 500 |
#ifndef OPENSSL_NO_NEXTPROTONEG |
| 501 |
{ TLSEXT_TYPE_next_proto_neg, "next_proto_neg" }, |
| 502 |
#endif |
| 503 |
}; |
| 504 |
|
| 505 |
static const ssl_trace_tbl ssl_groups_tbl[] = { |
| 506 |
{ 1, "sect163k1 (K-163)" }, |
| 507 |
{ 2, "sect163r1" }, |
| 508 |
{ 3, "sect163r2 (B-163)" }, |
| 509 |
{ 4, "sect193r1" }, |
| 510 |
{ 5, "sect193r2" }, |
| 511 |
{ 6, "sect233k1 (K-233)" }, |
| 512 |
{ 7, "sect233r1 (B-233)" }, |
| 513 |
{ 8, "sect239k1" }, |
| 514 |
{ 9, "sect283k1 (K-283)" }, |
| 515 |
{ 10, "sect283r1 (B-283)" }, |
| 516 |
{ 11, "sect409k1 (K-409)" }, |
| 517 |
{ 12, "sect409r1 (B-409)" }, |
| 518 |
{ 13, "sect571k1 (K-571)" }, |
| 519 |
{ 14, "sect571r1 (B-571)" }, |
| 520 |
{ 15, "secp160k1" }, |
| 521 |
{ 16, "secp160r1" }, |
| 522 |
{ 17, "secp160r2" }, |
| 523 |
{ 18, "secp192k1" }, |
| 524 |
{ 19, "secp192r1 (P-192)" }, |
| 525 |
{ 20, "secp224k1" }, |
| 526 |
{ 21, "secp224r1 (P-224)" }, |
| 527 |
{ 22, "secp256k1" }, |
| 528 |
{ 23, "secp256r1 (P-256)" }, |
| 529 |
{ 24, "secp384r1 (P-384)" }, |
| 530 |
{ 25, "secp521r1 (P-521)" }, |
| 531 |
{ 26, "brainpoolP256r1" }, |
| 532 |
{ 27, "brainpoolP384r1" }, |
| 533 |
{ 28, "brainpoolP512r1" }, |
| 534 |
{ 29, "ecdh_x25519" }, |
| 535 |
{ 30, "ecdh_x448" }, |
| 536 |
{ 31, "brainpoolP256r1tls13" }, |
| 537 |
{ 32, "brainpoolP384r1tls13" }, |
| 538 |
{ 33, "brainpoolP512r1tls13" }, |
| 539 |
{ 34, "GC256A" }, |
| 540 |
{ 35, "GC256B" }, |
| 541 |
{ 36, "GC256C" }, |
| 542 |
{ 37, "GC256D" }, |
| 543 |
{ 38, "GC512A" }, |
| 544 |
{ 39, "GC512B" }, |
| 545 |
{ 40, "GC512C" }, |
| 546 |
{ 256, "ffdhe2048" }, |
| 547 |
{ 257, "ffdhe3072" }, |
| 548 |
{ 258, "ffdhe4096" }, |
| 549 |
{ 259, "ffdhe6144" }, |
| 550 |
{ 260, "ffdhe8192" }, |
| 551 |
{ 512, "MLKEM512" }, |
| 552 |
{ 513, "MLKEM768" }, |
| 553 |
{ 514, "MLKEM1024" }, |
| 554 |
{ 4587, "SecP256r1MLKEM768" }, |
| 555 |
{ 4588, "X25519MLKEM768" }, |
| 556 |
{ 4589, "SecP384r1MLKEM1024" }, |
| 557 |
{ 25497, "X25519Kyber768Draft00" }, |
| 558 |
{ 25498, "SecP256r1Kyber768Draft00" }, |
| 559 |
{ 0xFF01, "arbitrary_explicit_prime_curves" }, |
| 560 |
{ 0xFF02, "arbitrary_explicit_char2_curves" } |
| 561 |
}; |
| 562 |
|
| 563 |
static const ssl_trace_tbl ssl_point_tbl[] = { |
| 564 |
{ 0, "uncompressed" }, |
| 565 |
{ 1, "ansiX962_compressed_prime" }, |
| 566 |
{ 2, "ansiX962_compressed_char2" } |
| 567 |
}; |
| 568 |
|
| 569 |
static const ssl_trace_tbl ssl_mfl_tbl[] = { |
| 570 |
{ 0, "disabled" }, |
| 571 |
{ 1, "max_fragment_length := 2^9 (512 bytes)" }, |
| 572 |
{ 2, "max_fragment_length := 2^10 (1024 bytes)" }, |
| 573 |
{ 3, "max_fragment_length := 2^11 (2048 bytes)" }, |
| 574 |
{ 4, "max_fragment_length := 2^12 (4096 bytes)" } |
| 575 |
}; |
| 576 |
|
| 577 |
static const ssl_trace_tbl ssl_sigalg_tbl[] = { |
| 578 |
{ TLSEXT_SIGALG_ecdsa_secp256r1_sha256, TLSEXT_SIGALG_ecdsa_secp256r1_sha256_name }, |
| 579 |
{ TLSEXT_SIGALG_ecdsa_secp384r1_sha384, TLSEXT_SIGALG_ecdsa_secp384r1_sha384_name }, |
| 580 |
{ TLSEXT_SIGALG_ecdsa_secp521r1_sha512, TLSEXT_SIGALG_ecdsa_secp521r1_sha512_name }, |
| 581 |
{ TLSEXT_SIGALG_ecdsa_sha224, TLSEXT_SIGALG_ecdsa_sha224_name }, |
| 582 |
{ TLSEXT_SIGALG_ed25519, TLSEXT_SIGALG_ed25519_name }, |
| 583 |
{ TLSEXT_SIGALG_ed448, TLSEXT_SIGALG_ed448_name }, |
| 584 |
{ TLSEXT_SIGALG_ecdsa_sha1, TLSEXT_SIGALG_ecdsa_sha1_name }, |
| 585 |
{ TLSEXT_SIGALG_rsa_pss_rsae_sha256, TLSEXT_SIGALG_rsa_pss_rsae_sha256_name }, |
| 586 |
{ TLSEXT_SIGALG_rsa_pss_rsae_sha384, TLSEXT_SIGALG_rsa_pss_rsae_sha384_name }, |
| 587 |
{ TLSEXT_SIGALG_rsa_pss_rsae_sha512, TLSEXT_SIGALG_rsa_pss_rsae_sha512_name }, |
| 588 |
{ TLSEXT_SIGALG_rsa_pss_pss_sha256, TLSEXT_SIGALG_rsa_pss_pss_sha256_name }, |
| 589 |
{ TLSEXT_SIGALG_rsa_pss_pss_sha384, TLSEXT_SIGALG_rsa_pss_pss_sha384_name }, |
| 590 |
{ TLSEXT_SIGALG_rsa_pss_pss_sha512, TLSEXT_SIGALG_rsa_pss_pss_sha512_name }, |
| 591 |
{ TLSEXT_SIGALG_rsa_pkcs1_sha256, TLSEXT_SIGALG_rsa_pkcs1_sha256_name }, |
| 592 |
{ TLSEXT_SIGALG_rsa_pkcs1_sha384, TLSEXT_SIGALG_rsa_pkcs1_sha384_name }, |
| 593 |
{ TLSEXT_SIGALG_rsa_pkcs1_sha512, TLSEXT_SIGALG_rsa_pkcs1_sha512_name }, |
| 594 |
{ TLSEXT_SIGALG_rsa_pkcs1_sha224, TLSEXT_SIGALG_rsa_pkcs1_sha224_name }, |
| 595 |
{ TLSEXT_SIGALG_rsa_pkcs1_sha1, TLSEXT_SIGALG_rsa_pkcs1_sha1_name }, |
| 596 |
{ TLSEXT_SIGALG_dsa_sha256, TLSEXT_SIGALG_dsa_sha256_name }, |
| 597 |
{ TLSEXT_SIGALG_dsa_sha384, TLSEXT_SIGALG_dsa_sha384_name }, |
| 598 |
{ TLSEXT_SIGALG_dsa_sha512, TLSEXT_SIGALG_dsa_sha512_name }, |
| 599 |
{ TLSEXT_SIGALG_dsa_sha224, TLSEXT_SIGALG_dsa_sha224_name }, |
| 600 |
{ TLSEXT_SIGALG_dsa_sha1, TLSEXT_SIGALG_dsa_sha1_name }, |
| 601 |
{ TLSEXT_SIGALG_gostr34102012_256_intrinsic, TLSEXT_SIGALG_gostr34102012_256_intrinsic_name }, |
| 602 |
{ TLSEXT_SIGALG_gostr34102012_512_intrinsic, TLSEXT_SIGALG_gostr34102012_512_intrinsic_name }, |
| 603 |
{ TLSEXT_SIGALG_gostr34102012_256_gostr34112012_256, TLSEXT_SIGALG_gostr34102012_256_gostr34112012_256_name }, |
| 604 |
{ TLSEXT_SIGALG_gostr34102012_512_gostr34112012_512, TLSEXT_SIGALG_gostr34102012_512_gostr34112012_512_name }, |
| 605 |
{ TLSEXT_SIGALG_gostr34102001_gostr3411, TLSEXT_SIGALG_gostr34102001_gostr3411_name }, |
| 606 |
{ TLSEXT_SIGALG_ecdsa_brainpoolP256r1_sha256, TLSEXT_SIGALG_ecdsa_brainpoolP256r1_sha256_name }, |
| 607 |
{ TLSEXT_SIGALG_ecdsa_brainpoolP384r1_sha384, TLSEXT_SIGALG_ecdsa_brainpoolP384r1_sha384_name }, |
| 608 |
{ TLSEXT_SIGALG_ecdsa_brainpoolP512r1_sha512, TLSEXT_SIGALG_ecdsa_brainpoolP512r1_sha512_name }, |
| 609 |
/* |
| 610 |
* Well known groups that we happen to know about, but only come from |
| 611 |
* provider capability declarations (hence no macros for the |
| 612 |
* codepoints/names) |
| 613 |
*/ |
| 614 |
{ 0x0904, "mldsa44" }, |
| 615 |
{ 0x0905, "mldsa65" }, |
| 616 |
{ 0x0906, "mldsa87" } |
| 617 |
}; |
| 618 |
|
| 619 |
static const ssl_trace_tbl ssl_ctype_tbl[] = { |
| 620 |
{ 1, "rsa_sign" }, |
| 621 |
{ 2, "dss_sign" }, |
| 622 |
{ 3, "rsa_fixed_dh" }, |
| 623 |
{ 4, "dss_fixed_dh" }, |
| 624 |
{ 5, "rsa_ephemeral_dh" }, |
| 625 |
{ 6, "dss_ephemeral_dh" }, |
| 626 |
{ 20, "fortezza_dms" }, |
| 627 |
{ 64, "ecdsa_sign" }, |
| 628 |
{ 65, "rsa_fixed_ecdh" }, |
| 629 |
{ 66, "ecdsa_fixed_ecdh" }, |
| 630 |
{ 67, "gost_sign256" }, |
| 631 |
{ 68, "gost_sign512" }, |
| 632 |
}; |
| 633 |
|
| 634 |
static const ssl_trace_tbl ssl_psk_kex_modes_tbl[] = { |
| 635 |
{ TLSEXT_KEX_MODE_KE, "psk_ke" }, |
| 636 |
{ TLSEXT_KEX_MODE_KE_DHE, "psk_dhe_ke" } |
| 637 |
}; |
| 638 |
|
| 639 |
static const ssl_trace_tbl ssl_key_update_tbl[] = { |
| 640 |
{ SSL_KEY_UPDATE_NOT_REQUESTED, "update_not_requested" }, |
| 641 |
{ SSL_KEY_UPDATE_REQUESTED, "update_requested" } |
| 642 |
}; |
| 643 |
|
| 644 |
static const ssl_trace_tbl ssl_comp_cert_tbl[] = { |
| 645 |
{ TLSEXT_comp_cert_none, "none" }, |
| 646 |
{ TLSEXT_comp_cert_zlib, "zlib" }, |
| 647 |
{ TLSEXT_comp_cert_brotli, "brotli" }, |
| 648 |
{ TLSEXT_comp_cert_zstd, "zstd" } |
| 649 |
}; |
| 650 |
|
| 651 |
/* |
| 652 |
* "pgp" and "1609dot2" are defined in RFC7250, |
| 653 |
* although OpenSSL doesn't support them, it can |
| 654 |
* at least report them in traces |
| 655 |
*/ |
| 656 |
static const ssl_trace_tbl ssl_cert_type_tbl[] = { |
| 657 |
{ TLSEXT_cert_type_x509, "x509" }, |
| 658 |
{ TLSEXT_cert_type_pgp, "pgp" }, |
| 659 |
{ TLSEXT_cert_type_rpk, "rpk" }, |
| 660 |
{ TLSEXT_cert_type_1609dot2, "1609dot2" } |
| 661 |
}; |
| 662 |
|
| 663 |
static void ssl_print_hex(BIO *bio, int indent, const char *name, |
| 664 |
const unsigned char *msg, size_t msglen) |
| 665 |
{ |
| 666 |
size_t i; |
| 667 |
|
| 668 |
BIO_indent(bio, indent, 80); |
| 669 |
BIO_printf(bio, "%s (len=%d): ", name, (int)msglen); |
| 670 |
for (i = 0; i < msglen; i++) |
| 671 |
BIO_printf(bio, "%02X", msg[i]); |
| 672 |
BIO_puts(bio, "\n"); |
| 673 |
} |
| 674 |
|
| 675 |
static int ssl_print_hexbuf(BIO *bio, int indent, const char *name, size_t nlen, |
| 676 |
const unsigned char **pmsg, size_t *pmsglen) |
| 677 |
{ |
| 678 |
size_t blen; |
| 679 |
const unsigned char *p = *pmsg; |
| 680 |
|
| 681 |
if (*pmsglen < nlen) |
| 682 |
return 0; |
| 683 |
blen = p[0]; |
| 684 |
if (nlen > 1) |
| 685 |
blen = (blen << 8) | p[1]; |
| 686 |
if (*pmsglen < nlen + blen) |
| 687 |
return 0; |
| 688 |
p += nlen; |
| 689 |
ssl_print_hex(bio, indent, name, p, blen); |
| 690 |
*pmsg += blen + nlen; |
| 691 |
*pmsglen -= blen + nlen; |
| 692 |
return 1; |
| 693 |
} |
| 694 |
|
| 695 |
static int ssl_print_version(BIO *bio, int indent, const char *name, |
| 696 |
const unsigned char **pmsg, size_t *pmsglen, |
| 697 |
unsigned int *version) |
| 698 |
{ |
| 699 |
int vers; |
| 700 |
|
| 701 |
if (*pmsglen < 2) |
| 702 |
return 0; |
| 703 |
vers = ((*pmsg)[0] << 8) | (*pmsg)[1]; |
| 704 |
if (version != NULL) |
| 705 |
*version = vers; |
| 706 |
BIO_indent(bio, indent, 80); |
| 707 |
BIO_printf(bio, "%s=0x%x (%s)\n", |
| 708 |
name, vers, ssl_trace_str(vers, ssl_version_tbl)); |
| 709 |
*pmsg += 2; |
| 710 |
*pmsglen -= 2; |
| 711 |
return 1; |
| 712 |
} |
| 713 |
|
| 714 |
static int ssl_print_random(BIO *bio, int indent, |
| 715 |
const unsigned char **pmsg, size_t *pmsglen) |
| 716 |
{ |
| 717 |
unsigned int tm; |
| 718 |
const unsigned char *p = *pmsg; |
| 719 |
|
| 720 |
if (*pmsglen < 32) |
| 721 |
return 0; |
| 722 |
tm = ((unsigned int)p[0] << 24) |
| 723 |
| ((unsigned int)p[1] << 16) |
| 724 |
| ((unsigned int)p[2] << 8) |
| 725 |
| (unsigned int)p[3]; |
| 726 |
p += 4; |
| 727 |
BIO_indent(bio, indent, 80); |
| 728 |
BIO_puts(bio, "Random:\n"); |
| 729 |
BIO_indent(bio, indent + 2, 80); |
| 730 |
BIO_printf(bio, "gmt_unix_time=0x%08X\n", tm); |
| 731 |
ssl_print_hex(bio, indent + 2, "random_bytes", p, 28); |
| 732 |
*pmsg += 32; |
| 733 |
*pmsglen -= 32; |
| 734 |
return 1; |
| 735 |
} |
| 736 |
|
| 737 |
static int ssl_print_signature(BIO *bio, int indent, const SSL_CONNECTION *sc, |
| 738 |
const unsigned char **pmsg, size_t *pmsglen) |
| 739 |
{ |
| 740 |
if (*pmsglen < 2) |
| 741 |
return 0; |
| 742 |
if (SSL_USE_SIGALGS(sc)) { |
| 743 |
const unsigned char *p = *pmsg; |
| 744 |
unsigned int sigalg = (p[0] << 8) | p[1]; |
| 745 |
|
| 746 |
BIO_indent(bio, indent, 80); |
| 747 |
BIO_printf(bio, "Signature Algorithm: %s (0x%04x)\n", |
| 748 |
ssl_trace_str(sigalg, ssl_sigalg_tbl), sigalg); |
| 749 |
*pmsg += 2; |
| 750 |
*pmsglen -= 2; |
| 751 |
} |
| 752 |
return ssl_print_hexbuf(bio, indent, "Signature", 2, pmsg, pmsglen); |
| 753 |
} |
| 754 |
|
| 755 |
static int ssl_print_extension(BIO *bio, int indent, int server, |
| 756 |
unsigned char mt, int extype, |
| 757 |
const unsigned char *ext, size_t extlen) |
| 758 |
{ |
| 759 |
size_t xlen, share_len; |
| 760 |
unsigned int sigalg; |
| 761 |
uint32_t max_early_data; |
| 762 |
|
| 763 |
BIO_indent(bio, indent, 80); |
| 764 |
BIO_printf(bio, "extension_type=%s(%d), length=%d\n", |
| 765 |
ssl_trace_str(extype, ssl_exts_tbl), extype, (int)extlen); |
| 766 |
switch (extype) { |
| 767 |
case TLSEXT_TYPE_compress_certificate: |
| 768 |
if (extlen < 1) |
| 769 |
return 0; |
| 770 |
xlen = ext[0]; |
| 771 |
if (extlen != xlen + 1) |
| 772 |
return 0; |
| 773 |
return ssl_trace_list(bio, indent + 2, ext + 1, xlen, 2, ssl_comp_cert_tbl); |
| 774 |
|
| 775 |
case TLSEXT_TYPE_max_fragment_length: |
| 776 |
if (extlen < 1) |
| 777 |
return 0; |
| 778 |
xlen = extlen; |
| 779 |
return ssl_trace_list(bio, indent + 2, ext, xlen, 1, ssl_mfl_tbl); |
| 780 |
|
| 781 |
case TLSEXT_TYPE_ec_point_formats: |
| 782 |
if (extlen < 1) |
| 783 |
return 0; |
| 784 |
xlen = ext[0]; |
| 785 |
if (extlen != xlen + 1) |
| 786 |
return 0; |
| 787 |
return ssl_trace_list(bio, indent + 2, ext + 1, xlen, 1, ssl_point_tbl); |
| 788 |
|
| 789 |
case TLSEXT_TYPE_supported_groups: |
| 790 |
if (extlen < 2) |
| 791 |
return 0; |
| 792 |
xlen = (ext[0] << 8) | ext[1]; |
| 793 |
if (extlen != xlen + 2) |
| 794 |
return 0; |
| 795 |
return ssl_trace_list(bio, indent + 2, ext + 2, xlen, 2, ssl_groups_tbl); |
| 796 |
case TLSEXT_TYPE_application_layer_protocol_negotiation: |
| 797 |
if (extlen < 2) |
| 798 |
return 0; |
| 799 |
xlen = (ext[0] << 8) | ext[1]; |
| 800 |
if (extlen != xlen + 2) |
| 801 |
return 0; |
| 802 |
ext += 2; |
| 803 |
while (xlen > 0) { |
| 804 |
size_t plen = *ext++; |
| 805 |
|
| 806 |
if (plen + 1 > xlen) |
| 807 |
return 0; |
| 808 |
BIO_indent(bio, indent + 2, 80); |
| 809 |
BIO_write(bio, ext, (int)plen); |
| 810 |
BIO_puts(bio, "\n"); |
| 811 |
ext += plen; |
| 812 |
xlen -= plen + 1; |
| 813 |
} |
| 814 |
return 1; |
| 815 |
|
| 816 |
case TLSEXT_TYPE_signature_algorithms: |
| 817 |
|
| 818 |
if (extlen < 2) |
| 819 |
return 0; |
| 820 |
xlen = (ext[0] << 8) | ext[1]; |
| 821 |
if (extlen != xlen + 2) |
| 822 |
return 0; |
| 823 |
if (xlen & 1) |
| 824 |
return 0; |
| 825 |
ext += 2; |
| 826 |
while (xlen > 0) { |
| 827 |
BIO_indent(bio, indent + 2, 80); |
| 828 |
sigalg = (ext[0] << 8) | ext[1]; |
| 829 |
BIO_printf(bio, "%s (0x%04x)\n", |
| 830 |
ssl_trace_str(sigalg, ssl_sigalg_tbl), sigalg); |
| 831 |
xlen -= 2; |
| 832 |
ext += 2; |
| 833 |
} |
| 834 |
break; |
| 835 |
|
| 836 |
case TLSEXT_TYPE_renegotiate: |
| 837 |
if (extlen < 1) |
| 838 |
return 0; |
| 839 |
xlen = ext[0]; |
| 840 |
if (xlen + 1 != extlen) |
| 841 |
return 0; |
| 842 |
ext++; |
| 843 |
if (xlen) { |
| 844 |
if (server) { |
| 845 |
if (xlen & 1) |
| 846 |
return 0; |
| 847 |
xlen >>= 1; |
| 848 |
} |
| 849 |
ssl_print_hex(bio, indent + 4, "client_verify_data", ext, xlen); |
| 850 |
if (server) { |
| 851 |
ext += xlen; |
| 852 |
ssl_print_hex(bio, indent + 4, "server_verify_data", ext, xlen); |
| 853 |
} |
| 854 |
} else { |
| 855 |
BIO_indent(bio, indent + 4, 80); |
| 856 |
BIO_puts(bio, "<EMPTY>\n"); |
| 857 |
} |
| 858 |
break; |
| 859 |
|
| 860 |
case TLSEXT_TYPE_session_ticket: |
| 861 |
if (extlen != 0) |
| 862 |
ssl_print_hex(bio, indent + 4, "ticket", ext, extlen); |
| 863 |
break; |
| 864 |
|
| 865 |
case TLSEXT_TYPE_key_share: |
| 866 |
if (server && extlen == 2) { |
| 867 |
int group_id; |
| 868 |
|
| 869 |
/* We assume this is an HRR, otherwise this is an invalid key_share */ |
| 870 |
group_id = (ext[0] << 8) | ext[1]; |
| 871 |
BIO_indent(bio, indent + 4, 80); |
| 872 |
BIO_printf(bio, "NamedGroup: %s (%d)\n", |
| 873 |
ssl_trace_str(group_id, ssl_groups_tbl), group_id); |
| 874 |
break; |
| 875 |
} |
| 876 |
if (extlen < 2) |
| 877 |
return 0; |
| 878 |
if (server) { |
| 879 |
xlen = extlen; |
| 880 |
} else { |
| 881 |
xlen = (ext[0] << 8) | ext[1]; |
| 882 |
if (extlen != xlen + 2) |
| 883 |
return 0; |
| 884 |
ext += 2; |
| 885 |
} |
| 886 |
for (; xlen > 0; ext += share_len, xlen -= share_len) { |
| 887 |
int group_id; |
| 888 |
|
| 889 |
if (xlen < 4) |
| 890 |
return 0; |
| 891 |
group_id = (ext[0] << 8) | ext[1]; |
| 892 |
share_len = (ext[2] << 8) | ext[3]; |
| 893 |
ext += 4; |
| 894 |
xlen -= 4; |
| 895 |
if (xlen < share_len) |
| 896 |
return 0; |
| 897 |
BIO_indent(bio, indent + 4, 80); |
| 898 |
BIO_printf(bio, "NamedGroup: %s (%d)\n", |
| 899 |
ssl_trace_str(group_id, ssl_groups_tbl), group_id); |
| 900 |
ssl_print_hex(bio, indent + 4, "key_exchange: ", ext, share_len); |
| 901 |
} |
| 902 |
break; |
| 903 |
|
| 904 |
case TLSEXT_TYPE_supported_versions: |
| 905 |
if (server) { |
| 906 |
int version; |
| 907 |
|
| 908 |
if (extlen != 2) |
| 909 |
return 0; |
| 910 |
version = (ext[0] << 8) | ext[1]; |
| 911 |
BIO_indent(bio, indent + 4, 80); |
| 912 |
BIO_printf(bio, "%s (%d)\n", |
| 913 |
ssl_trace_str(version, ssl_version_tbl), version); |
| 914 |
break; |
| 915 |
} |
| 916 |
if (extlen < 1) |
| 917 |
return 0; |
| 918 |
xlen = ext[0]; |
| 919 |
if (extlen != xlen + 1) |
| 920 |
return 0; |
| 921 |
return ssl_trace_list(bio, indent + 2, ext + 1, xlen, 2, |
| 922 |
ssl_version_tbl); |
| 923 |
|
| 924 |
case TLSEXT_TYPE_psk_kex_modes: |
| 925 |
if (extlen < 1) |
| 926 |
return 0; |
| 927 |
xlen = ext[0]; |
| 928 |
if (extlen != xlen + 1) |
| 929 |
return 0; |
| 930 |
return ssl_trace_list(bio, indent + 2, ext + 1, xlen, 1, |
| 931 |
ssl_psk_kex_modes_tbl); |
| 932 |
|
| 933 |
case TLSEXT_TYPE_early_data: |
| 934 |
if (mt != SSL3_MT_NEWSESSION_TICKET) |
| 935 |
break; |
| 936 |
if (extlen != 4) |
| 937 |
return 0; |
| 938 |
max_early_data = ((unsigned int)ext[0] << 24) |
| 939 |
| ((unsigned int)ext[1] << 16) |
| 940 |
| ((unsigned int)ext[2] << 8) |
| 941 |
| (unsigned int)ext[3]; |
| 942 |
BIO_indent(bio, indent + 2, 80); |
| 943 |
BIO_printf(bio, "max_early_data=%u\n", (unsigned int)max_early_data); |
| 944 |
break; |
| 945 |
|
| 946 |
case TLSEXT_TYPE_server_cert_type: |
| 947 |
case TLSEXT_TYPE_client_cert_type: |
| 948 |
if (server) { |
| 949 |
if (extlen != 1) |
| 950 |
return 0; |
| 951 |
return ssl_trace_list(bio, indent + 2, ext, 1, 1, ssl_cert_type_tbl); |
| 952 |
} |
| 953 |
if (extlen < 1) |
| 954 |
return 0; |
| 955 |
xlen = ext[0]; |
| 956 |
if (extlen != xlen + 1) |
| 957 |
return 0; |
| 958 |
return ssl_trace_list(bio, indent + 2, ext + 1, xlen, 1, ssl_cert_type_tbl); |
| 959 |
|
| 960 |
default: |
| 961 |
BIO_dump_indent(bio, (const char *)ext, (int)extlen, indent + 2); |
| 962 |
} |
| 963 |
return 1; |
| 964 |
} |
| 965 |
|
| 966 |
static int ssl_print_extensions(BIO *bio, int indent, int server, |
| 967 |
unsigned char mt, const unsigned char **msgin, |
| 968 |
size_t *msginlen) |
| 969 |
{ |
| 970 |
size_t extslen, msglen = *msginlen; |
| 971 |
const unsigned char *msg = *msgin; |
| 972 |
|
| 973 |
BIO_indent(bio, indent, 80); |
| 974 |
if (msglen == 0) { |
| 975 |
BIO_puts(bio, "No extensions\n"); |
| 976 |
return 1; |
| 977 |
} |
| 978 |
if (msglen < 2) |
| 979 |
return 0; |
| 980 |
extslen = (msg[0] << 8) | msg[1]; |
| 981 |
msglen -= 2; |
| 982 |
msg += 2; |
| 983 |
if (extslen == 0) { |
| 984 |
BIO_puts(bio, "No extensions\n"); |
| 985 |
*msgin = msg; |
| 986 |
*msginlen = msglen; |
| 987 |
return 1; |
| 988 |
} |
| 989 |
if (extslen > msglen) |
| 990 |
return 0; |
| 991 |
BIO_printf(bio, "extensions, length = %d\n", (int)extslen); |
| 992 |
msglen -= extslen; |
| 993 |
while (extslen > 0) { |
| 994 |
int extype; |
| 995 |
size_t extlen; |
| 996 |
if (extslen < 4) |
| 997 |
return 0; |
| 998 |
extype = (msg[0] << 8) | msg[1]; |
| 999 |
extlen = (msg[2] << 8) | msg[3]; |
| 1000 |
if (extslen < extlen + 4) { |
| 1001 |
BIO_printf(bio, "extensions, extype = %d, extlen = %d\n", extype, |
| 1002 |
(int)extlen); |
| 1003 |
BIO_dump_indent(bio, (const char *)msg, (int)extslen, indent + 2); |
| 1004 |
return 0; |
| 1005 |
} |
| 1006 |
msg += 4; |
| 1007 |
if (!ssl_print_extension(bio, indent + 2, server, mt, extype, msg, |
| 1008 |
extlen)) |
| 1009 |
return 0; |
| 1010 |
msg += extlen; |
| 1011 |
extslen -= extlen + 4; |
| 1012 |
} |
| 1013 |
|
| 1014 |
*msgin = msg; |
| 1015 |
*msginlen = msglen; |
| 1016 |
return 1; |
| 1017 |
} |
| 1018 |
|
| 1019 |
static int ssl_print_client_hello(BIO *bio, const SSL_CONNECTION *sc, int indent, |
| 1020 |
const unsigned char *msg, size_t msglen) |
| 1021 |
{ |
| 1022 |
size_t len; |
| 1023 |
unsigned int cs; |
| 1024 |
|
| 1025 |
if (!ssl_print_version(bio, indent, "client_version", &msg, &msglen, NULL)) |
| 1026 |
return 0; |
| 1027 |
if (!ssl_print_random(bio, indent, &msg, &msglen)) |
| 1028 |
return 0; |
| 1029 |
if (!ssl_print_hexbuf(bio, indent, "session_id", 1, &msg, &msglen)) |
| 1030 |
return 0; |
| 1031 |
if (SSL_CONNECTION_IS_DTLS(sc)) { |
| 1032 |
if (!ssl_print_hexbuf(bio, indent, "cookie", 1, &msg, &msglen)) |
| 1033 |
return 0; |
| 1034 |
} |
| 1035 |
if (msglen < 2) |
| 1036 |
return 0; |
| 1037 |
len = (msg[0] << 8) | msg[1]; |
| 1038 |
msg += 2; |
| 1039 |
msglen -= 2; |
| 1040 |
BIO_indent(bio, indent, 80); |
| 1041 |
BIO_printf(bio, "cipher_suites (len=%d)\n", (int)len); |
| 1042 |
if (msglen < len || len & 1) |
| 1043 |
return 0; |
| 1044 |
while (len > 0) { |
| 1045 |
cs = (msg[0] << 8) | msg[1]; |
| 1046 |
BIO_indent(bio, indent + 2, 80); |
| 1047 |
BIO_printf(bio, "{0x%02X, 0x%02X} %s\n", |
| 1048 |
msg[0], msg[1], ssl_trace_str(cs, ssl_ciphers_tbl)); |
| 1049 |
msg += 2; |
| 1050 |
msglen -= 2; |
| 1051 |
len -= 2; |
| 1052 |
} |
| 1053 |
if (msglen < 1) |
| 1054 |
return 0; |
| 1055 |
len = msg[0]; |
| 1056 |
msg++; |
| 1057 |
msglen--; |
| 1058 |
if (msglen < len) |
| 1059 |
return 0; |
| 1060 |
BIO_indent(bio, indent, 80); |
| 1061 |
BIO_printf(bio, "compression_methods (len=%d)\n", (int)len); |
| 1062 |
while (len > 0) { |
| 1063 |
BIO_indent(bio, indent + 2, 80); |
| 1064 |
BIO_printf(bio, "%s (0x%02X)\n", |
| 1065 |
ssl_trace_str(msg[0], ssl_comp_tbl), msg[0]); |
| 1066 |
msg++; |
| 1067 |
msglen--; |
| 1068 |
len--; |
| 1069 |
} |
| 1070 |
if (!ssl_print_extensions(bio, indent, 0, SSL3_MT_CLIENT_HELLO, &msg, |
| 1071 |
&msglen)) |
| 1072 |
return 0; |
| 1073 |
return 1; |
| 1074 |
} |
| 1075 |
|
| 1076 |
static int dtls_print_hello_vfyrequest(BIO *bio, int indent, |
| 1077 |
const unsigned char *msg, size_t msglen) |
| 1078 |
{ |
| 1079 |
if (!ssl_print_version(bio, indent, "server_version", &msg, &msglen, NULL)) |
| 1080 |
return 0; |
| 1081 |
if (!ssl_print_hexbuf(bio, indent, "cookie", 1, &msg, &msglen)) |
| 1082 |
return 0; |
| 1083 |
return 1; |
| 1084 |
} |
| 1085 |
|
| 1086 |
static int ssl_print_server_hello(BIO *bio, int indent, |
| 1087 |
const unsigned char *msg, size_t msglen) |
| 1088 |
{ |
| 1089 |
unsigned int cs; |
| 1090 |
unsigned int vers; |
| 1091 |
|
| 1092 |
if (!ssl_print_version(bio, indent, "server_version", &msg, &msglen, &vers)) |
| 1093 |
return 0; |
| 1094 |
if (!ssl_print_random(bio, indent, &msg, &msglen)) |
| 1095 |
return 0; |
| 1096 |
if (vers != TLS1_3_VERSION |
| 1097 |
&& !ssl_print_hexbuf(bio, indent, "session_id", 1, &msg, &msglen)) |
| 1098 |
return 0; |
| 1099 |
if (msglen < 2) |
| 1100 |
return 0; |
| 1101 |
cs = (msg[0] << 8) | msg[1]; |
| 1102 |
BIO_indent(bio, indent, 80); |
| 1103 |
BIO_printf(bio, "cipher_suite {0x%02X, 0x%02X} %s\n", |
| 1104 |
msg[0], msg[1], ssl_trace_str(cs, ssl_ciphers_tbl)); |
| 1105 |
msg += 2; |
| 1106 |
msglen -= 2; |
| 1107 |
if (vers != TLS1_3_VERSION) { |
| 1108 |
if (msglen < 1) |
| 1109 |
return 0; |
| 1110 |
BIO_indent(bio, indent, 80); |
| 1111 |
BIO_printf(bio, "compression_method: %s (0x%02X)\n", |
| 1112 |
ssl_trace_str(msg[0], ssl_comp_tbl), msg[0]); |
| 1113 |
msg++; |
| 1114 |
msglen--; |
| 1115 |
} |
| 1116 |
if (!ssl_print_extensions(bio, indent, 1, SSL3_MT_SERVER_HELLO, &msg, |
| 1117 |
&msglen)) |
| 1118 |
return 0; |
| 1119 |
return 1; |
| 1120 |
} |
| 1121 |
|
| 1122 |
static int ssl_get_keyex(const char **pname, const SSL_CONNECTION *sc) |
| 1123 |
{ |
| 1124 |
unsigned long alg_k = sc->s3.tmp.new_cipher->algorithm_mkey; |
| 1125 |
|
| 1126 |
if (alg_k & SSL_kRSA) { |
| 1127 |
*pname = "rsa"; |
| 1128 |
return SSL_kRSA; |
| 1129 |
} |
| 1130 |
if (alg_k & SSL_kDHE) { |
| 1131 |
*pname = "DHE"; |
| 1132 |
return SSL_kDHE; |
| 1133 |
} |
| 1134 |
if (alg_k & SSL_kECDHE) { |
| 1135 |
*pname = "ECDHE"; |
| 1136 |
return SSL_kECDHE; |
| 1137 |
} |
| 1138 |
if (alg_k & SSL_kPSK) { |
| 1139 |
*pname = "PSK"; |
| 1140 |
return SSL_kPSK; |
| 1141 |
} |
| 1142 |
if (alg_k & SSL_kRSAPSK) { |
| 1143 |
*pname = "RSAPSK"; |
| 1144 |
return SSL_kRSAPSK; |
| 1145 |
} |
| 1146 |
if (alg_k & SSL_kDHEPSK) { |
| 1147 |
*pname = "DHEPSK"; |
| 1148 |
return SSL_kDHEPSK; |
| 1149 |
} |
| 1150 |
if (alg_k & SSL_kECDHEPSK) { |
| 1151 |
*pname = "ECDHEPSK"; |
| 1152 |
return SSL_kECDHEPSK; |
| 1153 |
} |
| 1154 |
if (alg_k & SSL_kSRP) { |
| 1155 |
*pname = "SRP"; |
| 1156 |
return SSL_kSRP; |
| 1157 |
} |
| 1158 |
if (alg_k & SSL_kGOST) { |
| 1159 |
*pname = "GOST"; |
| 1160 |
return SSL_kGOST; |
| 1161 |
} |
| 1162 |
if (alg_k & SSL_kGOST18) { |
| 1163 |
*pname = "GOST18"; |
| 1164 |
return SSL_kGOST18; |
| 1165 |
} |
| 1166 |
*pname = "UNKNOWN"; |
| 1167 |
return 0; |
| 1168 |
} |
| 1169 |
|
| 1170 |
static int ssl_print_client_keyex(BIO *bio, int indent, const SSL_CONNECTION *sc, |
| 1171 |
const unsigned char *msg, size_t msglen) |
| 1172 |
{ |
| 1173 |
const char *algname; |
| 1174 |
int id = ssl_get_keyex(&algname, sc); |
| 1175 |
|
| 1176 |
BIO_indent(bio, indent, 80); |
| 1177 |
BIO_printf(bio, "KeyExchangeAlgorithm=%s\n", algname); |
| 1178 |
if (id & SSL_PSK) { |
| 1179 |
if (!ssl_print_hexbuf(bio, indent + 2, |
| 1180 |
"psk_identity", 2, &msg, &msglen)) |
| 1181 |
return 0; |
| 1182 |
} |
| 1183 |
switch (id) { |
| 1184 |
|
| 1185 |
case SSL_kRSA: |
| 1186 |
case SSL_kRSAPSK: |
| 1187 |
if (TLS1_get_version(SSL_CONNECTION_GET_SSL(sc)) == SSL3_VERSION) { |
| 1188 |
ssl_print_hex(bio, indent + 2, |
| 1189 |
"EncryptedPreMasterSecret", msg, msglen); |
| 1190 |
} else { |
| 1191 |
if (!ssl_print_hexbuf(bio, indent + 2, |
| 1192 |
"EncryptedPreMasterSecret", 2, &msg, &msglen)) |
| 1193 |
return 0; |
| 1194 |
} |
| 1195 |
break; |
| 1196 |
|
| 1197 |
case SSL_kDHE: |
| 1198 |
case SSL_kDHEPSK: |
| 1199 |
if (!ssl_print_hexbuf(bio, indent + 2, "dh_Yc", 2, &msg, &msglen)) |
| 1200 |
return 0; |
| 1201 |
break; |
| 1202 |
|
| 1203 |
case SSL_kECDHE: |
| 1204 |
case SSL_kECDHEPSK: |
| 1205 |
if (!ssl_print_hexbuf(bio, indent + 2, "ecdh_Yc", 1, &msg, &msglen)) |
| 1206 |
return 0; |
| 1207 |
break; |
| 1208 |
case SSL_kGOST: |
| 1209 |
ssl_print_hex(bio, indent + 2, "GostKeyTransportBlob", msg, msglen); |
| 1210 |
msglen = 0; |
| 1211 |
break; |
| 1212 |
case SSL_kGOST18: |
| 1213 |
ssl_print_hex(bio, indent + 2, |
| 1214 |
"GOST-wrapped PreMasterSecret", msg, msglen); |
| 1215 |
msglen = 0; |
| 1216 |
break; |
| 1217 |
} |
| 1218 |
|
| 1219 |
return !msglen; |
| 1220 |
} |
| 1221 |
|
| 1222 |
static int ssl_print_server_keyex(BIO *bio, int indent, const SSL_CONNECTION *sc, |
| 1223 |
const unsigned char *msg, size_t msglen) |
| 1224 |
{ |
| 1225 |
const char *algname; |
| 1226 |
int id = ssl_get_keyex(&algname, sc); |
| 1227 |
|
| 1228 |
BIO_indent(bio, indent, 80); |
| 1229 |
BIO_printf(bio, "KeyExchangeAlgorithm=%s\n", algname); |
| 1230 |
if (id & SSL_PSK) { |
| 1231 |
if (!ssl_print_hexbuf(bio, indent + 2, |
| 1232 |
"psk_identity_hint", 2, &msg, &msglen)) |
| 1233 |
return 0; |
| 1234 |
} |
| 1235 |
switch (id) { |
| 1236 |
case SSL_kRSA: |
| 1237 |
|
| 1238 |
if (!ssl_print_hexbuf(bio, indent + 2, "rsa_modulus", 2, &msg, &msglen)) |
| 1239 |
return 0; |
| 1240 |
if (!ssl_print_hexbuf(bio, indent + 2, "rsa_exponent", 2, |
| 1241 |
&msg, &msglen)) |
| 1242 |
return 0; |
| 1243 |
break; |
| 1244 |
|
| 1245 |
case SSL_kDHE: |
| 1246 |
case SSL_kDHEPSK: |
| 1247 |
if (!ssl_print_hexbuf(bio, indent + 2, "dh_p", 2, &msg, &msglen)) |
| 1248 |
return 0; |
| 1249 |
if (!ssl_print_hexbuf(bio, indent + 2, "dh_g", 2, &msg, &msglen)) |
| 1250 |
return 0; |
| 1251 |
if (!ssl_print_hexbuf(bio, indent + 2, "dh_Ys", 2, &msg, &msglen)) |
| 1252 |
return 0; |
| 1253 |
break; |
| 1254 |
|
| 1255 |
case SSL_kECDHE: |
| 1256 |
case SSL_kECDHEPSK: |
| 1257 |
if (msglen < 1) |
| 1258 |
return 0; |
| 1259 |
BIO_indent(bio, indent + 2, 80); |
| 1260 |
if (msg[0] == EXPLICIT_PRIME_CURVE_TYPE) |
| 1261 |
BIO_puts(bio, "explicit_prime\n"); |
| 1262 |
else if (msg[0] == EXPLICIT_CHAR2_CURVE_TYPE) |
| 1263 |
BIO_puts(bio, "explicit_char2\n"); |
| 1264 |
else if (msg[0] == NAMED_CURVE_TYPE) { |
| 1265 |
int curve; |
| 1266 |
if (msglen < 3) |
| 1267 |
return 0; |
| 1268 |
curve = (msg[1] << 8) | msg[2]; |
| 1269 |
BIO_printf(bio, "named_curve: %s (%d)\n", |
| 1270 |
ssl_trace_str(curve, ssl_groups_tbl), curve); |
| 1271 |
msg += 3; |
| 1272 |
msglen -= 3; |
| 1273 |
if (!ssl_print_hexbuf(bio, indent + 2, "point", 1, &msg, &msglen)) |
| 1274 |
return 0; |
| 1275 |
} else { |
| 1276 |
BIO_printf(bio, "UNKNOWN CURVE PARAMETER TYPE %d\n", msg[0]); |
| 1277 |
return 0; |
| 1278 |
} |
| 1279 |
break; |
| 1280 |
|
| 1281 |
case SSL_kPSK: |
| 1282 |
case SSL_kRSAPSK: |
| 1283 |
break; |
| 1284 |
} |
| 1285 |
if (!(id & SSL_PSK)) |
| 1286 |
ssl_print_signature(bio, indent, sc, &msg, &msglen); |
| 1287 |
return !msglen; |
| 1288 |
} |
| 1289 |
|
| 1290 |
static int ssl_print_certificate(BIO *bio, const SSL_CONNECTION *sc, int indent, |
| 1291 |
const unsigned char **pmsg, size_t *pmsglen) |
| 1292 |
{ |
| 1293 |
size_t msglen = *pmsglen; |
| 1294 |
size_t clen; |
| 1295 |
X509 *x; |
| 1296 |
const unsigned char *p = *pmsg, *q; |
| 1297 |
SSL_CTX *ctx = SSL_CONNECTION_GET_CTX(sc); |
| 1298 |
|
| 1299 |
if (msglen < 3) |
| 1300 |
return 0; |
| 1301 |
clen = (p[0] << 16) | (p[1] << 8) | p[2]; |
| 1302 |
if (msglen < clen + 3) |
| 1303 |
return 0; |
| 1304 |
q = p + 3; |
| 1305 |
BIO_indent(bio, indent, 80); |
| 1306 |
BIO_printf(bio, "ASN.1Cert, length=%d", (int)clen); |
| 1307 |
x = X509_new_ex(ctx->libctx, ctx->propq); |
| 1308 |
if (x != NULL && d2i_X509(&x, &q, (long)clen) == NULL) { |
| 1309 |
X509_free(x); |
| 1310 |
x = NULL; |
| 1311 |
} |
| 1312 |
if (x == NULL) |
| 1313 |
BIO_puts(bio, "<UNPARSABLE CERTIFICATE>\n"); |
| 1314 |
else { |
| 1315 |
BIO_puts(bio, "\n------details-----\n"); |
| 1316 |
X509_print_ex(bio, x, XN_FLAG_ONELINE, 0); |
| 1317 |
PEM_write_bio_X509(bio, x); |
| 1318 |
/* Print certificate stuff */ |
| 1319 |
BIO_puts(bio, "------------------\n"); |
| 1320 |
X509_free(x); |
| 1321 |
} |
| 1322 |
if (q != p + 3 + clen) { |
| 1323 |
BIO_puts(bio, "<TRAILING GARBAGE AFTER CERTIFICATE>\n"); |
| 1324 |
} |
| 1325 |
*pmsg += clen + 3; |
| 1326 |
*pmsglen -= clen + 3; |
| 1327 |
return 1; |
| 1328 |
} |
| 1329 |
|
| 1330 |
static int ssl_print_raw_public_key(BIO *bio, const SSL_CONNECTION *sc, |
| 1331 |
int server, int indent, const unsigned char **pmsg, size_t *pmsglen) |
| 1332 |
{ |
| 1333 |
EVP_PKEY *pkey; |
| 1334 |
SSL_CTX *ctx = SSL_CONNECTION_GET_CTX(sc); |
| 1335 |
size_t clen; |
| 1336 |
const unsigned char *msg = *pmsg; |
| 1337 |
size_t msglen = *pmsglen; |
| 1338 |
int has_spki_len; |
| 1339 |
|
| 1340 |
/* |
| 1341 |
* In TLS 1.2 and prior the SPKI is the entire payload of the extension, |
| 1342 |
* and does not have a separate length prefix |
| 1343 |
*/ |
| 1344 |
has_spki_len = SSL_CONNECTION_IS_DTLS(sc) |
| 1345 |
? DTLS_VERSION_GT(sc->version, DTLS1_2_VERSION) |
| 1346 |
: sc->version > TLS1_2_VERSION; |
| 1347 |
if (has_spki_len) { |
| 1348 |
if (msglen < 3) |
| 1349 |
return 0; |
| 1350 |
clen = (msg[0] << 16) | (msg[1] << 8) | msg[2]; |
| 1351 |
if (msglen < clen + 3) |
| 1352 |
return 0; |
| 1353 |
msg += 3; |
| 1354 |
*pmsg += clen + 3; |
| 1355 |
*pmsglen -= clen + 3; |
| 1356 |
} else { |
| 1357 |
clen = msglen; |
| 1358 |
*pmsg += msglen; |
| 1359 |
*pmsglen -= msglen; |
| 1360 |
} |
| 1361 |
|
| 1362 |
BIO_indent(bio, indent, 80); |
| 1363 |
BIO_printf(bio, "raw_public_key, length=%d\n", (int)clen); |
| 1364 |
|
| 1365 |
pkey = d2i_PUBKEY_ex(NULL, &msg, (long)clen, ctx->libctx, ctx->propq); |
| 1366 |
if (pkey == NULL) |
| 1367 |
return 0; |
| 1368 |
EVP_PKEY_print_public(bio, pkey, indent + 2, NULL); |
| 1369 |
EVP_PKEY_free(pkey); |
| 1370 |
return 1; |
| 1371 |
} |
| 1372 |
|
| 1373 |
static int ssl_print_certificates(BIO *bio, const SSL_CONNECTION *sc, int server, |
| 1374 |
int indent, const unsigned char *msg, |
| 1375 |
size_t msglen) |
| 1376 |
{ |
| 1377 |
size_t clen; |
| 1378 |
|
| 1379 |
if (SSL_CONNECTION_IS_TLS13(sc) |
| 1380 |
&& !ssl_print_hexbuf(bio, indent, "context", 1, &msg, &msglen)) |
| 1381 |
return 0; |
| 1382 |
|
| 1383 |
if (msglen < 3) |
| 1384 |
return 0; |
| 1385 |
clen = (msg[0] << 16) | (msg[1] << 8) | msg[2]; |
| 1386 |
if (msglen != clen + 3) |
| 1387 |
return 0; |
| 1388 |
msg += 3; |
| 1389 |
if ((server && sc->ext.server_cert_type == TLSEXT_cert_type_rpk) |
| 1390 |
|| (!server && sc->ext.client_cert_type == TLSEXT_cert_type_rpk)) { |
| 1391 |
if (!ssl_print_raw_public_key(bio, sc, server, indent, &msg, &clen)) |
| 1392 |
return 0; |
| 1393 |
if (SSL_CONNECTION_IS_TLS13(sc) |
| 1394 |
&& !ssl_print_extensions(bio, indent + 2, server, |
| 1395 |
SSL3_MT_CERTIFICATE, &msg, &clen)) |
| 1396 |
return 0; |
| 1397 |
return 1; |
| 1398 |
} |
| 1399 |
BIO_indent(bio, indent, 80); |
| 1400 |
BIO_printf(bio, "certificate_list, length=%d\n", (int)clen); |
| 1401 |
while (clen > 0) { |
| 1402 |
if (!ssl_print_certificate(bio, sc, indent + 2, &msg, &clen)) |
| 1403 |
return 0; |
| 1404 |
if (SSL_CONNECTION_IS_TLS13(sc) |
| 1405 |
&& !ssl_print_extensions(bio, indent + 2, server, |
| 1406 |
SSL3_MT_CERTIFICATE, &msg, &clen)) |
| 1407 |
return 0; |
| 1408 |
} |
| 1409 |
return 1; |
| 1410 |
} |
| 1411 |
|
| 1412 |
static int ssl_print_compressed_certificates(BIO *bio, const SSL_CONNECTION *sc, |
| 1413 |
int server, int indent, |
| 1414 |
const unsigned char *msg, |
| 1415 |
size_t msglen) |
| 1416 |
{ |
| 1417 |
size_t uclen; |
| 1418 |
size_t clen; |
| 1419 |
unsigned int alg; |
| 1420 |
int ret = 1; |
| 1421 |
#ifndef OPENSSL_NO_COMP_ALG |
| 1422 |
COMP_METHOD *method; |
| 1423 |
COMP_CTX *comp = NULL; |
| 1424 |
unsigned char *ucdata = NULL; |
| 1425 |
#endif |
| 1426 |
|
| 1427 |
if (msglen < 8) |
| 1428 |
return 0; |
| 1429 |
|
| 1430 |
alg = (msg[0] << 8) | msg[1]; |
| 1431 |
uclen = (msg[2] << 16) | (msg[3] << 8) | msg[4]; |
| 1432 |
clen = (msg[5] << 16) | (msg[6] << 8) | msg[7]; |
| 1433 |
if (msglen != clen + 8) |
| 1434 |
return 0; |
| 1435 |
|
| 1436 |
msg += 8; |
| 1437 |
BIO_indent(bio, indent, 80); |
| 1438 |
BIO_printf(bio, "Compression type=%s (0x%04x)\n", ssl_trace_str(alg, ssl_comp_cert_tbl), alg); |
| 1439 |
BIO_indent(bio, indent, 80); |
| 1440 |
BIO_printf(bio, "Uncompressed length=%d\n", (int)uclen); |
| 1441 |
BIO_indent(bio, indent, 80); |
| 1442 |
if (clen > 0) |
| 1443 |
BIO_printf(bio, "Compressed length=%d, Ratio=%f:1\n", (int)clen, (float)uclen / (float)clen); |
| 1444 |
else |
| 1445 |
BIO_printf(bio, "Compressed length=%d, Ratio=unknown\n", (int)clen); |
| 1446 |
|
| 1447 |
BIO_dump_indent(bio, (const char *)msg, (int)clen, indent); |
| 1448 |
|
| 1449 |
#ifndef OPENSSL_NO_COMP_ALG |
| 1450 |
if (!ossl_comp_has_alg(alg)) |
| 1451 |
return 0; |
| 1452 |
|
| 1453 |
/* Check against certificate maximum size (coverity) */ |
| 1454 |
if (uclen == 0 || uclen > 0xFFFFFF || (ucdata = OPENSSL_malloc(uclen)) == NULL) |
| 1455 |
return 0; |
| 1456 |
|
| 1457 |
switch (alg) { |
| 1458 |
case TLSEXT_comp_cert_zlib: |
| 1459 |
method = COMP_zlib(); |
| 1460 |
break; |
| 1461 |
case TLSEXT_comp_cert_brotli: |
| 1462 |
method = COMP_brotli_oneshot(); |
| 1463 |
break; |
| 1464 |
case TLSEXT_comp_cert_zstd: |
| 1465 |
method = COMP_zstd_oneshot(); |
| 1466 |
break; |
| 1467 |
default: |
| 1468 |
goto err; |
| 1469 |
} |
| 1470 |
|
| 1471 |
if ((comp = COMP_CTX_new(method)) == NULL |
| 1472 |
|| COMP_expand_block(comp, ucdata, (int)uclen, |
| 1473 |
(unsigned char *)msg, (int)clen) |
| 1474 |
!= (int)uclen) |
| 1475 |
goto err; |
| 1476 |
|
| 1477 |
ret = ssl_print_certificates(bio, sc, server, indent, ucdata, uclen); |
| 1478 |
err: |
| 1479 |
COMP_CTX_free(comp); |
| 1480 |
OPENSSL_free(ucdata); |
| 1481 |
#endif |
| 1482 |
return ret; |
| 1483 |
} |
| 1484 |
|
| 1485 |
static int ssl_print_cert_request(BIO *bio, int indent, const SSL_CONNECTION *sc, |
| 1486 |
const unsigned char *msg, size_t msglen) |
| 1487 |
{ |
| 1488 |
size_t xlen; |
| 1489 |
unsigned int sigalg; |
| 1490 |
|
| 1491 |
if (SSL_CONNECTION_IS_TLS13(sc)) { |
| 1492 |
if (!ssl_print_hexbuf(bio, indent, "request_context", 1, &msg, &msglen)) |
| 1493 |
return 0; |
| 1494 |
if (!ssl_print_extensions(bio, indent, 1, |
| 1495 |
SSL3_MT_CERTIFICATE_REQUEST, &msg, &msglen)) |
| 1496 |
return 0; |
| 1497 |
return 1; |
| 1498 |
} else { |
| 1499 |
if (msglen < 1) |
| 1500 |
return 0; |
| 1501 |
xlen = msg[0]; |
| 1502 |
if (msglen < xlen + 1) |
| 1503 |
return 0; |
| 1504 |
msg++; |
| 1505 |
BIO_indent(bio, indent, 80); |
| 1506 |
BIO_printf(bio, "certificate_types (len=%d)\n", (int)xlen); |
| 1507 |
if (!ssl_trace_list(bio, indent + 2, msg, xlen, 1, ssl_ctype_tbl)) |
| 1508 |
return 0; |
| 1509 |
msg += xlen; |
| 1510 |
msglen -= xlen + 1; |
| 1511 |
} |
| 1512 |
if (SSL_USE_SIGALGS(sc)) { |
| 1513 |
if (msglen < 2) |
| 1514 |
return 0; |
| 1515 |
xlen = (msg[0] << 8) | msg[1]; |
| 1516 |
if (msglen < xlen + 2 || (xlen & 1)) |
| 1517 |
return 0; |
| 1518 |
msg += 2; |
| 1519 |
msglen -= xlen + 2; |
| 1520 |
BIO_indent(bio, indent, 80); |
| 1521 |
BIO_printf(bio, "signature_algorithms (len=%d)\n", (int)xlen); |
| 1522 |
while (xlen > 0) { |
| 1523 |
BIO_indent(bio, indent + 2, 80); |
| 1524 |
sigalg = (msg[0] << 8) | msg[1]; |
| 1525 |
BIO_printf(bio, "%s (0x%04x)\n", |
| 1526 |
ssl_trace_str(sigalg, ssl_sigalg_tbl), sigalg); |
| 1527 |
xlen -= 2; |
| 1528 |
msg += 2; |
| 1529 |
} |
| 1530 |
msg += xlen; |
| 1531 |
} |
| 1532 |
|
| 1533 |
if (msglen < 2) |
| 1534 |
return 0; |
| 1535 |
xlen = (msg[0] << 8) | msg[1]; |
| 1536 |
BIO_indent(bio, indent, 80); |
| 1537 |
if (msglen < xlen + 2) |
| 1538 |
return 0; |
| 1539 |
msg += 2; |
| 1540 |
msglen -= 2 + xlen; |
| 1541 |
BIO_printf(bio, "certificate_authorities (len=%d)\n", (int)xlen); |
| 1542 |
while (xlen > 0) { |
| 1543 |
size_t dlen; |
| 1544 |
X509_NAME *nm; |
| 1545 |
const unsigned char *p; |
| 1546 |
if (xlen < 2) |
| 1547 |
return 0; |
| 1548 |
dlen = (msg[0] << 8) | msg[1]; |
| 1549 |
if (xlen < dlen + 2) |
| 1550 |
return 0; |
| 1551 |
msg += 2; |
| 1552 |
BIO_indent(bio, indent + 2, 80); |
| 1553 |
BIO_printf(bio, "DistinguishedName (len=%d): ", (int)dlen); |
| 1554 |
p = msg; |
| 1555 |
nm = d2i_X509_NAME(NULL, &p, (long)dlen); |
| 1556 |
if (!nm) { |
| 1557 |
BIO_puts(bio, "<UNPARSABLE DN>\n"); |
| 1558 |
} else { |
| 1559 |
X509_NAME_print_ex(bio, nm, 0, XN_FLAG_ONELINE); |
| 1560 |
BIO_puts(bio, "\n"); |
| 1561 |
X509_NAME_free(nm); |
| 1562 |
} |
| 1563 |
xlen -= dlen + 2; |
| 1564 |
msg += dlen; |
| 1565 |
} |
| 1566 |
if (SSL_CONNECTION_IS_TLS13(sc)) { |
| 1567 |
if (!ssl_print_hexbuf(bio, indent, "request_extensions", 2, |
| 1568 |
&msg, &msglen)) |
| 1569 |
return 0; |
| 1570 |
} |
| 1571 |
return msglen == 0; |
| 1572 |
} |
| 1573 |
|
| 1574 |
static int ssl_print_ticket(BIO *bio, int indent, const SSL_CONNECTION *sc, |
| 1575 |
const unsigned char *msg, size_t msglen) |
| 1576 |
{ |
| 1577 |
unsigned int tick_life; |
| 1578 |
|
| 1579 |
if (msglen == 0) { |
| 1580 |
BIO_indent(bio, indent + 2, 80); |
| 1581 |
BIO_puts(bio, "No Ticket\n"); |
| 1582 |
return 1; |
| 1583 |
} |
| 1584 |
if (msglen < 4) |
| 1585 |
return 0; |
| 1586 |
tick_life = ((unsigned int)msg[0] << 24) |
| 1587 |
| ((unsigned int)msg[1] << 16) |
| 1588 |
| ((unsigned int)msg[2] << 8) |
| 1589 |
| (unsigned int)msg[3]; |
| 1590 |
msglen -= 4; |
| 1591 |
msg += 4; |
| 1592 |
BIO_indent(bio, indent + 2, 80); |
| 1593 |
BIO_printf(bio, "ticket_lifetime_hint=%u\n", tick_life); |
| 1594 |
if (SSL_CONNECTION_IS_TLS13(sc)) { |
| 1595 |
unsigned int ticket_age_add; |
| 1596 |
|
| 1597 |
if (msglen < 4) |
| 1598 |
return 0; |
| 1599 |
ticket_age_add = ((unsigned int)msg[0] << 24) |
| 1600 |
| ((unsigned int)msg[1] << 16) |
| 1601 |
| ((unsigned int)msg[2] << 8) |
| 1602 |
| (unsigned int)msg[3]; |
| 1603 |
msglen -= 4; |
| 1604 |
msg += 4; |
| 1605 |
BIO_indent(bio, indent + 2, 80); |
| 1606 |
BIO_printf(bio, "ticket_age_add=%u\n", ticket_age_add); |
| 1607 |
if (!ssl_print_hexbuf(bio, indent + 2, "ticket_nonce", 1, &msg, |
| 1608 |
&msglen)) |
| 1609 |
return 0; |
| 1610 |
} |
| 1611 |
if (!ssl_print_hexbuf(bio, indent + 2, "ticket", 2, &msg, &msglen)) |
| 1612 |
return 0; |
| 1613 |
if (SSL_CONNECTION_IS_TLS13(sc) |
| 1614 |
&& !ssl_print_extensions(bio, indent + 2, 0, |
| 1615 |
SSL3_MT_NEWSESSION_TICKET, &msg, &msglen)) |
| 1616 |
return 0; |
| 1617 |
if (msglen) |
| 1618 |
return 0; |
| 1619 |
return 1; |
| 1620 |
} |
| 1621 |
|
| 1622 |
static int ssl_print_handshake(BIO *bio, const SSL_CONNECTION *sc, int server, |
| 1623 |
const unsigned char *msg, size_t msglen, |
| 1624 |
int indent) |
| 1625 |
{ |
| 1626 |
size_t hlen; |
| 1627 |
unsigned char htype; |
| 1628 |
|
| 1629 |
if (msglen < 4) |
| 1630 |
return 0; |
| 1631 |
htype = msg[0]; |
| 1632 |
hlen = (msg[1] << 16) | (msg[2] << 8) | msg[3]; |
| 1633 |
BIO_indent(bio, indent, 80); |
| 1634 |
BIO_printf(bio, "%s, Length=%d\n", |
| 1635 |
ssl_trace_str(htype, ssl_handshake_tbl), (int)hlen); |
| 1636 |
msg += 4; |
| 1637 |
msglen -= 4; |
| 1638 |
if (SSL_CONNECTION_IS_DTLS(sc)) { |
| 1639 |
if (msglen < 8) |
| 1640 |
return 0; |
| 1641 |
BIO_indent(bio, indent, 80); |
| 1642 |
BIO_printf(bio, "message_seq=%d, fragment_offset=%d, " |
| 1643 |
"fragment_length=%d\n", |
| 1644 |
(msg[0] << 8) | msg[1], |
| 1645 |
(msg[2] << 16) | (msg[3] << 8) | msg[4], |
| 1646 |
(msg[5] << 16) | (msg[6] << 8) | msg[7]); |
| 1647 |
msg += 8; |
| 1648 |
msglen -= 8; |
| 1649 |
} |
| 1650 |
if (msglen < hlen) |
| 1651 |
return 0; |
| 1652 |
switch (htype) { |
| 1653 |
case SSL3_MT_CLIENT_HELLO: |
| 1654 |
if (!ssl_print_client_hello(bio, sc, indent + 2, msg, msglen)) |
| 1655 |
return 0; |
| 1656 |
break; |
| 1657 |
|
| 1658 |
case DTLS1_MT_HELLO_VERIFY_REQUEST: |
| 1659 |
if (!dtls_print_hello_vfyrequest(bio, indent + 2, msg, msglen)) |
| 1660 |
return 0; |
| 1661 |
break; |
| 1662 |
|
| 1663 |
case SSL3_MT_SERVER_HELLO: |
| 1664 |
if (!ssl_print_server_hello(bio, indent + 2, msg, msglen)) |
| 1665 |
return 0; |
| 1666 |
break; |
| 1667 |
|
| 1668 |
case SSL3_MT_SERVER_KEY_EXCHANGE: |
| 1669 |
if (!ssl_print_server_keyex(bio, indent + 2, sc, msg, msglen)) |
| 1670 |
return 0; |
| 1671 |
break; |
| 1672 |
|
| 1673 |
case SSL3_MT_CLIENT_KEY_EXCHANGE: |
| 1674 |
if (!ssl_print_client_keyex(bio, indent + 2, sc, msg, msglen)) |
| 1675 |
return 0; |
| 1676 |
break; |
| 1677 |
|
| 1678 |
case SSL3_MT_CERTIFICATE: |
| 1679 |
if (!ssl_print_certificates(bio, sc, server, indent + 2, msg, msglen)) |
| 1680 |
return 0; |
| 1681 |
break; |
| 1682 |
|
| 1683 |
case SSL3_MT_COMPRESSED_CERTIFICATE: |
| 1684 |
if (!ssl_print_compressed_certificates(bio, sc, server, indent + 2, msg, msglen)) |
| 1685 |
return 0; |
| 1686 |
break; |
| 1687 |
|
| 1688 |
case SSL3_MT_CERTIFICATE_VERIFY: |
| 1689 |
if (!ssl_print_signature(bio, indent + 2, sc, &msg, &msglen)) |
| 1690 |
return 0; |
| 1691 |
break; |
| 1692 |
|
| 1693 |
case SSL3_MT_CERTIFICATE_REQUEST: |
| 1694 |
if (!ssl_print_cert_request(bio, indent + 2, sc, msg, msglen)) |
| 1695 |
return 0; |
| 1696 |
break; |
| 1697 |
|
| 1698 |
case SSL3_MT_FINISHED: |
| 1699 |
ssl_print_hex(bio, indent + 2, "verify_data", msg, msglen); |
| 1700 |
break; |
| 1701 |
|
| 1702 |
case SSL3_MT_END_OF_EARLY_DATA: |
| 1703 |
case SSL3_MT_SERVER_DONE: |
| 1704 |
if (msglen != 0) |
| 1705 |
ssl_print_hex(bio, indent + 2, "unexpected value", msg, msglen); |
| 1706 |
break; |
| 1707 |
|
| 1708 |
case SSL3_MT_NEWSESSION_TICKET: |
| 1709 |
if (!ssl_print_ticket(bio, indent + 2, sc, msg, msglen)) |
| 1710 |
return 0; |
| 1711 |
break; |
| 1712 |
|
| 1713 |
case SSL3_MT_ENCRYPTED_EXTENSIONS: |
| 1714 |
if (!ssl_print_extensions(bio, indent + 2, 1, |
| 1715 |
SSL3_MT_ENCRYPTED_EXTENSIONS, &msg, &msglen)) |
| 1716 |
return 0; |
| 1717 |
break; |
| 1718 |
|
| 1719 |
case SSL3_MT_KEY_UPDATE: |
| 1720 |
if (msglen != 1) { |
| 1721 |
ssl_print_hex(bio, indent + 2, "unexpected value", msg, msglen); |
| 1722 |
return 0; |
| 1723 |
} |
| 1724 |
if (!ssl_trace_list(bio, indent + 2, msg, msglen, 1, |
| 1725 |
ssl_key_update_tbl)) |
| 1726 |
return 0; |
| 1727 |
break; |
| 1728 |
|
| 1729 |
default: |
| 1730 |
BIO_indent(bio, indent + 2, 80); |
| 1731 |
BIO_puts(bio, "Unsupported, hex dump follows:\n"); |
| 1732 |
BIO_dump_indent(bio, (const char *)msg, (int)msglen, indent + 4); |
| 1733 |
} |
| 1734 |
return 1; |
| 1735 |
} |
| 1736 |
|
| 1737 |
void SSL_trace(int write_p, int version, int content_type, |
| 1738 |
const void *buf, size_t msglen, SSL *ssl, void *arg) |
| 1739 |
{ |
| 1740 |
const unsigned char *msg = buf; |
| 1741 |
BIO *bio = arg; |
| 1742 |
SSL_CONNECTION *sc = SSL_CONNECTION_FROM_SSL(ssl); |
| 1743 |
#ifndef OPENSSL_NO_QUIC |
| 1744 |
QUIC_CONNECTION *qc = QUIC_CONNECTION_FROM_SSL(ssl); |
| 1745 |
|
| 1746 |
if (qc != NULL) { |
| 1747 |
if (ossl_quic_trace(write_p, version, content_type, buf, msglen, ssl, |
| 1748 |
arg)) |
| 1749 |
return; |
| 1750 |
/* |
| 1751 |
* Otherwise ossl_quic_trace didn't handle this content_type so we |
| 1752 |
* fallback to standard TLS handling |
| 1753 |
*/ |
| 1754 |
} |
| 1755 |
#endif |
| 1756 |
|
| 1757 |
if (sc == NULL) |
| 1758 |
return; |
| 1759 |
|
| 1760 |
switch (content_type) { |
| 1761 |
case SSL3_RT_HEADER: { |
| 1762 |
int hvers; |
| 1763 |
|
| 1764 |
/* avoid overlapping with length at the end of buffer */ |
| 1765 |
if (msglen < (size_t)(SSL_CONNECTION_IS_DTLS(sc) ? DTLS1_RT_HEADER_LENGTH : SSL3_RT_HEADER_LENGTH)) { |
| 1766 |
BIO_puts(bio, write_p ? "Sent" : "Received"); |
| 1767 |
ssl_print_hex(bio, 0, " too short message", msg, msglen); |
| 1768 |
break; |
| 1769 |
} |
| 1770 |
hvers = msg[1] << 8 | msg[2]; |
| 1771 |
BIO_puts(bio, write_p ? "Sent" : "Received"); |
| 1772 |
BIO_printf(bio, " TLS Record\nHeader:\n Version = %s (0x%x)\n", |
| 1773 |
ssl_trace_str(hvers, ssl_version_tbl), hvers); |
| 1774 |
if (SSL_CONNECTION_IS_DTLS(sc)) { |
| 1775 |
BIO_printf(bio, |
| 1776 |
" epoch=%d, sequence_number=%04x%04x%04x\n", |
| 1777 |
(msg[3] << 8 | msg[4]), |
| 1778 |
(msg[5] << 8 | msg[6]), |
| 1779 |
(msg[7] << 8 | msg[8]), (msg[9] << 8 | msg[10])); |
| 1780 |
} |
| 1781 |
|
| 1782 |
BIO_printf(bio, " Content Type = %s (%d)\n Length = %d", |
| 1783 |
ssl_trace_str(msg[0], ssl_content_tbl), msg[0], |
| 1784 |
msg[msglen - 2] << 8 | msg[msglen - 1]); |
| 1785 |
} break; |
| 1786 |
|
| 1787 |
case SSL3_RT_INNER_CONTENT_TYPE: |
| 1788 |
BIO_printf(bio, " Inner Content Type = %s (%d)", |
| 1789 |
ssl_trace_str(msg[0], ssl_content_tbl), msg[0]); |
| 1790 |
break; |
| 1791 |
|
| 1792 |
case SSL3_RT_HANDSHAKE: |
| 1793 |
if (!ssl_print_handshake(bio, sc, sc->server ? write_p : !write_p, |
| 1794 |
msg, msglen, 4)) |
| 1795 |
BIO_printf(bio, "Message length parse error!\n"); |
| 1796 |
break; |
| 1797 |
|
| 1798 |
case SSL3_RT_CHANGE_CIPHER_SPEC: |
| 1799 |
if (msglen == 1 && msg[0] == 1) |
| 1800 |
BIO_puts(bio, " change_cipher_spec (1)\n"); |
| 1801 |
else |
| 1802 |
ssl_print_hex(bio, 4, "unknown value", msg, msglen); |
| 1803 |
break; |
| 1804 |
|
| 1805 |
case SSL3_RT_ALERT: |
| 1806 |
if (msglen != 2) |
| 1807 |
BIO_puts(bio, " Illegal Alert Length\n"); |
| 1808 |
else { |
| 1809 |
BIO_printf(bio, " Level=%s(%d), description=%s(%d)\n", |
| 1810 |
SSL_alert_type_string_long(msg[0] << 8), |
| 1811 |
msg[0], SSL_alert_desc_string_long(msg[1]), msg[1]); |
| 1812 |
} |
| 1813 |
} |
| 1814 |
|
| 1815 |
BIO_puts(bio, "\n"); |
| 1816 |
} |
| 1817 |
|
| 1818 |
#endif |