diff options
-rw-r--r-- | crypto/dh/dh_check.c | 10 | ||||
-rw-r--r-- | crypto/dh/dh_gen.c | 12 | ||||
-rw-r--r-- | crypto/modes/gcm128.c | 3 | ||||
-rw-r--r-- | crypto/pkcs12/p12_key.c | 7 | ||||
-rw-r--r-- | crypto/ripemd/asm/rips.cpp | 82 | ||||
-rw-r--r-- | crypto/ripemd/rmd_locl.h | 18 | ||||
-rw-r--r-- | crypto/rsa/rsa_null.c | 11 | ||||
-rw-r--r-- | crypto/srp/Makefile | 4 | ||||
-rw-r--r-- | crypto/srp/srp_lcl.h | 84 | ||||
-rw-r--r-- | crypto/srp/srp_lib.c | 5 | ||||
-rw-r--r-- | crypto/srp/srp_vfy.c | 7 |
11 files changed, 11 insertions, 232 deletions
diff --git a/crypto/dh/dh_check.c b/crypto/dh/dh_check.c index 347467c6a4..7a8e063fc8 100644 --- a/crypto/dh/dh_check.c +++ b/crypto/dh/dh_check.c @@ -116,15 +116,7 @@ int DH_check(const DH *dh, int *ret) l = BN_mod_word(dh->p, 24); if (l != 11) *ret |= DH_NOT_SUITABLE_GENERATOR; - } -#if 0 - else if (BN_is_word(dh->g, DH_GENERATOR_3)) { - l = BN_mod_word(dh->p, 12); - if (l != 5) - *ret |= DH_NOT_SUITABLE_GENERATOR; - } -#endif - else if (BN_is_word(dh->g, DH_GENERATOR_5)) { + } else if (BN_is_word(dh->g, DH_GENERATOR_5)) { l = BN_mod_word(dh->p, 10); if ((l != 3) && (l != 7)) *ret |= DH_NOT_SUITABLE_GENERATOR; diff --git a/crypto/dh/dh_gen.c b/crypto/dh/dh_gen.c index 9b9db6458b..99ccae33bf 100644 --- a/crypto/dh/dh_gen.c +++ b/crypto/dh/dh_gen.c @@ -136,17 +136,7 @@ static int dh_builtin_genparams(DH *ret, int prime_len, int generator, if (!BN_set_word(t2, 11)) goto err; g = 2; - } -#if 0 /* does not work for safe primes */ - else if (generator == DH_GENERATOR_3) { - if (!BN_set_word(t1, 12)) - goto err; - if (!BN_set_word(t2, 5)) - goto err; - g = 3; - } -#endif - else if (generator == DH_GENERATOR_5) { + } else if (generator == DH_GENERATOR_5) { if (!BN_set_word(t1, 10)) goto err; if (!BN_set_word(t2, 3)) diff --git a/crypto/modes/gcm128.c b/crypto/modes/gcm128.c index 5c75c91f82..1d1b0d9b16 100644 --- a/crypto/modes/gcm128.c +++ b/crypto/modes/gcm128.c @@ -1036,9 +1036,6 @@ int CRYPTO_gcm128_encrypt(GCM128_CONTEXT *ctx, # endif #endif -#if 0 - n = (unsigned int)mlen % 16; /* alternative to ctx->mres */ -#endif mlen += len; if (mlen > ((U64(1) << 36) - 32) || (sizeof(len) == 8 && mlen < len)) return -1; diff --git a/crypto/pkcs12/p12_key.c b/crypto/pkcs12/p12_key.c index 99b8260c96..5a062087d1 100644 --- a/crypto/pkcs12/p12_key.c +++ b/crypto/pkcs12/p12_key.c @@ -118,13 +118,6 @@ int PKCS12_key_gen_uni(unsigned char *pass, int passlen, unsigned char *salt, int tmpn = n; #endif -#if 0 - if (!pass) { - PKCS12err(PKCS12_F_PKCS12_KEY_GEN_UNI, ERR_R_PASSED_NULL_PARAMETER); - return 0; - } -#endif - EVP_MD_CTX_init(&ctx); #ifdef DEBUG_KEYGEN fprintf(stderr, "KEYGEN DEBUG\n"); diff --git a/crypto/ripemd/asm/rips.cpp b/crypto/ripemd/asm/rips.cpp deleted file mode 100644 index f7a13677a9..0000000000 --- a/crypto/ripemd/asm/rips.cpp +++ /dev/null @@ -1,82 +0,0 @@ -// -// gettsc.inl -// -// gives access to the Pentium's (secret) cycle counter -// -// This software was written by Leonard Janke (janke@unixg.ubc.ca) -// in 1996-7 and is entered, by him, into the public domain. - -#if defined(__WATCOMC__) -void GetTSC(unsigned long&); -#pragma aux GetTSC = 0x0f 0x31 "mov [edi], eax" parm [edi] modify [edx eax]; -#elif defined(__GNUC__) -inline -void GetTSC(unsigned long& tsc) -{ - asm volatile(".byte 15, 49\n\t" - : "=eax" (tsc) - : - : "%edx", "%eax"); -} -#elif defined(_MSC_VER) -inline -void GetTSC(unsigned long& tsc) -{ - unsigned long a; - __asm _emit 0fh - __asm _emit 31h - __asm mov a, eax; - tsc=a; -} -#endif - -#include <stdio.h> -#include <stdlib.h> -#include <openssl/ripemd.h> - -#define ripemd160_block_x86 ripemd160_block_asm_host_order - -extern "C" { -void ripemd160_block_x86(RIPEMD160_CTX *ctx, unsigned char *buffer,int num); -} - -void main(int argc,char *argv[]) - { - unsigned char buffer[64*256]; - RIPEMD160_CTX ctx; - unsigned long s1,s2,e1,e2; - unsigned char k[16]; - unsigned long data[2]; - unsigned char iv[8]; - int i,num=0,numm; - int j=0; - - if (argc >= 2) - num=atoi(argv[1]); - - if (num == 0) num=16; - if (num > 250) num=16; - numm=num+2; -#if 0 - num*=64; - numm*=64; -#endif - - for (j=0; j<6; j++) - { - for (i=0; i<10; i++) /**/ - { - ripemd160_block_x86(&ctx,buffer,numm); - GetTSC(s1); - ripemd160_block_x86(&ctx,buffer,numm); - GetTSC(e1); - GetTSC(s2); - ripemd160_block_x86(&ctx,buffer,num); - GetTSC(e2); - ripemd160_block_x86(&ctx,buffer,num); - } - printf("ripemd160 (%d bytes) %d %d (%.2f)\n",num*64, - e1-s1,e2-s2,(double)((e1-s1)-(e2-s2))/2); - } - } - diff --git a/crypto/ripemd/rmd_locl.h b/crypto/ripemd/rmd_locl.h index 497a1a167e..5a2eed386c 100644 --- a/crypto/ripemd/rmd_locl.h +++ b/crypto/ripemd/rmd_locl.h @@ -94,22 +94,14 @@ void ripemd160_block_data_order(RIPEMD160_CTX *c, const void *p, size_t num); #include "md32_common.h" -#if 0 -# define F1(x,y,z) ((x)^(y)^(z)) -# define F2(x,y,z) (((x)&(y))|((~x)&z)) -# define F3(x,y,z) (((x)|(~y))^(z)) -# define F4(x,y,z) (((x)&(z))|((y)&(~(z)))) -# define F5(x,y,z) ((x)^((y)|(~(z)))) -#else /* * Transformed F2 and F4 are courtesy of Wei Dai <weidai@eskimo.com> */ -# define F1(x,y,z) ((x) ^ (y) ^ (z)) -# define F2(x,y,z) ((((y) ^ (z)) & (x)) ^ (z)) -# define F3(x,y,z) (((~(y)) | (x)) ^ (z)) -# define F4(x,y,z) ((((x) ^ (y)) & (z)) ^ (y)) -# define F5(x,y,z) (((~(z)) | (y)) ^ (x)) -#endif +#define F1(x,y,z) ((x) ^ (y) ^ (z)) +#define F2(x,y,z) ((((y) ^ (z)) & (x)) ^ (z)) +#define F3(x,y,z) (((~(y)) | (x)) ^ (z)) +#define F4(x,y,z) ((((x) ^ (y)) & (z)) ^ (y)) +#define F5(x,y,z) (((~(z)) | (y)) ^ (x)) #define RIPEMD160_A 0x67452301L #define RIPEMD160_B 0xEFCDAB89L diff --git a/crypto/rsa/rsa_null.c b/crypto/rsa/rsa_null.c index 241b431ad5..535660a7de 100644 --- a/crypto/rsa/rsa_null.c +++ b/crypto/rsa/rsa_null.c @@ -79,9 +79,6 @@ static int RSA_null_public_decrypt(int flen, const unsigned char *from, unsigned char *to, RSA *rsa, int padding); static int RSA_null_private_decrypt(int flen, const unsigned char *from, unsigned char *to, RSA *rsa, int padding); -#if 0 /* not currently used */ -static int RSA_null_mod_exp(const BIGNUM *r0, const BIGNUM *i, RSA *rsa); -#endif static int RSA_null_init(RSA *rsa); static int RSA_null_finish(RSA *rsa); static RSA_METHOD rsa_null_meth = { @@ -136,14 +133,6 @@ static int RSA_null_public_decrypt(int flen, const unsigned char *from, return -1; } -#if 0 /* not currently used */ -static int RSA_null_mod_exp(BIGNUM *r0, BIGNUM *I, RSA *rsa) -{ - ... err(RSA_F_RSA_NULL_MOD_EXP, RSA_R_RSA_OPERATIONS_NOT_SUPPORTED); - return -1; -} -#endif - static int RSA_null_init(RSA *rsa) { return (1); diff --git a/crypto/srp/Makefile b/crypto/srp/Makefile index 0c37ec7da7..3674dd6cd6 100644 --- a/crypto/srp/Makefile +++ b/crypto/srp/Makefile @@ -82,7 +82,7 @@ srp_lib.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h srp_lib.o: ../../include/openssl/ossl_typ.h ../../include/openssl/safestack.h srp_lib.o: ../../include/openssl/sha.h ../../include/openssl/srp.h srp_lib.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h -srp_lib.o: ../cryptlib.h ../include/internal/bn_srp.h srp_lcl.h srp_lib.c +srp_lib.o: ../cryptlib.h ../include/internal/bn_srp.h srp_lib.c srp_vfy.o: ../../e_os.h ../../include/openssl/asn1.h srp_vfy.o: ../../include/openssl/bio.h ../../include/openssl/bn.h srp_vfy.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h @@ -94,4 +94,4 @@ srp_vfy.o: ../../include/openssl/ossl_typ.h ../../include/openssl/rand.h srp_vfy.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h srp_vfy.o: ../../include/openssl/srp.h ../../include/openssl/stack.h srp_vfy.o: ../../include/openssl/symhacks.h ../../include/openssl/txt_db.h -srp_vfy.o: ../cryptlib.h srp_lcl.h srp_vfy.c +srp_vfy.o: ../cryptlib.h srp_vfy.c diff --git a/crypto/srp/srp_lcl.h b/crypto/srp/srp_lcl.h deleted file mode 100644 index 9a7fce1b4c..0000000000 --- a/crypto/srp/srp_lcl.h +++ /dev/null @@ -1,84 +0,0 @@ -/* crypto/srp/srp_lcl.h */ -/* - * Written by Peter Sylvester (peter.sylvester@edelweb.fr) for the EdelKey - * project and contributed to the OpenSSL project 2004. - */ -/* ==================================================================== - * Copyright (c) 2004 The OpenSSL Project. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. All advertising materials mentioning features or use of this - * software must display the following acknowledgment: - * "This product includes software developed by the OpenSSL Project - * for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" - * - * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to - * endorse or promote products derived from this software without - * prior written permission. For written permission, please contact - * licensing@OpenSSL.org. - * - * 5. Products derived from this software may not be called "OpenSSL" - * nor may "OpenSSL" appear in their names without prior written - * permission of the OpenSSL Project. - * - * 6. Redistributions of any form whatsoever must retain the following - * acknowledgment: - * "This product includes software developed by the OpenSSL Project - * for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" - * - * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY - * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED - * OF THE POSSIBILITY OF SUCH DAMAGE. - * ==================================================================== - * - * This product includes cryptographic software written by Eric Young - * (eay@cryptsoft.com). This product includes software written by Tim - * Hudson (tjh@cryptsoft.com). - * - */ -#ifndef HEADER_SRP_LCL_H -# define HEADER_SRP_LCL_H - -# include <openssl/srp.h> -# include <openssl/sha.h> - -# if 0 -# define srp_bn_print(a) {fprintf(stderr, #a "="); BN_print_fp(stderr,a); \ - fprintf(stderr,"\n");} -# else -# define srp_bn_print(a) -# endif - - - -#ifdef __cplusplus -extern "C" { -#endif - - - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/crypto/srp/srp_lib.c b/crypto/srp/srp_lib.c index 6997a28957..9e1de740c1 100644 --- a/crypto/srp/srp_lib.c +++ b/crypto/srp/srp_lib.c @@ -59,7 +59,7 @@ */ #ifndef OPENSSL_NO_SRP # include "cryptlib.h" -# include "srp_lcl.h" +# include <openssl/sha.h> # include <openssl/srp.h> # include <openssl/evp.h> # include "internal/bn_srp.h" @@ -317,9 +317,6 @@ char *SRP_check_known_gN_param(BIGNUM *g, BIGNUM *N) if ((g == NULL) || (N == NULL)) return 0; - srp_bn_print(g); - srp_bn_print(N); - for (i = 0; i < KNOWN_GN_NUMBER; i++) { if (BN_cmp(knowngN[i].g, g) == 0 && BN_cmp(knowngN[i].N, N) == 0) return knowngN[i].id; diff --git a/crypto/srp/srp_vfy.c b/crypto/srp/srp_vfy.c index df82ca3830..4aed5b4ba5 100644 --- a/crypto/srp/srp_vfy.c +++ b/crypto/srp/srp_vfy.c @@ -59,7 +59,7 @@ */ #ifndef OPENSSL_NO_SRP # include "cryptlib.h" -# include "srp_lcl.h" +# include <openssl/sha.h> # include <openssl/srp.h> # include <openssl/evp.h> # include <openssl/buffer.h> @@ -607,9 +607,6 @@ int SRP_create_verifier_BN(const char *user, const char *pass, BIGNUM **salt, (verifier == NULL) || (N == NULL) || (g == NULL) || (bn_ctx == NULL)) goto err; - srp_bn_print(N); - srp_bn_print(g); - if (*salt == NULL) { RAND_pseudo_bytes(tmp2, SRP_RANDOM_SALT_LEN); @@ -627,8 +624,6 @@ int SRP_create_verifier_BN(const char *user, const char *pass, BIGNUM **salt, goto err; } - srp_bn_print(*verifier); - result = 1; err: |