Support for LUKS2 disk encryption
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v7 Latest6 patches 1 replyIn review
- v66 patches 8 repliesSuperseded
- v56 patches 3 repliesSuperseded
Earlier versions · 4
| Version | Posted | Patches | Replies | Status |
|---|---|---|---|---|
| v4 | 6 patches | 4 replies | Superseded | |
| v3 | 6 patches | 9 replies | Superseded | |
| v2 | 6 patches | 4 replies | Superseded | |
| v1 | 6 patches | 9 replies | Superseded |
Patches in v7 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/6 | json: Import upstream jsmn-1.1.0docs/ grub-core/ grub-core/ +1 more | +510 | 0 replies | |
| 2/6 | json: Implement wrapping interfacegrub-core/ grub-core/ | +366 | 0 replies | |
| 3/6 | bootstrap: Add gnulib's base64 modulebootstrap.conf conf/ grub-core/ | +26 | 0 replies | |
| 4/6 | afsplitter: Move into its own modulegrub-core/ grub-core/ | +8 | 0 replies | |
| 5/6 | luks: Move configuration of ciphers into cryptodiskgrub-core/ grub-core/ include/ | +181 | 0 replies | |
| 6/6 | disk: Implement support for LUKS2Makefile.util.def docs/ grub-core/ +1 more | +692 | 0 replies |
Reviews trailers per patch
5 of 6 patches have a Reviewed-by or Acked-by.
| Patch | Daniel Kiper |
|---|---|
| 1/6 | R-b |
| 2/6 | R-b |
| 3/6 | R-b |
| 4/6 | R-b |
| 5/6 | R-b |
| 6/6 |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH v7 0/6] Support for LUKS2 disk encryption
Hi,
this is hopefully the last version of this patchset. The previous version was rejected due to compile issues on 32 bit platforms, which I didn't test before. Anyway, this version should fix these issues by
- using correct types where appropriate (grub_uint64_t instead of grub_size_t)
- using grub_divmod64() for 64 bit division
This got i386 working for me, but I didn't have any arm32 platform available. Chances are good it's fixed on both platforms, though. As always, the range-diff against v6 can be found below.
Patrick
Patrick Steinhardt (6):
json: Import upstream jsmn-1.1.0
json: Implement wrapping interface
bootstrap: Add gnulib's base64 module
afsplitter: Move into its own module
luks: Move configuration of ciphers into cryptodisk
disk: Implement support for LUKS2
Makefile.util.def | 4 +- bootstrap.conf | 3 +- conf/Makefile.extra-dist | 1 + docs/grub-dev.texi | 14 + docs/grub.texi | 5 +- grub-core/Makefile.core.def | 19 +- grub-core/disk/AFSplitter.c | 3 + grub-core/disk/cryptodisk.c | 163 ++++- grub-core/disk/luks.c | 190 +---- grub-core/disk/luks2.c | 678 ++++++++++++++++++ grub-core/lib/gnulib-patches/fix-base64.patch | 23 + grub-core/lib/json/jsmn.h | 468 ++++++++++++ grub-core/lib/json/json.c | 267 +++++++ grub-core/lib/json/json.h | 122 ++++ include/grub/cryptodisk.h | 3 + 15 files changed, 1783 insertions(+), 180 deletions(-) create mode 100644 grub-core/disk/luks2.c create mode 100644 grub-core/lib/gnulib-patches/fix-base64.patch create mode 100644 grub-core/lib/json/jsmn.h create mode 100644 grub-core/lib/json/json.c create mode 100644 grub-core/lib/json/json.h
Range-diff against v6:
1: 2469e96f9 = 1: 2469e96f9 json: Import upstream jsmn-1.1.0 2: 88d2b083d ! 2: c67fda9fb json: Implement wrapping interface
@@ Commit message
grub_json_t.
+ Reviewed-by: Daniel Kiper <[email protected]>
## grub-core/lib/json/json.c ##
@@
3: 411a822b4 = 3: dcca930de bootstrap: Add gnulib's base64 module
4: be0859313 = 4: f922aabda afsplitter: Move into its own module
5: 8535bb34a = 5: 3d397ac30 luks: Move configuration of ciphers into cryptodisk
6: f9b578487 ! 6: 59d36e0e9 disk: Implement support for LUKS2
@@ grub-core/disk/luks2.c (new)
+luks2_parse_digest (grub_luks2_digest_t *out, const grub_json_t *digest)
+{
+ grub_json_t segments, keyslots, o;
++ grub_size_t i, size;
++ grub_uint64_t bit;
+ const char *type;
-+ grub_size_t i, size, bit;
+
+ if (grub_json_getstring (&type, digest, "type"))
+ return grub_error (GRUB_ERR_BAD_ARGUMENT, "Invalid digest type");
@@ grub-core/disk/luks2.c (new)
+ const grub_json_t *root, grub_size_t i)
+{
+ grub_json_t keyslots, keyslot, digests, digest, segments, segment;
-+ grub_size_t j, idx, size;
++ grub_size_t j, size;
++ grub_uint64_t idx;
+
+ /* Get nth keyslot */
+ if (grub_json_getvalue (&keyslots, root, "keyslots") ||
@@ grub-core/disk/luks2.c (new)
+ grub_dprintf ("luks2", "Trying keyslot %"PRIuGRUB_SIZE"\n", i);
+
+ /* Set up disk according to keyslot's segment. */
-+ crypt->offset = segment.offset / segment.sector_size;
++ crypt->offset = grub_divmod64 (segment.offset, segment.sector_size, NULL);
+ crypt->log_sector_size = sizeof (unsigned int) * 8
+ - __builtin_clz ((unsigned int) segment.sector_size) - 1;
+ if (grub_strcmp (segment.size, "dynamic") == 0)Signature · 1 line
2.24.1