summaryrefslogtreecommitdiff
path: root/src/lib/libssl/bio_ssl.c
diff options
context:
space:
mode:
authorbeck <>1999-09-29 04:37:45 +0000
committerbeck <>1999-09-29 04:37:45 +0000
commitde8f24ea083384bb66b32ec105dc4743c5663cdf (patch)
tree1412176ae62a3cab2cf2b0b92150fcbceaac6092 /src/lib/libssl/bio_ssl.c
parentcb929d29896bcb87c2a97417fbd03e50078fc178 (diff)
downloadopenbsd-de8f24ea083384bb66b32ec105dc4743c5663cdf.tar.gz
openbsd-de8f24ea083384bb66b32ec105dc4743c5663cdf.tar.bz2
openbsd-de8f24ea083384bb66b32ec105dc4743c5663cdf.zip
OpenSSL 0.9.4 merge
Diffstat (limited to 'src/lib/libssl/bio_ssl.c')
-rw-r--r--src/lib/libssl/bio_ssl.c62
1 files changed, 16 insertions, 46 deletions
diff --git a/src/lib/libssl/bio_ssl.c b/src/lib/libssl/bio_ssl.c
index 58a6d69b9b..f62cde4e5d 100644
--- a/src/lib/libssl/bio_ssl.c
+++ b/src/lib/libssl/bio_ssl.c
@@ -60,27 +60,17 @@
60#include <stdlib.h> 60#include <stdlib.h>
61#include <string.h> 61#include <string.h>
62#include <errno.h> 62#include <errno.h>
63#include "crypto.h" 63#include <openssl/crypto.h>
64#include "bio.h" 64#include <openssl/bio.h>
65#include "err.h" 65#include <openssl/err.h>
66#include "ssl.h" 66#include <openssl/ssl.h>
67 67
68#ifndef NOPROTO
69static int ssl_write(BIO *h,char *buf,int num); 68static int ssl_write(BIO *h,char *buf,int num);
70static int ssl_read(BIO *h,char *buf,int size); 69static int ssl_read(BIO *h,char *buf,int size);
71static int ssl_puts(BIO *h,char *str); 70static int ssl_puts(BIO *h,char *str);
72static long ssl_ctrl(BIO *h,int cmd,long arg1,char *arg2); 71static long ssl_ctrl(BIO *h,int cmd,long arg1,char *arg2);
73static int ssl_new(BIO *h); 72static int ssl_new(BIO *h);
74static int ssl_free(BIO *data); 73static int ssl_free(BIO *data);
75#else
76static int ssl_write();
77static int ssl_read();
78static int ssl_puts();
79static long ssl_ctrl();
80static int ssl_new();
81static int ssl_free();
82#endif
83
84typedef struct bio_ssl_st 74typedef struct bio_ssl_st
85 { 75 {
86 SSL *ssl; /* The ssl handle :-) */ 76 SSL *ssl; /* The ssl handle :-) */
@@ -104,13 +94,12 @@ static BIO_METHOD methods_sslp=
104 ssl_free, 94 ssl_free,
105 }; 95 };
106 96
107BIO_METHOD *BIO_f_ssl() 97BIO_METHOD *BIO_f_ssl(void)
108 { 98 {
109 return(&methods_sslp); 99 return(&methods_sslp);
110 } 100 }
111 101
112static int ssl_new(bi) 102static int ssl_new(BIO *bi)
113BIO *bi;
114 { 103 {
115 BIO_SSL *bs; 104 BIO_SSL *bs;
116 105
@@ -127,8 +116,7 @@ BIO *bi;
127 return(1); 116 return(1);
128 } 117 }
129 118
130static int ssl_free(a) 119static int ssl_free(BIO *a)
131BIO *a;
132 { 120 {
133 BIO_SSL *bs; 121 BIO_SSL *bs;
134 122
@@ -147,10 +135,7 @@ BIO *a;
147 return(1); 135 return(1);
148 } 136 }
149 137
150static int ssl_read(b,out,outl) 138static int ssl_read(BIO *b, char *out, int outl)
151BIO *b;
152char *out;
153int outl;
154 { 139 {
155 int ret=1; 140 int ret=1;
156 BIO_SSL *sb; 141 BIO_SSL *sb;
@@ -234,10 +219,7 @@ int outl;
234 return(ret); 219 return(ret);
235 } 220 }
236 221
237static int ssl_write(b,out,outl) 222static int ssl_write(BIO *b, char *out, int outl)
238BIO *b;
239char *out;
240int outl;
241 { 223 {
242 int ret,r=0; 224 int ret,r=0;
243 int retry_reason=0; 225 int retry_reason=0;
@@ -305,11 +287,7 @@ int outl;
305 return(ret); 287 return(ret);
306 } 288 }
307 289
308static long ssl_ctrl(b,cmd,num,ptr) 290static long ssl_ctrl(BIO *b, int cmd, long num, char *ptr)
309BIO *b;
310int cmd;
311long num;
312char *ptr;
313 { 291 {
314 SSL **sslp,*ssl; 292 SSL **sslp,*ssl;
315 BIO_SSL *bs; 293 BIO_SSL *bs;
@@ -483,9 +461,7 @@ char *ptr;
483 return(ret); 461 return(ret);
484 } 462 }
485 463
486static int ssl_puts(bp,str) 464static int ssl_puts(BIO *bp, char *str)
487BIO *bp;
488char *str;
489 { 465 {
490 int n,ret; 466 int n,ret;
491 467
@@ -494,8 +470,7 @@ char *str;
494 return(ret); 470 return(ret);
495 } 471 }
496 472
497BIO *BIO_new_buffer_ssl_connect(ctx) 473BIO *BIO_new_buffer_ssl_connect(SSL_CTX *ctx)
498SSL_CTX *ctx;
499 { 474 {
500 BIO *ret=NULL,*buf=NULL,*ssl=NULL; 475 BIO *ret=NULL,*buf=NULL,*ssl=NULL;
501 476
@@ -512,8 +487,7 @@ err:
512 return(NULL); 487 return(NULL);
513 } 488 }
514 489
515BIO *BIO_new_ssl_connect(ctx) 490BIO *BIO_new_ssl_connect(SSL_CTX *ctx)
516SSL_CTX *ctx;
517 { 491 {
518 BIO *ret=NULL,*con=NULL,*ssl=NULL; 492 BIO *ret=NULL,*con=NULL,*ssl=NULL;
519 493
@@ -530,9 +504,7 @@ err:
530 return(NULL); 504 return(NULL);
531 } 505 }
532 506
533BIO *BIO_new_ssl(ctx,client) 507BIO *BIO_new_ssl(SSL_CTX *ctx, int client)
534SSL_CTX *ctx;
535int client;
536 { 508 {
537 BIO *ret; 509 BIO *ret;
538 SSL *ssl; 510 SSL *ssl;
@@ -553,8 +525,7 @@ int client;
553 return(ret); 525 return(ret);
554 } 526 }
555 527
556int BIO_ssl_copy_session_id(t,f) 528int BIO_ssl_copy_session_id(BIO *t, BIO *f)
557BIO *t,*f;
558 { 529 {
559 t=BIO_find_type(t,BIO_TYPE_SSL); 530 t=BIO_find_type(t,BIO_TYPE_SSL);
560 f=BIO_find_type(f,BIO_TYPE_SSL); 531 f=BIO_find_type(f,BIO_TYPE_SSL);
@@ -567,8 +538,7 @@ BIO *t,*f;
567 return(1); 538 return(1);
568 } 539 }
569 540
570void BIO_ssl_shutdown(b) 541void BIO_ssl_shutdown(BIO *b)
571BIO *b;
572 { 542 {
573 SSL *s; 543 SSL *s;
574 544