diff options
author | deraadt <> | 2004-06-15 23:41:49 +0000 |
---|---|---|
committer | deraadt <> | 2004-06-15 23:41:49 +0000 |
commit | b77305065be9ea8af14bd6792e1852ab5e957fcb (patch) | |
tree | 99a4537389bc4408b3825458b4b735757b233430 | |
parent | ae9f75ae846c14c230b202c01a33e14601eb8c43 (diff) | |
download | openbsd-b77305065be9ea8af14bd6792e1852ab5e957fcb.tar.gz openbsd-b77305065be9ea8af14bd6792e1852ab5e957fcb.tar.bz2 openbsd-b77305065be9ea8af14bd6792e1852ab5e957fcb.zip |
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.
-rw-r--r-- | src/lib/libcrypto/engine/hw_cryptodev.c | 30 | ||||
-rw-r--r-- | src/lib/libssl/src/crypto/engine/hw_cryptodev.c | 30 |
2 files changed, 32 insertions, 28 deletions
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) | |||
744 | if (value == 0) | 744 | if (value == 0) |
745 | return (0); | 745 | return (0); |
746 | 746 | ||
747 | cryptodev_aes_128_cbc.init = xcrypt_init_key; | 747 | if (value & C3_HAS_AES) { |
748 | cryptodev_aes_128_cbc.do_cipher = xcrypt_cipher; | 748 | cryptodev_aes_128_cbc.init = xcrypt_init_key; |
749 | cryptodev_aes_128_cbc.cleanup = xcrypt_cleanup; | 749 | cryptodev_aes_128_cbc.do_cipher = xcrypt_cipher; |
750 | cryptodev_aes_128_cbc.ctx_size = sizeof(AES_KEY); | 750 | cryptodev_aes_128_cbc.cleanup = xcrypt_cleanup; |
751 | 751 | cryptodev_aes_128_cbc.ctx_size = sizeof(AES_KEY); | |
752 | cryptodev_aes_192_cbc.init = xcrypt_init_key; | 752 | |
753 | cryptodev_aes_192_cbc.do_cipher = xcrypt_cipher; | 753 | cryptodev_aes_192_cbc.init = xcrypt_init_key; |
754 | cryptodev_aes_192_cbc.cleanup = xcrypt_cleanup; | 754 | cryptodev_aes_192_cbc.do_cipher = xcrypt_cipher; |
755 | cryptodev_aes_192_cbc.ctx_size = sizeof(AES_KEY); | 755 | cryptodev_aes_192_cbc.cleanup = xcrypt_cleanup; |
756 | 756 | cryptodev_aes_192_cbc.ctx_size = sizeof(AES_KEY); | |
757 | cryptodev_aes_256_cbc.init = xcrypt_init_key; | 757 | |
758 | cryptodev_aes_256_cbc.do_cipher = xcrypt_cipher; | 758 | cryptodev_aes_256_cbc.init = xcrypt_init_key; |
759 | cryptodev_aes_256_cbc.cleanup = xcrypt_cleanup; | 759 | cryptodev_aes_256_cbc.do_cipher = xcrypt_cipher; |
760 | cryptodev_aes_256_cbc.ctx_size = sizeof(AES_KEY); | 760 | cryptodev_aes_256_cbc.cleanup = xcrypt_cleanup; |
761 | cryptodev_aes_256_cbc.ctx_size = sizeof(AES_KEY); | ||
762 | } | ||
761 | return (value); | 763 | return (value); |
762 | } | 764 | } |
763 | #endif /* __i386__ */ | 765 | #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) | |||
744 | if (value == 0) | 744 | if (value == 0) |
745 | return (0); | 745 | return (0); |
746 | 746 | ||
747 | cryptodev_aes_128_cbc.init = xcrypt_init_key; | 747 | if (value & C3_HAS_AES) { |
748 | cryptodev_aes_128_cbc.do_cipher = xcrypt_cipher; | 748 | cryptodev_aes_128_cbc.init = xcrypt_init_key; |
749 | cryptodev_aes_128_cbc.cleanup = xcrypt_cleanup; | 749 | cryptodev_aes_128_cbc.do_cipher = xcrypt_cipher; |
750 | cryptodev_aes_128_cbc.ctx_size = sizeof(AES_KEY); | 750 | cryptodev_aes_128_cbc.cleanup = xcrypt_cleanup; |
751 | 751 | cryptodev_aes_128_cbc.ctx_size = sizeof(AES_KEY); | |
752 | cryptodev_aes_192_cbc.init = xcrypt_init_key; | 752 | |
753 | cryptodev_aes_192_cbc.do_cipher = xcrypt_cipher; | 753 | cryptodev_aes_192_cbc.init = xcrypt_init_key; |
754 | cryptodev_aes_192_cbc.cleanup = xcrypt_cleanup; | 754 | cryptodev_aes_192_cbc.do_cipher = xcrypt_cipher; |
755 | cryptodev_aes_192_cbc.ctx_size = sizeof(AES_KEY); | 755 | cryptodev_aes_192_cbc.cleanup = xcrypt_cleanup; |
756 | 756 | cryptodev_aes_192_cbc.ctx_size = sizeof(AES_KEY); | |
757 | cryptodev_aes_256_cbc.init = xcrypt_init_key; | 757 | |
758 | cryptodev_aes_256_cbc.do_cipher = xcrypt_cipher; | 758 | cryptodev_aes_256_cbc.init = xcrypt_init_key; |
759 | cryptodev_aes_256_cbc.cleanup = xcrypt_cleanup; | 759 | cryptodev_aes_256_cbc.do_cipher = xcrypt_cipher; |
760 | cryptodev_aes_256_cbc.ctx_size = sizeof(AES_KEY); | 760 | cryptodev_aes_256_cbc.cleanup = xcrypt_cleanup; |
761 | cryptodev_aes_256_cbc.ctx_size = sizeof(AES_KEY); | ||
762 | } | ||
761 | return (value); | 763 | return (value); |
762 | } | 764 | } |
763 | #endif /* __i386__ */ | 765 | #endif /* __i386__ */ |