diff options
author | jsing <> | 2014-04-19 13:11:41 +0000 |
---|---|---|
committer | jsing <> | 2014-04-19 13:11:41 +0000 |
commit | 94b01fb1dea0219d681a8f31b420537fd56a8a20 (patch) | |
tree | d852cc766d4c429b41b38d7046ec6dfc58a87f6b /src/lib/libcrypto/asn1/a_set.c | |
parent | 1a4bc92d69fa85768e8b6d9592f3ca13bfb70c6e (diff) | |
download | openbsd-94b01fb1dea0219d681a8f31b420537fd56a8a20.tar.gz openbsd-94b01fb1dea0219d681a8f31b420537fd56a8a20.tar.bz2 openbsd-94b01fb1dea0219d681a8f31b420537fd56a8a20.zip |
More KNF.
Diffstat (limited to 'src/lib/libcrypto/asn1/a_set.c')
-rw-r--r-- | src/lib/libcrypto/asn1/a_set.c | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/src/lib/libcrypto/asn1/a_set.c b/src/lib/libcrypto/asn1/a_set.c index 8a97984893..3aeb7e54ff 100644 --- a/src/lib/libcrypto/asn1/a_set.c +++ b/src/lib/libcrypto/asn1/a_set.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 |
@@ -104,7 +104,7 @@ i2d_ASN1_SET(STACK_OF(OPENSSL_BLOCK) *a, unsigned char **pp, i2d_of_void *i2d, | |||
104 | if (pp == NULL) | 104 | if (pp == NULL) |
105 | return r; | 105 | return r; |
106 | 106 | ||
107 | p= *pp; | 107 | p = *pp; |
108 | ASN1_put_object(&p, 1, ret, ex_tag, ex_class); | 108 | ASN1_put_object(&p, 1, ret, ex_tag, ex_class); |
109 | 109 | ||
110 | /* Modified by gp@nsj.co.jp */ | 110 | /* Modified by gp@nsj.co.jp */ |
@@ -179,7 +179,7 @@ d2i_ASN1_SET(STACK_OF(OPENSSL_BLOCK) **a, const unsigned char **pp, long length, | |||
179 | } else | 179 | } else |
180 | ret = *a; | 180 | ret = *a; |
181 | 181 | ||
182 | c.p= *pp; | 182 | c.p = *pp; |
183 | c.max = (length == 0) ? 0 : (c.p + length); | 183 | c.max = (length == 0) ? 0 : (c.p + length); |
184 | 184 | ||
185 | c.inf = ASN1_get_object(&c.p, &c.slen, &c.tag, &c.xclass, c.max - c.p); | 185 | c.inf = ASN1_get_object(&c.p, &c.slen, &c.tag, &c.xclass, c.max - c.p); |
@@ -216,13 +216,14 @@ d2i_ASN1_SET(STACK_OF(OPENSSL_BLOCK) **a, const unsigned char **pp, long length, | |||
216 | asn1_add_error(*pp, (int)(c.p - *pp)); | 216 | asn1_add_error(*pp, (int)(c.p - *pp)); |
217 | goto err; | 217 | goto err; |
218 | } | 218 | } |
219 | if (!sk_OPENSSL_BLOCK_push(ret,s)) | 219 | if (!sk_OPENSSL_BLOCK_push(ret, s)) |
220 | goto err; | 220 | goto err; |
221 | } | 221 | } |
222 | if (a != NULL) | 222 | if (a != NULL) |
223 | *a = ret; | 223 | *a = ret; |
224 | *pp = c.p; | 224 | *pp = c.p; |
225 | return ret; | 225 | return ret; |
226 | |||
226 | err: | 227 | err: |
227 | if (ret != NULL && (a == NULL || *a != ret)) { | 228 | if (ret != NULL && (a == NULL || *a != ret)) { |
228 | if (free_func != NULL) | 229 | if (free_func != NULL) |