aboutsummaryrefslogtreecommitdiff
path: root/stand/libsa
diff options
context:
space:
mode:
authorJohn Baldwin <jhb@FreeBSD.org>2020-05-20 22:25:41 +0000
committerJohn Baldwin <jhb@FreeBSD.org>2020-05-20 22:25:41 +0000
commit4f98ffdd1da28744fbcf31d3d818fc17ea30cb5e (patch)
tree7789d34ca601b09277df736269ad69fb83166962 /stand/libsa
parent2c6d9dc0bbd887a50e7ff0c6af3499ff265f1a16 (diff)
downloadsrc-4f98ffdd1da28744fbcf31d3d818fc17ea30cb5e.tar.gz
src-4f98ffdd1da28744fbcf31d3d818fc17ea30cb5e.zip
Fix libstand build breakage after r361298.
- Use enc_xform_aes_xts.setkey() directly instead of duplicating the code now that it no longer calls malloc(). - Rather than bringing back all of xform_userland.h, add a conditional #include of <stand.h> to xform_enc.h. - Update calls to encrypt/decrypt callbacks in enc_xform_aes_xts for separate input/output pointers. Pointy hat to: jhb
Notes
Notes: svn path=/head/; revision=361306
Diffstat (limited to 'stand/libsa')
-rw-r--r--stand/libsa/geli/geliboot_crypto.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/stand/libsa/geli/geliboot_crypto.c b/stand/libsa/geli/geliboot_crypto.c
index 82a137c06212..e2de7bba4cf5 100644
--- a/stand/libsa/geli/geliboot_crypto.c
+++ b/stand/libsa/geli/geliboot_crypto.c
@@ -78,20 +78,20 @@ geliboot_crypt(u_int algo, int enc, u_char *data, size_t datasize,
xts_len = keysize << 1;
ctxp = &xtsctx;
- rijndael_set_key(&ctxp->key1, key, xts_len / 2);
- rijndael_set_key(&ctxp->key2, key + (xts_len / 16), xts_len / 2);
-
- enc_xform_aes_xts.reinit((caddr_t)ctxp, iv);
+ enc_xform_aes_xts.setkey(ctxp, key, xts_len / 8);
+ enc_xform_aes_xts.reinit(ctxp, iv);
switch (enc) {
case 0: /* decrypt */
for (i = 0; i < datasize; i += AES_XTS_BLOCKSIZE) {
- enc_xform_aes_xts.decrypt((caddr_t)ctxp, data + i);
+ enc_xform_aes_xts.decrypt(ctxp, data + i,
+ data + i);
}
break;
case 1: /* encrypt */
for (i = 0; i < datasize; i += AES_XTS_BLOCKSIZE) {
- enc_xform_aes_xts.encrypt((caddr_t)ctxp, data + i);
+ enc_xform_aes_xts.encrypt(ctxp, data + i,
+ data + 1);
}
break;
}