Lines Matching refs:ssl
0 /* ssl/bio_ssl.c */
5 * This package is an SSL implementation written
7 * The implementation was written so as to conform with Netscapes SSL.
12 * lhash, DES, etc., code; not just the SSL code. The SSL documentation
66 #include <openssl/ssl.h>
77 SSL *ssl; /* The ssl handle :-) */
88 BIO_TYPE_SSL,"ssl",
127 if (bs->ssl != NULL) SSL_shutdown(bs->ssl);
130 if (a->init && (bs->ssl != NULL))
131 SSL_free(bs->ssl);
144 SSL *ssl;
150 ssl=sb->ssl;
155 if (!SSL_is_init_finished(ssl))
157 /* ret=SSL_do_handshake(ssl); */
168 ret=SSL_read(ssl,out,outl);
170 switch (SSL_get_error(ssl,ret))
181 SSL_renegotiate(ssl);
194 SSL_renegotiate(ssl);
232 SSL *ssl;
237 ssl=bs->ssl;
241 /* ret=SSL_do_handshake(ssl);
243 ret=SSL_write(ssl,out,outl);
245 switch (SSL_get_error(ssl,ret))
256 SSL_renegotiate(ssl);
269 SSL_renegotiate(ssl);
298 SSL **sslp,*ssl;
304 ssl=bs->ssl;
305 if ((ssl == NULL) && (cmd != BIO_C_SET_SSL))
310 SSL_shutdown(ssl);
312 if (ssl->handshake_func == ssl->method->ssl_connect)
313 SSL_set_connect_state(ssl);
314 else if (ssl->handshake_func == ssl->method->ssl_accept)
315 SSL_set_accept_state(ssl);
317 SSL_clear(ssl);
321 else if (ssl->rbio != NULL)
322 ret=BIO_ctrl(ssl->rbio,cmd,num,ptr);
331 SSL_set_connect_state(ssl);
333 SSL_set_accept_state(ssl);
350 if (ssl != NULL)
353 ssl=(SSL *)ptr;
354 ((BIO_SSL *)b->ptr)->ssl=ssl;
355 bio=SSL_get_rbio(ssl);
368 sslp=(SSL **)ptr;
369 *sslp=ssl;
381 ret=BIO_ctrl(ssl->wbio,cmd,num,ptr);
384 ret=SSL_pending(ssl);
386 ret=BIO_pending(ssl->rbio);
390 ret=BIO_ctrl(ssl->wbio,cmd,num,ptr);
394 if ((b->next_bio != NULL) && (b->next_bio != ssl->rbio))
396 SSL_set_bio(ssl,b->next_bio,b->next_bio);
407 if (ssl->rbio != ssl->wbio)
408 BIO_free_all(ssl->wbio);
411 ssl->wbio=NULL;
412 ssl->rbio=NULL;
419 ret=(int)SSL_do_handshake(ssl);
421 switch (SSL_get_error(ssl,(int)ret))
442 if (((BIO_SSL *)dbio->ptr)->ssl != NULL)
443 SSL_free(((BIO_SSL *)dbio->ptr)->ssl);
444 ((BIO_SSL *)dbio->ptr)->ssl=SSL_dup(ssl);
453 ret=(((BIO_SSL *)dbio->ptr)->ssl != NULL);
456 ret=BIO_ctrl(ssl->rbio,cmd,num,ptr);
470 void (**fptr)(const SSL *xssl,int type,int val);
472 fptr=(void (**)(const SSL *xssl,int type,int val))ptr;
473 *fptr=SSL_get_info_callback(ssl);
477 ret=BIO_ctrl(ssl->rbio,cmd,num,ptr);
485 SSL *ssl;
490 ssl=bs->ssl;
497 SSL_set_info_callback(ssl,(void (*)(const SSL *,int,int))fp);
501 ret=BIO_callback_ctrl(ssl->rbio,cmd,fp);
519 BIO *ret=NULL,*buf=NULL,*ssl=NULL;
523 if ((ssl=BIO_new_ssl_connect(ctx)) == NULL)
525 if ((ret=BIO_push(buf,ssl)) == NULL)
530 if (ssl != NULL) BIO_free(ssl);
537 BIO *ret=NULL,*con=NULL,*ssl=NULL;
541 if ((ssl=BIO_new_ssl(ctx,1)) == NULL)
543 if ((ret=BIO_push(ssl,con)) == NULL)
554 SSL *ssl;
558 if ((ssl=SSL_new(ctx)) == NULL)
564 SSL_set_connect_state(ssl);
566 SSL_set_accept_state(ssl);
568 BIO_set_ssl(ret,ssl,BIO_CLOSE);
578 if ( (((BIO_SSL *)t->ptr)->ssl == NULL) ||
579 (((BIO_SSL *)f->ptr)->ssl == NULL))
581 SSL_copy_session_id(((BIO_SSL *)t->ptr)->ssl,((BIO_SSL *)f->ptr)->ssl);
587 SSL *s;
593 s=((BIO_SSL *)b->ptr)->ssl;