diff options
author | jsing <> | 2014-04-16 15:05:23 +0000 |
---|---|---|
committer | jsing <> | 2014-04-16 15:05:23 +0000 |
commit | 0e08f2db38e867e26107d9826aa489a211882fb1 (patch) | |
tree | a1b56f00a31d02b8812b128ad441e3f5f26bbd54 /src/lib/libcrypto/bio/bio_lib.c | |
parent | 10dfdaaf3324c4eccc97564cc84c12408a7b659b (diff) | |
download | openbsd-0e08f2db38e867e26107d9826aa489a211882fb1.tar.gz openbsd-0e08f2db38e867e26107d9826aa489a211882fb1.tar.bz2 openbsd-0e08f2db38e867e26107d9826aa489a211882fb1.zip |
More KNF.
Diffstat (limited to 'src/lib/libcrypto/bio/bio_lib.c')
-rw-r--r-- | src/lib/libcrypto/bio/bio_lib.c | 38 |
1 files changed, 20 insertions, 18 deletions
diff --git a/src/lib/libcrypto/bio/bio_lib.c b/src/lib/libcrypto/bio/bio_lib.c index 9e8fb7913a..90f1b1c1ef 100644 --- a/src/lib/libcrypto/bio/bio_lib.c +++ b/src/lib/libcrypto/bio/bio_lib.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 |
@@ -338,8 +338,8 @@ BIO_indent(BIO *b, int indent, int max) | |||
338 | if (indent > max) | 338 | if (indent > max) |
339 | indent = max; | 339 | indent = max; |
340 | while (indent--) | 340 | while (indent--) |
341 | if (BIO_puts(b, " ") != 1) | 341 | if (BIO_puts(b, " ") != 1) |
342 | return 0; | 342 | return 0; |
343 | return 1; | 343 | return 1; |
344 | } | 344 | } |
345 | 345 | ||
@@ -349,7 +349,7 @@ BIO_int_ctrl(BIO *b, int cmd, long larg, int iarg) | |||
349 | int i; | 349 | int i; |
350 | 350 | ||
351 | i = iarg; | 351 | i = iarg; |
352 | return (BIO_ctrl(b, cmd, larg,(char *)&i)); | 352 | return (BIO_ctrl(b, cmd, larg, (char *)&i)); |
353 | } | 353 | } |
354 | 354 | ||
355 | char | 355 | char |
@@ -357,7 +357,7 @@ char | |||
357 | { | 357 | { |
358 | char *p = NULL; | 358 | char *p = NULL; |
359 | 359 | ||
360 | if (BIO_ctrl(b, cmd, larg,(char *)&p) <= 0) | 360 | if (BIO_ctrl(b, cmd, larg, (char *)&p) <= 0) |
361 | return (NULL); | 361 | return (NULL); |
362 | else | 362 | else |
363 | return (p); | 363 | return (p); |
@@ -408,13 +408,13 @@ BIO_callback_ctrl(BIO *b, int cmd, | |||
408 | cb = b->callback; | 408 | cb = b->callback; |
409 | 409 | ||
410 | if ((cb != NULL) && | 410 | if ((cb != NULL) && |
411 | ((ret = cb(b, BIO_CB_CTRL,(void *)&fp, cmd, 0, 1L)) <= 0)) | 411 | ((ret = cb(b, BIO_CB_CTRL, (void *)&fp, cmd, 0, 1L)) <= 0)) |
412 | return (ret); | 412 | return (ret); |
413 | 413 | ||
414 | ret = b->method->callback_ctrl(b, cmd, fp); | 414 | ret = b->method->callback_ctrl(b, cmd, fp); |
415 | 415 | ||
416 | if (cb != NULL) | 416 | if (cb != NULL) |
417 | ret = cb(b, BIO_CB_CTRL|BIO_CB_RETURN,(void *)&fp, cmd, 0, ret); | 417 | ret = cb(b, BIO_CB_CTRL|BIO_CB_RETURN, (void *)&fp, cmd, 0, ret); |
418 | return (ret); | 418 | return (ret); |
419 | } | 419 | } |
420 | 420 | ||
@@ -444,7 +444,7 @@ BIO | |||
444 | return (bio); | 444 | return (bio); |
445 | lb = b; | 445 | lb = b; |
446 | while (lb->next_bio != NULL) | 446 | while (lb->next_bio != NULL) |
447 | lb = lb->next_bio; | 447 | lb = lb->next_bio; |
448 | lb->next_bio = bio; | 448 | lb->next_bio = bio; |
449 | if (bio != NULL) | 449 | if (bio != NULL) |
450 | bio->prev_bio = lb; | 450 | bio->prev_bio = lb; |
@@ -482,8 +482,9 @@ BIO | |||
482 | 482 | ||
483 | b = last = bio; | 483 | b = last = bio; |
484 | for (;;) { | 484 | for (;;) { |
485 | if (!BIO_should_retry(b)) break; | 485 | if (!BIO_should_retry(b)) |
486 | last = b; | 486 | break; |
487 | last = b; | ||
487 | b = b->next_bio; | 488 | b = b->next_bio; |
488 | if (b == NULL) | 489 | if (b == NULL) |
489 | break; | 490 | break; |
@@ -552,8 +553,9 @@ BIO | |||
552 | BIO *ret = NULL, *eoc = NULL, *bio, *new_bio; | 553 | BIO *ret = NULL, *eoc = NULL, *bio, *new_bio; |
553 | 554 | ||
554 | for (bio = in; bio != NULL; bio = bio->next_bio) { | 555 | for (bio = in; bio != NULL; bio = bio->next_bio) { |
555 | if ((new_bio = BIO_new(bio->method)) == NULL) goto err; | 556 | if ((new_bio = BIO_new(bio->method)) == NULL) |
556 | new_bio->callback = bio->callback; | 557 | goto err; |
558 | new_bio->callback = bio->callback; | ||
557 | new_bio->cb_arg = bio->cb_arg; | 559 | new_bio->cb_arg = bio->cb_arg; |
558 | new_bio->init = bio->init; | 560 | new_bio->init = bio->init; |
559 | new_bio->shutdown = bio->shutdown; | 561 | new_bio->shutdown = bio->shutdown; |
@@ -562,7 +564,7 @@ BIO | |||
562 | /* This will let SSL_s_sock() work with stdin/stdout */ | 564 | /* This will let SSL_s_sock() work with stdin/stdout */ |
563 | new_bio->num = bio->num; | 565 | new_bio->num = bio->num; |
564 | 566 | ||
565 | if (!BIO_dup_state(bio,(char *)new_bio)) { | 567 | if (!BIO_dup_state(bio, (char *)new_bio)) { |
566 | BIO_free(new_bio); | 568 | BIO_free(new_bio); |
567 | goto err; | 569 | goto err; |
568 | } | 570 | } |