Displaying 10 results from an estimated 10 matches for "key_store_add_from_selector".
2019 Nov 12
0
[PATCH 2/2] options: Allow multiple --key parameters and default keys.
...}
}
- return read_key (device);
+ if (j == 0) {
+ /* Key not found in the key store, ask the user for it. */
+ s = read_key (device);
+ if (!s)
+ error (EXIT_FAILURE, 0, _("could not read key from user"));
+ r[0] = s;
+ }
+
+ return r;
}
struct key_store *
-key_store_add_from_selector (struct key_store *ks, const char *selector_orig)
+key_store_add_from_selector (struct key_store *ks, const char *selector)
{
- CLEANUP_FREE char *selector = strdup (selector_orig);
- const char *elem;
- char *saveptr;
+ CLEANUP_FREE_STRING_LIST char **fields =
+ guestfs_int_split_string (&...
2019 Nov 26
0
[PATCH common v2 1/3] options: Simplify selector parsing for --key options.
...++++++++++---------------------
1 file changed, 14 insertions(+), 21 deletions(-)
diff --git a/options/keys.c b/options/keys.c
index f783066..74b5497 100644
--- a/options/keys.c
+++ b/options/keys.c
@@ -153,49 +153,42 @@ get_key (struct key_store *ks, const char *device)
}
struct key_store *
-key_store_add_from_selector (struct key_store *ks, const char *selector_orig)
+key_store_add_from_selector (struct key_store *ks, const char *selector)
{
- CLEANUP_FREE char *selector = strdup (selector_orig);
- const char *elem;
- char *saveptr;
+ CLEANUP_FREE_STRING_LIST char **fields =
+ guestfs_int_split_string (&...
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
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 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 29
0
[common PATCH 1/2] options: rename key.device as key.id
...uct 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)
}
/* 1: device */
- key.device = strdup (fields[0]);
- if (!key.device)
+ key.id = strdup (fields[0]);
+ if (!key.id)
error (EXIT_FAILURE, errno, "strdup");
/* 2: key type */
@@ -265,6 +265,6 @@ free_key_store (struct key_...
2019 Nov 29
0
[common PATCH 2/2] options: allow a UUID as identifier for --key
...-150,7 +150,7 @@ extern void print_inspect_prompt (void);
/* in key.c */
extern char *read_key (const char *param);
-extern char **get_keys (struct key_store *ks, const char *device);
+extern char **get_keys (struct key_store *ks, const char *device, const char *uuid);
extern struct key_store *key_store_add_from_selector (struct key_store *ks, const char *selector);
extern struct key_store *key_store_import_key (struct key_store *ks, const struct key_store_key *key);
extern void free_key_store (struct key_store *ks);
--
2.21.0
2019 Nov 26
0
[PATCH common v2 2/3] options: Allow multiple --key parameters.
...ice;
enum {
@@ -146,7 +148,7 @@ extern void print_inspect_prompt (void);
/* in key.c */
extern char *read_key (const char *param);
-extern char *get_key (struct key_store *ks, const char *device);
+extern char **get_keys (struct key_store *ks, const char *device);
extern struct key_store *key_store_add_from_selector (struct key_store *ks, const char *selector);
extern struct key_store *key_store_import_key (struct key_store *ks, const struct key_store_key *key);
extern void free_key_store (struct key_store *ks);
--
2.23.0
2018 Sep 19
0
[PATCH 2/2] Introduce a --key option in tools that accept keys
...AILURE, errno, "strdup");
+ return s;
+ case key_file:
+ return read_first_line_from_file (key->file.name);
+ }
+
+ /* Key not found in the key store, ask the user for it. */
+ break;
+ }
+ }
+
+ return read_key (device);
+}
+
+struct key_store *
+key_store_add_from_selector (struct key_store *ks, const char *selector_orig)
+{
+ CLEANUP_FREE char *selector = strdup (selector_orig);
+ const char *elem;
+ char *saveptr;
+ struct key_store_key key;
+
+ if (!selector)
+ error (EXIT_FAILURE, errno, "strdup");
+
+ /* 1: device */
+ elem = strtok_r (select...
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 +-