Index: stand/libsa/geli/geliboot.c =================================================================== --- stand/libsa/geli/geliboot.c +++ stand/libsa/geli/geliboot.c @@ -345,7 +345,7 @@ g_eli_key_fill(&gdev->sc, &gkey, keyno); error = geliboot_crypt(gdev->sc.sc_ealgo, enc, pbuf, secsize, - gkey.gek_key, gdev->sc.sc_ekeylen, iv, sizeof(iv)); + gkey.gek_key, gdev->sc.sc_ekeylen, iv); if (error != 0) { explicit_bzero(&gkey, sizeof(gkey)); Index: stand/libsa/geli/geliboot_crypto.c =================================================================== --- stand/libsa/geli/geliboot_crypto.c +++ stand/libsa/geli/geliboot_crypto.c @@ -36,7 +36,7 @@ int geliboot_crypt(u_int algo, geli_op_t enc, u_char *data, size_t datasize, - const u_char *key, size_t keysize, u_char *iv, size_t ivlen) + const u_char *key, size_t keysize, u_char *iv) { keyInstance aeskey; cipherInstance cipher; @@ -81,7 +81,7 @@ ctxp = &xtsctx; enc_xform_aes_xts.setkey(ctxp, key, xts_len / 8); - enc_xform_aes_xts.reinit(ctxp, iv, ivlen); + enc_xform_aes_xts.reinit(ctxp, iv, AES_XTS_IV_LEN); switch (enc) { case GELI_DECRYPT: @@ -106,11 +106,10 @@ g_eli_crypto_cipher(u_int algo, geli_op_t enc, u_char *data, size_t datasize, const u_char *key, size_t keysize) { - u_char iv[keysize]; + u_char iv[G_ELI_IVKEYLEN]; explicit_bzero(iv, sizeof(iv)); - return (geliboot_crypt(algo, enc, data, datasize, key, keysize, iv, - sizeof(iv))); + return (geliboot_crypt(algo, enc, data, datasize, key, keysize, iv)); } int Index: stand/libsa/geli/geliboot_internal.h =================================================================== --- stand/libsa/geli/geliboot_internal.h +++ stand/libsa/geli/geliboot_internal.h @@ -68,6 +68,6 @@ }; int geliboot_crypt(u_int algo, geli_op_t enc, u_char *data, size_t datasize, - const u_char *key, size_t keysize, u_char *iv, size_t ivlen); + const u_char *key, size_t keysize, u_char *iv); #endif /* _GELIBOOT_INTERNAL_H_ */