summaryrefslogtreecommitdiff
path: root/src/lib/libssl/bio_ssl.c
diff options
context:
space:
mode:
authorjsing <>2014-04-19 16:50:47 +0000
committerjsing <>2014-04-19 16:50:47 +0000
commit186836e9eb9f898bfa0516ec17d5e84521dfd8ae (patch)
treed4396c57c12a0eb7ee76e282ac1e9876990b8a1c /src/lib/libssl/bio_ssl.c
parente29d82f14d4a36a8824cc04cd277e44188f87e43 (diff)
downloadopenbsd-186836e9eb9f898bfa0516ec17d5e84521dfd8ae.tar.gz
openbsd-186836e9eb9f898bfa0516ec17d5e84521dfd8ae.tar.bz2
openbsd-186836e9eb9f898bfa0516ec17d5e84521dfd8ae.zip
More KNF.
Diffstat (limited to 'src/lib/libssl/bio_ssl.c')
-rw-r--r--src/lib/libssl/bio_ssl.c40
1 files changed, 20 insertions, 20 deletions
diff --git a/src/lib/libssl/bio_ssl.c b/src/lib/libssl/bio_ssl.c
index 35463c73d4..e88137aeca 100644
--- a/src/lib/libssl/bio_ssl.c
+++ b/src/lib/libssl/bio_ssl.c
@@ -5,21 +5,21 @@
5 * This package is an SSL implementation written 5 * This package is an SSL implementation written
6 * by Eric Young (eay@cryptsoft.com). 6 * by Eric Young (eay@cryptsoft.com).
7 * The implementation was written so as to conform with Netscapes SSL. 7 * The implementation was written so as to conform with Netscapes SSL.
8 * 8 *
9 * This library is free for commercial and non-commercial use as long as 9 * This library is free for commercial and non-commercial use as long as
10 * the following conditions are aheared to. The following conditions 10 * the following conditions are aheared to. The following conditions
11 * apply to all code found in this distribution, be it the RC4, RSA, 11 * apply to all code found in this distribution, be it the RC4, RSA,
12 * lhash, DES, etc., code; not just the SSL code. The SSL documentation 12 * lhash, DES, etc., code; not just the SSL code. The SSL documentation
13 * included with this distribution is covered by the same copyright terms 13 * included with this distribution is covered by the same copyright terms
14 * except that the holder is Tim Hudson (tjh@cryptsoft.com). 14 * except that the holder is Tim Hudson (tjh@cryptsoft.com).
15 * 15 *
16 * Copyright remains Eric Young's, and as such any Copyright notices in 16 * Copyright remains Eric Young's, and as such any Copyright notices in
17 * the code are not to be removed. 17 * the code are not to be removed.
18 * If this package is used in a product, Eric Young should be given attribution 18 * If this package is used in a product, Eric Young should be given attribution
19 * as the author of the parts of the library used. 19 * as the author of the parts of the library used.
20 * This can be in the form of a textual message at program startup or 20 * This can be in the form of a textual message at program startup or
21 * in documentation (online or textual) provided with the package. 21 * in documentation (online or textual) provided with the package.
22 * 22 *
23 * Redistribution and use in source and binary forms, with or without 23 * Redistribution and use in source and binary forms, with or without
24 * modification, are permitted provided that the following conditions 24 * modification, are permitted provided that the following conditions
25 * are met: 25 * are met:
@@ -34,10 +34,10 @@
34 * Eric Young (eay@cryptsoft.com)" 34 * Eric Young (eay@cryptsoft.com)"
35 * The word 'cryptographic' can be left out if the rouines from the library 35 * The word 'cryptographic' can be left out if the rouines from the library
36 * being used are not cryptographic related :-). 36 * being used are not cryptographic related :-).
37 * 4. If you include any Windows specific code (or a derivative thereof) from 37 * 4. If you include any Windows specific code (or a derivative thereof) from
38 * the apps directory (application code) you must include an acknowledgement: 38 * the apps directory (application code) you must include an acknowledgement:
39 * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" 39 * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
40 * 40 *
41 * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND 41 * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
42 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 42 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
43 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 43 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
@@ -49,7 +49,7 @@
49 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 49 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
50 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 50 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
51 * SUCH DAMAGE. 51 * SUCH DAMAGE.
52 * 52 *
53 * The licence and distribution terms for any publically available version or 53 * The licence and distribution terms for any publically available version or
54 * derivative of this code cannot be changed. i.e. this code cannot simply be 54 * derivative of this code cannot be changed. i.e. this code cannot simply be
55 * copied and put under another distribution licence 55 * copied and put under another distribution licence
@@ -94,8 +94,8 @@ static BIO_METHOD methods_sslp = {
94 ssl_callback_ctrl, 94 ssl_callback_ctrl,
95}; 95};
96 96
97BIO_METHOD 97BIO_METHOD *
98*BIO_f_ssl(void) 98BIO_f_ssl(void)
99{ 99{
100 return (&methods_sslp); 100 return (&methods_sslp);
101} 101}
@@ -412,18 +412,18 @@ ssl_ctrl(BIO *b, int cmd, long num, void *ptr)
412 b->retry_reason = 0; 412 b->retry_reason = 0;
413 ret = (int)SSL_do_handshake(ssl); 413 ret = (int)SSL_do_handshake(ssl);
414 414
415 switch (SSL_get_error(ssl,(int)ret)) { 415 switch (SSL_get_error(ssl, (int)ret)) {
416 case SSL_ERROR_WANT_READ: 416 case SSL_ERROR_WANT_READ:
417 BIO_set_flags(b, 417 BIO_set_flags(b,
418 BIO_FLAGS_READ|BIO_FLAGS_SHOULD_RETRY); 418 BIO_FLAGS_READ|BIO_FLAGS_SHOULD_RETRY);
419 break; 419 break;
420 case SSL_ERROR_WANT_WRITE: 420 case SSL_ERROR_WANT_WRITE:
421 BIO_set_flags(b, 421 BIO_set_flags(b,
422 BIO_FLAGS_WRITE|BIO_FLAGS_SHOULD_RETRY); 422 BIO_FLAGS_WRITE|BIO_FLAGS_SHOULD_RETRY);
423 break; 423 break;
424 case SSL_ERROR_WANT_CONNECT: 424 case SSL_ERROR_WANT_CONNECT:
425 BIO_set_flags(b, 425 BIO_set_flags(b,
426 BIO_FLAGS_IO_SPECIAL|BIO_FLAGS_SHOULD_RETRY); 426 BIO_FLAGS_IO_SPECIAL|BIO_FLAGS_SHOULD_RETRY);
427 b->retry_reason = b->next_bio->retry_reason; 427 b->retry_reason = b->next_bio->retry_reason;
428 break; 428 break;
429 default: 429 default:
@@ -487,7 +487,7 @@ ssl_callback_ctrl(BIO *b, int cmd, bio_info_cb *fp)
487 { 487 {
488 /* FIXME: setting this via a completely different prototype 488 /* FIXME: setting this via a completely different prototype
489 seems like a crap idea */ 489 seems like a crap idea */
490 SSL_set_info_callback(ssl,(void (*)(const SSL *, int, int))fp); 490 SSL_set_info_callback(ssl, (void (*)(const SSL *, int, int))fp);
491 } 491 }
492 break; 492 break;
493 default: 493 default:
@@ -507,8 +507,8 @@ ssl_puts(BIO *bp, const char *str)
507 return (ret); 507 return (ret);
508} 508}
509 509
510BIO 510BIO *
511*BIO_new_buffer_ssl_connect(SSL_CTX *ctx) 511BIO_new_buffer_ssl_connect(SSL_CTX *ctx)
512{ 512{
513#ifndef OPENSSL_NO_SOCK 513#ifndef OPENSSL_NO_SOCK
514 BIO *ret = NULL, *buf = NULL, *ssl = NULL; 514 BIO *ret = NULL, *buf = NULL, *ssl = NULL;
@@ -529,8 +529,8 @@ err:
529 return (NULL); 529 return (NULL);
530} 530}
531 531
532BIO 532BIO *
533*BIO_new_ssl_connect(SSL_CTX *ctx) 533BIO_new_ssl_connect(SSL_CTX *ctx)
534{ 534{
535#ifndef OPENSSL_NO_SOCK 535#ifndef OPENSSL_NO_SOCK
536 BIO *ret = NULL, *con = NULL, *ssl = NULL; 536 BIO *ret = NULL, *con = NULL, *ssl = NULL;
@@ -549,8 +549,8 @@ err:
549 return (NULL); 549 return (NULL);
550} 550}
551 551
552BIO 552BIO *
553*BIO_new_ssl(SSL_CTX *ctx, int client) 553BIO_new_ssl(SSL_CTX *ctx, int client)
554{ 554{
555 BIO *ret; 555 BIO *ret;
556 SSL *ssl; 556 SSL *ssl;
@@ -580,7 +580,7 @@ BIO_ssl_copy_session_id(BIO *t, BIO *f)
580 if ((((BIO_SSL *)t->ptr)->ssl == NULL) || 580 if ((((BIO_SSL *)t->ptr)->ssl == NULL) ||
581 (((BIO_SSL *)f->ptr)->ssl == NULL)) 581 (((BIO_SSL *)f->ptr)->ssl == NULL))
582 return (0); 582 return (0);
583 SSL_copy_session_id(((BIO_SSL *)t->ptr)->ssl,((BIO_SSL *)f->ptr)->ssl); 583 SSL_copy_session_id(((BIO_SSL *)t->ptr)->ssl, ((BIO_SSL *)f->ptr)->ssl);
584 return (1); 584 return (1);
585} 585}
586 586