From b77305065be9ea8af14bd6792e1852ab5e957fcb Mon Sep 17 00:00:00 2001 From: deraadt <> Date: Tue, 15 Jun 2004 23:41:49 +0000 Subject: machdep.xcrypt now has a different meaning: Instead of > 0 indicating that AES is there, we now have 3 flag bits: C3_HAS_AES, C3_HAS_SHA (SHA1 & SHA256), and C3_HAS_MM (RSA). Change this code to only look at C3_HAS_AES for now. --- src/lib/libcrypto/engine/hw_cryptodev.c | 30 +++++++++++++------------ src/lib/libssl/src/crypto/engine/hw_cryptodev.c | 30 +++++++++++++------------ 2 files changed, 32 insertions(+), 28 deletions(-) (limited to 'src/lib') diff --git a/src/lib/libcrypto/engine/hw_cryptodev.c b/src/lib/libcrypto/engine/hw_cryptodev.c index 21de0a9fdd..d12d23d9fc 100644 --- a/src/lib/libcrypto/engine/hw_cryptodev.c +++ b/src/lib/libcrypto/engine/hw_cryptodev.c @@ -744,20 +744,22 @@ check_viac3aes(void) if (value == 0) return (0); - cryptodev_aes_128_cbc.init = xcrypt_init_key; - cryptodev_aes_128_cbc.do_cipher = xcrypt_cipher; - cryptodev_aes_128_cbc.cleanup = xcrypt_cleanup; - cryptodev_aes_128_cbc.ctx_size = sizeof(AES_KEY); - - cryptodev_aes_192_cbc.init = xcrypt_init_key; - cryptodev_aes_192_cbc.do_cipher = xcrypt_cipher; - cryptodev_aes_192_cbc.cleanup = xcrypt_cleanup; - cryptodev_aes_192_cbc.ctx_size = sizeof(AES_KEY); - - cryptodev_aes_256_cbc.init = xcrypt_init_key; - cryptodev_aes_256_cbc.do_cipher = xcrypt_cipher; - cryptodev_aes_256_cbc.cleanup = xcrypt_cleanup; - cryptodev_aes_256_cbc.ctx_size = sizeof(AES_KEY); + if (value & C3_HAS_AES) { + cryptodev_aes_128_cbc.init = xcrypt_init_key; + cryptodev_aes_128_cbc.do_cipher = xcrypt_cipher; + cryptodev_aes_128_cbc.cleanup = xcrypt_cleanup; + cryptodev_aes_128_cbc.ctx_size = sizeof(AES_KEY); + + cryptodev_aes_192_cbc.init = xcrypt_init_key; + cryptodev_aes_192_cbc.do_cipher = xcrypt_cipher; + cryptodev_aes_192_cbc.cleanup = xcrypt_cleanup; + cryptodev_aes_192_cbc.ctx_size = sizeof(AES_KEY); + + cryptodev_aes_256_cbc.init = xcrypt_init_key; + 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 (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 21de0a9fdd..d12d23d9fc 100644 --- a/src/lib/libssl/src/crypto/engine/hw_cryptodev.c +++ b/src/lib/libssl/src/crypto/engine/hw_cryptodev.c @@ -744,20 +744,22 @@ check_viac3aes(void) if (value == 0) return (0); - cryptodev_aes_128_cbc.init = xcrypt_init_key; - cryptodev_aes_128_cbc.do_cipher = xcrypt_cipher; - cryptodev_aes_128_cbc.cleanup = xcrypt_cleanup; - cryptodev_aes_128_cbc.ctx_size = sizeof(AES_KEY); - - cryptodev_aes_192_cbc.init = xcrypt_init_key; - cryptodev_aes_192_cbc.do_cipher = xcrypt_cipher; - cryptodev_aes_192_cbc.cleanup = xcrypt_cleanup; - cryptodev_aes_192_cbc.ctx_size = sizeof(AES_KEY); - - cryptodev_aes_256_cbc.init = xcrypt_init_key; - cryptodev_aes_256_cbc.do_cipher = xcrypt_cipher; - cryptodev_aes_256_cbc.cleanup = xcrypt_cleanup; - cryptodev_aes_256_cbc.ctx_size = sizeof(AES_KEY); + if (value & C3_HAS_AES) { + cryptodev_aes_128_cbc.init = xcrypt_init_key; + cryptodev_aes_128_cbc.do_cipher = xcrypt_cipher; + cryptodev_aes_128_cbc.cleanup = xcrypt_cleanup; + cryptodev_aes_128_cbc.ctx_size = sizeof(AES_KEY); + + cryptodev_aes_192_cbc.init = xcrypt_init_key; + cryptodev_aes_192_cbc.do_cipher = xcrypt_cipher; + cryptodev_aes_192_cbc.cleanup = xcrypt_cleanup; + cryptodev_aes_192_cbc.ctx_size = sizeof(AES_KEY); + + cryptodev_aes_256_cbc.init = xcrypt_init_key; + 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 (value); } #endif /* __i386__ */ -- cgit v1.2.3-55-g6feb