summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorMike Belopuhov <mikeb@cvs.openbsd.org>2018-02-20 15:02:14 +0000
committerMike Belopuhov <mikeb@cvs.openbsd.org>2018-02-20 15:02:14 +0000
commit4364853c4f04d9eddf46e029392e3e7faf1a331e (patch)
tree43be245d52297de641156e9ea9b7b72af9701ef2 /sys
parentb3a91764b09b858e714e6fb20b054007982ef1aa (diff)
Convert key length from bits to bytes
Reported by Renaud Allard, fix tested by Renaud (i386) and fcambus@ (amd64). OK visa, fcambus
Diffstat (limited to 'sys')
-rw-r--r--sys/arch/amd64/amd64/via.c6
-rw-r--r--sys/arch/i386/i386/via.c6
2 files changed, 6 insertions, 6 deletions
diff --git a/sys/arch/amd64/amd64/via.c b/sys/arch/amd64/amd64/via.c
index c0e1e540b12..0f8f63f4957 100644
--- a/sys/arch/amd64/amd64/via.c
+++ b/sys/arch/amd64/amd64/via.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: via.c,v 1.26 2017/12/24 16:19:27 fcambus Exp $ */
+/* $OpenBSD: via.c,v 1.27 2018/02/20 15:02:13 mikeb Exp $ */
/* $NetBSD: machdep.c,v 1.214 1996/11/10 03:16:17 thorpej Exp $ */
/*-
@@ -179,9 +179,9 @@ viac3_crypto_newsession(u_int32_t *sidp, struct cryptoini *cri)
/* Build expanded keys for both directions */
AES_KeySetup_Encrypt(ses->ses_ekey, c->cri_key,
- c->cri_klen);
+ c->cri_klen / 8);
AES_KeySetup_Decrypt(ses->ses_dkey, c->cri_key,
- c->cri_klen);
+ c->cri_klen / 8);
for (i = 0; i < 4 * (AES_MAXROUNDS + 1); i++) {
ses->ses_ekey[i] = ntohl(ses->ses_ekey[i]);
ses->ses_dkey[i] = ntohl(ses->ses_dkey[i]);
diff --git a/sys/arch/i386/i386/via.c b/sys/arch/i386/i386/via.c
index 860fa45c0ac..89fd4a39a38 100644
--- a/sys/arch/i386/i386/via.c
+++ b/sys/arch/i386/i386/via.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: via.c,v 1.40 2017/12/29 13:24:11 fcambus Exp $ */
+/* $OpenBSD: via.c,v 1.41 2018/02/20 15:02:13 mikeb Exp $ */
/* $NetBSD: machdep.c,v 1.214 1996/11/10 03:16:17 thorpej Exp $ */
/*-
@@ -180,9 +180,9 @@ viac3_crypto_newsession(u_int32_t *sidp, struct cryptoini *cri)
/* Build expanded keys for both directions */
AES_KeySetup_Encrypt(ses->ses_ekey, c->cri_key,
- c->cri_klen);
+ c->cri_klen / 8);
AES_KeySetup_Decrypt(ses->ses_dkey, c->cri_key,
- c->cri_klen);
+ c->cri_klen / 8);
for (i = 0; i < 4 * (AES_MAXROUNDS + 1); i++) {
ses->ses_ekey[i] = ntohl(ses->ses_ekey[i]);
ses->ses_dkey[i] = ntohl(ses->ses_dkey[i]);