From acb76436eeac44bb2432cf37441f3eba95b589a5 Mon Sep 17 00:00:00 2001 From: deraadt <> Date: Wed, 4 Feb 2004 21:31:10 +0000 Subject: remove some debug code and cleanup.. --- src/lib/libcrypto/engine/hw_cryptodev.c | 24 ++++++------------------ src/lib/libssl/src/crypto/engine/hw_cryptodev.c | 24 ++++++------------------ 2 files changed, 12 insertions(+), 36 deletions(-) diff --git a/src/lib/libcrypto/engine/hw_cryptodev.c b/src/lib/libcrypto/engine/hw_cryptodev.c index b1eb38325d..2fe84a5002 100644 --- a/src/lib/libcrypto/engine/hw_cryptodev.c +++ b/src/lib/libcrypto/engine/hw_cryptodev.c @@ -1,6 +1,6 @@ /* + * Copyright (c) 2002-2004 Theo de Raadt * Copyright (c) 2002 Bob Beck - * Copyright (c) 2002 Theo de Raadt * Copyright (c) 2002 Markus Friedl * All rights reserved. * @@ -55,8 +55,6 @@ ENGINE_load_cryptodev(void) #include #include -#include - #include #include #include @@ -70,6 +68,9 @@ ENGINE_load_cryptodev(void) #include #include #include + +#include + static int check_viac3aes(void); #endif @@ -261,7 +262,7 @@ get_cryptodev_ciphers(const int **cnids) * On i386, always check for the VIA C3 AES instructions; * even if /dev/crypto is disabled. */ - if (check_viac3aes() == 1) { + if (check_viac3aes() >= 1) { int have_NID_aes_128_cbc = 0; int have_NID_aes_192_cbc = 0; int have_NID_aes_256_cbc = 0; @@ -709,16 +710,9 @@ xcrypt_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key, const unsigned char *iv, int enc) { AES_KEY *k = ctx->cipher_data; - u_long *kk = (u_long *)key; int i; bzero(k, sizeof *k); -#ifdef notdef - for (i = 0; i < ctx->key_len / 4; i++) - printf("%08x ", kk[i]); - printf("\n"); -#endif - if (enc) AES_set_encrypt_key(key, ctx->key_len * 8, k); else @@ -728,12 +722,6 @@ xcrypt_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key, for (i = 0; i < 4 * (AES_MAXNR + 1); i++) k->rd_key[i] = htonl(k->rd_key[i]); -#ifdef notdef - for (i = 0; i < 4 * (AES_MAXNR + 1); i++) - printf("%08x ", k->rd_key[i]); - printf("\n"); -#endif - return (1); } @@ -770,7 +758,7 @@ check_viac3aes(void) cryptodev_aes_256_cbc.do_cipher = xcrypt_cipher; cryptodev_aes_256_cbc.cleanup = xcrypt_cleanup; cryptodev_aes_256_cbc.ctx_size = sizeof(AES_KEY); - return (1); + return (value); } #endif /* __i386__ */ diff --git a/src/lib/libssl/src/crypto/engine/hw_cryptodev.c b/src/lib/libssl/src/crypto/engine/hw_cryptodev.c index b1eb38325d..2fe84a5002 100644 --- a/src/lib/libssl/src/crypto/engine/hw_cryptodev.c +++ b/src/lib/libssl/src/crypto/engine/hw_cryptodev.c @@ -1,6 +1,6 @@ /* + * Copyright (c) 2002-2004 Theo de Raadt * Copyright (c) 2002 Bob Beck - * Copyright (c) 2002 Theo de Raadt * Copyright (c) 2002 Markus Friedl * All rights reserved. * @@ -55,8 +55,6 @@ ENGINE_load_cryptodev(void) #include #include -#include - #include #include #include @@ -70,6 +68,9 @@ ENGINE_load_cryptodev(void) #include #include #include + +#include + static int check_viac3aes(void); #endif @@ -261,7 +262,7 @@ get_cryptodev_ciphers(const int **cnids) * On i386, always check for the VIA C3 AES instructions; * even if /dev/crypto is disabled. */ - if (check_viac3aes() == 1) { + if (check_viac3aes() >= 1) { int have_NID_aes_128_cbc = 0; int have_NID_aes_192_cbc = 0; int have_NID_aes_256_cbc = 0; @@ -709,16 +710,9 @@ xcrypt_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key, const unsigned char *iv, int enc) { AES_KEY *k = ctx->cipher_data; - u_long *kk = (u_long *)key; int i; bzero(k, sizeof *k); -#ifdef notdef - for (i = 0; i < ctx->key_len / 4; i++) - printf("%08x ", kk[i]); - printf("\n"); -#endif - if (enc) AES_set_encrypt_key(key, ctx->key_len * 8, k); else @@ -728,12 +722,6 @@ xcrypt_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key, for (i = 0; i < 4 * (AES_MAXNR + 1); i++) k->rd_key[i] = htonl(k->rd_key[i]); -#ifdef notdef - for (i = 0; i < 4 * (AES_MAXNR + 1); i++) - printf("%08x ", k->rd_key[i]); - printf("\n"); -#endif - return (1); } @@ -770,7 +758,7 @@ check_viac3aes(void) cryptodev_aes_256_cbc.do_cipher = xcrypt_cipher; cryptodev_aes_256_cbc.cleanup = xcrypt_cleanup; cryptodev_aes_256_cbc.ctx_size = sizeof(AES_KEY); - return (1); + return (value); } #endif /* __i386__ */ -- cgit v1.2.3-55-g6feb