2 /* Copyright Gerhard Rieger 2001-2007 */
3 /* Published under the GNU General Public License V.2, see file COPYING */
5 /* explicit system call and C library trace function, for those who miss strace
9 #include "xioconfig.h" /* what features are enabled */
11 #if WITH_SYCLS && WITH_OPENSSL
13 #include "sysincludes.h"
24 void sycSSL_load_error_strings(void) {
25 Debug("SSL_load_error_strings()");
26 SSL_load_error_strings();
27 Debug("SSL_load_error_strings() ->");
30 int sycSSL_library_init(void) {
32 Debug("SSL_library_init()");
33 result
= SSL_library_init();
34 Debug1("SSL_library_init() -> %d", result
);
38 SSL_METHOD
*sycSSLv2_client_method(void) {
40 Debug("SSLv2_client_method()");
41 result
= SSLv2_client_method();
42 Debug1("SSLv2_client_method() -> %p", result
);
46 SSL_METHOD
*sycSSLv2_server_method(void) {
48 Debug("SSLv2_server_method()");
49 result
= SSLv2_server_method();
50 Debug1("SSLv2_server_method() -> %p", result
);
54 SSL_METHOD
*sycSSLv3_client_method(void) {
56 Debug("SSLv3_client_method()");
57 result
= SSLv3_client_method();
58 Debug1("SSLv3_client_method() -> %p", result
);
62 SSL_METHOD
*sycSSLv3_server_method(void) {
64 Debug("SSLv3_server_method()");
65 result
= SSLv3_server_method();
66 Debug1("SSLv3_server_method() -> %p", result
);
70 SSL_METHOD
*sycSSLv23_client_method(void) {
72 Debug("SSLv23_client_method()");
73 result
= SSLv23_client_method();
74 Debug1("SSLv23_client_method() -> %p", result
);
78 SSL_METHOD
*sycSSLv23_server_method(void) {
80 Debug("SSLv23_server_method()");
81 result
= SSLv23_server_method();
82 Debug1("SSLv23_server_method() -> %p", result
);
86 SSL_METHOD
*sycTLSv1_client_method(void) {
88 Debug("TLSv1_client_method()");
89 result
= TLSv1_client_method();
90 Debug1("TLSv1_client_method() -> %p", result
);
94 SSL_METHOD
*sycTLSv1_server_method(void) {
96 Debug("TLSv1_server_method()");
97 result
= TLSv1_server_method();
98 Debug1("TLSv1_server_method() -> %p", result
);
102 SSL_CTX
*sycSSL_CTX_new(SSL_METHOD
*method
) {
104 Debug1("SSL_CTX_new(%p)", method
);
105 result
= SSL_CTX_new(method
);
106 Debug1("SSL_CTX_new() -> %p", result
);
110 SSL
*sycSSL_new(SSL_CTX
*ctx
) {
112 Debug1("SSL_new(%p)", ctx
);
113 result
= SSL_new(ctx
);
114 Debug1("SSL_new() -> %p", result
);
118 int sycSSL_CTX_load_verify_locations(SSL_CTX
*ctx
, const char *CAfile
,
119 const char *CApath
) {
121 Debug7("SSL_CTX_load_verify_locations(%p, %s%s%s, %s%s%s)", ctx
,
122 CAfile
?"\"":"", CAfile
?CAfile
:NULL
, CAfile
?"\"":"",
123 CApath
?"\"":"", CApath
?CApath
:NULL
, CApath
?"\"":"");
124 result
= SSL_CTX_load_verify_locations(ctx
, CAfile
, CApath
);
125 Debug1("SSL_CTX_load_verify_locations() -> %d", result
);
129 int sycSSL_CTX_use_certificate_file(SSL_CTX
*ctx
, const char *file
, int type
) {
131 Debug3("SSL_CTX_use_certificate_file(%p, \"%s\", %d)", ctx
, file
, type
);
132 result
= SSL_CTX_use_certificate_file(ctx
, file
, type
);
133 Debug1("SSL_CTX_use_certificate_file() -> %d", result
);
137 int sycSSL_CTX_use_certificate_chain_file(SSL_CTX
*ctx
, const char *file
) {
139 Debug2("SSL_CTX_use_certificate_chain_file(%p, \"%s\")", ctx
, file
);
140 result
= SSL_CTX_use_certificate_chain_file(ctx
, file
);
141 Debug1("SSL_CTX_use_certificate_chain_file() -> %d", result
);
145 int sycSSL_CTX_use_PrivateKey_file(SSL_CTX
*ctx
, const char *file
, int type
) {
147 Debug3("SSL_CTX_use_PrivateKey_file(%p, \"%s\", %d)", ctx
, file
, type
);
148 result
= SSL_CTX_use_PrivateKey_file(ctx
, file
, type
);
149 Debug1("SSL_CTX_use_PrivateKey_file() -> %d", result
);
153 void sycSSL_CTX_set_verify(SSL_CTX
*ctx
, int mode
,
154 int (*verify_callback
)(int, X509_STORE_CTX
*)) {
155 Debug3("SSL_CTX_set_verify(%p, %u, %p)", ctx
, mode
, verify_callback
);
156 SSL_CTX_set_verify(ctx
, mode
, verify_callback
);
157 Debug("SSL_CTX_set_verify() -> ");
160 int sycSSL_CTX_set_cipher_list(SSL_CTX
*ctx
, const char *str
) {
162 Debug2("SSL_CTX_set_cipher_list(%p, \"%s\")", ctx
, str
);
163 result
= SSL_CTX_set_cipher_list(ctx
, str
);
164 Debug1("SSL_CTX_set_cipher_list() -> %d", result
);
168 int sycSSL_CTX_set_tmp_dh(SSL_CTX
*ctx
, DH
*dh
) {
170 Debug2("SSL_CTX_set_tmp_dh(%p, %p)", ctx
, dh
);
171 result
= SSL_CTX_set_tmp_dh(ctx
, dh
);
172 Debug1("SSL_CTX_set_tmp_dh() -> %d", result
);
176 int sycSSL_set_cipher_list(SSL
*ssl
, const char *str
) {
178 Debug2("SSL_set_cipher_list(%p, \"%s\")", ssl
, str
);
179 result
= SSL_set_cipher_list(ssl
, str
);
180 Debug1("SSL_set_cipher_list() -> %d", result
);
184 long sycSSL_get_verify_result(SSL
*ssl
) {
186 Debug1("SSL_get_verify_result(%p)", ssl
);
187 result
= SSL_get_verify_result(ssl
);
188 Debug1("SSL_get_verify_result() -> %lx", result
);
192 int sycSSL_set_fd(SSL
*ssl
, int fd
) {
194 Debug2("SSL_set_fd(%p, %d)", ssl
, fd
);
195 result
= SSL_set_fd(ssl
, fd
);
196 Debug1("SSL_set_fd() -> %d", result
);
200 int sycSSL_connect(SSL
*ssl
) {
202 Debug1("SSL_connect(%p)", ssl
);
203 result
= SSL_connect(ssl
);
204 Debug1("SSL_connect() -> %d", result
);
208 int sycSSL_accept(SSL
*ssl
) {
210 Debug1("SSL_accept(%p)", ssl
);
211 result
= SSL_accept(ssl
);
212 Debug1("SSL_accept() -> %d", result
);
216 int sycSSL_read(SSL
*ssl
, void *buf
, int num
) {
218 Debug3("SSL_read(%p, %p, %d)", ssl
, buf
, num
);
219 result
= SSL_read(ssl
, buf
, num
);
220 Debug1("SSL_read() -> %d", result
);
224 int sycSSL_pending(SSL
*ssl
) {
226 Debug1("SSL_pending(%p)", ssl
);
227 result
= SSL_pending(ssl
);
228 Debug1("SSL_pending() -> %d", result
);
232 int sycSSL_write(SSL
*ssl
, const void *buf
, int num
) {
234 Debug3("SSL_write(%p, %p, %d)", ssl
, buf
, num
);
235 result
= SSL_write(ssl
, buf
, num
);
236 Debug1("SSL_write() -> %d", result
);
240 X509
*sycSSL_get_peer_certificate(SSL
*ssl
) {
242 Debug1("SSL_get_peer_certificate(%p)", ssl
);
243 result
= SSL_get_peer_certificate(ssl
);
245 Debug1("SSL_get_peer_certificate() -> %p", result
);
247 Debug("SSL_get_peer_certificate() -> NULL");
252 int sycSSL_shutdown(SSL
*ssl
) {
254 Debug1("SSL_shutdown(%p)", ssl
);
255 result
= SSL_shutdown(ssl
);
256 Debug1("SSL_shutdown() -> %d", result
);
260 void sycSSL_CTX_free(SSL_CTX
*ctx
) {
261 Debug1("SSL_CTX_free(%p)", ctx
);
263 Debug("SSL_CTX_free() -> void");
267 void sycSSL_free(SSL
*ssl
) {
268 Debug1("SSL_free(%p)", ssl
);
270 Debug("SSL_free() -> void");
274 int sycRAND_egd(const char *path
) {
276 Debug1("RAND_egd(\"%s\")", path
);
277 result
= RAND_egd(path
);
278 Debug1("RAND_egd() -> %d", result
);
282 DH
*sycPEM_read_bio_DHparams(BIO
*bp
, DH
**x
, pem_password_cb
*cb
, void *u
) {
284 Debug4("PEM_read_bio_DHparams(%p, %p, %p, %p)",
286 result
= PEM_read_bio_DHparams(bp
, x
, cb
, u
);
288 /*Debug2("PEM_read_bio_DHparams(, {%p},,) -> %p", *x, result);*/
289 Debug1("PEM_read_bio_DHparams() -> %p", result
);
291 Debug("PEM_read_bio_DHparams() -> NULL");
296 BIO
*sycBIO_new_file(const char *filename
, const char *mode
) {
298 Debug2("BIO_new_file(\"%s\", \"%s\")", filename
, mode
);
299 result
= BIO_new_file(filename
, mode
);
301 Debug1("BIO_new_file() -> %p", result
);
303 Debug("BIO_new_file() -> NULL");
309 int sycFIPS_mode_set(int onoff
) {
311 Debug1("FIPS_mode_set(%d)", onoff
);
312 result
= FIPS_mode_set(onoff
);
313 Debug1("FIPS_mode_set() -> %d", result
);
316 #endif /* WITH_FIPS */
318 #endif /* WITH_SYCLS && WITH_OPENSSL */