search for: keysv

Displaying 17 results from an estimated 17 matches for "keysv".

Did you mean: keys
2020 Jan 22
0
[PATCH] mltools, options: support --allow-discards when decrypting LUKS devices
...12 deletions(-) diff --git a/mltools/tools_utils-c.c b/mltools/tools_utils-c.c index 6c43b8d..1dcebc4 100644 --- a/mltools/tools_utils-c.c +++ b/mltools/tools_utils-c.c @@ -36,7 +36,7 @@ #include "options.h" -extern value guestfs_int_mllib_inspect_decrypt (value gv, value gpv, value keysv); +extern value guestfs_int_mllib_inspect_decrypt (value gv, value gpv, value keysv, value allowdiscards); extern value guestfs_int_mllib_set_echo_keys (value unitv); extern value guestfs_int_mllib_set_keys_from_stdin (value unitv); extern value guestfs_int_mllib_rfc3339_date_time_string (value...
2020 Jan 27
3
[PATCH v2 1/2] mltools, options: support --allow-discards when decrypting LUKS devices
...13 deletions(-) diff --git a/mltools/tools_utils-c.c b/mltools/tools_utils-c.c index 6c43b8d..1dcebc4 100644 --- a/mltools/tools_utils-c.c +++ b/mltools/tools_utils-c.c @@ -36,7 +36,7 @@ #include "options.h" -extern value guestfs_int_mllib_inspect_decrypt (value gv, value gpv, value keysv); +extern value guestfs_int_mllib_inspect_decrypt (value gv, value gpv, value keysv, value allowdiscards); extern value guestfs_int_mllib_set_echo_keys (value unitv); extern value guestfs_int_mllib_set_keys_from_stdin (value unitv); extern value guestfs_int_mllib_rfc3339_date_time_string (value...
2020 Jan 21
12
[PATCH 0/1] WIP: Support LUKS-encrypted partitions
The following patch attempts to implement sparsification of LUKS-encrypted partitions. It uses lsblk to pair the underlying LUKS block device with its mapped name. Also, --allow-discards was added by default to luks_open(). There are several potential issues that I can think of: 1) If and entire device is encrypted (not just one of more partitions), the lsblk trick might not work. 2) The
2019 Nov 29
0
[common PATCH 1/2] options: rename key.device as key.id
...| 8 +++++--- 4 files changed, 15 insertions(+), 12 deletions(-) diff --git a/mltools/tools_utils-c.c b/mltools/tools_utils-c.c index 3b80091..6c43b8d 100644 --- a/mltools/tools_utils-c.c +++ b/mltools/tools_utils-c.c @@ -57,8 +57,8 @@ guestfs_int_mllib_inspect_decrypt (value gv, value gpv, value keysv) struct key_store_key key; elemv = Field (keysv, 0); - key.device = strdup (String_val (Field (elemv, 0))); - if (!key.device) + key.id = strdup (String_val (Field (elemv, 0))); + if (!key.id) caml_raise_out_of_memory (); v = Field (elemv, 1); diff --git a/opti...
2019 Apr 01
2
[PATCH] OCaml tools: fix 3999 -> 3339 typo
...(+), 5 deletions(-) diff --git a/common/mltools/tools_utils-c.c b/common/mltools/tools_utils-c.c index b015dcace..3b80091c0 100644 --- a/common/mltools/tools_utils-c.c +++ b/common/mltools/tools_utils-c.c @@ -39,7 +39,7 @@ extern value guestfs_int_mllib_inspect_decrypt (value gv, value gpv, value keysv); extern value guestfs_int_mllib_set_echo_keys (value unitv); extern value guestfs_int_mllib_set_keys_from_stdin (value unitv); -extern value guestfs_int_mllib_rfc3999_date_time_string (value unitv); +extern value guestfs_int_mllib_rfc3339_date_time_string (value unitv); /* Interface with the...
2016 Jul 11
2
[PATCH v2] OCaml tools: add and use a Getopt module
...uf = v_buf; + + while (len > 0) { + r = write (fd, buf, len); + if (r == -1) + error (EXIT_FAILURE, errno, "write"); + buf += r; + len -= r; + } +} + +static void +show_help (value specsv, value usage_msgv) +{ + CAMLparam2 (specsv, usage_msgv); + CAMLlocal4 (specv, keysv, actionv, docv); + FILE *f; + CLEANUP_FREE char *buf = NULL; + size_t buf_len = 0; + size_t i, specs_len; + + f = open_memstream (&buf, &buf_len); + if (f == NULL) + error (EXIT_FAILURE, errno, "open_memstream"); + + fprintf (f, _("%s\n" + "...
2018 Sep 19
0
[PATCH 2/2] Introduce a --key option in tools that accept keys
...rno.h> +#include <error.h> #include <caml/alloc.h> #include <caml/fail.h> @@ -33,7 +34,7 @@ #include "options.h" -extern value guestfs_int_mllib_inspect_decrypt (value gv, value gpv); +extern value guestfs_int_mllib_inspect_decrypt (value gv, value gpv, value keysv); extern value guestfs_int_mllib_set_echo_keys (value unitv); extern value guestfs_int_mllib_set_keys_from_stdin (value unitv); @@ -42,12 +43,47 @@ int echo_keys = 0; int keys_from_stdin = 0; value -guestfs_int_mllib_inspect_decrypt (value gv, value gpv) +guestfs_int_mllib_inspect_decrypt (...
2019 Nov 29
8
[PATCH 0/1] Allow UUIDs for --key identifiers.
This combined patch series enables to decrypt LUKS devices on inspection by allowing the UUID of the LUKS device with the --key syntax. I opted for reusing the option instead of adding another one, as I think that device names and UUIDs are different enough that can be properly distinguished. A test for this (patch #4) can be applied only when the patches for common are applied, and the
2019 Mar 22
8
[PATCH 0/4] OCaml tools: output messages as JSON machine
Enhance the output in machine parseable mode, by outputting all the messages of OCaml tools as JSON to the machine parseable stream. Related, although not strictly needed for this (and thus can be split if requested), is the addition of the fd format for the machine readable stream. Pino Toscano (4): common/mltools: move the code for machine readable up common/mltools: make sure machine
2019 Mar 22
0
[PATCH 3/4] common/mltools: allow fd for machine readable output
...@@ #include <caml/memory.h> #include <caml/mlvalues.h> #include <caml/unixsupport.h> +/* Evil ... */ +#define CAML_INTERNALS +#include <caml/io.h> #include <guestfs.h> @@ -37,6 +40,7 @@ extern value guestfs_int_mllib_inspect_decrypt (value gv, value gpv, value keysv); extern value guestfs_int_mllib_set_echo_keys (value unitv); extern value guestfs_int_mllib_set_keys_from_stdin (value unitv); +extern value guestfs_int_mllib_open_out_channel_from_fd (value fdv); /* Interface with the guestfish inspection and decryption code. */ int echo_keys = 0; @@ -103,3...
2018 Sep 19
5
[PATCH 0/2] RFC: --key option for tools
Hi, the following series adds a --key option in the majority of tools: this makes it possible to pass LUKS credentials programmatically, avoid the need to manually input them, or unsafely pass them via stdin. Thanks, Pino Toscano (2): mltools: create a cmdline_options struct Introduce a --key option in tools that accept keys builder/cmdline.ml | 2 +-
2016 Jun 24
2
[PATCH] RFC: OCaml tools: add and use a Getopt module
...uf = v_buf; + + while (len > 0) { + r = write (fd, buf, len); + if (r == -1) + error (EXIT_FAILURE, errno, "write"); + buf += r; + len -= r; + } +} + +static void +show_help (value specsv, value usage_msgv) +{ + CAMLparam2 (specsv, usage_msgv); + CAMLlocal4 (specv, keysv, actionv, docv); + FILE *f; + CLEANUP_FREE char *buf = NULL; + size_t buf_len = 0; + size_t i, specs_len; + + f = open_memstream (&buf, &buf_len); + if (f == NULL) + error (EXIT_FAILURE, errno, "open_memstream"); + + fprintf (f, _("%s: %s\n" + &q...
2016 Jul 13
3
[PATCH v3 1/2] OCaml tools: add and use a Getopt module
..._attribute__((noreturn)) +show_error (int status) +{ + fprintf (stderr, _("Try `%s --help' for more information.\n"), + guestfs_int_program_name); + exit (status); +} + +static int +find_spec (value specsv, int specs_len, char opt) +{ + CAMLparam1 (specsv); + CAMLlocal1 (keysv); + int i, ret; + + for (i = 0; i < specs_len; ++i) { + int len, j; + + keysv = Field (Field (specsv, i), 0); + len = Wosize_val (keysv); + + for (j = 0; j < len; ++j) { + const char *key = String_val (Field (keysv, j)); + + if (key[0] == '-' && key[1]...
2019 Mar 22
0
[PATCH 4/4] OCaml tools: output messages into JSON for machine readable
...3,6 +23,8 @@ #include <unistd.h> #include <errno.h> #include <error.h> +#include <time.h> +#include <string.h> #include <caml/alloc.h> #include <caml/fail.h> @@ -41,6 +43,7 @@ extern value guestfs_int_mllib_inspect_decrypt (value gv, value gpv, value keysv extern value guestfs_int_mllib_set_echo_keys (value unitv); extern value guestfs_int_mllib_set_keys_from_stdin (value unitv); extern value guestfs_int_mllib_open_out_channel_from_fd (value fdv); +extern value guestfs_int_mllib_rfc3999_date_time_string (value unitv); /* Interface with the gues...
2019 Mar 28
0
[PATCH v2 4/4] OCaml tools: output messages into JSON for machine readable
...,6 +23,8 @@ #include <unistd.h> #include <errno.h> #include <error.h> +#include <time.h> +#include <string.h> #include <caml/alloc.h> #include <caml/fail.h> @@ -37,6 +39,7 @@ extern value guestfs_int_mllib_inspect_decrypt (value gv, value gpv, value keysv); extern value guestfs_int_mllib_set_echo_keys (value unitv); extern value guestfs_int_mllib_set_keys_from_stdin (value unitv); +extern value guestfs_int_mllib_rfc3999_date_time_string (value unitv); /* Interface with the guestfish inspection and decryption code. */ int echo_keys = 0; @@ -103...
2019 Mar 28
8
[PATCH v2 0/4] OCaml tools: output messages as JSON machine
Enhance the output in machine parseable mode, by outputting all the messages of OCaml tools as JSON to the machine parseable stream. Related, although not strictly needed for this (and thus can be split if requested), is the addition of the fd format for the machine readable stream. Changes from v1: - use Obj.magic to convert int -> Unix.file_descr - add tests Pino Toscano (4):
2016 Jun 27
0
Re: [PATCH] RFC: OCaml tools: add and use a Getopt module
..._mllib_getopt_parse (value argsv, value specsv, value anon_funv, value usage_msgv) I'm not convinced that this function is safe against OCaml GC compaction. In particular there are problems such as: ... > + for (j = 0; j < len; ++j) { > + const char *key = String_val (Field (keysv, j)); key now points to a string on the OCaml heap, and then ... > + if (newopts == NULL) > + caml_raise_out_of_memory (); > + longopts = newopts; > + longopts[longopts_len].name = key; the same pointer is copied to longopts, but ... > + case 0:...