diff options
Diffstat (limited to 'src/lib/libssl/ssl_stat.c')
| -rw-r--r-- | src/lib/libssl/ssl_stat.c | 826 | 
1 files changed, 826 insertions, 0 deletions
| diff --git a/src/lib/libssl/ssl_stat.c b/src/lib/libssl/ssl_stat.c new file mode 100644 index 0000000000..3d9371cdd7 --- /dev/null +++ b/src/lib/libssl/ssl_stat.c | |||
| @@ -0,0 +1,826 @@ | |||
| 1 | /* ssl/ssl_stat.c */ | ||
| 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) | ||
| 3 | * All rights reserved. | ||
| 4 | * | ||
| 5 | * This package is an SSL implementation written | ||
| 6 | * by Eric Young (eay@cryptsoft.com). | ||
| 7 | * The implementation was written so as to conform with Netscapes SSL. | ||
| 8 | * | ||
| 9 | * This library is free for commercial and non-commercial use as long as | ||
| 10 | * the following conditions are aheared to. The following conditions | ||
| 11 | * apply to all code found in this distribution, be it the RC4, RSA, | ||
| 12 | * lhash, DES, etc., code; not just the SSL code. The SSL documentation | ||
| 13 | * included with this distribution is covered by the same copyright terms | ||
| 14 | * except that the holder is Tim Hudson (tjh@cryptsoft.com). | ||
| 15 | * | ||
| 16 | * Copyright remains Eric Young's, and as such any Copyright notices in | ||
| 17 | * the code are not to be removed. | ||
| 18 | * If this package is used in a product, Eric Young should be given attribution | ||
| 19 | * as the author of the parts of the library used. | ||
| 20 | * This can be in the form of a textual message at program startup or | ||
| 21 | * in documentation (online or textual) provided with the package. | ||
| 22 | * | ||
| 23 | * Redistribution and use in source and binary forms, with or without | ||
| 24 | * modification, are permitted provided that the following conditions | ||
| 25 | * are met: | ||
| 26 | * 1. Redistributions of source code must retain the copyright | ||
| 27 | * notice, this list of conditions and the following disclaimer. | ||
| 28 | * 2. Redistributions in binary form must reproduce the above copyright | ||
| 29 | * notice, this list of conditions and the following disclaimer in the | ||
| 30 | * documentation and/or other materials provided with the distribution. | ||
| 31 | * 3. All advertising materials mentioning features or use of this software | ||
| 32 | * must display the following acknowledgement: | ||
| 33 | * "This product includes cryptographic software written by | ||
| 34 | * Eric Young (eay@cryptsoft.com)" | ||
| 35 | * The word 'cryptographic' can be left out if the rouines from the library | ||
| 36 | * being used are not cryptographic related :-). | ||
| 37 | * 4. If you include any Windows specific code (or a derivative thereof) from | ||
| 38 | * the apps directory (application code) you must include an acknowledgement: | ||
| 39 | * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" | ||
| 40 | * | ||
| 41 | * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND | ||
| 42 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
| 43 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | ||
| 44 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE | ||
| 45 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | ||
| 46 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | ||
| 47 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||
| 48 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | ||
| 49 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | ||
| 50 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | ||
| 51 | * SUCH DAMAGE. | ||
| 52 | * | ||
| 53 | * The licence and distribution terms for any publically available version or | ||
| 54 | * derivative of this code cannot be changed. i.e. this code cannot simply be | ||
| 55 | * copied and put under another distribution licence | ||
| 56 | * [including the GNU Public Licence.] | ||
| 57 | */ | ||
| 58 | /* ==================================================================== | ||
| 59 | * Copyright 2005 Nokia. All rights reserved. | ||
| 60 | * | ||
| 61 | * The portions of the attached software ("Contribution") is developed by | ||
| 62 | * Nokia Corporation and is licensed pursuant to the OpenSSL open source | ||
| 63 | * license. | ||
| 64 | * | ||
| 65 | * The Contribution, originally written by Mika Kousa and Pasi Eronen of | ||
| 66 | * Nokia Corporation, consists of the "PSK" (Pre-Shared Key) ciphersuites | ||
| 67 | * support (see RFC 4279) to OpenSSL. | ||
| 68 | * | ||
| 69 | * No patent licenses or other rights except those expressly stated in | ||
| 70 | * the OpenSSL open source license shall be deemed granted or received | ||
| 71 | * expressly, by implication, estoppel, or otherwise. | ||
| 72 | * | ||
| 73 | * No assurances are provided by Nokia that the Contribution does not | ||
| 74 | * infringe the patent or other intellectual property rights of any third | ||
| 75 | * party or that the license provides you with all the necessary rights | ||
| 76 | * to make use of the Contribution. | ||
| 77 | * | ||
| 78 | * THE SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. IN | ||
| 79 | * ADDITION TO THE DISCLAIMERS INCLUDED IN THE LICENSE, NOKIA | ||
| 80 | * SPECIFICALLY DISCLAIMS ANY LIABILITY FOR CLAIMS BROUGHT BY YOU OR ANY | ||
| 81 | * OTHER ENTITY BASED ON INFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS OR | ||
| 82 | * OTHERWISE. | ||
| 83 | */ | ||
| 84 | |||
| 85 | #include <stdio.h> | ||
| 86 | #include "ssl_locl.h" | ||
| 87 | |||
| 88 | const char | ||
| 89 | *SSL_state_string_long(const SSL *s) | ||
| 90 | { | ||
| 91 | const char *str; | ||
| 92 | |||
| 93 | switch (s->state) { | ||
| 94 | case SSL_ST_BEFORE: | ||
| 95 | str="before SSL initialization"; break; | ||
| 96 | case SSL_ST_ACCEPT: | ||
| 97 | str="before accept initialization"; break; | ||
| 98 | case SSL_ST_CONNECT: | ||
| 99 | str="before connect initialization"; break; | ||
| 100 | case SSL_ST_OK: | ||
| 101 | str="SSL negotiation finished successfully"; break; | ||
| 102 | case SSL_ST_RENEGOTIATE: | ||
| 103 | str="SSL renegotiate ciphers"; break; | ||
| 104 | case SSL_ST_BEFORE|SSL_ST_CONNECT: | ||
| 105 | str="before/connect initialization"; break; | ||
| 106 | case SSL_ST_OK|SSL_ST_CONNECT: | ||
| 107 | str="ok/connect SSL initialization"; break; | ||
| 108 | case SSL_ST_BEFORE|SSL_ST_ACCEPT: | ||
| 109 | str="before/accept initialization"; break; | ||
| 110 | case SSL_ST_OK|SSL_ST_ACCEPT: | ||
| 111 | str="ok/accept SSL initialization"; break; | ||
| 112 | #ifndef OPENSSL_NO_SSL2 | ||
| 113 | case SSL2_ST_CLIENT_START_ENCRYPTION: | ||
| 114 | str="SSLv2 client start encryption"; break; | ||
| 115 | case SSL2_ST_SERVER_START_ENCRYPTION: | ||
| 116 | str="SSLv2 server start encryption"; break; | ||
| 117 | case SSL2_ST_SEND_CLIENT_HELLO_A: | ||
| 118 | str="SSLv2 write client hello A"; break; | ||
| 119 | case SSL2_ST_SEND_CLIENT_HELLO_B: | ||
| 120 | str="SSLv2 write client hello B"; break; | ||
| 121 | case SSL2_ST_GET_SERVER_HELLO_A: | ||
| 122 | str="SSLv2 read server hello A"; break; | ||
| 123 | case SSL2_ST_GET_SERVER_HELLO_B: | ||
| 124 | str="SSLv2 read server hello B"; break; | ||
| 125 | case SSL2_ST_SEND_CLIENT_MASTER_KEY_A: | ||
| 126 | str="SSLv2 write client master key A"; break; | ||
| 127 | case SSL2_ST_SEND_CLIENT_MASTER_KEY_B: | ||
| 128 | str="SSLv2 write client master key B"; break; | ||
| 129 | case SSL2_ST_SEND_CLIENT_FINISHED_A: | ||
| 130 | str="SSLv2 write client finished A"; break; | ||
| 131 | case SSL2_ST_SEND_CLIENT_FINISHED_B: | ||
| 132 | str="SSLv2 write client finished B"; break; | ||
| 133 | case SSL2_ST_SEND_CLIENT_CERTIFICATE_A: | ||
| 134 | str="SSLv2 write client certificate A"; break; | ||
| 135 | case SSL2_ST_SEND_CLIENT_CERTIFICATE_B: | ||
| 136 | str="SSLv2 write client certificate B"; break; | ||
| 137 | case SSL2_ST_SEND_CLIENT_CERTIFICATE_C: | ||
| 138 | str="SSLv2 write client certificate C"; break; | ||
| 139 | case SSL2_ST_SEND_CLIENT_CERTIFICATE_D: | ||
| 140 | str="SSLv2 write client certificate D"; break; | ||
| 141 | case SSL2_ST_GET_SERVER_VERIFY_A: | ||
| 142 | str="SSLv2 read server verify A"; break; | ||
| 143 | case SSL2_ST_GET_SERVER_VERIFY_B: | ||
| 144 | str="SSLv2 read server verify B"; break; | ||
| 145 | case SSL2_ST_GET_SERVER_FINISHED_A: | ||
| 146 | str="SSLv2 read server finished A"; break; | ||
| 147 | case SSL2_ST_GET_SERVER_FINISHED_B: | ||
| 148 | str="SSLv2 read server finished B"; break; | ||
| 149 | case SSL2_ST_GET_CLIENT_HELLO_A: | ||
| 150 | str="SSLv2 read client hello A"; break; | ||
| 151 | case SSL2_ST_GET_CLIENT_HELLO_B: | ||
| 152 | str="SSLv2 read client hello B"; break; | ||
| 153 | case SSL2_ST_GET_CLIENT_HELLO_C: | ||
| 154 | str="SSLv2 read client hello C"; break; | ||
| 155 | case SSL2_ST_SEND_SERVER_HELLO_A: | ||
| 156 | str="SSLv2 write server hello A"; break; | ||
| 157 | case SSL2_ST_SEND_SERVER_HELLO_B: | ||
| 158 | str="SSLv2 write server hello B"; break; | ||
| 159 | case SSL2_ST_GET_CLIENT_MASTER_KEY_A: | ||
| 160 | str="SSLv2 read client master key A"; break; | ||
| 161 | case SSL2_ST_GET_CLIENT_MASTER_KEY_B: | ||
| 162 | str="SSLv2 read client master key B"; break; | ||
| 163 | case SSL2_ST_SEND_SERVER_VERIFY_A: | ||
| 164 | str="SSLv2 write server verify A"; break; | ||
| 165 | case SSL2_ST_SEND_SERVER_VERIFY_B: | ||
| 166 | str="SSLv2 write server verify B"; break; | ||
| 167 | case SSL2_ST_SEND_SERVER_VERIFY_C: | ||
| 168 | str="SSLv2 write server verify C"; break; | ||
| 169 | case SSL2_ST_GET_CLIENT_FINISHED_A: | ||
| 170 | str="SSLv2 read client finished A"; break; | ||
| 171 | case SSL2_ST_GET_CLIENT_FINISHED_B: | ||
| 172 | str="SSLv2 read client finished B"; break; | ||
| 173 | case SSL2_ST_SEND_SERVER_FINISHED_A: | ||
| 174 | str="SSLv2 write server finished A"; break; | ||
| 175 | case SSL2_ST_SEND_SERVER_FINISHED_B: | ||
| 176 | str="SSLv2 write server finished B"; break; | ||
| 177 | case SSL2_ST_SEND_REQUEST_CERTIFICATE_A: | ||
| 178 | str="SSLv2 write request certificate A"; break; | ||
| 179 | case SSL2_ST_SEND_REQUEST_CERTIFICATE_B: | ||
| 180 | str="SSLv2 write request certificate B"; break; | ||
| 181 | case SSL2_ST_SEND_REQUEST_CERTIFICATE_C: | ||
| 182 | str="SSLv2 write request certificate C"; break; | ||
| 183 | case SSL2_ST_SEND_REQUEST_CERTIFICATE_D: | ||
| 184 | str="SSLv2 write request certificate D"; break; | ||
| 185 | case SSL2_ST_X509_GET_SERVER_CERTIFICATE: | ||
| 186 | str="SSLv2 X509 read server certificate"; break; | ||
| 187 | case SSL2_ST_X509_GET_CLIENT_CERTIFICATE: | ||
| 188 | str="SSLv2 X509 read client certificate"; break; | ||
| 189 | #endif | ||
| 190 | |||
| 191 | #ifndef OPENSSL_NO_SSL3 | ||
| 192 | /* SSLv3 additions */ | ||
| 193 | case SSL3_ST_CW_CLNT_HELLO_A: | ||
| 194 | str="SSLv3 write client hello A"; break; | ||
| 195 | case SSL3_ST_CW_CLNT_HELLO_B: | ||
| 196 | str="SSLv3 write client hello B"; break; | ||
| 197 | case SSL3_ST_CR_SRVR_HELLO_A: | ||
| 198 | str="SSLv3 read server hello A"; break; | ||
| 199 | case SSL3_ST_CR_SRVR_HELLO_B: | ||
| 200 | str="SSLv3 read server hello B"; break; | ||
| 201 | case SSL3_ST_CR_CERT_A: | ||
| 202 | str="SSLv3 read server certificate A"; break; | ||
| 203 | case SSL3_ST_CR_CERT_B: | ||
| 204 | str="SSLv3 read server certificate B"; break; | ||
| 205 | case SSL3_ST_CR_KEY_EXCH_A: | ||
| 206 | str="SSLv3 read server key exchange A"; break; | ||
| 207 | case SSL3_ST_CR_KEY_EXCH_B: | ||
| 208 | str="SSLv3 read server key exchange B"; break; | ||
| 209 | case SSL3_ST_CR_CERT_REQ_A: | ||
| 210 | str="SSLv3 read server certificate request A"; break; | ||
| 211 | case SSL3_ST_CR_CERT_REQ_B: | ||
| 212 | str="SSLv3 read server certificate request B"; break; | ||
| 213 | case SSL3_ST_CR_SESSION_TICKET_A: | ||
| 214 | str="SSLv3 read server session ticket A";break; | ||
| 215 | case SSL3_ST_CR_SESSION_TICKET_B: | ||
| 216 | str="SSLv3 read server session ticket B";break; | ||
| 217 | case SSL3_ST_CR_SRVR_DONE_A: | ||
| 218 | str="SSLv3 read server done A"; break; | ||
| 219 | case SSL3_ST_CR_SRVR_DONE_B: | ||
| 220 | str="SSLv3 read server done B"; break; | ||
| 221 | case SSL3_ST_CW_CERT_A: | ||
| 222 | str="SSLv3 write client certificate A"; break; | ||
| 223 | case SSL3_ST_CW_CERT_B: | ||
| 224 | str="SSLv3 write client certificate B"; break; | ||
| 225 | case SSL3_ST_CW_CERT_C: | ||
| 226 | str="SSLv3 write client certificate C"; break; | ||
| 227 | case SSL3_ST_CW_CERT_D: | ||
| 228 | str="SSLv3 write client certificate D"; break; | ||
| 229 | case SSL3_ST_CW_KEY_EXCH_A: | ||
| 230 | str="SSLv3 write client key exchange A"; break; | ||
| 231 | case SSL3_ST_CW_KEY_EXCH_B: | ||
| 232 | str="SSLv3 write client key exchange B"; break; | ||
| 233 | case SSL3_ST_CW_CERT_VRFY_A: | ||
| 234 | str="SSLv3 write certificate verify A"; break; | ||
| 235 | case SSL3_ST_CW_CERT_VRFY_B: | ||
| 236 | str="SSLv3 write certificate verify B"; break; | ||
| 237 | |||
| 238 | case SSL3_ST_CW_CHANGE_A: | ||
| 239 | case SSL3_ST_SW_CHANGE_A: | ||
| 240 | str="SSLv3 write change cipher spec A"; break; | ||
| 241 | case SSL3_ST_CW_CHANGE_B: | ||
| 242 | case SSL3_ST_SW_CHANGE_B: | ||
| 243 | str="SSLv3 write change cipher spec B"; break; | ||
| 244 | case SSL3_ST_CW_FINISHED_A: | ||
| 245 | case SSL3_ST_SW_FINISHED_A: | ||
| 246 | str="SSLv3 write finished A"; break; | ||
| 247 | case SSL3_ST_CW_FINISHED_B: | ||
| 248 | case SSL3_ST_SW_FINISHED_B: | ||
| 249 | str="SSLv3 write finished B"; break; | ||
| 250 | case SSL3_ST_CR_CHANGE_A: | ||
| 251 | case SSL3_ST_SR_CHANGE_A: | ||
| 252 | str="SSLv3 read change cipher spec A"; break; | ||
| 253 | case SSL3_ST_CR_CHANGE_B: | ||
| 254 | case SSL3_ST_SR_CHANGE_B: | ||
| 255 | str="SSLv3 read change cipher spec B"; break; | ||
| 256 | case SSL3_ST_CR_FINISHED_A: | ||
| 257 | case SSL3_ST_SR_FINISHED_A: | ||
| 258 | str="SSLv3 read finished A"; break; | ||
| 259 | case SSL3_ST_CR_FINISHED_B: | ||
| 260 | case SSL3_ST_SR_FINISHED_B: | ||
| 261 | str="SSLv3 read finished B"; break; | ||
| 262 | |||
| 263 | case SSL3_ST_CW_FLUSH: | ||
| 264 | case SSL3_ST_SW_FLUSH: | ||
| 265 | str="SSLv3 flush data"; break; | ||
| 266 | |||
| 267 | case SSL3_ST_SR_CLNT_HELLO_A: | ||
| 268 | str="SSLv3 read client hello A"; break; | ||
| 269 | case SSL3_ST_SR_CLNT_HELLO_B: | ||
| 270 | str="SSLv3 read client hello B"; break; | ||
| 271 | case SSL3_ST_SR_CLNT_HELLO_C: | ||
| 272 | str="SSLv3 read client hello C"; break; | ||
| 273 | case SSL3_ST_SW_HELLO_REQ_A: | ||
| 274 | str="SSLv3 write hello request A"; break; | ||
| 275 | case SSL3_ST_SW_HELLO_REQ_B: | ||
| 276 | str="SSLv3 write hello request B"; break; | ||
| 277 | case SSL3_ST_SW_HELLO_REQ_C: | ||
| 278 | str="SSLv3 write hello request C"; break; | ||
| 279 | case SSL3_ST_SW_SRVR_HELLO_A: | ||
| 280 | str="SSLv3 write server hello A"; break; | ||
| 281 | case SSL3_ST_SW_SRVR_HELLO_B: | ||
| 282 | str="SSLv3 write server hello B"; break; | ||
| 283 | case SSL3_ST_SW_CERT_A: | ||
| 284 | str="SSLv3 write certificate A"; break; | ||
| 285 | case SSL3_ST_SW_CERT_B: | ||
| 286 | str="SSLv3 write certificate B"; break; | ||
| 287 | case SSL3_ST_SW_KEY_EXCH_A: | ||
| 288 | str="SSLv3 write key exchange A"; break; | ||
| 289 | case SSL3_ST_SW_KEY_EXCH_B: | ||
| 290 | str="SSLv3 write key exchange B"; break; | ||
| 291 | case SSL3_ST_SW_CERT_REQ_A: | ||
| 292 | str="SSLv3 write certificate request A"; break; | ||
| 293 | case SSL3_ST_SW_CERT_REQ_B: | ||
| 294 | str="SSLv3 write certificate request B"; break; | ||
| 295 | case SSL3_ST_SW_SESSION_TICKET_A: | ||
| 296 | str="SSLv3 write session ticket A"; break; | ||
| 297 | case SSL3_ST_SW_SESSION_TICKET_B: | ||
| 298 | str="SSLv3 write session ticket B"; break; | ||
| 299 | case SSL3_ST_SW_SRVR_DONE_A: | ||
| 300 | str="SSLv3 write server done A"; break; | ||
| 301 | case SSL3_ST_SW_SRVR_DONE_B: | ||
| 302 | str="SSLv3 write server done B"; break; | ||
| 303 | case SSL3_ST_SR_CERT_A: | ||
| 304 | str="SSLv3 read client certificate A"; break; | ||
| 305 | case SSL3_ST_SR_CERT_B: | ||
| 306 | str="SSLv3 read client certificate B"; break; | ||
| 307 | case SSL3_ST_SR_KEY_EXCH_A: | ||
| 308 | str="SSLv3 read client key exchange A"; break; | ||
| 309 | case SSL3_ST_SR_KEY_EXCH_B: | ||
| 310 | str="SSLv3 read client key exchange B"; break; | ||
| 311 | case SSL3_ST_SR_CERT_VRFY_A: | ||
| 312 | str="SSLv3 read certificate verify A"; break; | ||
| 313 | case SSL3_ST_SR_CERT_VRFY_B: | ||
| 314 | str="SSLv3 read certificate verify B"; break; | ||
| 315 | #endif | ||
| 316 | |||
| 317 | #if !defined(OPENSSL_NO_SSL2) && !defined(OPENSSL_NO_SSL3) | ||
| 318 | /* SSLv2/v3 compatibility states */ | ||
| 319 | /* client */ | ||
| 320 | case SSL23_ST_CW_CLNT_HELLO_A: | ||
| 321 | str="SSLv2/v3 write client hello A"; break; | ||
| 322 | case SSL23_ST_CW_CLNT_HELLO_B: | ||
| 323 | str="SSLv2/v3 write client hello B"; break; | ||
| 324 | case SSL23_ST_CR_SRVR_HELLO_A: | ||
| 325 | str="SSLv2/v3 read server hello A"; break; | ||
| 326 | case SSL23_ST_CR_SRVR_HELLO_B: | ||
| 327 | str="SSLv2/v3 read server hello B"; break; | ||
| 328 | /* server */ | ||
| 329 | case SSL23_ST_SR_CLNT_HELLO_A: | ||
| 330 | str="SSLv2/v3 read client hello A"; break; | ||
| 331 | case SSL23_ST_SR_CLNT_HELLO_B: | ||
| 332 | str="SSLv2/v3 read client hello B"; break; | ||
| 333 | #endif | ||
| 334 | |||
| 335 | /* DTLS */ | ||
| 336 | case DTLS1_ST_CR_HELLO_VERIFY_REQUEST_A: | ||
| 337 | str="DTLS1 read hello verify request A"; break; | ||
| 338 | case DTLS1_ST_CR_HELLO_VERIFY_REQUEST_B: | ||
| 339 | str="DTLS1 read hello verify request B"; break; | ||
| 340 | case DTLS1_ST_SW_HELLO_VERIFY_REQUEST_A: | ||
| 341 | str="DTLS1 write hello verify request A"; break; | ||
| 342 | case DTLS1_ST_SW_HELLO_VERIFY_REQUEST_B: | ||
| 343 | str="DTLS1 write hello verify request B"; break; | ||
| 344 | |||
| 345 | default: | ||
| 346 | str="unknown state"; break; | ||
| 347 | } | ||
| 348 | return (str); | ||
| 349 | } | ||
| 350 | |||
| 351 | const char | ||
| 352 | *SSL_rstate_string_long(const SSL *s) | ||
| 353 | { | ||
| 354 | const char *str; | ||
| 355 | |||
| 356 | switch (s->rstate) { | ||
| 357 | case SSL_ST_READ_HEADER: | ||
| 358 | str="read header"; break; | ||
| 359 | case SSL_ST_READ_BODY: | ||
| 360 | str="read body"; break; | ||
| 361 | case SSL_ST_READ_DONE: | ||
| 362 | str="read done"; break; | ||
| 363 | default: | ||
| 364 | str="unknown"; break; | ||
| 365 | } | ||
| 366 | return (str); | ||
| 367 | } | ||
| 368 | |||
| 369 | const char | ||
| 370 | *SSL_state_string(const SSL *s) | ||
| 371 | { | ||
| 372 | const char *str; | ||
| 373 | |||
| 374 | switch (s->state) { | ||
| 375 | case SSL_ST_BEFORE: | ||
| 376 | str="PINIT "; break; | ||
| 377 | case SSL_ST_ACCEPT: | ||
| 378 | str="AINIT "; break; | ||
| 379 | case SSL_ST_CONNECT: | ||
| 380 | str="CINIT "; break; | ||
| 381 | case SSL_ST_OK: | ||
| 382 | str="SSLOK "; break; | ||
| 383 | #ifndef OPENSSL_NO_SSL2 | ||
| 384 | case SSL2_ST_CLIENT_START_ENCRYPTION: | ||
| 385 | str="2CSENC"; break; | ||
| 386 | case SSL2_ST_SERVER_START_ENCRYPTION: | ||
| 387 | str="2SSENC"; break; | ||
| 388 | case SSL2_ST_SEND_CLIENT_HELLO_A: | ||
| 389 | str="2SCH_A"; break; | ||
| 390 | case SSL2_ST_SEND_CLIENT_HELLO_B: | ||
| 391 | str="2SCH_B"; break; | ||
| 392 | case SSL2_ST_GET_SERVER_HELLO_A: | ||
| 393 | str="2GSH_A"; break; | ||
| 394 | case SSL2_ST_GET_SERVER_HELLO_B: | ||
| 395 | str="2GSH_B"; break; | ||
| 396 | case SSL2_ST_SEND_CLIENT_MASTER_KEY_A: | ||
| 397 | str="2SCMKA"; break; | ||
| 398 | case SSL2_ST_SEND_CLIENT_MASTER_KEY_B: | ||
| 399 | str="2SCMKB"; break; | ||
| 400 | case SSL2_ST_SEND_CLIENT_FINISHED_A: | ||
| 401 | str="2SCF_A"; break; | ||
| 402 | case SSL2_ST_SEND_CLIENT_FINISHED_B: | ||
| 403 | str="2SCF_B"; break; | ||
| 404 | case SSL2_ST_SEND_CLIENT_CERTIFICATE_A: | ||
| 405 | str="2SCC_A"; break; | ||
| 406 | case SSL2_ST_SEND_CLIENT_CERTIFICATE_B: | ||
| 407 | str="2SCC_B"; break; | ||
| 408 | case SSL2_ST_SEND_CLIENT_CERTIFICATE_C: | ||
| 409 | str="2SCC_C"; break; | ||
| 410 | case SSL2_ST_SEND_CLIENT_CERTIFICATE_D: | ||
| 411 | str="2SCC_D"; break; | ||
| 412 | case SSL2_ST_GET_SERVER_VERIFY_A: | ||
| 413 | str="2GSV_A"; break; | ||
| 414 | case SSL2_ST_GET_SERVER_VERIFY_B: | ||
| 415 | str="2GSV_B"; break; | ||
| 416 | case SSL2_ST_GET_SERVER_FINISHED_A: | ||
| 417 | str="2GSF_A"; break; | ||
| 418 | case SSL2_ST_GET_SERVER_FINISHED_B: | ||
| 419 | str="2GSF_B"; break; | ||
| 420 | case SSL2_ST_GET_CLIENT_HELLO_A: | ||
| 421 | str="2GCH_A"; break; | ||
| 422 | case SSL2_ST_GET_CLIENT_HELLO_B: | ||
| 423 | str="2GCH_B"; break; | ||
| 424 | case SSL2_ST_GET_CLIENT_HELLO_C: | ||
| 425 | str="2GCH_C"; break; | ||
| 426 | case SSL2_ST_SEND_SERVER_HELLO_A: | ||
| 427 | str="2SSH_A"; break; | ||
| 428 | case SSL2_ST_SEND_SERVER_HELLO_B: | ||
| 429 | str="2SSH_B"; break; | ||
| 430 | case SSL2_ST_GET_CLIENT_MASTER_KEY_A: | ||
| 431 | str="2GCMKA"; break; | ||
| 432 | case SSL2_ST_GET_CLIENT_MASTER_KEY_B: | ||
| 433 | str="2GCMKA"; break; | ||
| 434 | case SSL2_ST_SEND_SERVER_VERIFY_A: | ||
| 435 | str="2SSV_A"; break; | ||
| 436 | case SSL2_ST_SEND_SERVER_VERIFY_B: | ||
| 437 | str="2SSV_B"; break; | ||
| 438 | case SSL2_ST_SEND_SERVER_VERIFY_C: | ||
| 439 | str="2SSV_C"; break; | ||
| 440 | case SSL2_ST_GET_CLIENT_FINISHED_A: | ||
| 441 | str="2GCF_A"; break; | ||
| 442 | case SSL2_ST_GET_CLIENT_FINISHED_B: | ||
| 443 | str="2GCF_B"; break; | ||
| 444 | case SSL2_ST_SEND_SERVER_FINISHED_A: | ||
| 445 | str="2SSF_A"; break; | ||
| 446 | case SSL2_ST_SEND_SERVER_FINISHED_B: | ||
| 447 | str="2SSF_B"; break; | ||
| 448 | case SSL2_ST_SEND_REQUEST_CERTIFICATE_A: | ||
| 449 | str="2SRC_A"; break; | ||
| 450 | case SSL2_ST_SEND_REQUEST_CERTIFICATE_B: | ||
| 451 | str="2SRC_B"; break; | ||
| 452 | case SSL2_ST_SEND_REQUEST_CERTIFICATE_C: | ||
| 453 | str="2SRC_C"; break; | ||
| 454 | case SSL2_ST_SEND_REQUEST_CERTIFICATE_D: | ||
| 455 | str="2SRC_D"; break; | ||
| 456 | case SSL2_ST_X509_GET_SERVER_CERTIFICATE: | ||
| 457 | str="2X9GSC"; break; | ||
| 458 | case SSL2_ST_X509_GET_CLIENT_CERTIFICATE: | ||
| 459 | str="2X9GCC"; break; | ||
| 460 | #endif | ||
| 461 | |||
| 462 | #ifndef OPENSSL_NO_SSL3 | ||
| 463 | /* SSLv3 additions */ | ||
| 464 | case SSL3_ST_SW_FLUSH: | ||
| 465 | case SSL3_ST_CW_FLUSH: | ||
| 466 | str="3FLUSH"; break; | ||
| 467 | case SSL3_ST_CW_CLNT_HELLO_A: | ||
| 468 | str="3WCH_A"; break; | ||
| 469 | case SSL3_ST_CW_CLNT_HELLO_B: | ||
| 470 | str="3WCH_B"; break; | ||
| 471 | case SSL3_ST_CR_SRVR_HELLO_A: | ||
| 472 | str="3RSH_A"; break; | ||
| 473 | case SSL3_ST_CR_SRVR_HELLO_B: | ||
| 474 | str="3RSH_B"; break; | ||
| 475 | case SSL3_ST_CR_CERT_A: | ||
| 476 | str="3RSC_A"; break; | ||
| 477 | case SSL3_ST_CR_CERT_B: | ||
| 478 | str="3RSC_B"; break; | ||
| 479 | case SSL3_ST_CR_KEY_EXCH_A: | ||
| 480 | str="3RSKEA"; break; | ||
| 481 | case SSL3_ST_CR_KEY_EXCH_B: | ||
| 482 | str="3RSKEB"; break; | ||
| 483 | case SSL3_ST_CR_CERT_REQ_A: | ||
| 484 | str="3RCR_A"; break; | ||
| 485 | case SSL3_ST_CR_CERT_REQ_B: | ||
| 486 | str="3RCR_B"; break; | ||
| 487 | case SSL3_ST_CR_SRVR_DONE_A: | ||
| 488 | str="3RSD_A"; break; | ||
| 489 | case SSL3_ST_CR_SRVR_DONE_B: | ||
| 490 | str="3RSD_B"; break; | ||
| 491 | case SSL3_ST_CW_CERT_A: | ||
| 492 | str="3WCC_A"; break; | ||
| 493 | case SSL3_ST_CW_CERT_B: | ||
| 494 | str="3WCC_B"; break; | ||
| 495 | case SSL3_ST_CW_CERT_C: | ||
| 496 | str="3WCC_C"; break; | ||
| 497 | case SSL3_ST_CW_CERT_D: | ||
| 498 | str="3WCC_D"; break; | ||
| 499 | case SSL3_ST_CW_KEY_EXCH_A: | ||
| 500 | str="3WCKEA"; break; | ||
| 501 | case SSL3_ST_CW_KEY_EXCH_B: | ||
| 502 | str="3WCKEB"; break; | ||
| 503 | case SSL3_ST_CW_CERT_VRFY_A: | ||
| 504 | str="3WCV_A"; break; | ||
| 505 | case SSL3_ST_CW_CERT_VRFY_B: | ||
| 506 | str="3WCV_B"; break; | ||
| 507 | |||
| 508 | case SSL3_ST_SW_CHANGE_A: | ||
| 509 | case SSL3_ST_CW_CHANGE_A: | ||
| 510 | str="3WCCSA"; break; | ||
| 511 | case SSL3_ST_SW_CHANGE_B: | ||
| 512 | case SSL3_ST_CW_CHANGE_B: | ||
| 513 | str="3WCCSB"; break; | ||
| 514 | case SSL3_ST_SW_FINISHED_A: | ||
| 515 | case SSL3_ST_CW_FINISHED_A: | ||
| 516 | str="3WFINA"; break; | ||
| 517 | case SSL3_ST_SW_FINISHED_B: | ||
| 518 | case SSL3_ST_CW_FINISHED_B: | ||
| 519 | str="3WFINB"; break; | ||
| 520 | case SSL3_ST_SR_CHANGE_A: | ||
| 521 | case SSL3_ST_CR_CHANGE_A: | ||
| 522 | str="3RCCSA"; break; | ||
| 523 | case SSL3_ST_SR_CHANGE_B: | ||
| 524 | case SSL3_ST_CR_CHANGE_B: | ||
| 525 | str="3RCCSB"; break; | ||
| 526 | case SSL3_ST_SR_FINISHED_A: | ||
| 527 | case SSL3_ST_CR_FINISHED_A: | ||
| 528 | str="3RFINA"; break; | ||
| 529 | case SSL3_ST_SR_FINISHED_B: | ||
| 530 | case SSL3_ST_CR_FINISHED_B: | ||
| 531 | str="3RFINB"; break; | ||
| 532 | |||
| 533 | case SSL3_ST_SW_HELLO_REQ_A: | ||
| 534 | str="3WHR_A"; break; | ||
| 535 | case SSL3_ST_SW_HELLO_REQ_B: | ||
| 536 | str="3WHR_B"; break; | ||
| 537 | case SSL3_ST_SW_HELLO_REQ_C: | ||
| 538 | str="3WHR_C"; break; | ||
| 539 | case SSL3_ST_SR_CLNT_HELLO_A: | ||
| 540 | str="3RCH_A"; break; | ||
| 541 | case SSL3_ST_SR_CLNT_HELLO_B: | ||
| 542 | str="3RCH_B"; break; | ||
| 543 | case SSL3_ST_SR_CLNT_HELLO_C: | ||
| 544 | str="3RCH_C"; break; | ||
| 545 | case SSL3_ST_SW_SRVR_HELLO_A: | ||
| 546 | str="3WSH_A"; break; | ||
| 547 | case SSL3_ST_SW_SRVR_HELLO_B: | ||
| 548 | str="3WSH_B"; break; | ||
| 549 | case SSL3_ST_SW_CERT_A: | ||
| 550 | str="3WSC_A"; break; | ||
| 551 | case SSL3_ST_SW_CERT_B: | ||
| 552 | str="3WSC_B"; break; | ||
| 553 | case SSL3_ST_SW_KEY_EXCH_A: | ||
| 554 | str="3WSKEA"; break; | ||
| 555 | case SSL3_ST_SW_KEY_EXCH_B: | ||
| 556 | str="3WSKEB"; break; | ||
| 557 | case SSL3_ST_SW_CERT_REQ_A: | ||
| 558 | str="3WCR_A"; break; | ||
| 559 | case SSL3_ST_SW_CERT_REQ_B: | ||
| 560 | str="3WCR_B"; break; | ||
| 561 | case SSL3_ST_SW_SRVR_DONE_A: | ||
| 562 | str="3WSD_A"; break; | ||
| 563 | case SSL3_ST_SW_SRVR_DONE_B: | ||
| 564 | str="3WSD_B"; break; | ||
| 565 | case SSL3_ST_SR_CERT_A: | ||
| 566 | str="3RCC_A"; break; | ||
| 567 | case SSL3_ST_SR_CERT_B: | ||
| 568 | str="3RCC_B"; break; | ||
| 569 | case SSL3_ST_SR_KEY_EXCH_A: | ||
| 570 | str="3RCKEA"; break; | ||
| 571 | case SSL3_ST_SR_KEY_EXCH_B: | ||
| 572 | str="3RCKEB"; break; | ||
| 573 | case SSL3_ST_SR_CERT_VRFY_A: | ||
| 574 | str="3RCV_A"; break; | ||
| 575 | case SSL3_ST_SR_CERT_VRFY_B: | ||
| 576 | str="3RCV_B"; break; | ||
| 577 | #endif | ||
| 578 | |||
| 579 | #if !defined(OPENSSL_NO_SSL2) && !defined(OPENSSL_NO_SSL3) | ||
| 580 | /* SSLv2/v3 compatibility states */ | ||
| 581 | /* client */ | ||
| 582 | case SSL23_ST_CW_CLNT_HELLO_A: | ||
| 583 | str="23WCHA"; break; | ||
| 584 | case SSL23_ST_CW_CLNT_HELLO_B: | ||
| 585 | str="23WCHB"; break; | ||
| 586 | case SSL23_ST_CR_SRVR_HELLO_A: | ||
| 587 | str="23RSHA"; break; | ||
| 588 | case SSL23_ST_CR_SRVR_HELLO_B: | ||
| 589 | str="23RSHA"; break; | ||
| 590 | /* server */ | ||
| 591 | case SSL23_ST_SR_CLNT_HELLO_A: | ||
| 592 | str="23RCHA"; break; | ||
| 593 | case SSL23_ST_SR_CLNT_HELLO_B: | ||
| 594 | str="23RCHB"; break; | ||
| 595 | #endif | ||
| 596 | /* DTLS */ | ||
| 597 | case DTLS1_ST_CR_HELLO_VERIFY_REQUEST_A: | ||
| 598 | str="DRCHVA"; break; | ||
| 599 | case DTLS1_ST_CR_HELLO_VERIFY_REQUEST_B: | ||
| 600 | str="DRCHVB"; break; | ||
| 601 | case DTLS1_ST_SW_HELLO_VERIFY_REQUEST_A: | ||
| 602 | str="DWCHVA"; break; | ||
| 603 | case DTLS1_ST_SW_HELLO_VERIFY_REQUEST_B: | ||
| 604 | str="DWCHVB"; break; | ||
| 605 | |||
| 606 | default: | ||
| 607 | str="UNKWN "; break; | ||
| 608 | } | ||
| 609 | return (str); | ||
| 610 | } | ||
| 611 | |||
| 612 | const char | ||
| 613 | *SSL_alert_type_string_long(int value) | ||
| 614 | { | ||
| 615 | value>>=8; | ||
| 616 | if (value == SSL3_AL_WARNING) | ||
| 617 | return("warning"); | ||
| 618 | else if (value == SSL3_AL_FATAL) | ||
| 619 | return("fatal"); | ||
| 620 | else | ||
| 621 | return("unknown"); | ||
| 622 | } | ||
| 623 | |||
| 624 | const char | ||
| 625 | *SSL_alert_type_string(int value) | ||
| 626 | { | ||
| 627 | value>>=8; | ||
| 628 | if (value == SSL3_AL_WARNING) | ||
| 629 | return("W"); | ||
| 630 | else if (value == SSL3_AL_FATAL) | ||
| 631 | return("F"); | ||
| 632 | else | ||
| 633 | return("U"); | ||
| 634 | } | ||
| 635 | |||
| 636 | const char | ||
| 637 | *SSL_alert_desc_string(int value) | ||
| 638 | { | ||
| 639 | const char *str; | ||
| 640 | |||
| 641 | switch (value & 0xff) { | ||
| 642 | case SSL3_AD_CLOSE_NOTIFY: | ||
| 643 | str="CN"; break; | ||
| 644 | case SSL3_AD_UNEXPECTED_MESSAGE: | ||
| 645 | str="UM"; break; | ||
| 646 | case SSL3_AD_BAD_RECORD_MAC: | ||
| 647 | str="BM"; break; | ||
| 648 | case SSL3_AD_DECOMPRESSION_FAILURE: | ||
| 649 | str="DF"; break; | ||
| 650 | case SSL3_AD_HANDSHAKE_FAILURE: | ||
| 651 | str="HF"; break; | ||
| 652 | case SSL3_AD_NO_CERTIFICATE: | ||
| 653 | str="NC"; break; | ||
| 654 | case SSL3_AD_BAD_CERTIFICATE: | ||
| 655 | str="BC"; break; | ||
| 656 | case SSL3_AD_UNSUPPORTED_CERTIFICATE: | ||
| 657 | str="UC"; break; | ||
| 658 | case SSL3_AD_CERTIFICATE_REVOKED: | ||
| 659 | str="CR"; break; | ||
| 660 | case SSL3_AD_CERTIFICATE_EXPIRED: | ||
| 661 | str="CE"; break; | ||
| 662 | case SSL3_AD_CERTIFICATE_UNKNOWN: | ||
| 663 | str="CU"; break; | ||
| 664 | case SSL3_AD_ILLEGAL_PARAMETER: | ||
| 665 | str="IP"; break; | ||
| 666 | case TLS1_AD_DECRYPTION_FAILED: | ||
| 667 | str="DC"; break; | ||
| 668 | case TLS1_AD_RECORD_OVERFLOW: | ||
| 669 | str="RO"; break; | ||
| 670 | case TLS1_AD_UNKNOWN_CA: | ||
| 671 | str="CA"; break; | ||
| 672 | case TLS1_AD_ACCESS_DENIED: | ||
| 673 | str="AD"; break; | ||
| 674 | case TLS1_AD_DECODE_ERROR: | ||
| 675 | str="DE"; break; | ||
| 676 | case TLS1_AD_DECRYPT_ERROR: | ||
| 677 | str="CY"; break; | ||
| 678 | case TLS1_AD_EXPORT_RESTRICTION: | ||
| 679 | str="ER"; break; | ||
| 680 | case TLS1_AD_PROTOCOL_VERSION: | ||
| 681 | str="PV"; break; | ||
| 682 | case TLS1_AD_INSUFFICIENT_SECURITY: | ||
| 683 | str="IS"; break; | ||
| 684 | case TLS1_AD_INTERNAL_ERROR: | ||
| 685 | str="IE"; break; | ||
| 686 | case TLS1_AD_USER_CANCELLED: | ||
| 687 | str="US"; break; | ||
| 688 | case TLS1_AD_NO_RENEGOTIATION: | ||
| 689 | str="NR"; break; | ||
| 690 | case TLS1_AD_UNSUPPORTED_EXTENSION: | ||
| 691 | str="UE"; break; | ||
| 692 | case TLS1_AD_CERTIFICATE_UNOBTAINABLE: | ||
| 693 | str="CO"; break; | ||
| 694 | case TLS1_AD_UNRECOGNIZED_NAME: | ||
| 695 | str="UN"; break; | ||
| 696 | case TLS1_AD_BAD_CERTIFICATE_STATUS_RESPONSE: | ||
| 697 | str="BR"; break; | ||
| 698 | case TLS1_AD_BAD_CERTIFICATE_HASH_VALUE: | ||
| 699 | str="BH"; break; | ||
| 700 | case TLS1_AD_UNKNOWN_PSK_IDENTITY: | ||
| 701 | str="UP"; break; | ||
| 702 | default: | ||
| 703 | str="UK"; break; | ||
| 704 | } | ||
| 705 | return (str); | ||
| 706 | } | ||
| 707 | |||
| 708 | const char | ||
| 709 | *SSL_alert_desc_string_long(int value) | ||
| 710 | { | ||
| 711 | const char *str; | ||
| 712 | |||
| 713 | switch (value & 0xff) { | ||
| 714 | case SSL3_AD_CLOSE_NOTIFY: | ||
| 715 | str="close notify"; | ||
| 716 | break; | ||
| 717 | case SSL3_AD_UNEXPECTED_MESSAGE: | ||
| 718 | str="unexpected_message"; | ||
| 719 | break; | ||
| 720 | case SSL3_AD_BAD_RECORD_MAC: | ||
| 721 | str="bad record mac"; | ||
| 722 | break; | ||
| 723 | case SSL3_AD_DECOMPRESSION_FAILURE: | ||
| 724 | str="decompression failure"; | ||
| 725 | break; | ||
| 726 | case SSL3_AD_HANDSHAKE_FAILURE: | ||
| 727 | str="handshake failure"; | ||
| 728 | break; | ||
| 729 | case SSL3_AD_NO_CERTIFICATE: | ||
| 730 | str="no certificate"; | ||
| 731 | break; | ||
| 732 | case SSL3_AD_BAD_CERTIFICATE: | ||
| 733 | str="bad certificate"; | ||
| 734 | break; | ||
| 735 | case SSL3_AD_UNSUPPORTED_CERTIFICATE: | ||
| 736 | str="unsupported certificate"; | ||
| 737 | break; | ||
| 738 | case SSL3_AD_CERTIFICATE_REVOKED: | ||
| 739 | str="certificate revoked"; | ||
| 740 | break; | ||
| 741 | case SSL3_AD_CERTIFICATE_EXPIRED: | ||
| 742 | str="certificate expired"; | ||
| 743 | break; | ||
| 744 | case SSL3_AD_CERTIFICATE_UNKNOWN: | ||
| 745 | str="certificate unknown"; | ||
| 746 | break; | ||
| 747 | case SSL3_AD_ILLEGAL_PARAMETER: | ||
| 748 | str="illegal parameter"; | ||
| 749 | break; | ||
| 750 | case TLS1_AD_DECRYPTION_FAILED: | ||
| 751 | str="decryption failed"; | ||
| 752 | break; | ||
| 753 | case TLS1_AD_RECORD_OVERFLOW: | ||
| 754 | str="record overflow"; | ||
| 755 | break; | ||
| 756 | case TLS1_AD_UNKNOWN_CA: | ||
| 757 | str="unknown CA"; | ||
| 758 | break; | ||
| 759 | case TLS1_AD_ACCESS_DENIED: | ||
| 760 | str="access denied"; | ||
| 761 | break; | ||
| 762 | case TLS1_AD_DECODE_ERROR: | ||
| 763 | str="decode error"; | ||
| 764 | break; | ||
| 765 | case TLS1_AD_DECRYPT_ERROR: | ||
| 766 | str="decrypt error"; | ||
| 767 | break; | ||
| 768 | case TLS1_AD_EXPORT_RESTRICTION: | ||
| 769 | str="export restriction"; | ||
| 770 | break; | ||
| 771 | case TLS1_AD_PROTOCOL_VERSION: | ||
| 772 | str="protocol version"; | ||
| 773 | break; | ||
| 774 | case TLS1_AD_INSUFFICIENT_SECURITY: | ||
| 775 | str="insufficient security"; | ||
| 776 | break; | ||
| 777 | case TLS1_AD_INTERNAL_ERROR: | ||
| 778 | str="internal error"; | ||
| 779 | break; | ||
| 780 | case TLS1_AD_USER_CANCELLED: | ||
| 781 | str="user canceled"; | ||
| 782 | break; | ||
| 783 | case TLS1_AD_NO_RENEGOTIATION: | ||
| 784 | str="no renegotiation"; | ||
| 785 | break; | ||
| 786 | case TLS1_AD_UNSUPPORTED_EXTENSION: | ||
| 787 | str="unsupported extension"; | ||
| 788 | break; | ||
| 789 | case TLS1_AD_CERTIFICATE_UNOBTAINABLE: | ||
| 790 | str="certificate unobtainable"; | ||
| 791 | break; | ||
| 792 | case TLS1_AD_UNRECOGNIZED_NAME: | ||
| 793 | str="unrecognized name"; | ||
| 794 | break; | ||
| 795 | case TLS1_AD_BAD_CERTIFICATE_STATUS_RESPONSE: | ||
| 796 | str="bad certificate status response"; | ||
| 797 | break; | ||
| 798 | case TLS1_AD_BAD_CERTIFICATE_HASH_VALUE: | ||
| 799 | str="bad certificate hash value"; | ||
| 800 | break; | ||
| 801 | case TLS1_AD_UNKNOWN_PSK_IDENTITY: | ||
| 802 | str="unknown PSK identity"; | ||
| 803 | break; | ||
| 804 | default: | ||
| 805 | str="unknown"; break; | ||
| 806 | } | ||
| 807 | return (str); | ||
| 808 | } | ||
| 809 | |||
| 810 | const char | ||
| 811 | *SSL_rstate_string(const SSL *s) | ||
| 812 | { | ||
| 813 | const char *str; | ||
| 814 | |||
| 815 | switch (s->rstate) { | ||
| 816 | case SSL_ST_READ_HEADER: | ||
| 817 | str="RH"; break; | ||
| 818 | case SSL_ST_READ_BODY: | ||
| 819 | str="RB"; break; | ||
| 820 | case SSL_ST_READ_DONE: | ||
| 821 | str="RD"; break; | ||
| 822 | default: | ||
| 823 | str="unknown"; break; | ||
| 824 | } | ||
| 825 | return (str); | ||
| 826 | } | ||
