diff options
Diffstat (limited to '')
24 files changed, 766 insertions, 616 deletions
diff --git a/src/lib/libcrypto/evp/m_dss.c b/src/lib/libcrypto/evp/m_dss.c index 89ea5b7a6d..1516b9da3f 100644 --- a/src/lib/libcrypto/evp/m_dss.c +++ b/src/lib/libcrypto/evp/m_dss.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 |
| @@ -68,16 +68,21 @@ | |||
| 68 | #ifndef OPENSSL_NO_SHA | 68 | #ifndef OPENSSL_NO_SHA |
| 69 | 69 | ||
| 70 | static int init(EVP_MD_CTX *ctx) | 70 | static int init(EVP_MD_CTX *ctx) |
| 71 | { return SHA1_Init(ctx->md_data); } | 71 | { |
| 72 | return SHA1_Init(ctx->md_data); | ||
| 73 | } | ||
| 72 | 74 | ||
| 73 | static int update(EVP_MD_CTX *ctx,const void *data,size_t count) | 75 | static int update(EVP_MD_CTX *ctx, const void *data, size_t count) |
| 74 | { return SHA1_Update(ctx->md_data,data,count); } | 76 | { |
| 77 | return SHA1_Update(ctx->md_data, data, count); | ||
| 78 | } | ||
| 75 | 79 | ||
| 76 | static int final(EVP_MD_CTX *ctx,unsigned char *md) | 80 | static int final(EVP_MD_CTX *ctx, unsigned char *md) |
| 77 | { return SHA1_Final(md,ctx->md_data); } | 81 | { |
| 82 | return SHA1_Final(md, ctx->md_data); | ||
| 83 | } | ||
| 78 | 84 | ||
| 79 | static const EVP_MD dsa_md= | 85 | static const EVP_MD dsa_md = { |
| 80 | { | ||
| 81 | NID_dsaWithSHA, | 86 | NID_dsaWithSHA, |
| 82 | NID_dsaWithSHA, | 87 | NID_dsaWithSHA, |
| 83 | SHA_DIGEST_LENGTH, | 88 | SHA_DIGEST_LENGTH, |
| @@ -89,11 +94,12 @@ static const EVP_MD dsa_md= | |||
| 89 | NULL, | 94 | NULL, |
| 90 | EVP_PKEY_DSA_method, | 95 | EVP_PKEY_DSA_method, |
| 91 | SHA_CBLOCK, | 96 | SHA_CBLOCK, |
| 92 | sizeof(EVP_MD *)+sizeof(SHA_CTX), | 97 | sizeof(EVP_MD *) + sizeof(SHA_CTX), |
| 93 | }; | 98 | }; |
| 94 | 99 | ||
| 95 | const EVP_MD *EVP_dss(void) | 100 | const EVP_MD * |
| 96 | { | 101 | EVP_dss(void) |
| 97 | return(&dsa_md); | 102 | { |
| 98 | } | 103 | return (&dsa_md); |
| 104 | } | ||
| 99 | #endif | 105 | #endif |
diff --git a/src/lib/libcrypto/evp/m_dss1.c b/src/lib/libcrypto/evp/m_dss1.c index a010103b7a..2d9feff095 100644 --- a/src/lib/libcrypto/evp/m_dss1.c +++ b/src/lib/libcrypto/evp/m_dss1.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 |
| @@ -69,16 +69,21 @@ | |||
| 69 | #endif | 69 | #endif |
| 70 | 70 | ||
| 71 | static int init(EVP_MD_CTX *ctx) | 71 | static int init(EVP_MD_CTX *ctx) |
| 72 | { return SHA1_Init(ctx->md_data); } | 72 | { |
| 73 | return SHA1_Init(ctx->md_data); | ||
| 74 | } | ||
| 73 | 75 | ||
| 74 | static int update(EVP_MD_CTX *ctx,const void *data,size_t count) | 76 | static int update(EVP_MD_CTX *ctx, const void *data, size_t count) |
| 75 | { return SHA1_Update(ctx->md_data,data,count); } | 77 | { |
| 78 | return SHA1_Update(ctx->md_data, data, count); | ||
| 79 | } | ||
| 76 | 80 | ||
| 77 | static int final(EVP_MD_CTX *ctx,unsigned char *md) | 81 | static int final(EVP_MD_CTX *ctx, unsigned char *md) |
| 78 | { return SHA1_Final(md,ctx->md_data); } | 82 | { |
| 83 | return SHA1_Final(md, ctx->md_data); | ||
| 84 | } | ||
| 79 | 85 | ||
| 80 | static const EVP_MD dss1_md= | 86 | static const EVP_MD dss1_md = { |
| 81 | { | ||
| 82 | NID_dsa, | 87 | NID_dsa, |
| 83 | NID_dsaWithSHA1, | 88 | NID_dsaWithSHA1, |
| 84 | SHA_DIGEST_LENGTH, | 89 | SHA_DIGEST_LENGTH, |
| @@ -90,11 +95,12 @@ static const EVP_MD dss1_md= | |||
| 90 | NULL, | 95 | NULL, |
| 91 | EVP_PKEY_DSA_method, | 96 | EVP_PKEY_DSA_method, |
| 92 | SHA_CBLOCK, | 97 | SHA_CBLOCK, |
| 93 | sizeof(EVP_MD *)+sizeof(SHA_CTX), | 98 | sizeof(EVP_MD *) + sizeof(SHA_CTX), |
| 94 | }; | 99 | }; |
| 95 | 100 | ||
| 96 | const EVP_MD *EVP_dss1(void) | 101 | const EVP_MD * |
| 97 | { | 102 | EVP_dss1(void) |
| 98 | return(&dss1_md); | 103 | { |
| 99 | } | 104 | return (&dss1_md); |
| 105 | } | ||
| 100 | #endif | 106 | #endif |
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 |
diff --git a/src/lib/libcrypto/evp/m_md4.c b/src/lib/libcrypto/evp/m_md4.c index 6d47f61b27..5a944e3c16 100644 --- a/src/lib/libcrypto/evp/m_md4.c +++ b/src/lib/libcrypto/evp/m_md4.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 |
| @@ -72,16 +72,21 @@ | |||
| 72 | #include "evp_locl.h" | 72 | #include "evp_locl.h" |
| 73 | 73 | ||
| 74 | static int init(EVP_MD_CTX *ctx) | 74 | static int init(EVP_MD_CTX *ctx) |
| 75 | { return MD4_Init(ctx->md_data); } | 75 | { |
| 76 | return MD4_Init(ctx->md_data); | ||
| 77 | } | ||
| 76 | 78 | ||
| 77 | static int update(EVP_MD_CTX *ctx,const void *data,size_t count) | 79 | static int update(EVP_MD_CTX *ctx, const void *data, size_t count) |
| 78 | { return MD4_Update(ctx->md_data,data,count); } | 80 | { |
| 81 | return MD4_Update(ctx->md_data, data, count); | ||
| 82 | } | ||
| 79 | 83 | ||
| 80 | static int final(EVP_MD_CTX *ctx,unsigned char *md) | 84 | static int final(EVP_MD_CTX *ctx, unsigned char *md) |
| 81 | { return MD4_Final(md,ctx->md_data); } | 85 | { |
| 86 | return MD4_Final(md, ctx->md_data); | ||
| 87 | } | ||
| 82 | 88 | ||
| 83 | static const EVP_MD md4_md= | 89 | static const EVP_MD md4_md = { |
| 84 | { | ||
| 85 | NID_md4, | 90 | NID_md4, |
| 86 | NID_md4WithRSAEncryption, | 91 | NID_md4WithRSAEncryption, |
| 87 | MD4_DIGEST_LENGTH, | 92 | MD4_DIGEST_LENGTH, |
| @@ -93,11 +98,12 @@ static const EVP_MD md4_md= | |||
| 93 | NULL, | 98 | NULL, |
| 94 | EVP_PKEY_RSA_method, | 99 | EVP_PKEY_RSA_method, |
| 95 | MD4_CBLOCK, | 100 | MD4_CBLOCK, |
| 96 | sizeof(EVP_MD *)+sizeof(MD4_CTX), | 101 | sizeof(EVP_MD *) + sizeof(MD4_CTX), |
| 97 | }; | 102 | }; |
| 98 | 103 | ||
| 99 | const EVP_MD *EVP_md4(void) | 104 | const EVP_MD * |
| 100 | { | 105 | EVP_md4(void) |
| 101 | return(&md4_md); | 106 | { |
| 102 | } | 107 | return (&md4_md); |
| 108 | } | ||
| 103 | #endif | 109 | #endif |
diff --git a/src/lib/libcrypto/evp/m_md5.c b/src/lib/libcrypto/evp/m_md5.c index 9a8bae0258..4ac9829886 100644 --- a/src/lib/libcrypto/evp/m_md5.c +++ b/src/lib/libcrypto/evp/m_md5.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 |
| @@ -71,16 +71,21 @@ | |||
| 71 | #include "evp_locl.h" | 71 | #include "evp_locl.h" |
| 72 | 72 | ||
| 73 | static int init(EVP_MD_CTX *ctx) | 73 | static int init(EVP_MD_CTX *ctx) |
| 74 | { return MD5_Init(ctx->md_data); } | 74 | { |
| 75 | return MD5_Init(ctx->md_data); | ||
| 76 | } | ||
| 75 | 77 | ||
| 76 | static int update(EVP_MD_CTX *ctx,const void *data,size_t count) | 78 | static int update(EVP_MD_CTX *ctx, const void *data, size_t count) |
| 77 | { return MD5_Update(ctx->md_data,data,count); } | 79 | { |
| 80 | return MD5_Update(ctx->md_data, data, count); | ||
| 81 | } | ||
| 78 | 82 | ||
| 79 | static int final(EVP_MD_CTX *ctx,unsigned char *md) | 83 | static int final(EVP_MD_CTX *ctx, unsigned char *md) |
| 80 | { return MD5_Final(md,ctx->md_data); } | 84 | { |
| 85 | return MD5_Final(md, ctx->md_data); | ||
| 86 | } | ||
| 81 | 87 | ||
| 82 | static const EVP_MD md5_md= | 88 | static const EVP_MD md5_md = { |
| 83 | { | ||
| 84 | NID_md5, | 89 | NID_md5, |
| 85 | NID_md5WithRSAEncryption, | 90 | NID_md5WithRSAEncryption, |
| 86 | MD5_DIGEST_LENGTH, | 91 | MD5_DIGEST_LENGTH, |
| @@ -92,11 +97,12 @@ static const EVP_MD md5_md= | |||
| 92 | NULL, | 97 | NULL, |
| 93 | EVP_PKEY_RSA_method, | 98 | EVP_PKEY_RSA_method, |
| 94 | MD5_CBLOCK, | 99 | MD5_CBLOCK, |
| 95 | sizeof(EVP_MD *)+sizeof(MD5_CTX), | 100 | sizeof(EVP_MD *) + sizeof(MD5_CTX), |
| 96 | }; | 101 | }; |
| 97 | 102 | ||
| 98 | const EVP_MD *EVP_md5(void) | 103 | const EVP_MD * |
| 99 | { | 104 | EVP_md5(void) |
| 100 | return(&md5_md); | 105 | { |
| 101 | } | 106 | return (&md5_md); |
| 107 | } | ||
| 102 | #endif | 108 | #endif |
diff --git a/src/lib/libcrypto/evp/m_mdc2.c b/src/lib/libcrypto/evp/m_mdc2.c index 3602bed316..70ce53bee8 100644 --- a/src/lib/libcrypto/evp/m_mdc2.c +++ b/src/lib/libcrypto/evp/m_mdc2.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 |
| @@ -72,16 +72,21 @@ | |||
| 72 | #include "evp_locl.h" | 72 | #include "evp_locl.h" |
| 73 | 73 | ||
| 74 | static int init(EVP_MD_CTX *ctx) | 74 | static int init(EVP_MD_CTX *ctx) |
| 75 | { return MDC2_Init(ctx->md_data); } | 75 | { |
| 76 | return MDC2_Init(ctx->md_data); | ||
| 77 | } | ||
| 76 | 78 | ||
| 77 | static int update(EVP_MD_CTX *ctx,const void *data,size_t count) | 79 | static int update(EVP_MD_CTX *ctx, const void *data, size_t count) |
| 78 | { return MDC2_Update(ctx->md_data,data,count); } | 80 | { |
| 81 | return MDC2_Update(ctx->md_data, data, count); | ||
| 82 | } | ||
| 79 | 83 | ||
| 80 | static int final(EVP_MD_CTX *ctx,unsigned char *md) | 84 | static int final(EVP_MD_CTX *ctx, unsigned char *md) |
| 81 | { return MDC2_Final(md,ctx->md_data); } | 85 | { |
| 86 | return MDC2_Final(md, ctx->md_data); | ||
| 87 | } | ||
| 82 | 88 | ||
| 83 | static const EVP_MD mdc2_md= | 89 | static const EVP_MD mdc2_md = { |
| 84 | { | ||
| 85 | NID_mdc2, | 90 | NID_mdc2, |
| 86 | NID_mdc2WithRSA, | 91 | NID_mdc2WithRSA, |
| 87 | MDC2_DIGEST_LENGTH, | 92 | MDC2_DIGEST_LENGTH, |
| @@ -93,11 +98,12 @@ static const EVP_MD mdc2_md= | |||
| 93 | NULL, | 98 | NULL, |
| 94 | EVP_PKEY_RSA_ASN1_OCTET_STRING_method, | 99 | EVP_PKEY_RSA_ASN1_OCTET_STRING_method, |
| 95 | MDC2_BLOCK, | 100 | MDC2_BLOCK, |
| 96 | sizeof(EVP_MD *)+sizeof(MDC2_CTX), | 101 | sizeof(EVP_MD *) + sizeof(MDC2_CTX), |
| 97 | }; | 102 | }; |
| 98 | 103 | ||
| 99 | const EVP_MD *EVP_mdc2(void) | 104 | const EVP_MD * |
| 100 | { | 105 | EVP_mdc2(void) |
| 101 | return(&mdc2_md); | 106 | { |
| 102 | } | 107 | return (&mdc2_md); |
| 108 | } | ||
| 103 | #endif | 109 | #endif |
diff --git a/src/lib/libcrypto/evp/m_null.c b/src/lib/libcrypto/evp/m_null.c index cb0721699d..f3c00ad5c8 100644 --- a/src/lib/libcrypto/evp/m_null.c +++ b/src/lib/libcrypto/evp/m_null.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 |
| @@ -63,16 +63,21 @@ | |||
| 63 | #include <openssl/x509.h> | 63 | #include <openssl/x509.h> |
| 64 | 64 | ||
| 65 | static int init(EVP_MD_CTX *ctx) | 65 | static int init(EVP_MD_CTX *ctx) |
| 66 | { return 1; } | 66 | { |
| 67 | return 1; | ||
| 68 | } | ||
| 67 | 69 | ||
| 68 | static int update(EVP_MD_CTX *ctx,const void *data,size_t count) | 70 | static int update(EVP_MD_CTX *ctx, const void *data, size_t count) |
| 69 | { return 1; } | 71 | { |
| 72 | return 1; | ||
| 73 | } | ||
| 70 | 74 | ||
| 71 | static int final(EVP_MD_CTX *ctx,unsigned char *md) | 75 | static int final(EVP_MD_CTX *ctx, unsigned char *md) |
| 72 | { return 1; } | 76 | { |
| 77 | return 1; | ||
| 78 | } | ||
| 73 | 79 | ||
| 74 | static const EVP_MD null_md= | 80 | static const EVP_MD null_md = { |
| 75 | { | ||
| 76 | NID_undef, | 81 | NID_undef, |
| 77 | NID_undef, | 82 | NID_undef, |
| 78 | 0, | 83 | 0, |
| @@ -85,11 +90,10 @@ static const EVP_MD null_md= | |||
| 85 | EVP_PKEY_NULL_method, | 90 | EVP_PKEY_NULL_method, |
| 86 | 0, | 91 | 0, |
| 87 | sizeof(EVP_MD *), | 92 | sizeof(EVP_MD *), |
| 88 | }; | 93 | }; |
| 89 | |||
| 90 | const EVP_MD *EVP_md_null(void) | ||
| 91 | { | ||
| 92 | return(&null_md); | ||
| 93 | } | ||
| 94 | |||
| 95 | 94 | ||
| 95 | const EVP_MD * | ||
| 96 | EVP_md_null(void) | ||
| 97 | { | ||
| 98 | return (&null_md); | ||
| 99 | } | ||
diff --git a/src/lib/libcrypto/evp/m_ripemd.c b/src/lib/libcrypto/evp/m_ripemd.c index 7bf4804cf8..69f30eb983 100644 --- a/src/lib/libcrypto/evp/m_ripemd.c +++ b/src/lib/libcrypto/evp/m_ripemd.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 |
| @@ -71,16 +71,21 @@ | |||
| 71 | #include "evp_locl.h" | 71 | #include "evp_locl.h" |
| 72 | 72 | ||
| 73 | static int init(EVP_MD_CTX *ctx) | 73 | static int init(EVP_MD_CTX *ctx) |
| 74 | { return RIPEMD160_Init(ctx->md_data); } | 74 | { |
| 75 | return RIPEMD160_Init(ctx->md_data); | ||
| 76 | } | ||
| 75 | 77 | ||
| 76 | static int update(EVP_MD_CTX *ctx,const void *data,size_t count) | 78 | static int update(EVP_MD_CTX *ctx, const void *data, size_t count) |
| 77 | { return RIPEMD160_Update(ctx->md_data,data,count); } | 79 | { |
| 80 | return RIPEMD160_Update(ctx->md_data, data, count); | ||
| 81 | } | ||
| 78 | 82 | ||
| 79 | static int final(EVP_MD_CTX *ctx,unsigned char *md) | 83 | static int final(EVP_MD_CTX *ctx, unsigned char *md) |
| 80 | { return RIPEMD160_Final(md,ctx->md_data); } | 84 | { |
| 85 | return RIPEMD160_Final(md, ctx->md_data); | ||
| 86 | } | ||
| 81 | 87 | ||
| 82 | static const EVP_MD ripemd160_md= | 88 | static const EVP_MD ripemd160_md = { |
| 83 | { | ||
| 84 | NID_ripemd160, | 89 | NID_ripemd160, |
| 85 | NID_ripemd160WithRSA, | 90 | NID_ripemd160WithRSA, |
| 86 | RIPEMD160_DIGEST_LENGTH, | 91 | RIPEMD160_DIGEST_LENGTH, |
| @@ -92,11 +97,12 @@ static const EVP_MD ripemd160_md= | |||
| 92 | NULL, | 97 | NULL, |
| 93 | EVP_PKEY_RSA_method, | 98 | EVP_PKEY_RSA_method, |
| 94 | RIPEMD160_CBLOCK, | 99 | RIPEMD160_CBLOCK, |
| 95 | sizeof(EVP_MD *)+sizeof(RIPEMD160_CTX), | 100 | sizeof(EVP_MD *) + sizeof(RIPEMD160_CTX), |
| 96 | }; | 101 | }; |
| 97 | 102 | ||
| 98 | const EVP_MD *EVP_ripemd160(void) | 103 | const EVP_MD * |
| 99 | { | 104 | EVP_ripemd160(void) |
| 100 | return(&ripemd160_md); | 105 | { |
| 101 | } | 106 | return (&ripemd160_md); |
| 107 | } | ||
| 102 | #endif | 108 | #endif |
diff --git a/src/lib/libcrypto/evp/m_sha.c b/src/lib/libcrypto/evp/m_sha.c index 8769cdd42f..d2d275f833 100644 --- a/src/lib/libcrypto/evp/m_sha.c +++ b/src/lib/libcrypto/evp/m_sha.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 |
| @@ -70,16 +70,21 @@ | |||
| 70 | #include "evp_locl.h" | 70 | #include "evp_locl.h" |
| 71 | 71 | ||
| 72 | static int init(EVP_MD_CTX *ctx) | 72 | static int init(EVP_MD_CTX *ctx) |
| 73 | { return SHA_Init(ctx->md_data); } | 73 | { |
| 74 | return SHA_Init(ctx->md_data); | ||
| 75 | } | ||
| 74 | 76 | ||
| 75 | static int update(EVP_MD_CTX *ctx,const void *data,size_t count) | 77 | static int update(EVP_MD_CTX *ctx, const void *data, size_t count) |
| 76 | { return SHA_Update(ctx->md_data,data,count); } | 78 | { |
| 79 | return SHA_Update(ctx->md_data, data, count); | ||
| 80 | } | ||
| 77 | 81 | ||
| 78 | static int final(EVP_MD_CTX *ctx,unsigned char *md) | 82 | static int final(EVP_MD_CTX *ctx, unsigned char *md) |
| 79 | { return SHA_Final(md,ctx->md_data); } | 83 | { |
| 84 | return SHA_Final(md, ctx->md_data); | ||
| 85 | } | ||
| 80 | 86 | ||
| 81 | static const EVP_MD sha_md= | 87 | static const EVP_MD sha_md = { |
| 82 | { | ||
| 83 | NID_sha, | 88 | NID_sha, |
| 84 | NID_shaWithRSAEncryption, | 89 | NID_shaWithRSAEncryption, |
| 85 | SHA_DIGEST_LENGTH, | 90 | SHA_DIGEST_LENGTH, |
| @@ -91,11 +96,12 @@ static const EVP_MD sha_md= | |||
| 91 | NULL, | 96 | NULL, |
| 92 | EVP_PKEY_RSA_method, | 97 | EVP_PKEY_RSA_method, |
| 93 | SHA_CBLOCK, | 98 | SHA_CBLOCK, |
| 94 | sizeof(EVP_MD *)+sizeof(SHA_CTX), | 99 | sizeof(EVP_MD *) + sizeof(SHA_CTX), |
| 95 | }; | 100 | }; |
| 96 | 101 | ||
| 97 | const EVP_MD *EVP_sha(void) | 102 | const EVP_MD * |
| 98 | { | 103 | EVP_sha(void) |
| 99 | return(&sha_md); | 104 | { |
| 100 | } | 105 | return (&sha_md); |
| 106 | } | ||
| 101 | #endif | 107 | #endif |
diff --git a/src/lib/libcrypto/evp/m_sha1.c b/src/lib/libcrypto/evp/m_sha1.c index f39ae77925..8c7e4eb222 100644 --- a/src/lib/libcrypto/evp/m_sha1.c +++ b/src/lib/libcrypto/evp/m_sha1.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 |
| @@ -70,16 +70,21 @@ | |||
| 70 | 70 | ||
| 71 | 71 | ||
| 72 | static int init(EVP_MD_CTX *ctx) | 72 | static int init(EVP_MD_CTX *ctx) |
| 73 | { return SHA1_Init(ctx->md_data); } | 73 | { |
| 74 | return SHA1_Init(ctx->md_data); | ||
| 75 | } | ||
| 74 | 76 | ||
| 75 | static int update(EVP_MD_CTX *ctx,const void *data,size_t count) | 77 | static int update(EVP_MD_CTX *ctx, const void *data, size_t count) |
| 76 | { return SHA1_Update(ctx->md_data,data,count); } | 78 | { |
| 79 | return SHA1_Update(ctx->md_data, data, count); | ||
| 80 | } | ||
| 77 | 81 | ||
| 78 | static int final(EVP_MD_CTX *ctx,unsigned char *md) | 82 | static int final(EVP_MD_CTX *ctx, unsigned char *md) |
| 79 | { return SHA1_Final(md,ctx->md_data); } | 83 | { |
| 84 | return SHA1_Final(md, ctx->md_data); | ||
| 85 | } | ||
| 80 | 86 | ||
| 81 | static const EVP_MD sha1_md= | 87 | static const EVP_MD sha1_md = { |
| 82 | { | ||
| 83 | NID_sha1, | 88 | NID_sha1, |
| 84 | NID_sha1WithRSAEncryption, | 89 | NID_sha1WithRSAEncryption, |
| 85 | SHA_DIGEST_LENGTH, | 90 | SHA_DIGEST_LENGTH, |
| @@ -91,32 +96,40 @@ static const EVP_MD sha1_md= | |||
| 91 | NULL, | 96 | NULL, |
| 92 | EVP_PKEY_RSA_method, | 97 | EVP_PKEY_RSA_method, |
| 93 | SHA_CBLOCK, | 98 | SHA_CBLOCK, |
| 94 | sizeof(EVP_MD *)+sizeof(SHA_CTX), | 99 | sizeof(EVP_MD *) + sizeof(SHA_CTX), |
| 95 | }; | 100 | }; |
| 96 | 101 | ||
| 97 | const EVP_MD *EVP_sha1(void) | 102 | const EVP_MD * |
| 98 | { | 103 | EVP_sha1(void) |
| 99 | return(&sha1_md); | 104 | { |
| 100 | } | 105 | return (&sha1_md); |
| 106 | } | ||
| 101 | #endif | 107 | #endif |
| 102 | 108 | ||
| 103 | #ifndef OPENSSL_NO_SHA256 | 109 | #ifndef OPENSSL_NO_SHA256 |
| 104 | static int init224(EVP_MD_CTX *ctx) | 110 | static int init224(EVP_MD_CTX *ctx) |
| 105 | { return SHA224_Init(ctx->md_data); } | 111 | { |
| 112 | return SHA224_Init(ctx->md_data); | ||
| 113 | } | ||
| 106 | static int init256(EVP_MD_CTX *ctx) | 114 | static int init256(EVP_MD_CTX *ctx) |
| 107 | { return SHA256_Init(ctx->md_data); } | 115 | { |
| 116 | return SHA256_Init(ctx->md_data); | ||
| 117 | } | ||
| 108 | /* | 118 | /* |
| 109 | * Even though there're separate SHA224_[Update|Final], we call | 119 | * Even though there're separate SHA224_[Update|Final], we call |
| 110 | * SHA256 functions even in SHA224 context. This is what happens | 120 | * SHA256 functions even in SHA224 context. This is what happens |
| 111 | * there anyway, so we can spare few CPU cycles:-) | 121 | * there anyway, so we can spare few CPU cycles:-) |
| 112 | */ | 122 | */ |
| 113 | static int update256(EVP_MD_CTX *ctx,const void *data,size_t count) | 123 | static int update256(EVP_MD_CTX *ctx, const void *data, size_t count) |
| 114 | { return SHA256_Update(ctx->md_data,data,count); } | 124 | { |
| 115 | static int final256(EVP_MD_CTX *ctx,unsigned char *md) | 125 | return SHA256_Update(ctx->md_data, data, count); |
| 116 | { return SHA256_Final(md,ctx->md_data); } | 126 | } |
| 117 | 127 | static int final256(EVP_MD_CTX *ctx, unsigned char *md) | |
| 118 | static const EVP_MD sha224_md= | 128 | { |
| 119 | { | 129 | return SHA256_Final(md, ctx->md_data); |
| 130 | } | ||
| 131 | |||
| 132 | static const EVP_MD sha224_md = { | ||
| 120 | NID_sha224, | 133 | NID_sha224, |
| 121 | NID_sha224WithRSAEncryption, | 134 | NID_sha224WithRSAEncryption, |
| 122 | SHA224_DIGEST_LENGTH, | 135 | SHA224_DIGEST_LENGTH, |
| @@ -128,14 +141,15 @@ static const EVP_MD sha224_md= | |||
| 128 | NULL, | 141 | NULL, |
| 129 | EVP_PKEY_RSA_method, | 142 | EVP_PKEY_RSA_method, |
| 130 | SHA256_CBLOCK, | 143 | SHA256_CBLOCK, |
| 131 | sizeof(EVP_MD *)+sizeof(SHA256_CTX), | 144 | sizeof(EVP_MD *) + sizeof(SHA256_CTX), |
| 132 | }; | 145 | }; |
| 133 | 146 | ||
| 134 | const EVP_MD *EVP_sha224(void) | 147 | const EVP_MD *EVP_sha224(void) |
| 135 | { return(&sha224_md); } | 148 | { |
| 149 | return (&sha224_md); | ||
| 150 | } | ||
| 136 | 151 | ||
| 137 | static const EVP_MD sha256_md= | 152 | static const EVP_MD sha256_md = { |
| 138 | { | ||
| 139 | NID_sha256, | 153 | NID_sha256, |
| 140 | NID_sha256WithRSAEncryption, | 154 | NID_sha256WithRSAEncryption, |
| 141 | SHA256_DIGEST_LENGTH, | 155 | SHA256_DIGEST_LENGTH, |
| @@ -147,26 +161,35 @@ static const EVP_MD sha256_md= | |||
| 147 | NULL, | 161 | NULL, |
| 148 | EVP_PKEY_RSA_method, | 162 | EVP_PKEY_RSA_method, |
| 149 | SHA256_CBLOCK, | 163 | SHA256_CBLOCK, |
| 150 | sizeof(EVP_MD *)+sizeof(SHA256_CTX), | 164 | sizeof(EVP_MD *) + sizeof(SHA256_CTX), |
| 151 | }; | 165 | }; |
| 152 | 166 | ||
| 153 | const EVP_MD *EVP_sha256(void) | 167 | const EVP_MD *EVP_sha256(void) |
| 154 | { return(&sha256_md); } | 168 | { |
| 169 | return (&sha256_md); | ||
| 170 | } | ||
| 155 | #endif /* ifndef OPENSSL_NO_SHA256 */ | 171 | #endif /* ifndef OPENSSL_NO_SHA256 */ |
| 156 | 172 | ||
| 157 | #ifndef OPENSSL_NO_SHA512 | 173 | #ifndef OPENSSL_NO_SHA512 |
| 158 | static int init384(EVP_MD_CTX *ctx) | 174 | static int init384(EVP_MD_CTX *ctx) |
| 159 | { return SHA384_Init(ctx->md_data); } | 175 | { |
| 176 | return SHA384_Init(ctx->md_data); | ||
| 177 | } | ||
| 160 | static int init512(EVP_MD_CTX *ctx) | 178 | static int init512(EVP_MD_CTX *ctx) |
| 161 | { return SHA512_Init(ctx->md_data); } | 179 | { |
| 180 | return SHA512_Init(ctx->md_data); | ||
| 181 | } | ||
| 162 | /* See comment in SHA224/256 section */ | 182 | /* See comment in SHA224/256 section */ |
| 163 | static int update512(EVP_MD_CTX *ctx,const void *data,size_t count) | 183 | static int update512(EVP_MD_CTX *ctx, const void *data, size_t count) |
| 164 | { return SHA512_Update(ctx->md_data,data,count); } | 184 | { |
| 165 | static int final512(EVP_MD_CTX *ctx,unsigned char *md) | 185 | return SHA512_Update(ctx->md_data, data, count); |
| 166 | { return SHA512_Final(md,ctx->md_data); } | 186 | } |
| 167 | 187 | static int final512(EVP_MD_CTX *ctx, unsigned char *md) | |
| 168 | static const EVP_MD sha384_md= | 188 | { |
| 169 | { | 189 | return SHA512_Final(md, ctx->md_data); |
| 190 | } | ||
| 191 | |||
| 192 | static const EVP_MD sha384_md = { | ||
| 170 | NID_sha384, | 193 | NID_sha384, |
| 171 | NID_sha384WithRSAEncryption, | 194 | NID_sha384WithRSAEncryption, |
| 172 | SHA384_DIGEST_LENGTH, | 195 | SHA384_DIGEST_LENGTH, |
| @@ -178,14 +201,15 @@ static const EVP_MD sha384_md= | |||
| 178 | NULL, | 201 | NULL, |
| 179 | EVP_PKEY_RSA_method, | 202 | EVP_PKEY_RSA_method, |
| 180 | SHA512_CBLOCK, | 203 | SHA512_CBLOCK, |
| 181 | sizeof(EVP_MD *)+sizeof(SHA512_CTX), | 204 | sizeof(EVP_MD *) + sizeof(SHA512_CTX), |
| 182 | }; | 205 | }; |
| 183 | 206 | ||
| 184 | const EVP_MD *EVP_sha384(void) | 207 | const EVP_MD *EVP_sha384(void) |
| 185 | { return(&sha384_md); } | 208 | { |
| 209 | return (&sha384_md); | ||
| 210 | } | ||
| 186 | 211 | ||
| 187 | static const EVP_MD sha512_md= | 212 | static const EVP_MD sha512_md = { |
| 188 | { | ||
| 189 | NID_sha512, | 213 | NID_sha512, |
| 190 | NID_sha512WithRSAEncryption, | 214 | NID_sha512WithRSAEncryption, |
| 191 | SHA512_DIGEST_LENGTH, | 215 | SHA512_DIGEST_LENGTH, |
| @@ -197,9 +221,11 @@ static const EVP_MD sha512_md= | |||
| 197 | NULL, | 221 | NULL, |
| 198 | EVP_PKEY_RSA_method, | 222 | EVP_PKEY_RSA_method, |
| 199 | SHA512_CBLOCK, | 223 | SHA512_CBLOCK, |
| 200 | sizeof(EVP_MD *)+sizeof(SHA512_CTX), | 224 | sizeof(EVP_MD *) + sizeof(SHA512_CTX), |
| 201 | }; | 225 | }; |
| 202 | 226 | ||
| 203 | const EVP_MD *EVP_sha512(void) | 227 | const EVP_MD *EVP_sha512(void) |
| 204 | { return(&sha512_md); } | 228 | { |
| 229 | return (&sha512_md); | ||
| 230 | } | ||
| 205 | #endif /* ifndef OPENSSL_NO_SHA512 */ | 231 | #endif /* ifndef OPENSSL_NO_SHA512 */ |
diff --git a/src/lib/libcrypto/evp/m_sigver.c b/src/lib/libcrypto/evp/m_sigver.c index 7e2731f4a4..0274a72c1c 100644 --- a/src/lib/libcrypto/evp/m_sigver.c +++ b/src/lib/libcrypto/evp/m_sigver.c | |||
| @@ -10,7 +10,7 @@ | |||
| 10 | * are met: | 10 | * are met: |
| 11 | * | 11 | * |
| 12 | * 1. Redistributions of source code must retain the above copyright | 12 | * 1. Redistributions of source code must retain the above copyright |
| 13 | * notice, this list of conditions and the following disclaimer. | 13 | * notice, this list of conditions and the following disclaimer. |
| 14 | * | 14 | * |
| 15 | * 2. Redistributions in binary form must reproduce the above copyright | 15 | * 2. Redistributions in binary form must reproduce the above copyright |
| 16 | * notice, this list of conditions and the following disclaimer in | 16 | * notice, this list of conditions and the following disclaimer in |
| @@ -63,50 +63,42 @@ | |||
| 63 | #include <openssl/x509.h> | 63 | #include <openssl/x509.h> |
| 64 | #include "evp_locl.h" | 64 | #include "evp_locl.h" |
| 65 | 65 | ||
| 66 | static int do_sigver_init(EVP_MD_CTX *ctx, EVP_PKEY_CTX **pctx, | 66 | static int |
| 67 | const EVP_MD *type, ENGINE *e, EVP_PKEY *pkey, | 67 | do_sigver_init(EVP_MD_CTX *ctx, EVP_PKEY_CTX **pctx, const EVP_MD *type, |
| 68 | int ver) | 68 | ENGINE *e, EVP_PKEY *pkey, int ver) |
| 69 | { | 69 | { |
| 70 | if (ctx->pctx == NULL) | 70 | if (ctx->pctx == NULL) |
| 71 | ctx->pctx = EVP_PKEY_CTX_new(pkey, e); | 71 | ctx->pctx = EVP_PKEY_CTX_new(pkey, e); |
| 72 | if (ctx->pctx == NULL) | 72 | if (ctx->pctx == NULL) |
| 73 | return 0; | 73 | return 0; |
| 74 | 74 | ||
| 75 | if (type == NULL) | 75 | if (type == NULL) { |
| 76 | { | ||
| 77 | int def_nid; | 76 | int def_nid; |
| 78 | if (EVP_PKEY_get_default_digest_nid(pkey, &def_nid) > 0) | 77 | if (EVP_PKEY_get_default_digest_nid(pkey, &def_nid) > 0) |
| 79 | type = EVP_get_digestbynid(def_nid); | 78 | type = EVP_get_digestbynid(def_nid); |
| 80 | } | 79 | } |
| 81 | 80 | ||
| 82 | if (type == NULL) | 81 | if (type == NULL) { |
| 83 | { | ||
| 84 | EVPerr(EVP_F_DO_SIGVER_INIT, EVP_R_NO_DEFAULT_DIGEST); | 82 | EVPerr(EVP_F_DO_SIGVER_INIT, EVP_R_NO_DEFAULT_DIGEST); |
| 85 | return 0; | 83 | return 0; |
| 86 | } | 84 | } |
| 87 | 85 | ||
| 88 | if (ver) | 86 | if (ver) { |
| 89 | { | 87 | if (ctx->pctx->pmeth->verifyctx_init) { |
| 90 | if (ctx->pctx->pmeth->verifyctx_init) | 88 | if (ctx->pctx->pmeth->verifyctx_init(ctx->pctx, |
| 91 | { | 89 | ctx) <=0) |
| 92 | if (ctx->pctx->pmeth->verifyctx_init(ctx->pctx, ctx) <=0) | ||
| 93 | return 0; | 90 | return 0; |
| 94 | ctx->pctx->operation = EVP_PKEY_OP_VERIFYCTX; | 91 | ctx->pctx->operation = EVP_PKEY_OP_VERIFYCTX; |
| 95 | } | 92 | } else if (EVP_PKEY_verify_init(ctx->pctx) <= 0) |
| 96 | else if (EVP_PKEY_verify_init(ctx->pctx) <= 0) | ||
| 97 | return 0; | 93 | return 0; |
| 98 | } | 94 | } else { |
| 99 | else | 95 | if (ctx->pctx->pmeth->signctx_init) { |
| 100 | { | ||
| 101 | if (ctx->pctx->pmeth->signctx_init) | ||
| 102 | { | ||
| 103 | if (ctx->pctx->pmeth->signctx_init(ctx->pctx, ctx) <= 0) | 96 | if (ctx->pctx->pmeth->signctx_init(ctx->pctx, ctx) <= 0) |
| 104 | return 0; | 97 | return 0; |
| 105 | ctx->pctx->operation = EVP_PKEY_OP_SIGNCTX; | 98 | ctx->pctx->operation = EVP_PKEY_OP_SIGNCTX; |
| 106 | } | 99 | } else if (EVP_PKEY_sign_init(ctx->pctx) <= 0) |
| 107 | else if (EVP_PKEY_sign_init(ctx->pctx) <= 0) | ||
| 108 | return 0; | 100 | return 0; |
| 109 | } | 101 | } |
| 110 | if (EVP_PKEY_CTX_set_signature_md(ctx->pctx, type) <= 0) | 102 | if (EVP_PKEY_CTX_set_signature_md(ctx->pctx, type) <= 0) |
| 111 | return 0; | 103 | return 0; |
| 112 | if (pctx) | 104 | if (pctx) |
| @@ -114,65 +106,66 @@ static int do_sigver_init(EVP_MD_CTX *ctx, EVP_PKEY_CTX **pctx, | |||
| 114 | if (!EVP_DigestInit_ex(ctx, type, e)) | 106 | if (!EVP_DigestInit_ex(ctx, type, e)) |
| 115 | return 0; | 107 | return 0; |
| 116 | return 1; | 108 | return 1; |
| 117 | } | 109 | } |
| 118 | 110 | ||
| 119 | int EVP_DigestSignInit(EVP_MD_CTX *ctx, EVP_PKEY_CTX **pctx, | 111 | int |
| 120 | const EVP_MD *type, ENGINE *e, EVP_PKEY *pkey) | 112 | EVP_DigestSignInit(EVP_MD_CTX *ctx, EVP_PKEY_CTX **pctx, const EVP_MD *type, |
| 121 | { | 113 | ENGINE *e, EVP_PKEY *pkey) |
| 114 | { | ||
| 122 | return do_sigver_init(ctx, pctx, type, e, pkey, 0); | 115 | return do_sigver_init(ctx, pctx, type, e, pkey, 0); |
| 123 | } | 116 | } |
| 124 | 117 | ||
| 125 | int EVP_DigestVerifyInit(EVP_MD_CTX *ctx, EVP_PKEY_CTX **pctx, | 118 | int |
| 126 | const EVP_MD *type, ENGINE *e, EVP_PKEY *pkey) | 119 | EVP_DigestVerifyInit(EVP_MD_CTX *ctx, EVP_PKEY_CTX **pctx, const EVP_MD *type, |
| 127 | { | 120 | ENGINE *e, EVP_PKEY *pkey) |
| 121 | { | ||
| 128 | return do_sigver_init(ctx, pctx, type, e, pkey, 1); | 122 | return do_sigver_init(ctx, pctx, type, e, pkey, 1); |
| 129 | } | 123 | } |
| 130 | 124 | ||
| 131 | int EVP_DigestSignFinal(EVP_MD_CTX *ctx, unsigned char *sigret, size_t *siglen) | 125 | int |
| 132 | { | 126 | EVP_DigestSignFinal(EVP_MD_CTX *ctx, unsigned char *sigret, size_t *siglen) |
| 127 | { | ||
| 133 | int sctx, r = 0; | 128 | int sctx, r = 0; |
| 129 | |||
| 134 | if (ctx->pctx->pmeth->signctx) | 130 | if (ctx->pctx->pmeth->signctx) |
| 135 | sctx = 1; | 131 | sctx = 1; |
| 136 | else | 132 | else |
| 137 | sctx = 0; | 133 | sctx = 0; |
| 138 | if (sigret) | 134 | if (sigret) { |
| 139 | { | ||
| 140 | EVP_MD_CTX tmp_ctx; | 135 | EVP_MD_CTX tmp_ctx; |
| 141 | unsigned char md[EVP_MAX_MD_SIZE]; | 136 | unsigned char md[EVP_MAX_MD_SIZE]; |
| 142 | unsigned int mdlen; | 137 | unsigned int mdlen; |
| 143 | EVP_MD_CTX_init(&tmp_ctx); | 138 | EVP_MD_CTX_init(&tmp_ctx); |
| 144 | if (!EVP_MD_CTX_copy_ex(&tmp_ctx,ctx)) | 139 | if (!EVP_MD_CTX_copy_ex(&tmp_ctx, ctx)) |
| 145 | return 0; | 140 | return 0; |
| 146 | if (sctx) | 141 | if (sctx) |
| 147 | r = tmp_ctx.pctx->pmeth->signctx(tmp_ctx.pctx, | 142 | r = tmp_ctx.pctx->pmeth->signctx(tmp_ctx.pctx, |
| 148 | sigret, siglen, &tmp_ctx); | 143 | sigret, siglen, &tmp_ctx); |
| 149 | else | 144 | else |
| 150 | r = EVP_DigestFinal_ex(&tmp_ctx,md,&mdlen); | 145 | r = EVP_DigestFinal_ex(&tmp_ctx, md, &mdlen); |
| 151 | EVP_MD_CTX_cleanup(&tmp_ctx); | 146 | EVP_MD_CTX_cleanup(&tmp_ctx); |
| 152 | if (sctx || !r) | 147 | if (sctx || !r) |
| 153 | return r; | 148 | return r; |
| 154 | if (EVP_PKEY_sign(ctx->pctx, sigret, siglen, md, mdlen) <= 0) | 149 | if (EVP_PKEY_sign(ctx->pctx, sigret, siglen, md, mdlen) <= 0) |
| 155 | return 0; | 150 | return 0; |
| 156 | } | 151 | } else { |
| 157 | else | 152 | if (sctx) { |
| 158 | { | 153 | if (ctx->pctx->pmeth->signctx(ctx->pctx, sigret, |
| 159 | if (sctx) | 154 | siglen, ctx) <= 0) |
| 160 | { | ||
| 161 | if (ctx->pctx->pmeth->signctx(ctx->pctx, sigret, siglen, ctx) <= 0) | ||
| 162 | return 0; | 155 | return 0; |
| 163 | } | 156 | } else { |
| 164 | else | ||
| 165 | { | ||
| 166 | int s = EVP_MD_size(ctx->digest); | 157 | int s = EVP_MD_size(ctx->digest); |
| 167 | if (s < 0 || EVP_PKEY_sign(ctx->pctx, sigret, siglen, NULL, s) <= 0) | 158 | if (s < 0 || EVP_PKEY_sign(ctx->pctx, sigret, siglen, |
| 159 | NULL, s) <= 0) | ||
| 168 | return 0; | 160 | return 0; |
| 169 | } | ||
| 170 | } | 161 | } |
| 171 | return 1; | ||
| 172 | } | 162 | } |
| 163 | return 1; | ||
| 164 | } | ||
| 173 | 165 | ||
| 174 | int EVP_DigestVerifyFinal(EVP_MD_CTX *ctx, unsigned char *sig, size_t siglen) | 166 | int |
| 175 | { | 167 | EVP_DigestVerifyFinal(EVP_MD_CTX *ctx, unsigned char *sig, size_t siglen) |
| 168 | { | ||
| 176 | EVP_MD_CTX tmp_ctx; | 169 | EVP_MD_CTX tmp_ctx; |
| 177 | unsigned char md[EVP_MAX_MD_SIZE]; | 170 | unsigned char md[EVP_MAX_MD_SIZE]; |
| 178 | int r; | 171 | int r; |
| @@ -184,17 +177,15 @@ int EVP_DigestVerifyFinal(EVP_MD_CTX *ctx, unsigned char *sig, size_t siglen) | |||
| 184 | else | 177 | else |
| 185 | vctx = 0; | 178 | vctx = 0; |
| 186 | EVP_MD_CTX_init(&tmp_ctx); | 179 | EVP_MD_CTX_init(&tmp_ctx); |
| 187 | if (!EVP_MD_CTX_copy_ex(&tmp_ctx,ctx)) | 180 | if (!EVP_MD_CTX_copy_ex(&tmp_ctx, ctx)) |
| 188 | return -1; | 181 | return -1; |
| 189 | if (vctx) | 182 | if (vctx) { |
| 190 | { | 183 | r = tmp_ctx.pctx->pmeth->verifyctx(tmp_ctx.pctx, sig, |
| 191 | r = tmp_ctx.pctx->pmeth->verifyctx(tmp_ctx.pctx, | 184 | siglen, &tmp_ctx); |
| 192 | sig, siglen, &tmp_ctx); | 185 | } else |
| 193 | } | 186 | r = EVP_DigestFinal_ex(&tmp_ctx, md, &mdlen); |
| 194 | else | ||
| 195 | r = EVP_DigestFinal_ex(&tmp_ctx,md,&mdlen); | ||
| 196 | EVP_MD_CTX_cleanup(&tmp_ctx); | 187 | EVP_MD_CTX_cleanup(&tmp_ctx); |
| 197 | if (vctx || !r) | 188 | if (vctx || !r) |
| 198 | return r; | 189 | return r; |
| 199 | return EVP_PKEY_verify(ctx->pctx, sig, siglen, md, mdlen); | 190 | return EVP_PKEY_verify(ctx->pctx, sig, siglen, md, mdlen); |
| 200 | } | 191 | } |
diff --git a/src/lib/libcrypto/evp/m_wp.c b/src/lib/libcrypto/evp/m_wp.c index c51bc2d5d1..3991a71c17 100644 --- a/src/lib/libcrypto/evp/m_wp.c +++ b/src/lib/libcrypto/evp/m_wp.c | |||
| @@ -12,16 +12,21 @@ | |||
| 12 | #include "evp_locl.h" | 12 | #include "evp_locl.h" |
| 13 | 13 | ||
| 14 | static int init(EVP_MD_CTX *ctx) | 14 | static int init(EVP_MD_CTX *ctx) |
| 15 | { return WHIRLPOOL_Init(ctx->md_data); } | 15 | { |
| 16 | return WHIRLPOOL_Init(ctx->md_data); | ||
| 17 | } | ||
| 16 | 18 | ||
| 17 | static int update(EVP_MD_CTX *ctx,const void *data,size_t count) | 19 | static int update(EVP_MD_CTX *ctx, const void *data, size_t count) |
| 18 | { return WHIRLPOOL_Update(ctx->md_data,data,count); } | 20 | { |
| 21 | return WHIRLPOOL_Update(ctx->md_data, data, count); | ||
| 22 | } | ||
| 19 | 23 | ||
| 20 | static int final(EVP_MD_CTX *ctx,unsigned char *md) | 24 | static int final(EVP_MD_CTX *ctx, unsigned char *md) |
| 21 | { return WHIRLPOOL_Final(md,ctx->md_data); } | 25 | { |
| 26 | return WHIRLPOOL_Final(md, ctx->md_data); | ||
| 27 | } | ||
| 22 | 28 | ||
| 23 | static const EVP_MD whirlpool_md= | 29 | static const EVP_MD whirlpool_md = { |
| 24 | { | ||
| 25 | NID_whirlpool, | 30 | NID_whirlpool, |
| 26 | 0, | 31 | 0, |
| 27 | WHIRLPOOL_DIGEST_LENGTH, | 32 | WHIRLPOOL_DIGEST_LENGTH, |
| @@ -33,11 +38,12 @@ static const EVP_MD whirlpool_md= | |||
| 33 | NULL, | 38 | NULL, |
| 34 | EVP_PKEY_NULL_method, | 39 | EVP_PKEY_NULL_method, |
| 35 | WHIRLPOOL_BBLOCK/8, | 40 | WHIRLPOOL_BBLOCK/8, |
| 36 | sizeof(EVP_MD *)+sizeof(WHIRLPOOL_CTX), | 41 | sizeof(EVP_MD *) + sizeof(WHIRLPOOL_CTX), |
| 37 | }; | 42 | }; |
| 38 | 43 | ||
| 39 | const EVP_MD *EVP_whirlpool(void) | 44 | const EVP_MD * |
| 40 | { | 45 | EVP_whirlpool(void) |
| 41 | return(&whirlpool_md); | 46 | { |
| 42 | } | 47 | return (&whirlpool_md); |
| 48 | } | ||
| 43 | #endif | 49 | #endif |
diff --git a/src/lib/libssl/src/crypto/evp/m_dss.c b/src/lib/libssl/src/crypto/evp/m_dss.c index 89ea5b7a6d..1516b9da3f 100644 --- a/src/lib/libssl/src/crypto/evp/m_dss.c +++ b/src/lib/libssl/src/crypto/evp/m_dss.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 |
| @@ -68,16 +68,21 @@ | |||
| 68 | #ifndef OPENSSL_NO_SHA | 68 | #ifndef OPENSSL_NO_SHA |
| 69 | 69 | ||
| 70 | static int init(EVP_MD_CTX *ctx) | 70 | static int init(EVP_MD_CTX *ctx) |
| 71 | { return SHA1_Init(ctx->md_data); } | 71 | { |
| 72 | return SHA1_Init(ctx->md_data); | ||
| 73 | } | ||
| 72 | 74 | ||
| 73 | static int update(EVP_MD_CTX *ctx,const void *data,size_t count) | 75 | static int update(EVP_MD_CTX *ctx, const void *data, size_t count) |
| 74 | { return SHA1_Update(ctx->md_data,data,count); } | 76 | { |
| 77 | return SHA1_Update(ctx->md_data, data, count); | ||
| 78 | } | ||
| 75 | 79 | ||
| 76 | static int final(EVP_MD_CTX *ctx,unsigned char *md) | 80 | static int final(EVP_MD_CTX *ctx, unsigned char *md) |
| 77 | { return SHA1_Final(md,ctx->md_data); } | 81 | { |
| 82 | return SHA1_Final(md, ctx->md_data); | ||
| 83 | } | ||
| 78 | 84 | ||
| 79 | static const EVP_MD dsa_md= | 85 | static const EVP_MD dsa_md = { |
| 80 | { | ||
| 81 | NID_dsaWithSHA, | 86 | NID_dsaWithSHA, |
| 82 | NID_dsaWithSHA, | 87 | NID_dsaWithSHA, |
| 83 | SHA_DIGEST_LENGTH, | 88 | SHA_DIGEST_LENGTH, |
| @@ -89,11 +94,12 @@ static const EVP_MD dsa_md= | |||
| 89 | NULL, | 94 | NULL, |
| 90 | EVP_PKEY_DSA_method, | 95 | EVP_PKEY_DSA_method, |
| 91 | SHA_CBLOCK, | 96 | SHA_CBLOCK, |
| 92 | sizeof(EVP_MD *)+sizeof(SHA_CTX), | 97 | sizeof(EVP_MD *) + sizeof(SHA_CTX), |
| 93 | }; | 98 | }; |
| 94 | 99 | ||
| 95 | const EVP_MD *EVP_dss(void) | 100 | const EVP_MD * |
| 96 | { | 101 | EVP_dss(void) |
| 97 | return(&dsa_md); | 102 | { |
| 98 | } | 103 | return (&dsa_md); |
| 104 | } | ||
| 99 | #endif | 105 | #endif |
diff --git a/src/lib/libssl/src/crypto/evp/m_dss1.c b/src/lib/libssl/src/crypto/evp/m_dss1.c index a010103b7a..2d9feff095 100644 --- a/src/lib/libssl/src/crypto/evp/m_dss1.c +++ b/src/lib/libssl/src/crypto/evp/m_dss1.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 |
| @@ -69,16 +69,21 @@ | |||
| 69 | #endif | 69 | #endif |
| 70 | 70 | ||
| 71 | static int init(EVP_MD_CTX *ctx) | 71 | static int init(EVP_MD_CTX *ctx) |
| 72 | { return SHA1_Init(ctx->md_data); } | 72 | { |
| 73 | return SHA1_Init(ctx->md_data); | ||
| 74 | } | ||
| 73 | 75 | ||
| 74 | static int update(EVP_MD_CTX *ctx,const void *data,size_t count) | 76 | static int update(EVP_MD_CTX *ctx, const void *data, size_t count) |
| 75 | { return SHA1_Update(ctx->md_data,data,count); } | 77 | { |
| 78 | return SHA1_Update(ctx->md_data, data, count); | ||
| 79 | } | ||
| 76 | 80 | ||
| 77 | static int final(EVP_MD_CTX *ctx,unsigned char *md) | 81 | static int final(EVP_MD_CTX *ctx, unsigned char *md) |
| 78 | { return SHA1_Final(md,ctx->md_data); } | 82 | { |
| 83 | return SHA1_Final(md, ctx->md_data); | ||
| 84 | } | ||
| 79 | 85 | ||
| 80 | static const EVP_MD dss1_md= | 86 | static const EVP_MD dss1_md = { |
| 81 | { | ||
| 82 | NID_dsa, | 87 | NID_dsa, |
| 83 | NID_dsaWithSHA1, | 88 | NID_dsaWithSHA1, |
| 84 | SHA_DIGEST_LENGTH, | 89 | SHA_DIGEST_LENGTH, |
| @@ -90,11 +95,12 @@ static const EVP_MD dss1_md= | |||
| 90 | NULL, | 95 | NULL, |
| 91 | EVP_PKEY_DSA_method, | 96 | EVP_PKEY_DSA_method, |
| 92 | SHA_CBLOCK, | 97 | SHA_CBLOCK, |
| 93 | sizeof(EVP_MD *)+sizeof(SHA_CTX), | 98 | sizeof(EVP_MD *) + sizeof(SHA_CTX), |
| 94 | }; | 99 | }; |
| 95 | 100 | ||
| 96 | const EVP_MD *EVP_dss1(void) | 101 | const EVP_MD * |
| 97 | { | 102 | EVP_dss1(void) |
| 98 | return(&dss1_md); | 103 | { |
| 99 | } | 104 | return (&dss1_md); |
| 105 | } | ||
| 100 | #endif | 106 | #endif |
diff --git a/src/lib/libssl/src/crypto/evp/m_ecdsa.c b/src/lib/libssl/src/crypto/evp/m_ecdsa.c index a6ed24b0b6..1d7714571c 100644 --- a/src/lib/libssl/src/crypto/evp/m_ecdsa.c +++ b/src/lib/libssl/src/crypto/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 |
diff --git a/src/lib/libssl/src/crypto/evp/m_md4.c b/src/lib/libssl/src/crypto/evp/m_md4.c index 6d47f61b27..5a944e3c16 100644 --- a/src/lib/libssl/src/crypto/evp/m_md4.c +++ b/src/lib/libssl/src/crypto/evp/m_md4.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 |
| @@ -72,16 +72,21 @@ | |||
| 72 | #include "evp_locl.h" | 72 | #include "evp_locl.h" |
| 73 | 73 | ||
| 74 | static int init(EVP_MD_CTX *ctx) | 74 | static int init(EVP_MD_CTX *ctx) |
| 75 | { return MD4_Init(ctx->md_data); } | 75 | { |
| 76 | return MD4_Init(ctx->md_data); | ||
| 77 | } | ||
| 76 | 78 | ||
| 77 | static int update(EVP_MD_CTX *ctx,const void *data,size_t count) | 79 | static int update(EVP_MD_CTX *ctx, const void *data, size_t count) |
| 78 | { return MD4_Update(ctx->md_data,data,count); } | 80 | { |
| 81 | return MD4_Update(ctx->md_data, data, count); | ||
| 82 | } | ||
| 79 | 83 | ||
| 80 | static int final(EVP_MD_CTX *ctx,unsigned char *md) | 84 | static int final(EVP_MD_CTX *ctx, unsigned char *md) |
| 81 | { return MD4_Final(md,ctx->md_data); } | 85 | { |
| 86 | return MD4_Final(md, ctx->md_data); | ||
| 87 | } | ||
| 82 | 88 | ||
| 83 | static const EVP_MD md4_md= | 89 | static const EVP_MD md4_md = { |
| 84 | { | ||
| 85 | NID_md4, | 90 | NID_md4, |
| 86 | NID_md4WithRSAEncryption, | 91 | NID_md4WithRSAEncryption, |
| 87 | MD4_DIGEST_LENGTH, | 92 | MD4_DIGEST_LENGTH, |
| @@ -93,11 +98,12 @@ static const EVP_MD md4_md= | |||
| 93 | NULL, | 98 | NULL, |
| 94 | EVP_PKEY_RSA_method, | 99 | EVP_PKEY_RSA_method, |
| 95 | MD4_CBLOCK, | 100 | MD4_CBLOCK, |
| 96 | sizeof(EVP_MD *)+sizeof(MD4_CTX), | 101 | sizeof(EVP_MD *) + sizeof(MD4_CTX), |
| 97 | }; | 102 | }; |
| 98 | 103 | ||
| 99 | const EVP_MD *EVP_md4(void) | 104 | const EVP_MD * |
| 100 | { | 105 | EVP_md4(void) |
| 101 | return(&md4_md); | 106 | { |
| 102 | } | 107 | return (&md4_md); |
| 108 | } | ||
| 103 | #endif | 109 | #endif |
diff --git a/src/lib/libssl/src/crypto/evp/m_md5.c b/src/lib/libssl/src/crypto/evp/m_md5.c index 9a8bae0258..4ac9829886 100644 --- a/src/lib/libssl/src/crypto/evp/m_md5.c +++ b/src/lib/libssl/src/crypto/evp/m_md5.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 |
| @@ -71,16 +71,21 @@ | |||
| 71 | #include "evp_locl.h" | 71 | #include "evp_locl.h" |
| 72 | 72 | ||
| 73 | static int init(EVP_MD_CTX *ctx) | 73 | static int init(EVP_MD_CTX *ctx) |
| 74 | { return MD5_Init(ctx->md_data); } | 74 | { |
| 75 | return MD5_Init(ctx->md_data); | ||
| 76 | } | ||
| 75 | 77 | ||
| 76 | static int update(EVP_MD_CTX *ctx,const void *data,size_t count) | 78 | static int update(EVP_MD_CTX *ctx, const void *data, size_t count) |
| 77 | { return MD5_Update(ctx->md_data,data,count); } | 79 | { |
| 80 | return MD5_Update(ctx->md_data, data, count); | ||
| 81 | } | ||
| 78 | 82 | ||
| 79 | static int final(EVP_MD_CTX *ctx,unsigned char *md) | 83 | static int final(EVP_MD_CTX *ctx, unsigned char *md) |
| 80 | { return MD5_Final(md,ctx->md_data); } | 84 | { |
| 85 | return MD5_Final(md, ctx->md_data); | ||
| 86 | } | ||
| 81 | 87 | ||
| 82 | static const EVP_MD md5_md= | 88 | static const EVP_MD md5_md = { |
| 83 | { | ||
| 84 | NID_md5, | 89 | NID_md5, |
| 85 | NID_md5WithRSAEncryption, | 90 | NID_md5WithRSAEncryption, |
| 86 | MD5_DIGEST_LENGTH, | 91 | MD5_DIGEST_LENGTH, |
| @@ -92,11 +97,12 @@ static const EVP_MD md5_md= | |||
| 92 | NULL, | 97 | NULL, |
| 93 | EVP_PKEY_RSA_method, | 98 | EVP_PKEY_RSA_method, |
| 94 | MD5_CBLOCK, | 99 | MD5_CBLOCK, |
| 95 | sizeof(EVP_MD *)+sizeof(MD5_CTX), | 100 | sizeof(EVP_MD *) + sizeof(MD5_CTX), |
| 96 | }; | 101 | }; |
| 97 | 102 | ||
| 98 | const EVP_MD *EVP_md5(void) | 103 | const EVP_MD * |
| 99 | { | 104 | EVP_md5(void) |
| 100 | return(&md5_md); | 105 | { |
| 101 | } | 106 | return (&md5_md); |
| 107 | } | ||
| 102 | #endif | 108 | #endif |
diff --git a/src/lib/libssl/src/crypto/evp/m_mdc2.c b/src/lib/libssl/src/crypto/evp/m_mdc2.c index 3602bed316..70ce53bee8 100644 --- a/src/lib/libssl/src/crypto/evp/m_mdc2.c +++ b/src/lib/libssl/src/crypto/evp/m_mdc2.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 |
| @@ -72,16 +72,21 @@ | |||
| 72 | #include "evp_locl.h" | 72 | #include "evp_locl.h" |
| 73 | 73 | ||
| 74 | static int init(EVP_MD_CTX *ctx) | 74 | static int init(EVP_MD_CTX *ctx) |
| 75 | { return MDC2_Init(ctx->md_data); } | 75 | { |
| 76 | return MDC2_Init(ctx->md_data); | ||
| 77 | } | ||
| 76 | 78 | ||
| 77 | static int update(EVP_MD_CTX *ctx,const void *data,size_t count) | 79 | static int update(EVP_MD_CTX *ctx, const void *data, size_t count) |
| 78 | { return MDC2_Update(ctx->md_data,data,count); } | 80 | { |
| 81 | return MDC2_Update(ctx->md_data, data, count); | ||
| 82 | } | ||
| 79 | 83 | ||
| 80 | static int final(EVP_MD_CTX *ctx,unsigned char *md) | 84 | static int final(EVP_MD_CTX *ctx, unsigned char *md) |
| 81 | { return MDC2_Final(md,ctx->md_data); } | 85 | { |
| 86 | return MDC2_Final(md, ctx->md_data); | ||
| 87 | } | ||
| 82 | 88 | ||
| 83 | static const EVP_MD mdc2_md= | 89 | static const EVP_MD mdc2_md = { |
| 84 | { | ||
| 85 | NID_mdc2, | 90 | NID_mdc2, |
| 86 | NID_mdc2WithRSA, | 91 | NID_mdc2WithRSA, |
| 87 | MDC2_DIGEST_LENGTH, | 92 | MDC2_DIGEST_LENGTH, |
| @@ -93,11 +98,12 @@ static const EVP_MD mdc2_md= | |||
| 93 | NULL, | 98 | NULL, |
| 94 | EVP_PKEY_RSA_ASN1_OCTET_STRING_method, | 99 | EVP_PKEY_RSA_ASN1_OCTET_STRING_method, |
| 95 | MDC2_BLOCK, | 100 | MDC2_BLOCK, |
| 96 | sizeof(EVP_MD *)+sizeof(MDC2_CTX), | 101 | sizeof(EVP_MD *) + sizeof(MDC2_CTX), |
| 97 | }; | 102 | }; |
| 98 | 103 | ||
| 99 | const EVP_MD *EVP_mdc2(void) | 104 | const EVP_MD * |
| 100 | { | 105 | EVP_mdc2(void) |
| 101 | return(&mdc2_md); | 106 | { |
| 102 | } | 107 | return (&mdc2_md); |
| 108 | } | ||
| 103 | #endif | 109 | #endif |
diff --git a/src/lib/libssl/src/crypto/evp/m_null.c b/src/lib/libssl/src/crypto/evp/m_null.c index cb0721699d..f3c00ad5c8 100644 --- a/src/lib/libssl/src/crypto/evp/m_null.c +++ b/src/lib/libssl/src/crypto/evp/m_null.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 |
| @@ -63,16 +63,21 @@ | |||
| 63 | #include <openssl/x509.h> | 63 | #include <openssl/x509.h> |
| 64 | 64 | ||
| 65 | static int init(EVP_MD_CTX *ctx) | 65 | static int init(EVP_MD_CTX *ctx) |
| 66 | { return 1; } | 66 | { |
| 67 | return 1; | ||
| 68 | } | ||
| 67 | 69 | ||
| 68 | static int update(EVP_MD_CTX *ctx,const void *data,size_t count) | 70 | static int update(EVP_MD_CTX *ctx, const void *data, size_t count) |
| 69 | { return 1; } | 71 | { |
| 72 | return 1; | ||
| 73 | } | ||
| 70 | 74 | ||
| 71 | static int final(EVP_MD_CTX *ctx,unsigned char *md) | 75 | static int final(EVP_MD_CTX *ctx, unsigned char *md) |
| 72 | { return 1; } | 76 | { |
| 77 | return 1; | ||
| 78 | } | ||
| 73 | 79 | ||
| 74 | static const EVP_MD null_md= | 80 | static const EVP_MD null_md = { |
| 75 | { | ||
| 76 | NID_undef, | 81 | NID_undef, |
| 77 | NID_undef, | 82 | NID_undef, |
| 78 | 0, | 83 | 0, |
| @@ -85,11 +90,10 @@ static const EVP_MD null_md= | |||
| 85 | EVP_PKEY_NULL_method, | 90 | EVP_PKEY_NULL_method, |
| 86 | 0, | 91 | 0, |
| 87 | sizeof(EVP_MD *), | 92 | sizeof(EVP_MD *), |
| 88 | }; | 93 | }; |
| 89 | |||
| 90 | const EVP_MD *EVP_md_null(void) | ||
| 91 | { | ||
| 92 | return(&null_md); | ||
| 93 | } | ||
| 94 | |||
| 95 | 94 | ||
| 95 | const EVP_MD * | ||
| 96 | EVP_md_null(void) | ||
| 97 | { | ||
| 98 | return (&null_md); | ||
| 99 | } | ||
diff --git a/src/lib/libssl/src/crypto/evp/m_ripemd.c b/src/lib/libssl/src/crypto/evp/m_ripemd.c index 7bf4804cf8..69f30eb983 100644 --- a/src/lib/libssl/src/crypto/evp/m_ripemd.c +++ b/src/lib/libssl/src/crypto/evp/m_ripemd.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 |
| @@ -71,16 +71,21 @@ | |||
| 71 | #include "evp_locl.h" | 71 | #include "evp_locl.h" |
| 72 | 72 | ||
| 73 | static int init(EVP_MD_CTX *ctx) | 73 | static int init(EVP_MD_CTX *ctx) |
| 74 | { return RIPEMD160_Init(ctx->md_data); } | 74 | { |
| 75 | return RIPEMD160_Init(ctx->md_data); | ||
| 76 | } | ||
| 75 | 77 | ||
| 76 | static int update(EVP_MD_CTX *ctx,const void *data,size_t count) | 78 | static int update(EVP_MD_CTX *ctx, const void *data, size_t count) |
| 77 | { return RIPEMD160_Update(ctx->md_data,data,count); } | 79 | { |
| 80 | return RIPEMD160_Update(ctx->md_data, data, count); | ||
| 81 | } | ||
| 78 | 82 | ||
| 79 | static int final(EVP_MD_CTX *ctx,unsigned char *md) | 83 | static int final(EVP_MD_CTX *ctx, unsigned char *md) |
| 80 | { return RIPEMD160_Final(md,ctx->md_data); } | 84 | { |
| 85 | return RIPEMD160_Final(md, ctx->md_data); | ||
| 86 | } | ||
| 81 | 87 | ||
| 82 | static const EVP_MD ripemd160_md= | 88 | static const EVP_MD ripemd160_md = { |
| 83 | { | ||
| 84 | NID_ripemd160, | 89 | NID_ripemd160, |
| 85 | NID_ripemd160WithRSA, | 90 | NID_ripemd160WithRSA, |
| 86 | RIPEMD160_DIGEST_LENGTH, | 91 | RIPEMD160_DIGEST_LENGTH, |
| @@ -92,11 +97,12 @@ static const EVP_MD ripemd160_md= | |||
| 92 | NULL, | 97 | NULL, |
| 93 | EVP_PKEY_RSA_method, | 98 | EVP_PKEY_RSA_method, |
| 94 | RIPEMD160_CBLOCK, | 99 | RIPEMD160_CBLOCK, |
| 95 | sizeof(EVP_MD *)+sizeof(RIPEMD160_CTX), | 100 | sizeof(EVP_MD *) + sizeof(RIPEMD160_CTX), |
| 96 | }; | 101 | }; |
| 97 | 102 | ||
| 98 | const EVP_MD *EVP_ripemd160(void) | 103 | const EVP_MD * |
| 99 | { | 104 | EVP_ripemd160(void) |
| 100 | return(&ripemd160_md); | 105 | { |
| 101 | } | 106 | return (&ripemd160_md); |
| 107 | } | ||
| 102 | #endif | 108 | #endif |
diff --git a/src/lib/libssl/src/crypto/evp/m_sha.c b/src/lib/libssl/src/crypto/evp/m_sha.c index 8769cdd42f..d2d275f833 100644 --- a/src/lib/libssl/src/crypto/evp/m_sha.c +++ b/src/lib/libssl/src/crypto/evp/m_sha.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 |
| @@ -70,16 +70,21 @@ | |||
| 70 | #include "evp_locl.h" | 70 | #include "evp_locl.h" |
| 71 | 71 | ||
| 72 | static int init(EVP_MD_CTX *ctx) | 72 | static int init(EVP_MD_CTX *ctx) |
| 73 | { return SHA_Init(ctx->md_data); } | 73 | { |
| 74 | return SHA_Init(ctx->md_data); | ||
| 75 | } | ||
| 74 | 76 | ||
| 75 | static int update(EVP_MD_CTX *ctx,const void *data,size_t count) | 77 | static int update(EVP_MD_CTX *ctx, const void *data, size_t count) |
| 76 | { return SHA_Update(ctx->md_data,data,count); } | 78 | { |
| 79 | return SHA_Update(ctx->md_data, data, count); | ||
| 80 | } | ||
| 77 | 81 | ||
| 78 | static int final(EVP_MD_CTX *ctx,unsigned char *md) | 82 | static int final(EVP_MD_CTX *ctx, unsigned char *md) |
| 79 | { return SHA_Final(md,ctx->md_data); } | 83 | { |
| 84 | return SHA_Final(md, ctx->md_data); | ||
| 85 | } | ||
| 80 | 86 | ||
| 81 | static const EVP_MD sha_md= | 87 | static const EVP_MD sha_md = { |
| 82 | { | ||
| 83 | NID_sha, | 88 | NID_sha, |
| 84 | NID_shaWithRSAEncryption, | 89 | NID_shaWithRSAEncryption, |
| 85 | SHA_DIGEST_LENGTH, | 90 | SHA_DIGEST_LENGTH, |
| @@ -91,11 +96,12 @@ static const EVP_MD sha_md= | |||
| 91 | NULL, | 96 | NULL, |
| 92 | EVP_PKEY_RSA_method, | 97 | EVP_PKEY_RSA_method, |
| 93 | SHA_CBLOCK, | 98 | SHA_CBLOCK, |
| 94 | sizeof(EVP_MD *)+sizeof(SHA_CTX), | 99 | sizeof(EVP_MD *) + sizeof(SHA_CTX), |
| 95 | }; | 100 | }; |
| 96 | 101 | ||
| 97 | const EVP_MD *EVP_sha(void) | 102 | const EVP_MD * |
| 98 | { | 103 | EVP_sha(void) |
| 99 | return(&sha_md); | 104 | { |
| 100 | } | 105 | return (&sha_md); |
| 106 | } | ||
| 101 | #endif | 107 | #endif |
diff --git a/src/lib/libssl/src/crypto/evp/m_sha1.c b/src/lib/libssl/src/crypto/evp/m_sha1.c index f39ae77925..8c7e4eb222 100644 --- a/src/lib/libssl/src/crypto/evp/m_sha1.c +++ b/src/lib/libssl/src/crypto/evp/m_sha1.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 |
| @@ -70,16 +70,21 @@ | |||
| 70 | 70 | ||
| 71 | 71 | ||
| 72 | static int init(EVP_MD_CTX *ctx) | 72 | static int init(EVP_MD_CTX *ctx) |
| 73 | { return SHA1_Init(ctx->md_data); } | 73 | { |
| 74 | return SHA1_Init(ctx->md_data); | ||
| 75 | } | ||
| 74 | 76 | ||
| 75 | static int update(EVP_MD_CTX *ctx,const void *data,size_t count) | 77 | static int update(EVP_MD_CTX *ctx, const void *data, size_t count) |
| 76 | { return SHA1_Update(ctx->md_data,data,count); } | 78 | { |
| 79 | return SHA1_Update(ctx->md_data, data, count); | ||
| 80 | } | ||
| 77 | 81 | ||
| 78 | static int final(EVP_MD_CTX *ctx,unsigned char *md) | 82 | static int final(EVP_MD_CTX *ctx, unsigned char *md) |
| 79 | { return SHA1_Final(md,ctx->md_data); } | 83 | { |
| 84 | return SHA1_Final(md, ctx->md_data); | ||
| 85 | } | ||
| 80 | 86 | ||
| 81 | static const EVP_MD sha1_md= | 87 | static const EVP_MD sha1_md = { |
| 82 | { | ||
| 83 | NID_sha1, | 88 | NID_sha1, |
| 84 | NID_sha1WithRSAEncryption, | 89 | NID_sha1WithRSAEncryption, |
| 85 | SHA_DIGEST_LENGTH, | 90 | SHA_DIGEST_LENGTH, |
| @@ -91,32 +96,40 @@ static const EVP_MD sha1_md= | |||
| 91 | NULL, | 96 | NULL, |
| 92 | EVP_PKEY_RSA_method, | 97 | EVP_PKEY_RSA_method, |
| 93 | SHA_CBLOCK, | 98 | SHA_CBLOCK, |
| 94 | sizeof(EVP_MD *)+sizeof(SHA_CTX), | 99 | sizeof(EVP_MD *) + sizeof(SHA_CTX), |
| 95 | }; | 100 | }; |
| 96 | 101 | ||
| 97 | const EVP_MD *EVP_sha1(void) | 102 | const EVP_MD * |
| 98 | { | 103 | EVP_sha1(void) |
| 99 | return(&sha1_md); | 104 | { |
| 100 | } | 105 | return (&sha1_md); |
| 106 | } | ||
| 101 | #endif | 107 | #endif |
| 102 | 108 | ||
| 103 | #ifndef OPENSSL_NO_SHA256 | 109 | #ifndef OPENSSL_NO_SHA256 |
| 104 | static int init224(EVP_MD_CTX *ctx) | 110 | static int init224(EVP_MD_CTX *ctx) |
| 105 | { return SHA224_Init(ctx->md_data); } | 111 | { |
| 112 | return SHA224_Init(ctx->md_data); | ||
| 113 | } | ||
| 106 | static int init256(EVP_MD_CTX *ctx) | 114 | static int init256(EVP_MD_CTX *ctx) |
| 107 | { return SHA256_Init(ctx->md_data); } | 115 | { |
| 116 | return SHA256_Init(ctx->md_data); | ||
| 117 | } | ||
| 108 | /* | 118 | /* |
| 109 | * Even though there're separate SHA224_[Update|Final], we call | 119 | * Even though there're separate SHA224_[Update|Final], we call |
| 110 | * SHA256 functions even in SHA224 context. This is what happens | 120 | * SHA256 functions even in SHA224 context. This is what happens |
| 111 | * there anyway, so we can spare few CPU cycles:-) | 121 | * there anyway, so we can spare few CPU cycles:-) |
| 112 | */ | 122 | */ |
| 113 | static int update256(EVP_MD_CTX *ctx,const void *data,size_t count) | 123 | static int update256(EVP_MD_CTX *ctx, const void *data, size_t count) |
| 114 | { return SHA256_Update(ctx->md_data,data,count); } | 124 | { |
| 115 | static int final256(EVP_MD_CTX *ctx,unsigned char *md) | 125 | return SHA256_Update(ctx->md_data, data, count); |
| 116 | { return SHA256_Final(md,ctx->md_data); } | 126 | } |
| 117 | 127 | static int final256(EVP_MD_CTX *ctx, unsigned char *md) | |
| 118 | static const EVP_MD sha224_md= | 128 | { |
| 119 | { | 129 | return SHA256_Final(md, ctx->md_data); |
| 130 | } | ||
| 131 | |||
| 132 | static const EVP_MD sha224_md = { | ||
| 120 | NID_sha224, | 133 | NID_sha224, |
| 121 | NID_sha224WithRSAEncryption, | 134 | NID_sha224WithRSAEncryption, |
| 122 | SHA224_DIGEST_LENGTH, | 135 | SHA224_DIGEST_LENGTH, |
| @@ -128,14 +141,15 @@ static const EVP_MD sha224_md= | |||
| 128 | NULL, | 141 | NULL, |
| 129 | EVP_PKEY_RSA_method, | 142 | EVP_PKEY_RSA_method, |
| 130 | SHA256_CBLOCK, | 143 | SHA256_CBLOCK, |
| 131 | sizeof(EVP_MD *)+sizeof(SHA256_CTX), | 144 | sizeof(EVP_MD *) + sizeof(SHA256_CTX), |
| 132 | }; | 145 | }; |
| 133 | 146 | ||
| 134 | const EVP_MD *EVP_sha224(void) | 147 | const EVP_MD *EVP_sha224(void) |
| 135 | { return(&sha224_md); } | 148 | { |
| 149 | return (&sha224_md); | ||
| 150 | } | ||
| 136 | 151 | ||
| 137 | static const EVP_MD sha256_md= | 152 | static const EVP_MD sha256_md = { |
| 138 | { | ||
| 139 | NID_sha256, | 153 | NID_sha256, |
| 140 | NID_sha256WithRSAEncryption, | 154 | NID_sha256WithRSAEncryption, |
| 141 | SHA256_DIGEST_LENGTH, | 155 | SHA256_DIGEST_LENGTH, |
| @@ -147,26 +161,35 @@ static const EVP_MD sha256_md= | |||
| 147 | NULL, | 161 | NULL, |
| 148 | EVP_PKEY_RSA_method, | 162 | EVP_PKEY_RSA_method, |
| 149 | SHA256_CBLOCK, | 163 | SHA256_CBLOCK, |
| 150 | sizeof(EVP_MD *)+sizeof(SHA256_CTX), | 164 | sizeof(EVP_MD *) + sizeof(SHA256_CTX), |
| 151 | }; | 165 | }; |
| 152 | 166 | ||
| 153 | const EVP_MD *EVP_sha256(void) | 167 | const EVP_MD *EVP_sha256(void) |
| 154 | { return(&sha256_md); } | 168 | { |
| 169 | return (&sha256_md); | ||
| 170 | } | ||
| 155 | #endif /* ifndef OPENSSL_NO_SHA256 */ | 171 | #endif /* ifndef OPENSSL_NO_SHA256 */ |
| 156 | 172 | ||
| 157 | #ifndef OPENSSL_NO_SHA512 | 173 | #ifndef OPENSSL_NO_SHA512 |
| 158 | static int init384(EVP_MD_CTX *ctx) | 174 | static int init384(EVP_MD_CTX *ctx) |
| 159 | { return SHA384_Init(ctx->md_data); } | 175 | { |
| 176 | return SHA384_Init(ctx->md_data); | ||
| 177 | } | ||
| 160 | static int init512(EVP_MD_CTX *ctx) | 178 | static int init512(EVP_MD_CTX *ctx) |
| 161 | { return SHA512_Init(ctx->md_data); } | 179 | { |
| 180 | return SHA512_Init(ctx->md_data); | ||
| 181 | } | ||
| 162 | /* See comment in SHA224/256 section */ | 182 | /* See comment in SHA224/256 section */ |
| 163 | static int update512(EVP_MD_CTX *ctx,const void *data,size_t count) | 183 | static int update512(EVP_MD_CTX *ctx, const void *data, size_t count) |
| 164 | { return SHA512_Update(ctx->md_data,data,count); } | 184 | { |
| 165 | static int final512(EVP_MD_CTX *ctx,unsigned char *md) | 185 | return SHA512_Update(ctx->md_data, data, count); |
| 166 | { return SHA512_Final(md,ctx->md_data); } | 186 | } |
| 167 | 187 | static int final512(EVP_MD_CTX *ctx, unsigned char *md) | |
| 168 | static const EVP_MD sha384_md= | 188 | { |
| 169 | { | 189 | return SHA512_Final(md, ctx->md_data); |
| 190 | } | ||
| 191 | |||
| 192 | static const EVP_MD sha384_md = { | ||
| 170 | NID_sha384, | 193 | NID_sha384, |
| 171 | NID_sha384WithRSAEncryption, | 194 | NID_sha384WithRSAEncryption, |
| 172 | SHA384_DIGEST_LENGTH, | 195 | SHA384_DIGEST_LENGTH, |
| @@ -178,14 +201,15 @@ static const EVP_MD sha384_md= | |||
| 178 | NULL, | 201 | NULL, |
| 179 | EVP_PKEY_RSA_method, | 202 | EVP_PKEY_RSA_method, |
| 180 | SHA512_CBLOCK, | 203 | SHA512_CBLOCK, |
| 181 | sizeof(EVP_MD *)+sizeof(SHA512_CTX), | 204 | sizeof(EVP_MD *) + sizeof(SHA512_CTX), |
| 182 | }; | 205 | }; |
| 183 | 206 | ||
| 184 | const EVP_MD *EVP_sha384(void) | 207 | const EVP_MD *EVP_sha384(void) |
| 185 | { return(&sha384_md); } | 208 | { |
| 209 | return (&sha384_md); | ||
| 210 | } | ||
| 186 | 211 | ||
| 187 | static const EVP_MD sha512_md= | 212 | static const EVP_MD sha512_md = { |
| 188 | { | ||
| 189 | NID_sha512, | 213 | NID_sha512, |
| 190 | NID_sha512WithRSAEncryption, | 214 | NID_sha512WithRSAEncryption, |
| 191 | SHA512_DIGEST_LENGTH, | 215 | SHA512_DIGEST_LENGTH, |
| @@ -197,9 +221,11 @@ static const EVP_MD sha512_md= | |||
| 197 | NULL, | 221 | NULL, |
| 198 | EVP_PKEY_RSA_method, | 222 | EVP_PKEY_RSA_method, |
| 199 | SHA512_CBLOCK, | 223 | SHA512_CBLOCK, |
| 200 | sizeof(EVP_MD *)+sizeof(SHA512_CTX), | 224 | sizeof(EVP_MD *) + sizeof(SHA512_CTX), |
| 201 | }; | 225 | }; |
| 202 | 226 | ||
| 203 | const EVP_MD *EVP_sha512(void) | 227 | const EVP_MD *EVP_sha512(void) |
| 204 | { return(&sha512_md); } | 228 | { |
| 229 | return (&sha512_md); | ||
| 230 | } | ||
| 205 | #endif /* ifndef OPENSSL_NO_SHA512 */ | 231 | #endif /* ifndef OPENSSL_NO_SHA512 */ |
diff --git a/src/lib/libssl/src/crypto/evp/m_sigver.c b/src/lib/libssl/src/crypto/evp/m_sigver.c index 7e2731f4a4..0274a72c1c 100644 --- a/src/lib/libssl/src/crypto/evp/m_sigver.c +++ b/src/lib/libssl/src/crypto/evp/m_sigver.c | |||
| @@ -10,7 +10,7 @@ | |||
| 10 | * are met: | 10 | * are met: |
| 11 | * | 11 | * |
| 12 | * 1. Redistributions of source code must retain the above copyright | 12 | * 1. Redistributions of source code must retain the above copyright |
| 13 | * notice, this list of conditions and the following disclaimer. | 13 | * notice, this list of conditions and the following disclaimer. |
| 14 | * | 14 | * |
| 15 | * 2. Redistributions in binary form must reproduce the above copyright | 15 | * 2. Redistributions in binary form must reproduce the above copyright |
| 16 | * notice, this list of conditions and the following disclaimer in | 16 | * notice, this list of conditions and the following disclaimer in |
| @@ -63,50 +63,42 @@ | |||
| 63 | #include <openssl/x509.h> | 63 | #include <openssl/x509.h> |
| 64 | #include "evp_locl.h" | 64 | #include "evp_locl.h" |
| 65 | 65 | ||
| 66 | static int do_sigver_init(EVP_MD_CTX *ctx, EVP_PKEY_CTX **pctx, | 66 | static int |
| 67 | const EVP_MD *type, ENGINE *e, EVP_PKEY *pkey, | 67 | do_sigver_init(EVP_MD_CTX *ctx, EVP_PKEY_CTX **pctx, const EVP_MD *type, |
| 68 | int ver) | 68 | ENGINE *e, EVP_PKEY *pkey, int ver) |
| 69 | { | 69 | { |
| 70 | if (ctx->pctx == NULL) | 70 | if (ctx->pctx == NULL) |
| 71 | ctx->pctx = EVP_PKEY_CTX_new(pkey, e); | 71 | ctx->pctx = EVP_PKEY_CTX_new(pkey, e); |
| 72 | if (ctx->pctx == NULL) | 72 | if (ctx->pctx == NULL) |
| 73 | return 0; | 73 | return 0; |
| 74 | 74 | ||
| 75 | if (type == NULL) | 75 | if (type == NULL) { |
| 76 | { | ||
| 77 | int def_nid; | 76 | int def_nid; |
| 78 | if (EVP_PKEY_get_default_digest_nid(pkey, &def_nid) > 0) | 77 | if (EVP_PKEY_get_default_digest_nid(pkey, &def_nid) > 0) |
| 79 | type = EVP_get_digestbynid(def_nid); | 78 | type = EVP_get_digestbynid(def_nid); |
| 80 | } | 79 | } |
| 81 | 80 | ||
| 82 | if (type == NULL) | 81 | if (type == NULL) { |
| 83 | { | ||
| 84 | EVPerr(EVP_F_DO_SIGVER_INIT, EVP_R_NO_DEFAULT_DIGEST); | 82 | EVPerr(EVP_F_DO_SIGVER_INIT, EVP_R_NO_DEFAULT_DIGEST); |
| 85 | return 0; | 83 | return 0; |
| 86 | } | 84 | } |
| 87 | 85 | ||
| 88 | if (ver) | 86 | if (ver) { |
| 89 | { | 87 | if (ctx->pctx->pmeth->verifyctx_init) { |
| 90 | if (ctx->pctx->pmeth->verifyctx_init) | 88 | if (ctx->pctx->pmeth->verifyctx_init(ctx->pctx, |
| 91 | { | 89 | ctx) <=0) |
| 92 | if (ctx->pctx->pmeth->verifyctx_init(ctx->pctx, ctx) <=0) | ||
| 93 | return 0; | 90 | return 0; |
| 94 | ctx->pctx->operation = EVP_PKEY_OP_VERIFYCTX; | 91 | ctx->pctx->operation = EVP_PKEY_OP_VERIFYCTX; |
| 95 | } | 92 | } else if (EVP_PKEY_verify_init(ctx->pctx) <= 0) |
| 96 | else if (EVP_PKEY_verify_init(ctx->pctx) <= 0) | ||
| 97 | return 0; | 93 | return 0; |
| 98 | } | 94 | } else { |
| 99 | else | 95 | if (ctx->pctx->pmeth->signctx_init) { |
| 100 | { | ||
| 101 | if (ctx->pctx->pmeth->signctx_init) | ||
| 102 | { | ||
| 103 | if (ctx->pctx->pmeth->signctx_init(ctx->pctx, ctx) <= 0) | 96 | if (ctx->pctx->pmeth->signctx_init(ctx->pctx, ctx) <= 0) |
| 104 | return 0; | 97 | return 0; |
| 105 | ctx->pctx->operation = EVP_PKEY_OP_SIGNCTX; | 98 | ctx->pctx->operation = EVP_PKEY_OP_SIGNCTX; |
| 106 | } | 99 | } else if (EVP_PKEY_sign_init(ctx->pctx) <= 0) |
| 107 | else if (EVP_PKEY_sign_init(ctx->pctx) <= 0) | ||
| 108 | return 0; | 100 | return 0; |
| 109 | } | 101 | } |
| 110 | if (EVP_PKEY_CTX_set_signature_md(ctx->pctx, type) <= 0) | 102 | if (EVP_PKEY_CTX_set_signature_md(ctx->pctx, type) <= 0) |
| 111 | return 0; | 103 | return 0; |
| 112 | if (pctx) | 104 | if (pctx) |
| @@ -114,65 +106,66 @@ static int do_sigver_init(EVP_MD_CTX *ctx, EVP_PKEY_CTX **pctx, | |||
| 114 | if (!EVP_DigestInit_ex(ctx, type, e)) | 106 | if (!EVP_DigestInit_ex(ctx, type, e)) |
| 115 | return 0; | 107 | return 0; |
| 116 | return 1; | 108 | return 1; |
| 117 | } | 109 | } |
| 118 | 110 | ||
| 119 | int EVP_DigestSignInit(EVP_MD_CTX *ctx, EVP_PKEY_CTX **pctx, | 111 | int |
| 120 | const EVP_MD *type, ENGINE *e, EVP_PKEY *pkey) | 112 | EVP_DigestSignInit(EVP_MD_CTX *ctx, EVP_PKEY_CTX **pctx, const EVP_MD *type, |
| 121 | { | 113 | ENGINE *e, EVP_PKEY *pkey) |
| 114 | { | ||
| 122 | return do_sigver_init(ctx, pctx, type, e, pkey, 0); | 115 | return do_sigver_init(ctx, pctx, type, e, pkey, 0); |
| 123 | } | 116 | } |
| 124 | 117 | ||
| 125 | int EVP_DigestVerifyInit(EVP_MD_CTX *ctx, EVP_PKEY_CTX **pctx, | 118 | int |
| 126 | const EVP_MD *type, ENGINE *e, EVP_PKEY *pkey) | 119 | EVP_DigestVerifyInit(EVP_MD_CTX *ctx, EVP_PKEY_CTX **pctx, const EVP_MD *type, |
| 127 | { | 120 | ENGINE *e, EVP_PKEY *pkey) |
| 121 | { | ||
| 128 | return do_sigver_init(ctx, pctx, type, e, pkey, 1); | 122 | return do_sigver_init(ctx, pctx, type, e, pkey, 1); |
| 129 | } | 123 | } |
| 130 | 124 | ||
| 131 | int EVP_DigestSignFinal(EVP_MD_CTX *ctx, unsigned char *sigret, size_t *siglen) | 125 | int |
| 132 | { | 126 | EVP_DigestSignFinal(EVP_MD_CTX *ctx, unsigned char *sigret, size_t *siglen) |
| 127 | { | ||
| 133 | int sctx, r = 0; | 128 | int sctx, r = 0; |
| 129 | |||
| 134 | if (ctx->pctx->pmeth->signctx) | 130 | if (ctx->pctx->pmeth->signctx) |
| 135 | sctx = 1; | 131 | sctx = 1; |
| 136 | else | 132 | else |
| 137 | sctx = 0; | 133 | sctx = 0; |
| 138 | if (sigret) | 134 | if (sigret) { |
| 139 | { | ||
| 140 | EVP_MD_CTX tmp_ctx; | 135 | EVP_MD_CTX tmp_ctx; |
| 141 | unsigned char md[EVP_MAX_MD_SIZE]; | 136 | unsigned char md[EVP_MAX_MD_SIZE]; |
| 142 | unsigned int mdlen; | 137 | unsigned int mdlen; |
| 143 | EVP_MD_CTX_init(&tmp_ctx); | 138 | EVP_MD_CTX_init(&tmp_ctx); |
| 144 | if (!EVP_MD_CTX_copy_ex(&tmp_ctx,ctx)) | 139 | if (!EVP_MD_CTX_copy_ex(&tmp_ctx, ctx)) |
| 145 | return 0; | 140 | return 0; |
| 146 | if (sctx) | 141 | if (sctx) |
| 147 | r = tmp_ctx.pctx->pmeth->signctx(tmp_ctx.pctx, | 142 | r = tmp_ctx.pctx->pmeth->signctx(tmp_ctx.pctx, |
| 148 | sigret, siglen, &tmp_ctx); | 143 | sigret, siglen, &tmp_ctx); |
| 149 | else | 144 | else |
| 150 | r = EVP_DigestFinal_ex(&tmp_ctx,md,&mdlen); | 145 | r = EVP_DigestFinal_ex(&tmp_ctx, md, &mdlen); |
| 151 | EVP_MD_CTX_cleanup(&tmp_ctx); | 146 | EVP_MD_CTX_cleanup(&tmp_ctx); |
| 152 | if (sctx || !r) | 147 | if (sctx || !r) |
| 153 | return r; | 148 | return r; |
| 154 | if (EVP_PKEY_sign(ctx->pctx, sigret, siglen, md, mdlen) <= 0) | 149 | if (EVP_PKEY_sign(ctx->pctx, sigret, siglen, md, mdlen) <= 0) |
| 155 | return 0; | 150 | return 0; |
| 156 | } | 151 | } else { |
| 157 | else | 152 | if (sctx) { |
| 158 | { | 153 | if (ctx->pctx->pmeth->signctx(ctx->pctx, sigret, |
| 159 | if (sctx) | 154 | siglen, ctx) <= 0) |
| 160 | { | ||
| 161 | if (ctx->pctx->pmeth->signctx(ctx->pctx, sigret, siglen, ctx) <= 0) | ||
| 162 | return 0; | 155 | return 0; |
| 163 | } | 156 | } else { |
| 164 | else | ||
| 165 | { | ||
| 166 | int s = EVP_MD_size(ctx->digest); | 157 | int s = EVP_MD_size(ctx->digest); |
| 167 | if (s < 0 || EVP_PKEY_sign(ctx->pctx, sigret, siglen, NULL, s) <= 0) | 158 | if (s < 0 || EVP_PKEY_sign(ctx->pctx, sigret, siglen, |
| 159 | NULL, s) <= 0) | ||
| 168 | return 0; | 160 | return 0; |
| 169 | } | ||
| 170 | } | 161 | } |
| 171 | return 1; | ||
| 172 | } | 162 | } |
| 163 | return 1; | ||
| 164 | } | ||
| 173 | 165 | ||
| 174 | int EVP_DigestVerifyFinal(EVP_MD_CTX *ctx, unsigned char *sig, size_t siglen) | 166 | int |
| 175 | { | 167 | EVP_DigestVerifyFinal(EVP_MD_CTX *ctx, unsigned char *sig, size_t siglen) |
| 168 | { | ||
| 176 | EVP_MD_CTX tmp_ctx; | 169 | EVP_MD_CTX tmp_ctx; |
| 177 | unsigned char md[EVP_MAX_MD_SIZE]; | 170 | unsigned char md[EVP_MAX_MD_SIZE]; |
| 178 | int r; | 171 | int r; |
| @@ -184,17 +177,15 @@ int EVP_DigestVerifyFinal(EVP_MD_CTX *ctx, unsigned char *sig, size_t siglen) | |||
| 184 | else | 177 | else |
| 185 | vctx = 0; | 178 | vctx = 0; |
| 186 | EVP_MD_CTX_init(&tmp_ctx); | 179 | EVP_MD_CTX_init(&tmp_ctx); |
| 187 | if (!EVP_MD_CTX_copy_ex(&tmp_ctx,ctx)) | 180 | if (!EVP_MD_CTX_copy_ex(&tmp_ctx, ctx)) |
| 188 | return -1; | 181 | return -1; |
| 189 | if (vctx) | 182 | if (vctx) { |
| 190 | { | 183 | r = tmp_ctx.pctx->pmeth->verifyctx(tmp_ctx.pctx, sig, |
| 191 | r = tmp_ctx.pctx->pmeth->verifyctx(tmp_ctx.pctx, | 184 | siglen, &tmp_ctx); |
| 192 | sig, siglen, &tmp_ctx); | 185 | } else |
| 193 | } | 186 | r = EVP_DigestFinal_ex(&tmp_ctx, md, &mdlen); |
| 194 | else | ||
| 195 | r = EVP_DigestFinal_ex(&tmp_ctx,md,&mdlen); | ||
| 196 | EVP_MD_CTX_cleanup(&tmp_ctx); | 187 | EVP_MD_CTX_cleanup(&tmp_ctx); |
| 197 | if (vctx || !r) | 188 | if (vctx || !r) |
| 198 | return r; | 189 | return r; |
| 199 | return EVP_PKEY_verify(ctx->pctx, sig, siglen, md, mdlen); | 190 | return EVP_PKEY_verify(ctx->pctx, sig, siglen, md, mdlen); |
| 200 | } | 191 | } |
diff --git a/src/lib/libssl/src/crypto/evp/m_wp.c b/src/lib/libssl/src/crypto/evp/m_wp.c index c51bc2d5d1..3991a71c17 100644 --- a/src/lib/libssl/src/crypto/evp/m_wp.c +++ b/src/lib/libssl/src/crypto/evp/m_wp.c | |||
| @@ -12,16 +12,21 @@ | |||
| 12 | #include "evp_locl.h" | 12 | #include "evp_locl.h" |
| 13 | 13 | ||
| 14 | static int init(EVP_MD_CTX *ctx) | 14 | static int init(EVP_MD_CTX *ctx) |
| 15 | { return WHIRLPOOL_Init(ctx->md_data); } | 15 | { |
| 16 | return WHIRLPOOL_Init(ctx->md_data); | ||
| 17 | } | ||
| 16 | 18 | ||
| 17 | static int update(EVP_MD_CTX *ctx,const void *data,size_t count) | 19 | static int update(EVP_MD_CTX *ctx, const void *data, size_t count) |
| 18 | { return WHIRLPOOL_Update(ctx->md_data,data,count); } | 20 | { |
| 21 | return WHIRLPOOL_Update(ctx->md_data, data, count); | ||
| 22 | } | ||
| 19 | 23 | ||
| 20 | static int final(EVP_MD_CTX *ctx,unsigned char *md) | 24 | static int final(EVP_MD_CTX *ctx, unsigned char *md) |
| 21 | { return WHIRLPOOL_Final(md,ctx->md_data); } | 25 | { |
| 26 | return WHIRLPOOL_Final(md, ctx->md_data); | ||
| 27 | } | ||
| 22 | 28 | ||
| 23 | static const EVP_MD whirlpool_md= | 29 | static const EVP_MD whirlpool_md = { |
| 24 | { | ||
| 25 | NID_whirlpool, | 30 | NID_whirlpool, |
| 26 | 0, | 31 | 0, |
| 27 | WHIRLPOOL_DIGEST_LENGTH, | 32 | WHIRLPOOL_DIGEST_LENGTH, |
| @@ -33,11 +38,12 @@ static const EVP_MD whirlpool_md= | |||
| 33 | NULL, | 38 | NULL, |
| 34 | EVP_PKEY_NULL_method, | 39 | EVP_PKEY_NULL_method, |
| 35 | WHIRLPOOL_BBLOCK/8, | 40 | WHIRLPOOL_BBLOCK/8, |
| 36 | sizeof(EVP_MD *)+sizeof(WHIRLPOOL_CTX), | 41 | sizeof(EVP_MD *) + sizeof(WHIRLPOOL_CTX), |
| 37 | }; | 42 | }; |
| 38 | 43 | ||
| 39 | const EVP_MD *EVP_whirlpool(void) | 44 | const EVP_MD * |
| 40 | { | 45 | EVP_whirlpool(void) |
| 41 | return(&whirlpool_md); | 46 | { |
| 42 | } | 47 | return (&whirlpool_md); |
| 48 | } | ||
| 43 | #endif | 49 | #endif |
