diff options
| author | beck <> | 1999-09-29 04:37:45 +0000 |
|---|---|---|
| committer | beck <> | 1999-09-29 04:37:45 +0000 |
| commit | de8f24ea083384bb66b32ec105dc4743c5663cdf (patch) | |
| tree | 1412176ae62a3cab2cf2b0b92150fcbceaac6092 /src/lib/libssl/bio_ssl.c | |
| parent | cb929d29896bcb87c2a97417fbd03e50078fc178 (diff) | |
| download | openbsd-de8f24ea083384bb66b32ec105dc4743c5663cdf.tar.gz openbsd-de8f24ea083384bb66b32ec105dc4743c5663cdf.tar.bz2 openbsd-de8f24ea083384bb66b32ec105dc4743c5663cdf.zip | |
OpenSSL 0.9.4 merge
Diffstat (limited to '')
| -rw-r--r-- | src/lib/libssl/bio_ssl.c | 62 |
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 | ||
| 69 | static int ssl_write(BIO *h,char *buf,int num); | 68 | static int ssl_write(BIO *h,char *buf,int num); |
| 70 | static int ssl_read(BIO *h,char *buf,int size); | 69 | static int ssl_read(BIO *h,char *buf,int size); |
| 71 | static int ssl_puts(BIO *h,char *str); | 70 | static int ssl_puts(BIO *h,char *str); |
| 72 | static long ssl_ctrl(BIO *h,int cmd,long arg1,char *arg2); | 71 | static long ssl_ctrl(BIO *h,int cmd,long arg1,char *arg2); |
| 73 | static int ssl_new(BIO *h); | 72 | static int ssl_new(BIO *h); |
| 74 | static int ssl_free(BIO *data); | 73 | static int ssl_free(BIO *data); |
| 75 | #else | ||
| 76 | static int ssl_write(); | ||
| 77 | static int ssl_read(); | ||
| 78 | static int ssl_puts(); | ||
| 79 | static long ssl_ctrl(); | ||
| 80 | static int ssl_new(); | ||
| 81 | static int ssl_free(); | ||
| 82 | #endif | ||
| 83 | |||
| 84 | typedef struct bio_ssl_st | 74 | typedef 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 | ||
| 107 | BIO_METHOD *BIO_f_ssl() | 97 | BIO_METHOD *BIO_f_ssl(void) |
| 108 | { | 98 | { |
| 109 | return(&methods_sslp); | 99 | return(&methods_sslp); |
| 110 | } | 100 | } |
| 111 | 101 | ||
| 112 | static int ssl_new(bi) | 102 | static int ssl_new(BIO *bi) |
| 113 | BIO *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 | ||
| 130 | static int ssl_free(a) | 119 | static int ssl_free(BIO *a) |
| 131 | BIO *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 | ||
| 150 | static int ssl_read(b,out,outl) | 138 | static int ssl_read(BIO *b, char *out, int outl) |
| 151 | BIO *b; | ||
| 152 | char *out; | ||
| 153 | int 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 | ||
| 237 | static int ssl_write(b,out,outl) | 222 | static int ssl_write(BIO *b, char *out, int outl) |
| 238 | BIO *b; | ||
| 239 | char *out; | ||
| 240 | int 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 | ||
| 308 | static long ssl_ctrl(b,cmd,num,ptr) | 290 | static long ssl_ctrl(BIO *b, int cmd, long num, char *ptr) |
| 309 | BIO *b; | ||
| 310 | int cmd; | ||
| 311 | long num; | ||
| 312 | char *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 | ||
| 486 | static int ssl_puts(bp,str) | 464 | static int ssl_puts(BIO *bp, char *str) |
| 487 | BIO *bp; | ||
| 488 | char *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 | ||
| 497 | BIO *BIO_new_buffer_ssl_connect(ctx) | 473 | BIO *BIO_new_buffer_ssl_connect(SSL_CTX *ctx) |
| 498 | SSL_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 | ||
| 515 | BIO *BIO_new_ssl_connect(ctx) | 490 | BIO *BIO_new_ssl_connect(SSL_CTX *ctx) |
| 516 | SSL_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 | ||
| 533 | BIO *BIO_new_ssl(ctx,client) | 507 | BIO *BIO_new_ssl(SSL_CTX *ctx, int client) |
| 534 | SSL_CTX *ctx; | ||
| 535 | int 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 | ||
| 556 | int BIO_ssl_copy_session_id(t,f) | 528 | int BIO_ssl_copy_session_id(BIO *t, BIO *f) |
| 557 | BIO *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 | ||
| 570 | void BIO_ssl_shutdown(b) | 541 | void BIO_ssl_shutdown(BIO *b) |
| 571 | BIO *b; | ||
| 572 | { | 542 | { |
| 573 | SSL *s; | 543 | SSL *s; |
| 574 | 544 | ||
