standards-version: 3.8.4
[ckermit.git] / ck_ssl.h
1 /*
2   C K _ S S L . H --  OpenSSL Interface Header for C-Kermit
3
4   Copyright (C) 1985, 2004,
5     Trustees of Columbia University in the City of New York.
6     All rights reserved.  See the C-Kermit COPYING.TXT file or the
7     copyright text in the ckcmai.c module for disclaimer and permissions.
8
9     Author:  Jeffrey E Altman (jaltman@secure-endpoints.com)
10                Secure Endpoints Inc., New York City
11 */
12
13 #ifdef CK_SSL
14 #ifndef CK_ANSIC
15 #define NOPROTO
16 #endif /* CK_ANSIC */
17
18 #ifdef COMMENT                          /* Not for C-Kermit 7.1 */
19 #ifdef KRB5
20 #ifndef NOSSLK5
21 #ifndef SSL_KRB5
22 #define SSL_KRB5
23 #endif /* SSL_KRB5 */
24 #endif /* NOSSLK5 */
25 #endif /* KRB5 */
26 #endif /* COMMENT */
27
28 #ifdef OS2
29 #ifndef ZLIB
30 #define ZLIB
31 #endif /* ZLIB */
32 #endif /* OS2 */
33
34 #ifdef ZLIB
35 #include <openssl/comp.h>
36 #endif /* ZLIB */
37 /* We place the following to avoid loading openssl/mdc2.h since it 
38  * relies on the OpenSSL des.h.  Since we do not need the MDC2 
39  * definitions there is no reason to have it included by openssl/evp.h
40  */
41 #define OPENSSL_NO_MDC2
42 #include <openssl/des.h>
43 #include <openssl/ssl.h>
44 #include <openssl/x509v3.h>
45 #include <openssl/rand.h>
46 #include <openssl/x509_vfy.h>
47 #include <openssl/err.h>
48 #include <openssl/pem.h>
49 #include <openssl/bn.h>
50 #include <openssl/blowfish.h>
51 #include <openssl/dh.h>
52 #include <openssl/rc4.h>
53 #include <openssl/cast.h>
54 #include <openssl/dsa.h>
55 #include <openssl/rsa.h>
56 #include <openssl/md5.h>
57 #include <openssl/sha.h>
58 #include <openssl/evp.h>
59 #include <openssl/hmac.h>
60 #ifdef SSL_KRB5
61 #include <openssl/kssl.h>
62 #endif /* SSL_KRB5 */
63
64 extern BIO *bio_err;
65 extern SSL *ssl_con;
66 extern SSL_CTX *ssl_ctx;
67 extern int ssl_debug_flag;
68 extern int ssl_only_flag;
69 extern int ssl_active_flag;
70 extern int ssl_verify_flag;
71 extern int ssl_verbose_flag;
72 extern int ssl_certsok_flag;
73 extern int ssl_dummy_flag;
74 extern int ssl_verify_depth;
75
76 extern char *ssl_rsa_cert_file;
77 extern char *ssl_rsa_cert_chain_file;
78 extern char *ssl_rsa_key_file;
79 extern char *ssl_dsa_cert_file;
80 extern char *ssl_dsa_cert_chain_file;
81 extern char *ssl_dh_key_file;
82 extern char *ssl_cipher_list;
83 extern char *ssl_crl_file;
84 extern char *ssl_crl_dir;
85 extern char *ssl_verify_file;
86 extern char *ssl_verify_dir;
87 extern char *ssl_dh_param_file;
88 extern char *ssl_rnd_file;
89
90 extern SSL_CTX *tls_ctx;
91 extern SSL *tls_con;
92 extern int tls_only_flag;
93 extern int tls_active_flag;
94 extern int x509_cert_valid;
95 extern X509_STORE *crl_store;
96
97 #ifndef NOHTTP
98 extern SSL_CTX *tls_http_ctx;
99 extern SSL *tls_http_con;
100 extern int tls_http_active_flag;
101 #endif /* NOHTTP */
102
103 extern int ssl_initialized;
104
105 _PROTOTYP(VOID ssl_once_init,(void));
106 _PROTOTYP(int ssl_tn_init,(int));
107 _PROTOTYP(int ssl_http_init,(char *));
108 _PROTOTYP(int ck_ssl_http_client,(int,char *));
109 _PROTOTYP(int ssl_display_connect_details,(SSL *,int,int));
110 _PROTOTYP(int ssl_server_verify_callback,(int, X509_STORE_CTX *));
111 _PROTOTYP(int ssl_client_verify_callback,(int, X509_STORE_CTX *));
112 _PROTOTYP(int ssl_reply,(int, unsigned char *, int));
113 _PROTOTYP(int ssl_is,(unsigned char *, int));
114 _PROTOTYP(int ck_ssl_incoming,(int));
115 _PROTOTYP(int ck_ssl_outgoing,(int));
116 _PROTOTYP(int tls_is_user_valid,(SSL *, const char *));
117 _PROTOTYP(char * ssl_get_dnsName,(SSL *));
118 _PROTOTYP(char * ssl_get_commonName,(SSL *));
119 _PROTOTYP(char * ssl_get_issuer_name,(SSL *));
120 _PROTOTYP(char * ssl_get_subject_name,(SSL *));
121 _PROTOTYP(int ssl_get_client_finished,(char *, int));
122 _PROTOTYP(int ssl_get_server_finished,(char *, int));
123 _PROTOTYP(int ssl_passwd_callback,(char *, int, int, VOID *));
124 _PROTOTYP(VOID ssl_client_info_callback,(const SSL *,int, int));
125 _PROTOTYP(int ssl_anonymous_cipher,(SSL * ssl));
126 _PROTOTYP(int tls_load_certs,(SSL_CTX * ctx, SSL * con, int server));
127 _PROTOTYP(int ssl_verify_crl,(int, X509_STORE_CTX *));
128 _PROTOTYP(int tls_is_krb5,(int));
129 _PROTOTYP(int X509_userok,(X509 *,const char *));
130 _PROTOTYP(int ck_X509_save_cert_to_user_store,(X509 *));
131 #ifdef OS2
132 #include "ckosslc.h"
133 #include "ckossl.h"
134 #endif /* OS2 */
135
136 #define SSL_CLIENT 0
137 #define SSL_SERVER 1
138 #define SSL_HTTP   2
139
140 #define SSL_ERR_BFSZ 4096
141
142 #ifdef SSL_KRB5
143 #define DEFAULT_CIPHER_LIST "HIGH:MEDIUM:LOW:+KRB5:+ADH:+EXP"
144 #else
145 #define DEFAULT_CIPHER_LIST "HIGH:MEDIUM:LOW:+ADH:+EXP"
146 #endif /* SSL_KRB5 */
147 #endif /* CK_SSL */