From b09b76a7c63ad74a19cc5bcf8d9642ce521d9e69 Mon Sep 17 00:00:00 2001 From: jsg <> Date: Thu, 16 Dec 2010 00:07:25 +0000 Subject: The VIA ciphers are added to an array of CRYPTO_ALGORITHM_MAX length which should have been declared as CRYPTO_ALGORITHM_MAX + 1, fix this and reserve enough space for the VIA additions as well. ok/comments from mikeb & deraadt --- src/lib/libcrypto/engine/hw_cryptodev.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/lib/libcrypto/engine/hw_cryptodev.c') diff --git a/src/lib/libcrypto/engine/hw_cryptodev.c b/src/lib/libcrypto/engine/hw_cryptodev.c index 6ac2f9be30..d6d78da9b2 100644 --- a/src/lib/libcrypto/engine/hw_cryptodev.c +++ b/src/lib/libcrypto/engine/hw_cryptodev.c @@ -238,7 +238,7 @@ cipher_nid_to_cryptodev(int nid) static int get_cryptodev_ciphers(const int **cnids) { - static int nids[CRYPTO_ALGORITHM_MAX]; + static int nids[CRYPTO_ALGORITHM_MAX + CRYPTO_VIAC3_MAX + 1]; struct session_op sess; int fd, i, count = 0; @@ -249,7 +249,7 @@ get_cryptodev_ciphers(const int **cnids) memset(&sess, 0, sizeof(sess)); sess.key = (caddr_t)"123456781234567812345678"; - for (i = 0; ciphers[i].c_id && count < CRYPTO_ALGORITHM_MAX; i++) { + for (i = 0; ciphers[i].c_id && count <= CRYPTO_ALGORITHM_MAX; i++) { if (ciphers[i].c_nid == NID_undef) continue; sess.cipher = ciphers[i].c_id; -- cgit v1.2.3-55-g6feb