summaryrefslogtreecommitdiff
path: root/src/lib/libssl/ssl_stat.c
diff options
context:
space:
mode:
authorryker <>1998-10-05 20:13:14 +0000
committerryker <>1998-10-05 20:13:14 +0000
commitaeeae06a79815dc190061534d47236cec09f9e32 (patch)
tree851692b9c2f9c04f077666855641900f19fdb217 /src/lib/libssl/ssl_stat.c
parenta4f79641824cbf9f60ca9d1168d1fcc46717a82a (diff)
downloadopenbsd-aeeae06a79815dc190061534d47236cec09f9e32.tar.gz
openbsd-aeeae06a79815dc190061534d47236cec09f9e32.tar.bz2
openbsd-aeeae06a79815dc190061534d47236cec09f9e32.zip
Import of SSLeay-0.9.0b with RSA and IDEA stubbed + OpenBSD build
functionality for shared libs. Note that routines such as sslv2_init and friends that use RSA will not work due to lack of RSA in this library. Needs documentation and help from ports for easy upgrade to full functionality where legally possible.
Diffstat (limited to 'src/lib/libssl/ssl_stat.c')
-rw-r--r--src/lib/libssl/ssl_stat.c458
1 files changed, 458 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..a1daf25dd4
--- /dev/null
+++ b/src/lib/libssl/ssl_stat.c
@@ -0,0 +1,458 @@
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#include <stdio.h>
60#include "ssl_locl.h"
61
62char *SSL_state_string_long(s)
63SSL *s;
64 {
65 char *str;
66
67 switch (s->state)
68 {
69case SSL_ST_BEFORE: str="before SSL initalisation"; break;
70case SSL_ST_ACCEPT: str="before accept initalisation"; break;
71case SSL_ST_CONNECT: str="before connect initalisation"; break;
72case SSL_ST_OK: str="SSL negotiation finished successfully"; break;
73case SSL_ST_RENEGOTIATE: str="SSL renegotiate ciphers"; break;
74case SSL_ST_BEFORE|SSL_ST_CONNECT: str="before/connect initalisation"; break;
75case SSL_ST_OK|SSL_ST_CONNECT: str="ok/connect SSL initalisation"; break;
76case SSL_ST_BEFORE|SSL_ST_ACCEPT: str="before/accept initalisation"; break;
77case SSL_ST_OK|SSL_ST_ACCEPT: str="ok/accept SSL initalisation"; break;
78#ifndef NO_SSL2
79case SSL2_ST_CLIENT_START_ENCRYPTION: str="SSLv2 client start encryption"; break;
80case SSL2_ST_SERVER_START_ENCRYPTION: str="SSLv2 server start encryption"; break;
81case SSL2_ST_SEND_CLIENT_HELLO_A: str="SSLv2 write client hello A"; break;
82case SSL2_ST_SEND_CLIENT_HELLO_B: str="SSLv2 write client hello B"; break;
83case SSL2_ST_GET_SERVER_HELLO_A: str="SSLv2 read server hello A"; break;
84case SSL2_ST_GET_SERVER_HELLO_B: str="SSLv2 read server hello B"; break;
85case SSL2_ST_SEND_CLIENT_MASTER_KEY_A: str="SSLv2 write client master key A"; break;
86case SSL2_ST_SEND_CLIENT_MASTER_KEY_B: str="SSLv2 write client master key B"; break;
87case SSL2_ST_SEND_CLIENT_FINISHED_A: str="SSLv2 write client finished A"; break;
88case SSL2_ST_SEND_CLIENT_FINISHED_B: str="SSLv2 write client finished B"; break;
89case SSL2_ST_SEND_CLIENT_CERTIFICATE_A: str="SSLv2 write client certificate A"; break;
90case SSL2_ST_SEND_CLIENT_CERTIFICATE_B: str="SSLv2 write client certificate B"; break;
91case SSL2_ST_SEND_CLIENT_CERTIFICATE_C: str="SSLv2 write client certificate C"; break;
92case SSL2_ST_SEND_CLIENT_CERTIFICATE_D: str="SSLv2 write client certificate D"; break;
93case SSL2_ST_GET_SERVER_VERIFY_A: str="SSLv2 read server verify A"; break;
94case SSL2_ST_GET_SERVER_VERIFY_B: str="SSLv2 read server verify B"; break;
95case SSL2_ST_GET_SERVER_FINISHED_A: str="SSLv2 read server finished A"; break;
96case SSL2_ST_GET_SERVER_FINISHED_B: str="SSLv2 read server finished B"; break;
97case SSL2_ST_GET_CLIENT_HELLO_A: str="SSLv2 read client hello A"; break;
98case SSL2_ST_GET_CLIENT_HELLO_B: str="SSLv2 read client hello B"; break;
99case SSL2_ST_GET_CLIENT_HELLO_C: str="SSLv2 read client hello C"; break;
100case SSL2_ST_SEND_SERVER_HELLO_A: str="SSLv2 write server hello A"; break;
101case SSL2_ST_SEND_SERVER_HELLO_B: str="SSLv2 write server hello B"; break;
102case SSL2_ST_GET_CLIENT_MASTER_KEY_A: str="SSLv2 read client master key A"; break;
103case SSL2_ST_GET_CLIENT_MASTER_KEY_B: str="SSLv2 read client master key B"; break;
104case SSL2_ST_SEND_SERVER_VERIFY_A: str="SSLv2 write server verify A"; break;
105case SSL2_ST_SEND_SERVER_VERIFY_B: str="SSLv2 write server verify B"; break;
106case SSL2_ST_SEND_SERVER_VERIFY_C: str="SSLv2 write server verify C"; break;
107case SSL2_ST_GET_CLIENT_FINISHED_A: str="SSLv2 read client finished A"; break;
108case SSL2_ST_GET_CLIENT_FINISHED_B: str="SSLv2 read client finished B"; break;
109case SSL2_ST_SEND_SERVER_FINISHED_A: str="SSLv2 write server finished A"; break;
110case SSL2_ST_SEND_SERVER_FINISHED_B: str="SSLv2 write server finished B"; break;
111case SSL2_ST_SEND_REQUEST_CERTIFICATE_A: str="SSLv2 write request certificate A"; break;
112case SSL2_ST_SEND_REQUEST_CERTIFICATE_B: str="SSLv2 write request certificate B"; break;
113case SSL2_ST_SEND_REQUEST_CERTIFICATE_C: str="SSLv2 write request certificate C"; break;
114case SSL2_ST_SEND_REQUEST_CERTIFICATE_D: str="SSLv2 write request certificate D"; break;
115case SSL2_ST_X509_GET_SERVER_CERTIFICATE: str="SSLv2 X509 read server certificate"; break;
116case SSL2_ST_X509_GET_CLIENT_CERTIFICATE: str="SSLv2 X509 read client certificate"; break;
117#endif
118
119#ifndef NO_SSL3
120/* SSLv3 additions */
121case SSL3_ST_CW_CLNT_HELLO_A: str="SSLv3 write client hello A"; break;
122case SSL3_ST_CW_CLNT_HELLO_B: str="SSLv3 write client hello B"; break;
123case SSL3_ST_CR_SRVR_HELLO_A: str="SSLv3 read server hello A"; break;
124case SSL3_ST_CR_SRVR_HELLO_B: str="SSLv3 read server hello B"; break;
125case SSL3_ST_CR_CERT_A: str="SSLv3 read server certificate A"; break;
126case SSL3_ST_CR_CERT_B: str="SSLv3 read server certificate B"; break;
127case SSL3_ST_CR_KEY_EXCH_A: str="SSLv3 read server key exchange A"; break;
128case SSL3_ST_CR_KEY_EXCH_B: str="SSLv3 read server key exchange B"; break;
129case SSL3_ST_CR_CERT_REQ_A: str="SSLv3 read server certificate request A"; break;
130case SSL3_ST_CR_CERT_REQ_B: str="SSLv3 read server certificate request B"; break;
131case SSL3_ST_CR_SRVR_DONE_A: str="SSLv3 read server done A"; break;
132case SSL3_ST_CR_SRVR_DONE_B: str="SSLv3 read server done B"; break;
133case SSL3_ST_CW_CERT_A: str="SSLv3 write client certificate A"; break;
134case SSL3_ST_CW_CERT_B: str="SSLv3 write client certificate B"; break;
135case SSL3_ST_CW_KEY_EXCH_A: str="SSLv3 write client key exchange A"; break;
136case SSL3_ST_CW_KEY_EXCH_B: str="SSLv3 write client key exchange B"; break;
137case SSL3_ST_CW_CERT_VRFY_A: str="SSLv3 write certificate verify A"; break;
138case SSL3_ST_CW_CERT_VRFY_B: str="SSLv3 write certificate verify A"; break;
139
140case SSL3_ST_CW_CHANGE_A:
141case SSL3_ST_SW_CHANGE_A: str="SSLv3 write change cipher spec A"; break;
142case SSL3_ST_CW_CHANGE_B:
143case SSL3_ST_SW_CHANGE_B: str="SSLv3 write change cipher spec B"; break;
144case SSL3_ST_CW_FINISHED_A:
145case SSL3_ST_SW_FINISHED_A: str="SSLv3 write finished A"; break;
146case SSL3_ST_CW_FINISHED_B:
147case SSL3_ST_SW_FINISHED_B: str="SSLv3 write finished A"; break;
148case SSL3_ST_CR_CHANGE_A:
149case SSL3_ST_SR_CHANGE_A: str="SSLv3 read change cipher spec A"; break;
150case SSL3_ST_CR_CHANGE_B:
151case SSL3_ST_SR_CHANGE_B: str="SSLv3 read change cipher spec B"; break;
152case SSL3_ST_CR_FINISHED_A:
153case SSL3_ST_SR_FINISHED_A: str="SSLv3 read finished A"; break;
154case SSL3_ST_CR_FINISHED_B:
155case SSL3_ST_SR_FINISHED_B: str="SSLv3 read finished B"; break;
156
157case SSL3_ST_CW_FLUSH:
158case SSL3_ST_SW_FLUSH: str="SSLv3 flush data"; break;
159
160case SSL3_ST_SR_CLNT_HELLO_A: str="SSLv3 read client hello A"; break;
161case SSL3_ST_SR_CLNT_HELLO_B: str="SSLv3 read client hello B"; break;
162case SSL3_ST_SR_CLNT_HELLO_C: str="SSLv3 read client hello C"; break;
163case SSL3_ST_SW_HELLO_REQ_A: str="SSLv3 write hello request A"; break;
164case SSL3_ST_SW_HELLO_REQ_B: str="SSLv3 write hello request B"; break;
165case SSL3_ST_SW_HELLO_REQ_C: str="SSLv3 write hello request C"; break;
166case SSL3_ST_SW_SRVR_HELLO_A: str="SSLv3 write server hello A"; break;
167case SSL3_ST_SW_SRVR_HELLO_B: str="SSLv3 write server hello B"; break;
168case SSL3_ST_SW_CERT_A: str="SSLv3 write certificate A"; break;
169case SSL3_ST_SW_CERT_B: str="SSLv3 write certificate B"; break;
170case SSL3_ST_SW_KEY_EXCH_A: str="SSLv3 write key exchange A"; break;
171case SSL3_ST_SW_KEY_EXCH_B: str="SSLv3 write key exchange B"; break;
172case SSL3_ST_SW_CERT_REQ_A: str="SSLv3 write certificate request A"; break;
173case SSL3_ST_SW_CERT_REQ_B: str="SSLv3 write certificate request B"; break;
174case SSL3_ST_SW_SRVR_DONE_A: str="SSLv3 write server done A"; break;
175case SSL3_ST_SW_SRVR_DONE_B: str="SSLv3 write server done B"; break;
176case SSL3_ST_SR_CERT_A: str="SSLv3 read client certificate A"; break;
177case SSL3_ST_SR_CERT_B: str="SSLv3 read client certificate B"; break;
178case SSL3_ST_SR_KEY_EXCH_A: str="SSLv3 read client key exchange A"; break;
179case SSL3_ST_SR_KEY_EXCH_B: str="SSLv3 read client key exchange B"; break;
180case SSL3_ST_SR_CERT_VRFY_A: str="SSLv3 read certificate verify A"; break;
181case SSL3_ST_SR_CERT_VRFY_B: str="SSLv3 read certificate verify B"; break;
182#endif
183
184#if !defined(NO_SSL2) && !defined(NO_SSL3)
185/* SSLv2/v3 compatablitity states */
186/* client */
187case SSL23_ST_CW_CLNT_HELLO_A: str="SSLv2/v3 write client hello A"; break;
188case SSL23_ST_CW_CLNT_HELLO_B: str="SSLv2/v3 write client hello B"; break;
189case SSL23_ST_CR_SRVR_HELLO_A: str="SSLv2/v3 read server hello A"; break;
190case SSL23_ST_CR_SRVR_HELLO_B: str="SSLv2/v3 read server hello B"; break;
191/* server */
192case SSL23_ST_SR_CLNT_HELLO_A: str="SSLv2/v3 read client hello A"; break;
193case SSL23_ST_SR_CLNT_HELLO_B: str="SSLv2/v3 read client hello B"; break;
194#endif
195
196default: str="unknown state"; break;
197 }
198 return(str);
199 }
200
201char *SSL_rstate_string_long(s)
202SSL *s;
203 {
204 char *str;
205
206 switch (s->rstate)
207 {
208 case SSL_ST_READ_HEADER: str="read header"; break;
209 case SSL_ST_READ_BODY: str="read body"; break;
210 case SSL_ST_READ_DONE: str="read done"; break;
211 default: str="unknown"; break;
212 }
213 return(str);
214 }
215
216char *SSL_state_string(s)
217SSL *s;
218 {
219 char *str;
220
221 switch (s->state)
222 {
223case SSL_ST_BEFORE: str="PINIT "; break;
224case SSL_ST_ACCEPT: str="AINIT "; break;
225case SSL_ST_CONNECT: str="CINIT "; break;
226case SSL_ST_OK: str="SSLOK "; break;
227#ifndef NO_SSL2
228case SSL2_ST_CLIENT_START_ENCRYPTION: str="2CSENC"; break;
229case SSL2_ST_SERVER_START_ENCRYPTION: str="2SSENC"; break;
230case SSL2_ST_SEND_CLIENT_HELLO_A: str="2SCH_A"; break;
231case SSL2_ST_SEND_CLIENT_HELLO_B: str="2SCH_B"; break;
232case SSL2_ST_GET_SERVER_HELLO_A: str="2GSH_A"; break;
233case SSL2_ST_GET_SERVER_HELLO_B: str="2GSH_B"; break;
234case SSL2_ST_SEND_CLIENT_MASTER_KEY_A: str="2SCMKA"; break;
235case SSL2_ST_SEND_CLIENT_MASTER_KEY_B: str="2SCMKB"; break;
236case SSL2_ST_SEND_CLIENT_FINISHED_A: str="2SCF_A"; break;
237case SSL2_ST_SEND_CLIENT_FINISHED_B: str="2SCF_B"; break;
238case SSL2_ST_SEND_CLIENT_CERTIFICATE_A: str="2SCC_A"; break;
239case SSL2_ST_SEND_CLIENT_CERTIFICATE_B: str="2SCC_B"; break;
240case SSL2_ST_SEND_CLIENT_CERTIFICATE_C: str="2SCC_C"; break;
241case SSL2_ST_SEND_CLIENT_CERTIFICATE_D: str="2SCC_D"; break;
242case SSL2_ST_GET_SERVER_VERIFY_A: str="2GSV_A"; break;
243case SSL2_ST_GET_SERVER_VERIFY_B: str="2GSV_B"; break;
244case SSL2_ST_GET_SERVER_FINISHED_A: str="2GSF_A"; break;
245case SSL2_ST_GET_SERVER_FINISHED_B: str="2GSF_B"; break;
246case SSL2_ST_GET_CLIENT_HELLO_A: str="2GCH_A"; break;
247case SSL2_ST_GET_CLIENT_HELLO_B: str="2GCH_B"; break;
248case SSL2_ST_GET_CLIENT_HELLO_C: str="2GCH_C"; break;
249case SSL2_ST_SEND_SERVER_HELLO_A: str="2SSH_A"; break;
250case SSL2_ST_SEND_SERVER_HELLO_B: str="2SSH_B"; break;
251case SSL2_ST_GET_CLIENT_MASTER_KEY_A: str="2GCMKA"; break;
252case SSL2_ST_GET_CLIENT_MASTER_KEY_B: str="2GCMKA"; break;
253case SSL2_ST_SEND_SERVER_VERIFY_A: str="2SSV_A"; break;
254case SSL2_ST_SEND_SERVER_VERIFY_B: str="2SSV_B"; break;
255case SSL2_ST_SEND_SERVER_VERIFY_C: str="2SSV_C"; break;
256case SSL2_ST_GET_CLIENT_FINISHED_A: str="2GCF_A"; break;
257case SSL2_ST_GET_CLIENT_FINISHED_B: str="2GCF_B"; break;
258case SSL2_ST_SEND_SERVER_FINISHED_A: str="2SSF_A"; break;
259case SSL2_ST_SEND_SERVER_FINISHED_B: str="2SSF_B"; break;
260case SSL2_ST_SEND_REQUEST_CERTIFICATE_A: str="2SRC_A"; break;
261case SSL2_ST_SEND_REQUEST_CERTIFICATE_B: str="2SRC_B"; break;
262case SSL2_ST_SEND_REQUEST_CERTIFICATE_C: str="2SRC_C"; break;
263case SSL2_ST_SEND_REQUEST_CERTIFICATE_D: str="2SRC_D"; break;
264case SSL2_ST_X509_GET_SERVER_CERTIFICATE: str="2X9GSC"; break;
265case SSL2_ST_X509_GET_CLIENT_CERTIFICATE: str="2X9GCC"; break;
266#endif
267
268#ifndef NO_SSL3
269/* SSLv3 additions */
270case SSL3_ST_SW_FLUSH:
271case SSL3_ST_CW_FLUSH: str="3FLUSH"; break;
272case SSL3_ST_CW_CLNT_HELLO_A: str="3WCH_A"; break;
273case SSL3_ST_CW_CLNT_HELLO_B: str="3WCH_B"; break;
274case SSL3_ST_CR_SRVR_HELLO_A: str="3RSH_A"; break;
275case SSL3_ST_CR_SRVR_HELLO_B: str="3RSH_B"; break;
276case SSL3_ST_CR_CERT_A: str="3RSC_A"; break;
277case SSL3_ST_CR_CERT_B: str="3RSC_B"; break;
278case SSL3_ST_CR_KEY_EXCH_A: str="3RSKEA"; break;
279case SSL3_ST_CR_KEY_EXCH_B: str="3RSKEB"; break;
280case SSL3_ST_CR_CERT_REQ_A: str="3RCR_A"; break;
281case SSL3_ST_CR_CERT_REQ_B: str="3RCR_B"; break;
282case SSL3_ST_CR_SRVR_DONE_A: str="3RSD_A"; break;
283case SSL3_ST_CR_SRVR_DONE_B: str="3RSD_B"; break;
284case SSL3_ST_CW_CERT_A: str="3WCC_A"; break;
285case SSL3_ST_CW_CERT_B: str="3WCC_B"; break;
286case SSL3_ST_CW_KEY_EXCH_A: str="3WCKEA"; break;
287case SSL3_ST_CW_KEY_EXCH_B: str="3WCKEB"; break;
288case SSL3_ST_CW_CERT_VRFY_A: str="3WCV_A"; break;
289case SSL3_ST_CW_CERT_VRFY_B: str="3WCV_B"; break;
290
291case SSL3_ST_SW_CHANGE_A:
292case SSL3_ST_CW_CHANGE_A: str="3WCCSA"; break;
293case SSL3_ST_SW_CHANGE_B:
294case SSL3_ST_CW_CHANGE_B: str="3WCCSB"; break;
295case SSL3_ST_SW_FINISHED_A:
296case SSL3_ST_CW_FINISHED_A: str="3WFINA"; break;
297case SSL3_ST_SW_FINISHED_B:
298case SSL3_ST_CW_FINISHED_B: str="3WFINB"; break;
299case SSL3_ST_SR_CHANGE_A:
300case SSL3_ST_CR_CHANGE_A: str="3RCCSA"; break;
301case SSL3_ST_SR_CHANGE_B:
302case SSL3_ST_CR_CHANGE_B: str="3RCCSB"; break;
303case SSL3_ST_SR_FINISHED_A:
304case SSL3_ST_CR_FINISHED_A: str="3RFINA"; break;
305case SSL3_ST_SR_FINISHED_B:
306case SSL3_ST_CR_FINISHED_B: str="3RFINB"; break;
307
308case SSL3_ST_SW_HELLO_REQ_A: str="3WHR_A"; break;
309case SSL3_ST_SW_HELLO_REQ_B: str="3WHR_B"; break;
310case SSL3_ST_SW_HELLO_REQ_C: str="3WHR_C"; break;
311case SSL3_ST_SR_CLNT_HELLO_A: str="3RCH_A"; break;
312case SSL3_ST_SR_CLNT_HELLO_B: str="3RCH_B"; break;
313case SSL3_ST_SR_CLNT_HELLO_C: str="3RCH_C"; break;
314case SSL3_ST_SW_SRVR_HELLO_A: str="3WSH_A"; break;
315case SSL3_ST_SW_SRVR_HELLO_B: str="3WSH_B"; break;
316case SSL3_ST_SW_CERT_A: str="3WSC_A"; break;
317case SSL3_ST_SW_CERT_B: str="3WSC_B"; break;
318case SSL3_ST_SW_KEY_EXCH_A: str="3WSKEA"; break;
319case SSL3_ST_SW_KEY_EXCH_B: str="3WSKEB"; break;
320case SSL3_ST_SW_CERT_REQ_A: str="3WCR_A"; break;
321case SSL3_ST_SW_CERT_REQ_B: str="3WCR_B"; break;
322case SSL3_ST_SW_SRVR_DONE_A: str="3WSD_A"; break;
323case SSL3_ST_SW_SRVR_DONE_B: str="3WSD_B"; break;
324case SSL3_ST_SR_CERT_A: str="3RCC_A"; break;
325case SSL3_ST_SR_CERT_B: str="3RCC_B"; break;
326case SSL3_ST_SR_KEY_EXCH_A: str="3RCKEA"; break;
327case SSL3_ST_SR_KEY_EXCH_B: str="3RCKEB"; break;
328case SSL3_ST_SR_CERT_VRFY_A: str="3RCV_A"; break;
329case SSL3_ST_SR_CERT_VRFY_B: str="3RCV_B"; break;
330#endif
331
332#if !defined(NO_SSL2) && !defined(NO_SSL3)
333/* SSLv2/v3 compatablitity states */
334/* client */
335case SSL23_ST_CW_CLNT_HELLO_A: str="23WCHA"; break;
336case SSL23_ST_CW_CLNT_HELLO_B: str="23WCHB"; break;
337case SSL23_ST_CR_SRVR_HELLO_A: str="23RSHA"; break;
338case SSL23_ST_CR_SRVR_HELLO_B: str="23RSHA"; break;
339/* server */
340case SSL23_ST_SR_CLNT_HELLO_A: str="23RCHA"; break;
341case SSL23_ST_SR_CLNT_HELLO_B: str="23RCHB"; break;
342#endif
343
344default: str="UNKWN "; break;
345 }
346 return(str);
347 }
348
349char *SSL_alert_type_string_long(value)
350int value;
351 {
352 value>>=8;
353 if (value == SSL3_AL_WARNING)
354 return("warning");
355 else if (value == SSL3_AL_FATAL)
356 return("fatal");
357 else
358 return("unknown");
359 }
360
361char *SSL_alert_type_string(value)
362int value;
363 {
364 value>>=8;
365 if (value == SSL3_AL_WARNING)
366 return("W");
367 else if (value == SSL3_AL_FATAL)
368 return("F");
369 else
370 return("U");
371 }
372
373char *SSL_alert_desc_string(value)
374int value;
375 {
376 char *str;
377
378 switch (value & 0xff)
379 {
380 case SSL3_AD_CLOSE_NOTIFY: str="CN"; break;
381 case SSL3_AD_UNEXPECTED_MESSAGE: str="UM"; break;
382 case SSL3_AD_BAD_RECORD_MAC: str="BM"; break;
383 case SSL3_AD_DECOMPRESSION_FAILURE: str="DF"; break;
384 case SSL3_AD_HANDSHAKE_FAILURE: str="HF"; break;
385 case SSL3_AD_NO_CERTIFICATE: str="NC"; break;
386 case SSL3_AD_BAD_CERTIFICATE: str="BC"; break;
387 case SSL3_AD_UNSUPPORTED_CERTIFICATE: str="UC"; break;
388 case SSL3_AD_CERTIFICATE_REVOKED: str="CR"; break;
389 case SSL3_AD_CERTIFICATE_EXPIRED: str="CE"; break;
390 case SSL3_AD_CERTIFICATE_UNKNOWN: str="CU"; break;
391 case SSL3_AD_ILLEGAL_PARAMETER: str="IP"; break;
392 default: str="UK"; break;
393 }
394 return(str);
395 }
396
397char *SSL_alert_desc_string_long(value)
398int value;
399 {
400 char *str;
401
402 switch (value & 0xff)
403 {
404 case SSL3_AD_CLOSE_NOTIFY:
405 str="close notify";
406 break;
407 case SSL3_AD_UNEXPECTED_MESSAGE:
408 str="unexected_message";
409 break;
410 case SSL3_AD_BAD_RECORD_MAC:
411 str="bad record mac";
412 break;
413 case SSL3_AD_DECOMPRESSION_FAILURE:
414 str="decompression failure";
415 break;
416 case SSL3_AD_HANDSHAKE_FAILURE:
417 str="handshake failure";
418 break;
419 case SSL3_AD_NO_CERTIFICATE:
420 str="no certificate";
421 break;
422 case SSL3_AD_BAD_CERTIFICATE:
423 str="bad certificate";
424 break;
425 case SSL3_AD_UNSUPPORTED_CERTIFICATE:
426 str="unsupported certificate";
427 break;
428 case SSL3_AD_CERTIFICATE_REVOKED:
429 str="certificate revoked";
430 break;
431 case SSL3_AD_CERTIFICATE_EXPIRED:
432 str="certificate expired";
433 break;
434 case SSL3_AD_CERTIFICATE_UNKNOWN:
435 str="certifcate unknown";
436 break;
437 case SSL3_AD_ILLEGAL_PARAMETER:
438 str="illegal parameter";
439 break;
440 default: str="unknown"; break;
441 }
442 return(str);
443 }
444
445char *SSL_rstate_string(s)
446SSL *s;
447 {
448 char *str;
449
450 switch (s->rstate)
451 {
452 case SSL_ST_READ_HEADER:str="RH"; break;
453 case SSL_ST_READ_BODY: str="RB"; break;
454 case SSL_ST_READ_DONE: str="RD"; break;
455 default: str="unknown"; break;
456 }
457 return(str);
458 }