summaryrefslogtreecommitdiff
path: root/lib/libssl
diff options
context:
space:
mode:
authorJonathan Gray <jsg@cvs.openbsd.org>2010-12-16 00:07:26 +0000
committerJonathan Gray <jsg@cvs.openbsd.org>2010-12-16 00:07:26 +0000
commitd05d7f2e1d560b7a36f2cba90fb5ebf44777cc90 (patch)
treef8f7cab59415c0dbcf12b76e5a36094849466dc7 /lib/libssl
parent8b8c111bf0798c616b2dac6ee3a3dde2c77e2549 (diff)
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
Diffstat (limited to 'lib/libssl')
-rw-r--r--lib/libssl/src/crypto/engine/hw_cryptodev.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/libssl/src/crypto/engine/hw_cryptodev.c b/lib/libssl/src/crypto/engine/hw_cryptodev.c
index 6ac2f9be300..d6d78da9b26 100644
--- a/lib/libssl/src/crypto/engine/hw_cryptodev.c
+++ b/lib/libssl/src/crypto/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;