diff options
author | jsing <> | 2014-05-08 16:01:06 +0000 |
---|---|---|
committer | jsing <> | 2014-05-08 16:01:06 +0000 |
commit | b590070115ee73703baaa8c896eed6bb11a45b0e (patch) | |
tree | ed90c25aca72e0544ad65b810adf731e64b16466 /src/lib/libcrypto/evp/m_ecdsa.c | |
parent | fc600bbf618c114f1545a86a1a31d1bf5babf3c5 (diff) | |
download | openbsd-b590070115ee73703baaa8c896eed6bb11a45b0e.tar.gz openbsd-b590070115ee73703baaa8c896eed6bb11a45b0e.tar.bz2 openbsd-b590070115ee73703baaa8c896eed6bb11a45b0e.zip |
KNF.
Diffstat (limited to 'src/lib/libcrypto/evp/m_ecdsa.c')
-rw-r--r-- | src/lib/libcrypto/evp/m_ecdsa.c | 46 |
1 files changed, 26 insertions, 20 deletions
diff --git a/src/lib/libcrypto/evp/m_ecdsa.c b/src/lib/libcrypto/evp/m_ecdsa.c index a6ed24b0b6..1d7714571c 100644 --- a/src/lib/libcrypto/evp/m_ecdsa.c +++ b/src/lib/libcrypto/evp/m_ecdsa.c | |||
@@ -7,7 +7,7 @@ | |||
7 | * are met: | 7 | * are met: |
8 | * | 8 | * |
9 | * 1. Redistributions of source code must retain the above copyright | 9 | * 1. Redistributions of source code must retain the above copyright |
10 | * notice, this list of conditions and the following disclaimer. | 10 | * notice, this list of conditions and the following disclaimer. |
11 | * | 11 | * |
12 | * 2. Redistributions in binary form must reproduce the above copyright | 12 | * 2. Redistributions in binary form must reproduce the above copyright |
13 | * notice, this list of conditions and the following disclaimer in | 13 | * notice, this list of conditions and the following disclaimer in |
@@ -58,21 +58,21 @@ | |||
58 | * This package is an SSL implementation written | 58 | * This package is an SSL implementation written |
59 | * by Eric Young (eay@cryptsoft.com). | 59 | * by Eric Young (eay@cryptsoft.com). |
60 | * The implementation was written so as to conform with Netscapes SSL. | 60 | * The implementation was written so as to conform with Netscapes SSL. |
61 | * | 61 | * |
62 | * This library is free for commercial and non-commercial use as long as | 62 | * This library is free for commercial and non-commercial use as long as |
63 | * the following conditions are aheared to. The following conditions | 63 | * the following conditions are aheared to. The following conditions |
64 | * apply to all code found in this distribution, be it the RC4, RSA, | 64 | * apply to all code found in this distribution, be it the RC4, RSA, |
65 | * lhash, DES, etc., code; not just the SSL code. The SSL documentation | 65 | * lhash, DES, etc., code; not just the SSL code. The SSL documentation |
66 | * included with this distribution is covered by the same copyright terms | 66 | * included with this distribution is covered by the same copyright terms |
67 | * except that the holder is Tim Hudson (tjh@cryptsoft.com). | 67 | * except that the holder is Tim Hudson (tjh@cryptsoft.com). |
68 | * | 68 | * |
69 | * Copyright remains Eric Young's, and as such any Copyright notices in | 69 | * Copyright remains Eric Young's, and as such any Copyright notices in |
70 | * the code are not to be removed. | 70 | * the code are not to be removed. |
71 | * If this package is used in a product, Eric Young should be given attribution | 71 | * If this package is used in a product, Eric Young should be given attribution |
72 | * as the author of the parts of the library used. | 72 | * as the author of the parts of the library used. |
73 | * This can be in the form of a textual message at program startup or | 73 | * This can be in the form of a textual message at program startup or |
74 | * in documentation (online or textual) provided with the package. | 74 | * in documentation (online or textual) provided with the package. |
75 | * | 75 | * |
76 | * Redistribution and use in source and binary forms, with or without | 76 | * Redistribution and use in source and binary forms, with or without |
77 | * modification, are permitted provided that the following conditions | 77 | * modification, are permitted provided that the following conditions |
78 | * are met: | 78 | * are met: |
@@ -87,10 +87,10 @@ | |||
87 | * Eric Young (eay@cryptsoft.com)" | 87 | * Eric Young (eay@cryptsoft.com)" |
88 | * The word 'cryptographic' can be left out if the rouines from the library | 88 | * The word 'cryptographic' can be left out if the rouines from the library |
89 | * being used are not cryptographic related :-). | 89 | * being used are not cryptographic related :-). |
90 | * 4. If you include any Windows specific code (or a derivative thereof) from | 90 | * 4. If you include any Windows specific code (or a derivative thereof) from |
91 | * the apps directory (application code) you must include an acknowledgement: | 91 | * the apps directory (application code) you must include an acknowledgement: |
92 | * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" | 92 | * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" |
93 | * | 93 | * |
94 | * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND | 94 | * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND |
95 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | 95 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
96 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | 96 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
@@ -102,7 +102,7 @@ | |||
102 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | 102 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY |
103 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | 103 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
104 | * SUCH DAMAGE. | 104 | * SUCH DAMAGE. |
105 | * | 105 | * |
106 | * The licence and distribution terms for any publically available version or | 106 | * The licence and distribution terms for any publically available version or |
107 | * derivative of this code cannot be changed. i.e. this code cannot simply be | 107 | * derivative of this code cannot be changed. i.e. this code cannot simply be |
108 | * copied and put under another distribution licence | 108 | * copied and put under another distribution licence |
@@ -118,16 +118,21 @@ | |||
118 | #ifndef OPENSSL_NO_SHA | 118 | #ifndef OPENSSL_NO_SHA |
119 | 119 | ||
120 | static int init(EVP_MD_CTX *ctx) | 120 | static int init(EVP_MD_CTX *ctx) |
121 | { return SHA1_Init(ctx->md_data); } | 121 | { |
122 | return SHA1_Init(ctx->md_data); | ||
123 | } | ||
122 | 124 | ||
123 | static int update(EVP_MD_CTX *ctx,const void *data,size_t count) | 125 | static int update(EVP_MD_CTX *ctx, const void *data, size_t count) |
124 | { return SHA1_Update(ctx->md_data,data,count); } | 126 | { |
127 | return SHA1_Update(ctx->md_data, data, count); | ||
128 | } | ||
125 | 129 | ||
126 | static int final(EVP_MD_CTX *ctx,unsigned char *md) | 130 | static int final(EVP_MD_CTX *ctx, unsigned char *md) |
127 | { return SHA1_Final(md,ctx->md_data); } | 131 | { |
132 | return SHA1_Final(md, ctx->md_data); | ||
133 | } | ||
128 | 134 | ||
129 | static const EVP_MD ecdsa_md= | 135 | static const EVP_MD ecdsa_md = { |
130 | { | ||
131 | NID_ecdsa_with_SHA1, | 136 | NID_ecdsa_with_SHA1, |
132 | NID_ecdsa_with_SHA1, | 137 | NID_ecdsa_with_SHA1, |
133 | SHA_DIGEST_LENGTH, | 138 | SHA_DIGEST_LENGTH, |
@@ -139,11 +144,12 @@ static const EVP_MD ecdsa_md= | |||
139 | NULL, | 144 | NULL, |
140 | EVP_PKEY_ECDSA_method, | 145 | EVP_PKEY_ECDSA_method, |
141 | SHA_CBLOCK, | 146 | SHA_CBLOCK, |
142 | sizeof(EVP_MD *)+sizeof(SHA_CTX), | 147 | sizeof(EVP_MD *) + sizeof(SHA_CTX), |
143 | }; | 148 | }; |
144 | 149 | ||
145 | const EVP_MD *EVP_ecdsa(void) | 150 | const EVP_MD * |
146 | { | 151 | EVP_ecdsa(void) |
147 | return(&ecdsa_md); | 152 | { |
148 | } | 153 | return (&ecdsa_md); |
154 | } | ||
149 | #endif | 155 | #endif |