From owner-svn-ports-head@FreeBSD.ORG Wed Jan 14 16:52:19 2015 Return-Path: Delivered-To: svn-ports-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4993C5B6; Wed, 14 Jan 2015 16:52:19 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2AA41BC5; Wed, 14 Jan 2015 16:52:19 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t0EGqJe6089641; Wed, 14 Jan 2015 16:52:19 GMT (envelope-from kmoore@FreeBSD.org) Received: (from kmoore@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t0EGqIqP089637; Wed, 14 Jan 2015 16:52:18 GMT (envelope-from kmoore@FreeBSD.org) Message-Id: <201501141652.t0EGqIqP089637@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kmoore set sender to kmoore@FreeBSD.org using -f From: Kris Moore Date: Wed, 14 Jan 2015 16:52:18 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r377027 - in head/sysutils: grub2-efi grub2-efi/files grub2-pcbsd grub2-pcbsd/files X-SVN-Group: ports-head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the ports tree for head List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Jan 2015 16:52:19 -0000 Author: kmoore Date: Wed Jan 14 16:52:17 2015 New Revision: 377027 URL: https://svnweb.freebsd.org/changeset/ports/377027 QAT: https://qat.redports.org/buildarchive/r377027/ Log: - Update patch to allow GRUB support of GELI v7 - Bump PORTREV Modified: head/sysutils/grub2-efi/Makefile head/sysutils/grub2-efi/files/patch-grub-core_disk_geli.c head/sysutils/grub2-pcbsd/Makefile head/sysutils/grub2-pcbsd/files/patch-grub-core_disk_geli.c Modified: head/sysutils/grub2-efi/Makefile ============================================================================== --- head/sysutils/grub2-efi/Makefile Wed Jan 14 16:26:37 2015 (r377026) +++ head/sysutils/grub2-efi/Makefile Wed Jan 14 16:52:17 2015 (r377027) @@ -3,7 +3,7 @@ PORTNAME= grub2-efi PORTVERSION= 2.02 -PORTREVISION= 10 +PORTREVISION= 11 CATEGORIES= sysutils MASTER_SITES= http://www.pcbsd.org/~kris/software/ \ ftp://ftp.pcbsd.org/pub/software/ Modified: head/sysutils/grub2-efi/files/patch-grub-core_disk_geli.c ============================================================================== --- head/sysutils/grub2-efi/files/patch-grub-core_disk_geli.c Wed Jan 14 16:26:37 2015 (r377026) +++ head/sysutils/grub2-efi/files/patch-grub-core_disk_geli.c Wed Jan 14 16:52:17 2015 (r377027) @@ -1,6 +1,32 @@ ---- grub-core/disk/geli.c.orig 2014-05-15 14:00:10.000000000 -0400 -+++ grub-core/disk/geli.c 2014-09-26 10:18:53.325111693 -0400 -@@ -430,6 +430,9 @@ +--- grub-core/disk/geli.c.orig 2014-12-30 11:08:32.000000000 -0500 ++++ grub-core/disk/geli.c 2015-01-13 13:42:46.758595608 -0500 +@@ -225,7 +225,7 @@ + + /* Look for GELI magic sequence. */ + if (grub_memcmp (header->magic, GELI_MAGIC, sizeof (GELI_MAGIC)) +- || grub_le_to_cpu32 (header->version) > 5 ++ || grub_le_to_cpu32 (header->version) > 7 + || grub_le_to_cpu32 (header->version) < 1) + grub_util_error ("%s", _("wrong ELI magic or version")); + +@@ -265,7 +265,7 @@ + + /* Look for GELI magic sequence. */ + if (grub_memcmp (header.magic, GELI_MAGIC, sizeof (GELI_MAGIC)) +- || grub_le_to_cpu32 (header.version) > 5 ++ || grub_le_to_cpu32 (header.version) > 7 + || grub_le_to_cpu32 (header.version) < 1) + { + grub_dprintf ("geli", "wrong magic %02x\n", header.magic[0]); +@@ -401,6 +401,7 @@ + grub_uint8_t geomkey[GRUB_CRYPTO_MAX_MDLEN]; + grub_uint8_t verify_key[GRUB_CRYPTO_MAX_MDLEN]; + grub_uint8_t zero[GRUB_CRYPTO_MAX_CIPHER_BLOCKSIZE]; ++ grub_uint8_t geli_cipher_key[64]; + char passphrase[MAX_PASSPHRASE] = ""; + unsigned i; + gcry_err_code_t gcry_err; +@@ -440,6 +441,9 @@ if (!grub_password_get (passphrase, MAX_PASSPHRASE)) return grub_error (GRUB_ERR_BAD_ARGUMENT, "Passphrase not supplied"); @@ -10,3 +36,41 @@ /* Calculate the PBKDF2 of the user supplied passphrase. */ if (grub_le_to_cpu32 (header.niter) != 0) { +@@ -524,6 +528,19 @@ + continue; + grub_printf_ (N_("Slot %d opened\n"), i); + ++ if (grub_le_to_cpu32 (header.version) >= 7) ++ { ++ /* GELI >=7 uses the cipher_key */ ++ grub_memcpy (geli_cipher_key, candidate_key.cipher_key, ++ sizeof (candidate_key.cipher_key)); ++ } ++ else ++ { ++ /* GELI <=6 uses the iv_key */ ++ grub_memcpy (geli_cipher_key, candidate_key.iv_key, ++ sizeof (candidate_key.iv_key)); ++ } ++ + /* Set the master key. */ + if (!dev->rekey) + { +@@ -540,13 +557,13 @@ + grub_size_t real_keysize = keysize; + if (grub_le_to_cpu16 (header.alg) == 0x16) + real_keysize *= 2; +- /* For a reason I don't know, the IV key is used in rekeying. */ +- grub_memcpy (dev->rekey_key, candidate_key.iv_key, +- sizeof (candidate_key.iv_key)); ++ ++ grub_memcpy (dev->rekey_key, geli_cipher_key, ++ sizeof (geli_cipher_key)); + dev->rekey_derived_size = real_keysize; + dev->last_rekey = -1; + COMPILE_TIME_ASSERT (sizeof (dev->rekey_key) +- >= sizeof (candidate_key.iv_key)); ++ >= sizeof (geli_cipher_key)); + } + + dev->iv_prefix_len = sizeof (candidate_key.iv_key); Modified: head/sysutils/grub2-pcbsd/Makefile ============================================================================== --- head/sysutils/grub2-pcbsd/Makefile Wed Jan 14 16:26:37 2015 (r377026) +++ head/sysutils/grub2-pcbsd/Makefile Wed Jan 14 16:52:17 2015 (r377027) @@ -3,7 +3,7 @@ PORTNAME= grub2-pcbsd PORTVERSION= 2.02p -PORTREVISION= 18 +PORTREVISION= 19 CATEGORIES= sysutils MASTER_SITES= http://www.pcbsd.org/~kris/software/ \ ftp://ftp.pcbsd.org/pub/software/ Modified: head/sysutils/grub2-pcbsd/files/patch-grub-core_disk_geli.c ============================================================================== --- head/sysutils/grub2-pcbsd/files/patch-grub-core_disk_geli.c Wed Jan 14 16:26:37 2015 (r377026) +++ head/sysutils/grub2-pcbsd/files/patch-grub-core_disk_geli.c Wed Jan 14 16:52:17 2015 (r377027) @@ -1,6 +1,32 @@ ---- grub-core/disk/geli.c.orig 2014-05-15 14:00:10.000000000 -0400 -+++ grub-core/disk/geli.c 2014-09-26 10:18:53.325111693 -0400 -@@ -430,6 +430,9 @@ +--- grub-core/disk/geli.c.orig 2014-12-30 11:08:32.000000000 -0500 ++++ grub-core/disk/geli.c 2015-01-13 13:42:46.758595608 -0500 +@@ -225,7 +225,7 @@ + + /* Look for GELI magic sequence. */ + if (grub_memcmp (header->magic, GELI_MAGIC, sizeof (GELI_MAGIC)) +- || grub_le_to_cpu32 (header->version) > 5 ++ || grub_le_to_cpu32 (header->version) > 7 + || grub_le_to_cpu32 (header->version) < 1) + grub_util_error ("%s", _("wrong ELI magic or version")); + +@@ -265,7 +265,7 @@ + + /* Look for GELI magic sequence. */ + if (grub_memcmp (header.magic, GELI_MAGIC, sizeof (GELI_MAGIC)) +- || grub_le_to_cpu32 (header.version) > 5 ++ || grub_le_to_cpu32 (header.version) > 7 + || grub_le_to_cpu32 (header.version) < 1) + { + grub_dprintf ("geli", "wrong magic %02x\n", header.magic[0]); +@@ -401,6 +401,7 @@ + grub_uint8_t geomkey[GRUB_CRYPTO_MAX_MDLEN]; + grub_uint8_t verify_key[GRUB_CRYPTO_MAX_MDLEN]; + grub_uint8_t zero[GRUB_CRYPTO_MAX_CIPHER_BLOCKSIZE]; ++ grub_uint8_t geli_cipher_key[64]; + char passphrase[MAX_PASSPHRASE] = ""; + unsigned i; + gcry_err_code_t gcry_err; +@@ -440,6 +441,9 @@ if (!grub_password_get (passphrase, MAX_PASSPHRASE)) return grub_error (GRUB_ERR_BAD_ARGUMENT, "Passphrase not supplied"); @@ -10,3 +36,41 @@ /* Calculate the PBKDF2 of the user supplied passphrase. */ if (grub_le_to_cpu32 (header.niter) != 0) { +@@ -524,6 +528,19 @@ + continue; + grub_printf_ (N_("Slot %d opened\n"), i); + ++ if (grub_le_to_cpu32 (header.version) >= 7) ++ { ++ /* GELI >=7 uses the cipher_key */ ++ grub_memcpy (geli_cipher_key, candidate_key.cipher_key, ++ sizeof (candidate_key.cipher_key)); ++ } ++ else ++ { ++ /* GELI <=6 uses the iv_key */ ++ grub_memcpy (geli_cipher_key, candidate_key.iv_key, ++ sizeof (candidate_key.iv_key)); ++ } ++ + /* Set the master key. */ + if (!dev->rekey) + { +@@ -540,13 +557,13 @@ + grub_size_t real_keysize = keysize; + if (grub_le_to_cpu16 (header.alg) == 0x16) + real_keysize *= 2; +- /* For a reason I don't know, the IV key is used in rekeying. */ +- grub_memcpy (dev->rekey_key, candidate_key.iv_key, +- sizeof (candidate_key.iv_key)); ++ ++ grub_memcpy (dev->rekey_key, geli_cipher_key, ++ sizeof (geli_cipher_key)); + dev->rekey_derived_size = real_keysize; + dev->last_rekey = -1; + COMPILE_TIME_ASSERT (sizeof (dev->rekey_key) +- >= sizeof (candidate_key.iv_key)); ++ >= sizeof (geli_cipher_key)); + } + + dev->iv_prefix_len = sizeof (candidate_key.iv_key);