From owner-svn-src-head@freebsd.org Wed May 20 22:25:41 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DC9992F6DC6; Wed, 20 May 2020 22:25:41 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49S6lT5Mbqz3fNh; Wed, 20 May 2020 22:25:41 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AEC382304B; Wed, 20 May 2020 22:25:41 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04KMPfP6033287; Wed, 20 May 2020 22:25:41 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04KMPfoF033285; Wed, 20 May 2020 22:25:41 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <202005202225.04KMPfoF033285@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Wed, 20 May 2020 22:25:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361306 - in head: stand/libsa/geli sys/opencrypto X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in head: stand/libsa/geli sys/opencrypto X-SVN-Commit-Revision: 361306 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 May 2020 22:25:41 -0000 Author: jhb Date: Wed May 20 22:25:41 2020 New Revision: 361306 URL: https://svnweb.freebsd.org/changeset/base/361306 Log: 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 to xform_enc.h. - Update calls to encrypt/decrypt callbacks in enc_xform_aes_xts for separate input/output pointers. Pointy hat to: jhb Modified: head/stand/libsa/geli/geliboot_crypto.c head/sys/opencrypto/xform_enc.h Modified: head/stand/libsa/geli/geliboot_crypto.c ============================================================================== --- head/stand/libsa/geli/geliboot_crypto.c Wed May 20 22:20:53 2020 (r361305) +++ head/stand/libsa/geli/geliboot_crypto.c Wed May 20 22:25:41 2020 (r361306) @@ -78,20 +78,20 @@ geliboot_crypt(u_int algo, int enc, u_char *data, size 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.setkey(ctxp, key, xts_len / 8); + enc_xform_aes_xts.reinit(ctxp, iv); - enc_xform_aes_xts.reinit((caddr_t)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; } Modified: head/sys/opencrypto/xform_enc.h ============================================================================== --- head/sys/opencrypto/xform_enc.h Wed May 20 22:20:53 2020 (r361305) +++ head/sys/opencrypto/xform_enc.h Wed May 20 22:25:41 2020 (r361306) @@ -36,6 +36,9 @@ #include #include #include +#ifdef _STANDALONE +#include +#endif #define AESICM_BLOCKSIZE AES_BLOCK_LEN #define AES_XTS_BLOCKSIZE 16