Fix-up a few things missed in the rijndael_set_key() change.

This commit is contained in:
thorpej 2003-08-27 14:55:36 +00:00
parent d5d0a860bc
commit c171c20800

View File

@ -1,4 +1,4 @@
/* $NetBSD: xform.c,v 1.10 2003/08/27 14:23:28 itojun Exp $ */
/* $NetBSD: xform.c,v 1.11 2003/08/27 14:55:36 thorpej Exp $ */
/* $FreeBSD: src/sys/opencrypto/xform.c,v 1.1.2.1 2002/11/21 23:34:23 sam Exp $ */
/* $OpenBSD: xform.c,v 1.19 2002/08/16 22:47:25 dhartmei Exp $ */
@ -40,7 +40,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: xform.c,v 1.10 2003/08/27 14:23:28 itojun Exp $");
__KERNEL_RCSID(0, "$NetBSD: xform.c,v 1.11 2003/08/27 14:55:36 thorpej Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -540,7 +540,7 @@ rijndael128_encrypt(caddr_t key, u_int8_t *blk)
static void
rijndael128_decrypt(caddr_t key, u_int8_t *blk)
{
rijndael_decrypt(((rijndael_ctx *) key) + 1, (u_char *) blk,
rijndael_decrypt((rijndael_ctx *) key, (u_char *) blk,
(u_char *) blk);
}
@ -552,8 +552,8 @@ rijndael128_setkey(u_int8_t **sched, const u_int8_t *key, int len)
MALLOC(*sched, u_int8_t *, sizeof(rijndael_ctx), M_CRYPTO_DATA,
M_WAITOK);
if (*sched != NULL) {
bzero(*sched, 2 * sizeof(rijndael_ctx));
rijndael_set_key((rijndael_ctx *) *sched, (u_char *) key, len * 8);
bzero(*sched, sizeof(rijndael_ctx));
rijndael_set_key((rijndael_ctx *) *sched, key, len * 8);
err = 0;
} else
err = ENOMEM;