diff options
author | 2010-12-16 00:07:25 +0000 | |
---|---|---|
committer | 2010-12-16 00:07:25 +0000 | |
commit | faf93eea5c5df611289239ce8178d44d93a5f5b2 (patch) | |
tree | a80778750ebae82712b15875ebab514beb4353c4 /lib/libcrypto/engine/hw_cryptodev.c | |
parent | Bring CBC oracle attack countermeasure from r1.32 of cryptosoft.c to (diff) | |
download | wireguard-openbsd-faf93eea5c5df611289239ce8178d44d93a5f5b2.tar.xz wireguard-openbsd-faf93eea5c5df611289239ce8178d44d93a5f5b2.zip |
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/libcrypto/engine/hw_cryptodev.c')
-rw-r--r-- | lib/libcrypto/engine/hw_cryptodev.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/libcrypto/engine/hw_cryptodev.c b/lib/libcrypto/engine/hw_cryptodev.c index 6ac2f9be300..d6d78da9b26 100644 --- a/lib/libcrypto/engine/hw_cryptodev.c +++ b/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; |