2 /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
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.
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).
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.
23 * Redistribution and use in source and binary forms, with or without
24 * modification, are permitted provided that the following conditions
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)"
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
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.]
58 /* ====================================================================
59 * Copyright 2005 Nokia. All rights reserved.
61 * The portions of the attached software ("Contribution") is developed by
62 * Nokia Corporation and is licensed pursuant to the OpenSSL open source
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.
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.
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.
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
88 const char *SSL_state_string_long(const SSL *s)
94 str = "before SSL initialization";
97 str = "before accept initialization";
100 str = "before connect initialization";
103 str = "SSL negotiation finished successfully";
105 case SSL_ST_RENEGOTIATE:
106 str = "SSL renegotiate ciphers";
108 case SSL_ST_BEFORE | SSL_ST_CONNECT:
109 str = "before/connect initialization";
111 case SSL_ST_OK | SSL_ST_CONNECT:
112 str = "ok/connect SSL initialization";
114 case SSL_ST_BEFORE | SSL_ST_ACCEPT:
115 str = "before/accept initialization";
117 case SSL_ST_OK | SSL_ST_ACCEPT:
118 str = "ok/accept SSL initialization";
123 #ifndef OPENSSL_NO_SSL2
124 case SSL2_ST_CLIENT_START_ENCRYPTION:
125 str = "SSLv2 client start encryption";
127 case SSL2_ST_SERVER_START_ENCRYPTION:
128 str = "SSLv2 server start encryption";
130 case SSL2_ST_SEND_CLIENT_HELLO_A:
131 str = "SSLv2 write client hello A";
133 case SSL2_ST_SEND_CLIENT_HELLO_B:
134 str = "SSLv2 write client hello B";
136 case SSL2_ST_GET_SERVER_HELLO_A:
137 str = "SSLv2 read server hello A";
139 case SSL2_ST_GET_SERVER_HELLO_B:
140 str = "SSLv2 read server hello B";
142 case SSL2_ST_SEND_CLIENT_MASTER_KEY_A:
143 str = "SSLv2 write client master key A";
145 case SSL2_ST_SEND_CLIENT_MASTER_KEY_B:
146 str = "SSLv2 write client master key B";
148 case SSL2_ST_SEND_CLIENT_FINISHED_A:
149 str = "SSLv2 write client finished A";
151 case SSL2_ST_SEND_CLIENT_FINISHED_B:
152 str = "SSLv2 write client finished B";
154 case SSL2_ST_SEND_CLIENT_CERTIFICATE_A:
155 str = "SSLv2 write client certificate A";
157 case SSL2_ST_SEND_CLIENT_CERTIFICATE_B:
158 str = "SSLv2 write client certificate B";
160 case SSL2_ST_SEND_CLIENT_CERTIFICATE_C:
161 str = "SSLv2 write client certificate C";
163 case SSL2_ST_SEND_CLIENT_CERTIFICATE_D:
164 str = "SSLv2 write client certificate D";
166 case SSL2_ST_GET_SERVER_VERIFY_A:
167 str = "SSLv2 read server verify A";
169 case SSL2_ST_GET_SERVER_VERIFY_B:
170 str = "SSLv2 read server verify B";
172 case SSL2_ST_GET_SERVER_FINISHED_A:
173 str = "SSLv2 read server finished A";
175 case SSL2_ST_GET_SERVER_FINISHED_B:
176 str = "SSLv2 read server finished B";
178 case SSL2_ST_GET_CLIENT_HELLO_A:
179 str = "SSLv2 read client hello A";
181 case SSL2_ST_GET_CLIENT_HELLO_B:
182 str = "SSLv2 read client hello B";
184 case SSL2_ST_GET_CLIENT_HELLO_C:
185 str = "SSLv2 read client hello C";
187 case SSL2_ST_SEND_SERVER_HELLO_A:
188 str = "SSLv2 write server hello A";
190 case SSL2_ST_SEND_SERVER_HELLO_B:
191 str = "SSLv2 write server hello B";
193 case SSL2_ST_GET_CLIENT_MASTER_KEY_A:
194 str = "SSLv2 read client master key A";
196 case SSL2_ST_GET_CLIENT_MASTER_KEY_B:
197 str = "SSLv2 read client master key B";
199 case SSL2_ST_SEND_SERVER_VERIFY_A:
200 str = "SSLv2 write server verify A";
202 case SSL2_ST_SEND_SERVER_VERIFY_B:
203 str = "SSLv2 write server verify B";
205 case SSL2_ST_SEND_SERVER_VERIFY_C:
206 str = "SSLv2 write server verify C";
208 case SSL2_ST_GET_CLIENT_FINISHED_A:
209 str = "SSLv2 read client finished A";
211 case SSL2_ST_GET_CLIENT_FINISHED_B:
212 str = "SSLv2 read client finished B";
214 case SSL2_ST_SEND_SERVER_FINISHED_A:
215 str = "SSLv2 write server finished A";
217 case SSL2_ST_SEND_SERVER_FINISHED_B:
218 str = "SSLv2 write server finished B";
220 case SSL2_ST_SEND_REQUEST_CERTIFICATE_A:
221 str = "SSLv2 write request certificate A";
223 case SSL2_ST_SEND_REQUEST_CERTIFICATE_B:
224 str = "SSLv2 write request certificate B";
226 case SSL2_ST_SEND_REQUEST_CERTIFICATE_C:
227 str = "SSLv2 write request certificate C";
229 case SSL2_ST_SEND_REQUEST_CERTIFICATE_D:
230 str = "SSLv2 write request certificate D";
232 case SSL2_ST_X509_GET_SERVER_CERTIFICATE:
233 str = "SSLv2 X509 read server certificate";
235 case SSL2_ST_X509_GET_CLIENT_CERTIFICATE:
236 str = "SSLv2 X509 read client certificate";
240 #ifndef OPENSSL_NO_SSL3
241 /* SSLv3 additions */
242 case SSL3_ST_CW_CLNT_HELLO_A:
243 str = "SSLv3 write client hello A";
245 case SSL3_ST_CW_CLNT_HELLO_B:
246 str = "SSLv3 write client hello B";
248 case SSL3_ST_CR_SRVR_HELLO_A:
249 str = "SSLv3 read server hello A";
251 case SSL3_ST_CR_SRVR_HELLO_B:
252 str = "SSLv3 read server hello B";
254 case SSL3_ST_CR_CERT_A:
255 str = "SSLv3 read server certificate A";
257 case SSL3_ST_CR_CERT_B:
258 str = "SSLv3 read server certificate B";
260 case SSL3_ST_CR_KEY_EXCH_A:
261 str = "SSLv3 read server key exchange A";
263 case SSL3_ST_CR_KEY_EXCH_B:
264 str = "SSLv3 read server key exchange B";
266 case SSL3_ST_CR_CERT_REQ_A:
267 str = "SSLv3 read server certificate request A";
269 case SSL3_ST_CR_CERT_REQ_B:
270 str = "SSLv3 read server certificate request B";
272 case SSL3_ST_CR_SESSION_TICKET_A:
273 str = "SSLv3 read server session ticket A";
275 case SSL3_ST_CR_SESSION_TICKET_B:
276 str = "SSLv3 read server session ticket B";
278 case SSL3_ST_CR_SRVR_DONE_A:
279 str = "SSLv3 read server done A";
281 case SSL3_ST_CR_SRVR_DONE_B:
282 str = "SSLv3 read server done B";
284 case SSL3_ST_CW_CERT_A:
285 str = "SSLv3 write client certificate A";
287 case SSL3_ST_CW_CERT_B:
288 str = "SSLv3 write client certificate B";
290 case SSL3_ST_CW_CERT_C:
291 str = "SSLv3 write client certificate C";
293 case SSL3_ST_CW_CERT_D:
294 str = "SSLv3 write client certificate D";
296 case SSL3_ST_CW_KEY_EXCH_A:
297 str = "SSLv3 write client key exchange A";
299 case SSL3_ST_CW_KEY_EXCH_B:
300 str = "SSLv3 write client key exchange B";
302 case SSL3_ST_CW_CERT_VRFY_A:
303 str = "SSLv3 write certificate verify A";
305 case SSL3_ST_CW_CERT_VRFY_B:
306 str = "SSLv3 write certificate verify B";
309 case SSL3_ST_CW_CHANGE_A:
310 case SSL3_ST_SW_CHANGE_A:
311 str = "SSLv3 write change cipher spec A";
313 case SSL3_ST_CW_CHANGE_B:
314 case SSL3_ST_SW_CHANGE_B:
315 str = "SSLv3 write change cipher spec B";
317 case SSL3_ST_CW_FINISHED_A:
318 case SSL3_ST_SW_FINISHED_A:
319 str = "SSLv3 write finished A";
321 case SSL3_ST_CW_FINISHED_B:
322 case SSL3_ST_SW_FINISHED_B:
323 str = "SSLv3 write finished B";
325 case SSL3_ST_CR_CHANGE_A:
326 case SSL3_ST_SR_CHANGE_A:
327 str = "SSLv3 read change cipher spec A";
329 case SSL3_ST_CR_CHANGE_B:
330 case SSL3_ST_SR_CHANGE_B:
331 str = "SSLv3 read change cipher spec B";
333 case SSL3_ST_CR_FINISHED_A:
334 case SSL3_ST_SR_FINISHED_A:
335 str = "SSLv3 read finished A";
337 case SSL3_ST_CR_FINISHED_B:
338 case SSL3_ST_SR_FINISHED_B:
339 str = "SSLv3 read finished B";
342 case SSL3_ST_CW_FLUSH:
343 case SSL3_ST_SW_FLUSH:
344 str = "SSLv3 flush data";
347 case SSL3_ST_SR_CLNT_HELLO_A:
348 str = "SSLv3 read client hello A";
350 case SSL3_ST_SR_CLNT_HELLO_B:
351 str = "SSLv3 read client hello B";
353 case SSL3_ST_SR_CLNT_HELLO_C:
354 str = "SSLv3 read client hello C";
356 case SSL3_ST_SW_HELLO_REQ_A:
357 str = "SSLv3 write hello request A";
359 case SSL3_ST_SW_HELLO_REQ_B:
360 str = "SSLv3 write hello request B";
362 case SSL3_ST_SW_HELLO_REQ_C:
363 str = "SSLv3 write hello request C";
365 case SSL3_ST_SW_SRVR_HELLO_A:
366 str = "SSLv3 write server hello A";
368 case SSL3_ST_SW_SRVR_HELLO_B:
369 str = "SSLv3 write server hello B";
371 case SSL3_ST_SW_CERT_A:
372 str = "SSLv3 write certificate A";
374 case SSL3_ST_SW_CERT_B:
375 str = "SSLv3 write certificate B";
377 case SSL3_ST_SW_KEY_EXCH_A:
378 str = "SSLv3 write key exchange A";
380 case SSL3_ST_SW_KEY_EXCH_B:
381 str = "SSLv3 write key exchange B";
383 case SSL3_ST_SW_CERT_REQ_A:
384 str = "SSLv3 write certificate request A";
386 case SSL3_ST_SW_CERT_REQ_B:
387 str = "SSLv3 write certificate request B";
389 case SSL3_ST_SW_SESSION_TICKET_A:
390 str = "SSLv3 write session ticket A";
392 case SSL3_ST_SW_SESSION_TICKET_B:
393 str = "SSLv3 write session ticket B";
395 case SSL3_ST_SW_SRVR_DONE_A:
396 str = "SSLv3 write server done A";
398 case SSL3_ST_SW_SRVR_DONE_B:
399 str = "SSLv3 write server done B";
401 case SSL3_ST_SR_CERT_A:
402 str = "SSLv3 read client certificate A";
404 case SSL3_ST_SR_CERT_B:
405 str = "SSLv3 read client certificate B";
407 case SSL3_ST_SR_KEY_EXCH_A:
408 str = "SSLv3 read client key exchange A";
410 case SSL3_ST_SR_KEY_EXCH_B:
411 str = "SSLv3 read client key exchange B";
413 case SSL3_ST_SR_CERT_VRFY_A:
414 str = "SSLv3 read certificate verify A";
416 case SSL3_ST_SR_CERT_VRFY_B:
417 str = "SSLv3 read certificate verify B";
421 /* SSLv2/v3 compatibility states */
423 case SSL23_ST_CW_CLNT_HELLO_A:
424 str = "SSLv2/v3 write client hello A";
426 case SSL23_ST_CW_CLNT_HELLO_B:
427 str = "SSLv2/v3 write client hello B";
429 case SSL23_ST_CR_SRVR_HELLO_A:
430 str = "SSLv2/v3 read server hello A";
432 case SSL23_ST_CR_SRVR_HELLO_B:
433 str = "SSLv2/v3 read server hello B";
436 case SSL23_ST_SR_CLNT_HELLO_A:
437 str = "SSLv2/v3 read client hello A";
439 case SSL23_ST_SR_CLNT_HELLO_B:
440 str = "SSLv2/v3 read client hello B";
444 case DTLS1_ST_CR_HELLO_VERIFY_REQUEST_A:
445 str = "DTLS1 read hello verify request A";
447 case DTLS1_ST_CR_HELLO_VERIFY_REQUEST_B:
448 str = "DTLS1 read hello verify request B";
450 case DTLS1_ST_SW_HELLO_VERIFY_REQUEST_A:
451 str = "DTLS1 write hello verify request A";
453 case DTLS1_ST_SW_HELLO_VERIFY_REQUEST_B:
454 str = "DTLS1 write hello verify request B";
458 str = "unknown state";
464 const char *SSL_rstate_string_long(const SSL *s)
469 case SSL_ST_READ_HEADER:
472 case SSL_ST_READ_BODY:
475 case SSL_ST_READ_DONE:
485 const char *SSL_state_string(const SSL *s)
505 #ifndef OPENSSL_NO_SSL2
506 case SSL2_ST_CLIENT_START_ENCRYPTION:
509 case SSL2_ST_SERVER_START_ENCRYPTION:
512 case SSL2_ST_SEND_CLIENT_HELLO_A:
515 case SSL2_ST_SEND_CLIENT_HELLO_B:
518 case SSL2_ST_GET_SERVER_HELLO_A:
521 case SSL2_ST_GET_SERVER_HELLO_B:
524 case SSL2_ST_SEND_CLIENT_MASTER_KEY_A:
527 case SSL2_ST_SEND_CLIENT_MASTER_KEY_B:
530 case SSL2_ST_SEND_CLIENT_FINISHED_A:
533 case SSL2_ST_SEND_CLIENT_FINISHED_B:
536 case SSL2_ST_SEND_CLIENT_CERTIFICATE_A:
539 case SSL2_ST_SEND_CLIENT_CERTIFICATE_B:
542 case SSL2_ST_SEND_CLIENT_CERTIFICATE_C:
545 case SSL2_ST_SEND_CLIENT_CERTIFICATE_D:
548 case SSL2_ST_GET_SERVER_VERIFY_A:
551 case SSL2_ST_GET_SERVER_VERIFY_B:
554 case SSL2_ST_GET_SERVER_FINISHED_A:
557 case SSL2_ST_GET_SERVER_FINISHED_B:
560 case SSL2_ST_GET_CLIENT_HELLO_A:
563 case SSL2_ST_GET_CLIENT_HELLO_B:
566 case SSL2_ST_GET_CLIENT_HELLO_C:
569 case SSL2_ST_SEND_SERVER_HELLO_A:
572 case SSL2_ST_SEND_SERVER_HELLO_B:
575 case SSL2_ST_GET_CLIENT_MASTER_KEY_A:
578 case SSL2_ST_GET_CLIENT_MASTER_KEY_B:
581 case SSL2_ST_SEND_SERVER_VERIFY_A:
584 case SSL2_ST_SEND_SERVER_VERIFY_B:
587 case SSL2_ST_SEND_SERVER_VERIFY_C:
590 case SSL2_ST_GET_CLIENT_FINISHED_A:
593 case SSL2_ST_GET_CLIENT_FINISHED_B:
596 case SSL2_ST_SEND_SERVER_FINISHED_A:
599 case SSL2_ST_SEND_SERVER_FINISHED_B:
602 case SSL2_ST_SEND_REQUEST_CERTIFICATE_A:
605 case SSL2_ST_SEND_REQUEST_CERTIFICATE_B:
608 case SSL2_ST_SEND_REQUEST_CERTIFICATE_C:
611 case SSL2_ST_SEND_REQUEST_CERTIFICATE_D:
614 case SSL2_ST_X509_GET_SERVER_CERTIFICATE:
617 case SSL2_ST_X509_GET_CLIENT_CERTIFICATE:
622 #ifndef OPENSSL_NO_SSL3
623 /* SSLv3 additions */
624 case SSL3_ST_SW_FLUSH:
625 case SSL3_ST_CW_FLUSH:
628 case SSL3_ST_CW_CLNT_HELLO_A:
631 case SSL3_ST_CW_CLNT_HELLO_B:
634 case SSL3_ST_CR_SRVR_HELLO_A:
637 case SSL3_ST_CR_SRVR_HELLO_B:
640 case SSL3_ST_CR_CERT_A:
643 case SSL3_ST_CR_CERT_B:
646 case SSL3_ST_CR_KEY_EXCH_A:
649 case SSL3_ST_CR_KEY_EXCH_B:
652 case SSL3_ST_CR_CERT_REQ_A:
655 case SSL3_ST_CR_CERT_REQ_B:
658 case SSL3_ST_CR_SRVR_DONE_A:
661 case SSL3_ST_CR_SRVR_DONE_B:
664 case SSL3_ST_CW_CERT_A:
667 case SSL3_ST_CW_CERT_B:
670 case SSL3_ST_CW_CERT_C:
673 case SSL3_ST_CW_CERT_D:
676 case SSL3_ST_CW_KEY_EXCH_A:
679 case SSL3_ST_CW_KEY_EXCH_B:
682 case SSL3_ST_CW_CERT_VRFY_A:
685 case SSL3_ST_CW_CERT_VRFY_B:
689 case SSL3_ST_SW_CHANGE_A:
690 case SSL3_ST_CW_CHANGE_A:
693 case SSL3_ST_SW_CHANGE_B:
694 case SSL3_ST_CW_CHANGE_B:
697 case SSL3_ST_SW_FINISHED_A:
698 case SSL3_ST_CW_FINISHED_A:
701 case SSL3_ST_SW_FINISHED_B:
702 case SSL3_ST_CW_FINISHED_B:
705 case SSL3_ST_SR_CHANGE_A:
706 case SSL3_ST_CR_CHANGE_A:
709 case SSL3_ST_SR_CHANGE_B:
710 case SSL3_ST_CR_CHANGE_B:
713 case SSL3_ST_SR_FINISHED_A:
714 case SSL3_ST_CR_FINISHED_A:
717 case SSL3_ST_SR_FINISHED_B:
718 case SSL3_ST_CR_FINISHED_B:
722 case SSL3_ST_SW_HELLO_REQ_A:
725 case SSL3_ST_SW_HELLO_REQ_B:
728 case SSL3_ST_SW_HELLO_REQ_C:
731 case SSL3_ST_SR_CLNT_HELLO_A:
734 case SSL3_ST_SR_CLNT_HELLO_B:
737 case SSL3_ST_SR_CLNT_HELLO_C:
740 case SSL3_ST_SW_SRVR_HELLO_A:
743 case SSL3_ST_SW_SRVR_HELLO_B:
746 case SSL3_ST_SW_CERT_A:
749 case SSL3_ST_SW_CERT_B:
752 case SSL3_ST_SW_KEY_EXCH_A:
755 case SSL3_ST_SW_KEY_EXCH_B:
758 case SSL3_ST_SW_CERT_REQ_A:
761 case SSL3_ST_SW_CERT_REQ_B:
764 case SSL3_ST_SW_SRVR_DONE_A:
767 case SSL3_ST_SW_SRVR_DONE_B:
770 case SSL3_ST_SR_CERT_A:
773 case SSL3_ST_SR_CERT_B:
776 case SSL3_ST_SR_KEY_EXCH_A:
779 case SSL3_ST_SR_KEY_EXCH_B:
782 case SSL3_ST_SR_CERT_VRFY_A:
785 case SSL3_ST_SR_CERT_VRFY_B:
790 /* SSLv2/v3 compatibility states */
792 case SSL23_ST_CW_CLNT_HELLO_A:
795 case SSL23_ST_CW_CLNT_HELLO_B:
798 case SSL23_ST_CR_SRVR_HELLO_A:
801 case SSL23_ST_CR_SRVR_HELLO_B:
805 case SSL23_ST_SR_CLNT_HELLO_A:
808 case SSL23_ST_SR_CLNT_HELLO_B:
813 case DTLS1_ST_CR_HELLO_VERIFY_REQUEST_A:
816 case DTLS1_ST_CR_HELLO_VERIFY_REQUEST_B:
819 case DTLS1_ST_SW_HELLO_VERIFY_REQUEST_A:
822 case DTLS1_ST_SW_HELLO_VERIFY_REQUEST_B:
833 const char *SSL_alert_type_string_long(int value)
836 if (value == SSL3_AL_WARNING)
838 else if (value == SSL3_AL_FATAL)
844 const char *SSL_alert_type_string(int value)
847 if (value == SSL3_AL_WARNING)
849 else if (value == SSL3_AL_FATAL)
855 const char *SSL_alert_desc_string(int value)
859 switch (value & 0xff) {
860 case SSL3_AD_CLOSE_NOTIFY:
863 case SSL3_AD_UNEXPECTED_MESSAGE:
866 case SSL3_AD_BAD_RECORD_MAC:
869 case SSL3_AD_DECOMPRESSION_FAILURE:
872 case SSL3_AD_HANDSHAKE_FAILURE:
875 case SSL3_AD_NO_CERTIFICATE:
878 case SSL3_AD_BAD_CERTIFICATE:
881 case SSL3_AD_UNSUPPORTED_CERTIFICATE:
884 case SSL3_AD_CERTIFICATE_REVOKED:
887 case SSL3_AD_CERTIFICATE_EXPIRED:
890 case SSL3_AD_CERTIFICATE_UNKNOWN:
893 case SSL3_AD_ILLEGAL_PARAMETER:
896 case TLS1_AD_DECRYPTION_FAILED:
899 case TLS1_AD_RECORD_OVERFLOW:
902 case TLS1_AD_UNKNOWN_CA:
905 case TLS1_AD_ACCESS_DENIED:
908 case TLS1_AD_DECODE_ERROR:
911 case TLS1_AD_DECRYPT_ERROR:
914 case TLS1_AD_EXPORT_RESTRICTION:
917 case TLS1_AD_PROTOCOL_VERSION:
920 case TLS1_AD_INSUFFICIENT_SECURITY:
923 case TLS1_AD_INTERNAL_ERROR:
926 case TLS1_AD_USER_CANCELLED:
929 case TLS1_AD_NO_RENEGOTIATION:
932 case TLS1_AD_UNSUPPORTED_EXTENSION:
935 case TLS1_AD_CERTIFICATE_UNOBTAINABLE:
938 case TLS1_AD_UNRECOGNIZED_NAME:
941 case TLS1_AD_BAD_CERTIFICATE_STATUS_RESPONSE:
944 case TLS1_AD_BAD_CERTIFICATE_HASH_VALUE:
947 case TLS1_AD_UNKNOWN_PSK_IDENTITY:
957 const char *SSL_alert_desc_string_long(int value)
961 switch (value & 0xff) {
962 case SSL3_AD_CLOSE_NOTIFY:
963 str = "close notify";
965 case SSL3_AD_UNEXPECTED_MESSAGE:
966 str = "unexpected_message";
968 case SSL3_AD_BAD_RECORD_MAC:
969 str = "bad record mac";
971 case SSL3_AD_DECOMPRESSION_FAILURE:
972 str = "decompression failure";
974 case SSL3_AD_HANDSHAKE_FAILURE:
975 str = "handshake failure";
977 case SSL3_AD_NO_CERTIFICATE:
978 str = "no certificate";
980 case SSL3_AD_BAD_CERTIFICATE:
981 str = "bad certificate";
983 case SSL3_AD_UNSUPPORTED_CERTIFICATE:
984 str = "unsupported certificate";
986 case SSL3_AD_CERTIFICATE_REVOKED:
987 str = "certificate revoked";
989 case SSL3_AD_CERTIFICATE_EXPIRED:
990 str = "certificate expired";
992 case SSL3_AD_CERTIFICATE_UNKNOWN:
993 str = "certificate unknown";
995 case SSL3_AD_ILLEGAL_PARAMETER:
996 str = "illegal parameter";
998 case TLS1_AD_DECRYPTION_FAILED:
999 str = "decryption failed";
1001 case TLS1_AD_RECORD_OVERFLOW:
1002 str = "record overflow";
1004 case TLS1_AD_UNKNOWN_CA:
1007 case TLS1_AD_ACCESS_DENIED:
1008 str = "access denied";
1010 case TLS1_AD_DECODE_ERROR:
1011 str = "decode error";
1013 case TLS1_AD_DECRYPT_ERROR:
1014 str = "decrypt error";
1016 case TLS1_AD_EXPORT_RESTRICTION:
1017 str = "export restriction";
1019 case TLS1_AD_PROTOCOL_VERSION:
1020 str = "protocol version";
1022 case TLS1_AD_INSUFFICIENT_SECURITY:
1023 str = "insufficient security";
1025 case TLS1_AD_INTERNAL_ERROR:
1026 str = "internal error";
1028 case TLS1_AD_USER_CANCELLED:
1029 str = "user canceled";
1031 case TLS1_AD_NO_RENEGOTIATION:
1032 str = "no renegotiation";
1034 case TLS1_AD_UNSUPPORTED_EXTENSION:
1035 str = "unsupported extension";
1037 case TLS1_AD_CERTIFICATE_UNOBTAINABLE:
1038 str = "certificate unobtainable";
1040 case TLS1_AD_UNRECOGNIZED_NAME:
1041 str = "unrecognized name";
1043 case TLS1_AD_BAD_CERTIFICATE_STATUS_RESPONSE:
1044 str = "bad certificate status response";
1046 case TLS1_AD_BAD_CERTIFICATE_HASH_VALUE:
1047 str = "bad certificate hash value";
1049 case TLS1_AD_UNKNOWN_PSK_IDENTITY:
1050 str = "unknown PSK identity";
1059 const char *SSL_rstate_string(const SSL *s)
1063 switch (s->rstate) {
1064 case SSL_ST_READ_HEADER:
1067 case SSL_ST_READ_BODY:
1070 case SSL_ST_READ_DONE: