search for: nr_keys

Displaying 15 results from an estimated 15 matches for "nr_keys".

2019 Nov 12
4
[PATCH 1/2] options: Fixes and enhancements to --key parsing.
The first patch fixes a rather serious bug, the second patch allows multiple --key parameters and default parameters. There is a third patch to libguestfs which adds a test, coming up. I did not yet review and fix the documentation. I think we need to centralize it in one place because at the moment the same documentation for --key is copy/pasted all over the tools. Rich.
2019 Nov 26
0
[PATCH common v2 2/3] options: Allow multiple --key parameters.
...re may be multiple. If none are read from the + * keystore, ask the user. + */ +char ** +get_keys (struct key_store *ks, const char *device) { - size_t i; + size_t i, j, len; + char **r; + char *s; + + /* We know the returned list must have at least one element and not + * more than ks->nr_keys. + */ + len = 1; + if (ks) + len = MIN (1, ks->nr_keys); + r = calloc (len+1, sizeof (char *)); + if (r == NULL) + error (EXIT_FAILURE, errno, "calloc"); + + j = 0; if (ks) { for (i = 0; i < ks->nr_keys; ++i) { struct key_store_key *key = &ks-&gt...
2010 Feb 05
13
[PATCH 01/14] hivexsh: Document some peculiarities of the "cd" command.
--- hivex/hivexsh.pod | 9 ++++++++- 1 files changed, 8 insertions(+), 1 deletions(-) diff --git a/hivex/hivexsh.pod b/hivex/hivexsh.pod index 277e3ae..9336798 100644 --- a/hivex/hivexsh.pod +++ b/hivex/hivexsh.pod @@ -100,7 +100,14 @@ or even: Path elements (node names) are matched case insensitively, and characters like space, C<*>, and C<?> have I<no> special
2019 Nov 26
6
[PATCH options v2 0/3] options: Allow multiple and default --key parameters.
v1: https://www.redhat.com/archives/libguestfs/2019-November/msg00036.html
2019 Nov 12
0
[PATCH 2/2] options: Allow multiple --key parameters and default keys.
...re may be multiple. If none are read from the + * keystore, ask the user. + */ +char ** +get_keys (struct key_store *ks, const char *device) { - size_t i; + size_t i, j, len; + char **r; + char *s; + + /* We know the returned list must have at least one element and not + * more than ks->nr_keys. + */ + len = 1; + if (ks) + len = MIN (1, ks->nr_keys); + r = calloc (len+1, sizeof (char *)); + if (r == NULL) + error (EXIT_FAILURE, errno, "calloc"); + + j = 0; if (ks) { for (i = 0; i < ks->nr_keys; ++i) { struct key_store_key *key = &ks-&gt...
2013 Jul 25
19
[PATCH hivex 00/19] Fix read/write handling of li-records.
This is, hopefully, a full fix for handling of li-records. See: https://bugzilla.redhat.com/show_bug.cgi?id=717583 https://bugzilla.redhat.com/show_bug.cgi?id=987463 Rich.
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 Nov 12
0
[PATCH 1/2] options: Fix segfault when multiple --key parameters given.
...-- a/options/keys.c +++ b/options/keys.c @@ -216,7 +216,8 @@ key_store_import_key (struct key_store *ks, const struct key_store_key *key) } assert (ks != NULL); - new_keys = realloc (ks->keys, sizeof (*ks->keys) + 1); + new_keys = realloc (ks->keys, + (ks->nr_keys + 1) * sizeof (struct key_store_key)); if (!new_keys) error (EXIT_FAILURE, errno, "realloc"); -- 2.23.0
2019 Nov 26
0
[PATCH common v2 3/3] options: Allow default --key parameters.
...options/options.h | 5 ++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/options/keys.c b/options/keys.c index 782bdb6..817508b 100644 --- a/options/keys.c +++ b/options/keys.c @@ -148,7 +148,8 @@ get_keys (struct key_store *ks, const char *device) for (i = 0; i < ks->nr_keys; ++i) { struct key_store_key *key = &ks->keys[i]; - if (STRNEQ (key->device, device)) + if (STRNEQ (key->device, "") && + STRNEQ (key->device, device)) continue; switch (key->type) { diff --git a/options/options.h b/...
2019 Nov 29
0
[common PATCH 1/2] options: rename key.device as key.id
...> C<ID>:file:FILENAME Read the passphrase from F<FILENAME>. diff --git a/options/keys.c b/options/keys.c index 782bdb6..7c391ac 100644 --- a/options/keys.c +++ b/options/keys.c @@ -148,7 +148,7 @@ get_keys (struct key_store *ks, const char *device) for (i = 0; i < ks->nr_keys; ++i) { struct key_store_key *key = &ks->keys[i]; - if (STRNEQ (key->device, device)) + if (STRNEQ (key->id, device)) continue; switch (key->type) { @@ -193,8 +193,8 @@ key_store_add_from_selector (struct key_store *ks, const char *selector) }...
2019 Nov 29
0
[common PATCH 2/2] options: allow a UUID as identifier for --key
...ystore, ask the user. */ char ** -get_keys (struct key_store *ks, const char *device) +get_keys (struct key_store *ks, const char *device, const char *uuid) { size_t i, j, len; char **r; @@ -148,7 +148,7 @@ get_keys (struct key_store *ks, const char *device) for (i = 0; i < ks->nr_keys; ++i) { struct key_store_key *key = &ks->keys[i]; - if (STRNEQ (key->id, device)) + if (STRNEQ (key->id, device) && (uuid && STRNEQ (key->id, uuid))) continue; switch (key->type) { diff --git a/options/options.h b/options/optio...
2018 Sep 19
0
[PATCH 2/2] Introduce a --key option in tools that accept keys
..., filename); + + /* Remove the terminating \n if there is one. */ + if (len > 0 && ret[len-1] == '\n') + ret[len-1] = '\0'; + + return ret; +} + +char * +get_key (struct key_store *ks, const char *device) +{ + size_t i; + + if (ks) { + for (i = 0; i < ks->nr_keys; ++i) { + struct key_store_key *key = &ks->keys[i]; + char *s; + + if (STRNEQ (key->device, device)) + continue; + + switch (key->type) { + case key_string: + s = strdup (key->string.s); + if (!s) + error (EXIT_FAILURE, errno, &...
2019 Nov 26
1
Re: [PATCH common v2 3/3] options: Allow default --key parameters.
...les changed, 6 insertions(+), 2 deletions(-) > > diff --git a/options/keys.c b/options/keys.c > index 782bdb6..817508b 100644 > --- a/options/keys.c > +++ b/options/keys.c > @@ -148,7 +148,8 @@ get_keys (struct key_store *ks, const char *device) > for (i = 0; i < ks->nr_keys; ++i) { > struct key_store_key *key = &ks->keys[i]; > > - if (STRNEQ (key->device, device)) > + if (STRNEQ (key->device, "") && > + STRNEQ (key->device, device)) > continue; > > switch (key->type)...
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 +-
2011 Apr 13
1
[PATCH hivex] maint: split long lines
..., "hivex_node_children: returning EFAULT" + " because subkey_lf is not a valid block (0x%zx)\n", subkey_lf); errno = EFAULT; goto error; @@ -775,7 +780,8 @@ get_children (hive_h *h, hive_node_h node, size_t nr_subkeys_in_lf = le16toh (lf->nr_keys); if (h->msglvl >= 2) - fprintf (stderr, "hivex_node_children: nr_subkeys_in_nk = %zu, nr_subkeys_in_lf = %zu\n", + fprintf (stderr, "hivex_node_children: nr_subkeys_in_nk = %zu," + " nr_subkeys_in_lf = %zu\n", nr_subkeys_in...