This patch series imports the Argon2 code and tests from libgcrypt and adds Argon2 support to LUKS2.
- Patch 1~6 import kdf.c from libgcrypt and extract the Argon2 related functions. The _gcry_kdf_* functions are also imported to make it easier to support other KDF functions when necessary. - Patch 7 introduces grub_crypto_argon2(). - Patch 8 and 9 integrates the Argon2 tests from libgcrypt into functional_test. - Patch 10 leverages grub_crypto_argon2() to add Argon2 support to LUKS2. - Patch 11 changes the default KDF of the LUKS2 test to Argon2id. - Patch 12 documents argon2 and argon2_test modules. v3: - Updating comments in import_gcry.py - Splitting the kdf build patch into 3 smaller patches - Fixing the build error on 32-bit platforms - Adjusting the order of 'ldadd' in Makefile.util.def - Fixing the error messages in luks2_parse_keyslot() v2: - Import Argon2 code differently to improve maintainability * Updating import_gcry.py to import Argon2 and _gcry_kdf_* functions from kdf.c instead of extracting the code manually * Implementing grub_crypto_argon2() with the _gcry_kdf_* functions to avoid the GCRY flags when building argon2.c * Building argon2.c inside libgrubkernel.a since the GCRY flags are not needed anymore Gary Lin (12): util/import_gcry: Import kdf.c for Argon2 crypto: Update crypto.h for libgcrypt KDF functions libgcrypt/kdf: Implement blake2b_512.hash_buffers() libgcrypt/kdf: Get rid of gpg_err_code_from_errno() libgcrypt/kdf: Remove unsupported KDFs libgcrypt/kdf: Fix 64-bit modulus on 32-bit platforms argon2: Introduce grub_crypto_argon2() Import Argon2 tests from libgcrypt Integrate Argon2 tests into functional_test disk/luks2: Add Argon2 support tests/util/grub-fs-tester: Use Argon2id for LUKS2 test docs: Document argon2 and argon2_test Makefile.util.def | 55 +++--- conf/Makefile.extra-dist | 4 + docs/grub.texi | 11 ++ grub-core/Makefile.core.def | 10 ++ grub-core/disk/luks2.c | 40 ++++- grub-core/lib/argon2.c | 52 ++++++ .../09-blake2b-hash-buffers.patch | 54 ++++++ .../10-kdf-use-GPG-errs.patch | 48 +++++ .../11-kdf-remove-unsupported-kdfs.patch | 166 ++++++++++++++++++ .../12-kdf-use-grub_divmod64.patch | 78 ++++++++ grub-core/tests/argon2_test.c | 139 +++++++++++++++ grub-core/tests/lib/functional_test.c | 1 + include/grub/crypto.h | 49 ++++++ tests/util/grub-fs-tester.in | 10 +- util/import_gcry.py | 31 +++- 15 files changed, 712 insertions(+), 36 deletions(-) create mode 100644 grub-core/lib/argon2.c create mode 100644 grub-core/lib/libgcrypt-patches/09-blake2b-hash-buffers.patch create mode 100644 grub-core/lib/libgcrypt-patches/10-kdf-use-GPG-errs.patch create mode 100644 grub-core/lib/libgcrypt-patches/11-kdf-remove-unsupported-kdfs.patch create mode 100644 grub-core/lib/libgcrypt-patches/12-kdf-use-grub_divmod64.patch create mode 100644 grub-core/tests/argon2_test.c Range-diff against v2: 1: 5dd329599 ! 1: 4c2b3fec8 util/import_gcry: Import kdf.c for Argon2 @@ Commit message ## util/import_gcry.py ## @@ util/import_gcry.py: with codecs.open (os.path.join (cipher_dir_out, "crypto.lst"), "w", "utf-8") as + if re.match (r"(Makefile\.am|primegen\.c|cipher\.c|cipher-.*\.c|mac-.*\.c|mac\.c|pubkey\.c)$", cipher_file): chlog = "%s%s: Removed\n" % (chlog, chlognew) continue - # TODO: Support KDF +- # TODO: Support KDF - if re.match (r"(kdf\.c|scrypt\.c)$", cipher_file): ++ # TODO: Support scrypt KDF + if re.match (r"(scrypt\.c)$", cipher_file): chlog = "%s%s: Removed\n" % (chlog, chlognew) continue @@ util/import_gcry.py: with codecs.open (os.path.join (cipher_dir_out, "crypto.lst nch = True continue + elif re.match ("_gcry_kdf_selftest|check_one|_gcry_kdf_pkdf2|_gcry_kdf_derive|openpgp_s2k|ballon_context_size|balloon_*|prng_aes_*|onestep_kdf_*|hkdf_*|x963_kdf_*", line) is not None and cipher_file == "kdf.c": ++ # TODO Support other KDFs + skip = 1 + fname = re.match ("[a-zA-Z0-9_]*", line).group () + chmsg = "(%s): Removed." % fname 2: 5e544e51c ! 2: 210b6292b crypto: Update crypto.h for libgcrypt KDF functions @@ Commit message - prototypes of '_gcry_kdf_*' functions Signed-off-by: Gary Lin <g...@suse.com> + Reviewed-by: Vladimir Serbinenko<phco...@gmail.com> ## include/grub/crypto.h ## @@ include/grub/crypto.h: typedef enum -: --------- > 3: 97e34226d libgcrypt/kdf: Implement blake2b_512.hash_buffers() -: --------- > 4: ece319254 libgcrypt/kdf: Get rid of gpg_err_code_from_errno() 3: 69aea293b ! 5: ac22a5546 kdf: Resovle the build errors @@ Metadata Author: Gary Lin <g...@suse.com> ## Commit message ## - kdf: Resovle the build errors + libgcrypt/kdf: Remove unsupported KDFs - - Adding argon2_blake2b_512_hash_buffers() as the replacement of - _gcry_digest_spec_blake2b_512.hash_buffers() - - Replacing gpg_err_code_from_errno() with GPG_ERR_* - - Removing the unsupported KDFs from _gcry_kdf_*() + Clean up _gcry_kdf_*() to remove unsupported KDFs. Signed-off-by: Gary Lin <g...@suse.com> ## conf/Makefile.extra-dist ## -@@ conf/Makefile.extra-dist: EXTRA_DIST += grub-core/lib/libgcrypt-patches/05_disable_rsa_shake.patch - EXTRA_DIST += grub-core/lib/libgcrypt-patches/06_blake.patch - EXTRA_DIST += grub-core/lib/libgcrypt-patches/07_disable_64div.patch +@@ conf/Makefile.extra-dist: EXTRA_DIST += grub-core/lib/libgcrypt-patches/07_disable_64div.patch EXTRA_DIST += grub-core/lib/libgcrypt-patches/08_sexp_leak.patch -+EXTRA_DIST += grub-core/lib/libgcrypt-patches/09_kdf_build_fix.patch + EXTRA_DIST += grub-core/lib/libgcrypt-patches/09-blake2b-hash-buffers.patch + EXTRA_DIST += grub-core/lib/libgcrypt-patches/10-kdf-use-GPG-errs.patch ++EXTRA_DIST += grub-core/lib/libgcrypt-patches/11-kdf-remove-unsupported-kdfs.patch EXTRA_DIST += grub-core/lib/libtasn1-patches/0001-libtasn1-disable-code-not-needed-in-grub.patch EXTRA_DIST += grub-core/lib/libtasn1-patches/0002-libtasn1-replace-strcat-with-strcpy-in-_asn1_str_cat.patch - ## grub-core/lib/libgcrypt-patches/09_kdf_build_fix.patch (new) ## + ## grub-core/lib/libgcrypt-patches/11-kdf-remove-unsupported-kdfs.patch (new) ## @@ -+From 8583cb1211e9f8253e072b047082b2141346fd31 Mon Sep 17 00:00:00 2001 ++From f46f3dbd2e572a6610d651d14e9a3a8b27883c49 Mon Sep 17 00:00:00 2001 +From: Gary Lin <g...@suse.com> -+Date: Wed, 6 Aug 2025 09:56:21 +0800 -+Subject: [PATCH] kdf: Resovle the build errors ++Date: Mon, 25 Aug 2025 16:00:17 +0800 ++Subject: [PATCH 3/4] libgcrypt/kdf: Remove unsupported KDFs + -+- Adding argon2_blake2b_512_hash_buffers() as the replacement of -+ _gcry_digest_spec_blake2b_512.hash_buffers() -+- Replacing gpg_err_code_from_errno() with GPG_ERR_* -+- Removing the unsupported KDFs from _gcry_kdf_*() ++Clean up _gcry_kdf_*() to remove unsupported KDFs. + +Signed-off-by: Gary Lin <g...@suse.com> +--- -+ grub-core/lib/libgcrypt-grub/cipher/kdf.c | 145 ++++------------------ -+ 1 file changed, 22 insertions(+), 123 deletions(-) ++ grub-core/lib/libgcrypt-grub/cipher/kdf.c | 119 ---------------------- ++ 1 file changed, 119 deletions(-) + +diff --git a/grub-core/lib/libgcrypt-grub/cipher/kdf.c b/grub-core/lib/libgcrypt-grub/cipher/kdf.c -+index 0689f88b1..6e825d3e8 100644 ++index 55294672b..6e825d3e8 100644 +--- a/grub-core/lib/libgcrypt-grub/cipher/kdf.c ++++ b/grub-core/lib/libgcrypt-grub/cipher/kdf.c -+@@ -129,6 +129,24 @@ beswap64_block (u64 *dst) -+ #endif -+ } -+ -++/* Implementation of _gcry_blake2b_512_hash_buffers */ -++static void -++argon2_blake2b_512_hash_buffers (void *outbuf, const gcry_buffer_t *iov, int iovcnt) -++{ -++ void *hd; -++ -++ hd = xtrymalloc (_gcry_digest_spec_blake2b_512.contextsize); -++ if (!hd) -++ return; -++ -++ _gcry_digest_spec_blake2b_512.init (hd, 0); -++ for (;iovcnt > 0; iov++, iovcnt--) -++ _gcry_digest_spec_blake2b_512.write (hd, (const char*)iov[0].data + iov[0].off, iov[0].len); -++ _gcry_digest_spec_blake2b_512.final (hd); -++ grub_memcpy (outbuf, _gcry_digest_spec_blake2b_512.read (hd), 512 / 8); -++ -++ xfree (hd); -++} -+ -+ static gpg_err_code_t -+ argon2_fill_first_blocks (argon2_ctx_t a) -+@@ -195,7 +213,7 @@ argon2_fill_first_blocks (argon2_ctx_t a) -+ iov_count++; -+ } -+ -+- _gcry_digest_spec_blake2b_512.hash_buffers (h0_01_i, 64, iov, iov_count); -++ argon2_blake2b_512_hash_buffers (h0_01_i, iov, iov_count); -+ -+ for (i = 0; i < a->lanes; i++) -+ { -+@@ -242,7 +260,7 @@ argon2_init (argon2_ctx_t a, unsigned int parallelism, -+ block = xtrymalloc (1024 * memory_blocks); -+ if (!block) -+ { -+- ec = gpg_err_code_from_errno (errno); -++ ec = GPG_ERR_OUT_OF_MEMORY; -+ return ec; -+ } -+ memset (block, 0, 1024 * memory_blocks); -+@@ -250,7 +268,7 @@ argon2_init (argon2_ctx_t a, unsigned int parallelism, -+ thread_data = xtrymalloc (a->lanes * sizeof (struct argon2_thread_data)); -+ if (!thread_data) -+ { -+- ec = gpg_err_code_from_errno (errno); -++ ec = GPG_ERR_OUT_OF_MEMORY; -+ xfree (block); -+ return ec; -+ } -+@@ -601,7 +619,7 @@ argon2_open (gcry_kdf_hd_t *hd, int subalgo, -+ n = offsetof (struct argon2_context, out) + taglen; -+ a = xtrymalloc (n); -+ if (!a) -+- return gpg_err_code_from_errno (errno); -++ return GPG_ERR_OUT_OF_MEMORY; -+ -+ a->algo = GCRY_KDF_ARGON2; -+ a->hash_type = hash_type; -+@@ -798,64 +816,6 @@ _gcry_kdf_open (gcry_kdf_hd_t *hd, int algo, int subalgo, ++@@ -816,64 +816,6 @@ _gcry_kdf_open (gcry_kdf_hd_t *hd, int algo, int subalgo, + key, keylen, ad, adlen); + break; + @@ -798,64 +816,6 @@ _gcry_kdf_open (gcry_kdf_hd_t *hd, int algo, int subalgo, + default: + ec = GPG_ERR_UNKNOWN_ALGORITHM; + break; -+@@ -875,26 +835,6 @@ _gcry_kdf_compute (gcry_kdf_hd_t h, const struct gcry_kdf_thread_ops *ops) ++@@ -893,26 +835,6 @@ _gcry_kdf_compute (gcry_kdf_hd_t h, const struct gcry_kdf_thread_ops *ops) + ec = argon2_compute ((argon2_ctx_t)(void *)h, ops); + break; + @@ -875,26 +835,6 @@ _gcry_kdf_compute (gcry_kdf_hd_t h, const struct gcry_kdf_thre + default: + ec = GPG_ERR_UNKNOWN_ALGORITHM; + break; -+@@ -915,27 +855,6 @@ _gcry_kdf_final (gcry_kdf_hd_t h, size_t resultlen, void *result) ++@@ -933,27 +855,6 @@ _gcry_kdf_final (gcry_kdf_hd_t h, size_t resultlen, void *result) + ec = argon2_final ((argon2_ctx_t)(void *)h, resultlen, result); + break; + @@ -915,27 +855,6 @@ _gcry_kdf_final (gcry_kdf_hd_t h, size_t resultlen, void *resu + default: + ec = GPG_ERR_UNKNOWN_ALGORITHM; + break; -+@@ -953,26 +872,6 @@ _gcry_kdf_close (gcry_kdf_hd_t h) ++@@ -971,26 +872,6 @@ _gcry_kdf_close (gcry_kdf_hd_t h) + argon2_close ((argon2_ctx_t)(void *)h); + break; + -: --------- > 6: 51cabda08 libgcrypt/kdf: Fix 64-bit modulus on 32-bit platforms 4: d551580b9 ! 7: b56661bb6 argon2: Introduce grub_crypto_argon2() @@ Commit message linker can discover those functions. Signed-off-by: Gary Lin <g...@suse.com> + Reviewed-by: Vladimir Serbinenko<phco...@gmail.com> ## Makefile.util.def ## @@ Makefile.util.def: library = { @@ Makefile.util.def: library = { common = grub-core/lib/pbkdf2.c; common = grub-core/commands/extcmd.c; common = grub-core/lib/arg.c; +@@ Makefile.util.def: program = { + extra_dist = util/grub-mkimagexx.c; + + ldadd = libgrubmods.a; +- ldadd = libgrubgcry.a; + ldadd = libgrubkern.a; ++ ldadd = libgrubgcry.a; + ldadd = grub-core/lib/gnulib/libgnu.a; + ldadd = '$(LIBLZMA)'; + ldadd = '$(LIBINTL) $(LIBDEVMAPPER) $(LIBZFS) $(LIBNVPAIR) $(LIBGEOM)'; @@ Makefile.util.def: program = { cflags = '-I$(srcdir)/grub-core/lib/tss2 -I$(srcdir)/grub-core/commands/tpm2_key_protector'; @@ Makefile.util.def: program = { @@ Makefile.util.def: program = { common = grub-core/osdep/init.c; + ldadd = libgrubmods.a; +- ldadd = libgrubgcry.a; + ldadd = libgrubkern.a; ++ ldadd = libgrubgcry.a; + ldadd = grub-core/lib/gnulib/libgnu.a; + ldadd = '$(LIBINTL) $(LIBDEVMAPPER) $(LIBZFS) $(LIBNVPAIR) $(LIBGEOM)'; + }; +@@ Makefile.util.def: program = { + + ldadd = '$(LIBLZMA)'; + ldadd = libgrubmods.a; +- ldadd = libgrubgcry.a; + ldadd = libgrubkern.a; ++ ldadd = libgrubgcry.a; + ldadd = grub-core/lib/gnulib/libgnu.a; + ldadd = '$(LIBINTL) $(LIBDEVMAPPER) $(LIBZFS) $(LIBNVPAIR) $(LIBGEOM)'; + }; +@@ Makefile.util.def: program = { + common = grub-core/osdep/init.c; + + ldadd = libgrubmods.a; +- ldadd = libgrubgcry.a; + ldadd = libgrubkern.a; ++ ldadd = libgrubgcry.a; + ldadd = grub-core/lib/gnulib/libgnu.a; + ldadd = '$(LIBINTL) $(LIBDEVMAPPER) $(LIBZFS) $(LIBNVPAIR) $(LIBGEOM)'; + }; +@@ Makefile.util.def: program = { + common = grub-core/osdep/init.c; + ldadd = libgrubmods.a; - ldadd = libgrubgcry.a; ldadd = libgrubkern.a; @@ Makefile.util.def: program = { ldadd = grub-core/lib/gnulib/libgnu.a; ldadd = '$(LIBINTL) $(LIBDEVMAPPER) $(LIBUTIL) $(LIBZFS) $(LIBNVPAIR) $(LIBGEOM)'; }; +@@ Makefile.util.def: program = { + cflags = '$(FUSE_CFLAGS)'; + + ldadd = libgrubmods.a; +- ldadd = libgrubgcry.a; + ldadd = libgrubkern.a; ++ ldadd = libgrubgcry.a; + ldadd = grub-core/lib/gnulib/libgnu.a; + ldadd = '$(LIBINTL) $(LIBDEVMAPPER) $(LIBZFS) $(LIBNVPAIR) $(LIBGEOM) $(FUSE_LIBS)'; + condition = COND_GRUB_MOUNT; +@@ Makefile.util.def: program = { + cppflags = '-DGRUB_MKFONT=1'; + + ldadd = libgrubmods.a; +- ldadd = libgrubgcry.a; + ldadd = libgrubkern.a; ++ ldadd = libgrubgcry.a; + ldadd = grub-core/lib/gnulib/libgnu.a; + ldadd = '$(FREETYPE_LIBS)'; + ldadd = '$(LIBINTL) $(LIBDEVMAPPER) $(LIBZFS) $(LIBNVPAIR) $(LIBGEOM)'; +@@ Makefile.util.def: program = { + common = grub-core/osdep/init.c; + + ldadd = libgrubmods.a; +- ldadd = libgrubgcry.a; + ldadd = libgrubkern.a; ++ ldadd = libgrubgcry.a; + ldadd = grub-core/lib/gnulib/libgnu.a; + ldadd = '$(LIBINTL) $(LIBDEVMAPPER) $(LIBUTIL) $(LIBZFS) $(LIBNVPAIR) $(LIBGEOM)'; + }; +@@ Makefile.util.def: program = { + common = grub-core/osdep/init.c; + + ldadd = libgrubmods.a; +- ldadd = libgrubgcry.a; + ldadd = libgrubkern.a; ++ ldadd = libgrubgcry.a; + ldadd = grub-core/lib/gnulib/libgnu.a; + ldadd = '$(LIBINTL) $(LIBDEVMAPPER) $(LIBUTIL) $(LIBZFS) $(LIBNVPAIR) $(LIBGEOM)'; + }; +@@ Makefile.util.def: program = { + common = grub-core/osdep/init.c; + + ldadd = libgrubmods.a; +- ldadd = libgrubgcry.a; + ldadd = libgrubkern.a; ++ ldadd = libgrubgcry.a; + ldadd = grub-core/lib/gnulib/libgnu.a; + ldadd = '$(LIBINTL) $(LIBDEVMAPPER) $(LIBZFS) $(LIBNVPAIR) $(LIBGEOM)'; + }; @@ Makefile.util.def: program = { common = grub-core/kern/emu/argp_common.c; @@ Makefile.util.def: program = { ldadd = '$(LIBINTL) $(LIBDEVMAPPER) $(LIBUTIL) $(LIBZFS) $(LIBNVPAIR) $(LIBGEOM)'; }; @@ Makefile.util.def: program = { + + ldadd = '$(LIBLZMA)'; + ldadd = libgrubmods.a; +- ldadd = libgrubgcry.a; + ldadd = libgrubkern.a; ++ ldadd = libgrubgcry.a; + ldadd = grub-core/lib/gnulib/libgnu.a; + ldadd = '$(LIBINTL) $(LIBDEVMAPPER) $(LIBUTIL) $(LIBZFS) $(LIBNVPAIR) $(LIBGEOM)'; + }; +@@ Makefile.util.def: program = { + + ldadd = '$(LIBLZMA)'; + ldadd = libgrubmods.a; +- ldadd = libgrubgcry.a; + ldadd = libgrubkern.a; ++ ldadd = libgrubgcry.a; + ldadd = grub-core/lib/gnulib/libgnu.a; + ldadd = '$(LIBINTL) $(LIBDEVMAPPER) $(LIBUTIL) $(LIBZFS) $(LIBNVPAIR) $(LIBGEOM)'; + }; +@@ Makefile.util.def: program = { + common = grub-core/kern/misc.c; + common = grub-core/tests/lib/test.c; + ldadd = libgrubmods.a; +- ldadd = libgrubgcry.a; + ldadd = libgrubkern.a; ++ ldadd = libgrubgcry.a; + ldadd = grub-core/lib/gnulib/libgnu.a; + ldadd = '$(LIBDEVMAPPER) $(LIBZFS) $(LIBNVPAIR) $(LIBGEOM)'; + }; +@@ Makefile.util.def: program = { + common = grub-core/kern/misc.c; + common = grub-core/tests/lib/test.c; + ldadd = libgrubmods.a; +- ldadd = libgrubgcry.a; + ldadd = libgrubkern.a; ++ ldadd = libgrubgcry.a; + ldadd = grub-core/lib/gnulib/libgnu.a; + ldadd = '$(LIBDEVMAPPER) $(LIBZFS) $(LIBNVPAIR) $(LIBGEOM)'; + }; +@@ Makefile.util.def: program = { + common = grub-core/kern/misc.c; + common = grub-core/tests/lib/test.c; + ldadd = libgrubmods.a; +- ldadd = libgrubgcry.a; + ldadd = libgrubkern.a; ++ ldadd = libgrubgcry.a; + ldadd = grub-core/lib/gnulib/libgnu.a; + ldadd = '$(LIBDEVMAPPER) $(LIBZFS) $(LIBNVPAIR) $(LIBGEOM)'; + }; +@@ Makefile.util.def: program = { + common = grub-core/tests/lib/test.c; + common = grub-core/lib/priority_queue.c; + ldadd = libgrubmods.a; +- ldadd = libgrubgcry.a; + ldadd = libgrubkern.a; ++ ldadd = libgrubgcry.a; + ldadd = grub-core/lib/gnulib/libgnu.a; + ldadd = '$(LIBDEVMAPPER) $(LIBZFS) $(LIBNVPAIR) $(LIBGEOM)'; + condition = COND_HAVE_CXX; +@@ Makefile.util.def: program = { + common = grub-core/kern/misc.c; + common = grub-core/tests/lib/test.c; + ldadd = libgrubmods.a; +- ldadd = libgrubgcry.a; + ldadd = libgrubkern.a; ++ ldadd = libgrubgcry.a; + ldadd = grub-core/lib/gnulib/libgnu.a; + ldadd = '$(LIBDEVMAPPER) $(LIBZFS) $(LIBNVPAIR) $(LIBGEOM)'; + }; +@@ Makefile.util.def: program = { + common = grub-core/osdep/init.c; + + ldadd = libgrubmods.a; +- ldadd = libgrubgcry.a; + ldadd = libgrubkern.a; ++ ldadd = libgrubgcry.a; + ldadd = grub-core/lib/gnulib/libgnu.a; + ldadd = '$(LIBINTL) $(LIBDEVMAPPER) $(LIBZFS) $(LIBNVPAIR) $(LIBGEOM)'; + }; +@@ Makefile.util.def: program = { common = grub-core/kern/emu/argp_common.c; ldadd = libgrubmods.a; @@ Makefile.util.def: program = { ldadd = grub-core/lib/gnulib/libgnu.a; ldadd = '$(LIBINTL) $(LIBDEVMAPPER) $(LIBZFS) $(LIBNVPAIR) $(LIBGEOM)'; }; +@@ Makefile.util.def: program = { + common = grub-core/osdep/init.c; + + ldadd = libgrubmods.a; +- ldadd = libgrubgcry.a; + ldadd = libgrubkern.a; ++ ldadd = libgrubgcry.a; + ldadd = grub-core/lib/gnulib/libgnu.a; + ldadd = '$(LIBINTL) $(LIBDEVMAPPER) $(LIBZFS) $(LIBNVPAIR) $(LIBGEOM)'; + }; ## grub-core/Makefile.core.def ## @@ grub-core/Makefile.core.def: module = { 5: 60a8a8ff9 = 8: 54bd89f6a Import Argon2 tests from libgcrypt 6: 78d6cb520 ! 9: e386633aa Integrate Argon2 tests into functional_test @@ Commit message Signed-off-by: Gary Lin <g...@suse.com> Tested-By: Waldemar Brodkorb <w...@openadk.org> + Reviewed-by: Vladimir Serbinenko<phco...@gmail.com> ## grub-core/Makefile.core.def ## @@ grub-core/Makefile.core.def: module = { 7: 06836af69 ! 10: 86bbe307d disk/luks2: Add Argon2 support @@ grub-core/disk/luks2.c: luks2_parse_keyslot (grub_luks2_keyslot_t *out, const gr { out->kdf.type = LUKS2_KDF_TYPE_ARGON2I; if (grub_json_getint64 (&out->kdf.u.argon2i.time, &kdf, "time") || -@@ grub-core/disk/luks2.c: luks2_parse_keyslot (grub_luks2_keyslot_t *out, const grub_json_t *keyslot) + grub_json_getint64 (&out->kdf.u.argon2i.memory, &kdf, "memory") || grub_json_getint64 (&out->kdf.u.argon2i.cpus, &kdf, "cpus")) - return grub_error (GRUB_ERR_BAD_ARGUMENT, "Missing Argon2i parameters"); - } +- return grub_error (GRUB_ERR_BAD_ARGUMENT, "Missing Argon2i parameters"); ++ return grub_error (GRUB_ERR_BAD_ARGUMENT, "missing Argon2i parameters"); ++ } + else if (!grub_strcmp (type, "argon2id")) + { + out->kdf.type = LUKS2_KDF_TYPE_ARGON2ID; + if (grub_json_getint64 (&out->kdf.u.argon2i.time, &kdf, "time") || + grub_json_getint64 (&out->kdf.u.argon2i.memory, &kdf, "memory") || + grub_json_getint64 (&out->kdf.u.argon2i.cpus, &kdf, "cpus")) -+ return grub_error (GRUB_ERR_BAD_ARGUMENT, "Missing Argon2id parameters"); -+ } ++ return grub_error (GRUB_ERR_BAD_ARGUMENT, "missing Argon2id parameters"); + } else if (!grub_strcmp (type, "pbkdf2")) { - out->kdf.type = LUKS2_KDF_TYPE_PBKDF2; @@ grub-core/disk/luks2.c: luks2_decrypt_key (grub_uint8_t *out_key, grub_uint8_t salt[GRUB_CRYPTODISK_MAX_KEYLEN]; grub_uint8_t *split_key = NULL; 8: 57ec8ca9f ! 11: f626d2001 tests/util/grub-fs-tester: Use Argon2id for LUKS2 test @@ Commit message Signed-off-by: Gary Lin <g...@suse.com> Tested-By: Waldemar Brodkorb <w...@openadk.org> + Reviewed-by: Vladimir Serbinenko<phco...@gmail.com> ## tests/util/grub-fs-tester.in ## @@ tests/util/grub-fs-tester.in: for LOGSECSIZE in $(range "$MINLOGSECSIZE" "$MAXLOGSECSIZE" 1); do 9: 1d3ce8f59 ! 12: a1cdf3b42 docs: Document argon2 and argon2_test @@ Commit message Signed-off-by: Gary Lin <g...@suse.com> Tested-By: Waldemar Brodkorb <w...@openadk.org> + Reviewed-by: Vladimir Serbinenko<phco...@gmail.com> ## docs/grub.texi ## @@ docs/grub.texi: Modules can be loaded via the @command{insmod} (@pxref{insmod}) command. -- 2.43.0 _______________________________________________ Grub-devel mailing list Grub-devel@gnu.org https://lists.gnu.org/mailman/listinfo/grub-devel