summaryrefslogtreecommitdiff
path: root/src/creds
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2022-04-14 15:37:54 +0200
committerLennart Poettering <lennart@poettering.net>2022-04-20 17:49:16 +0200
commit571d829ee49147c588e53a1f107c29fd23968581 (patch)
tree318a3e9bce65e03f68d632f30a04f0128b7d0647 /src/creds
parent7cac4a2e2d8d7886df00e085c8299741d66cf1d0 (diff)
downloadsystemd-571d829ee49147c588e53a1f107c29fd23968581.tar.gz
creds-util: add an explicit 128bit ID for identifying "automatic" key determination
Previously, when encrypting creds you could pick which key to use for this via a 128bit ID identifying the key type, and use an all zero ID for rquesting automatic mode. Let's change this to use an explicitly picked 128bit ID for automatic mode, i.e. something other than all zeros. This is in preparation for adding one further automatic mode with slightly different semantics. no change in behaviour. Note that the new 128bit id is never written to disk but only used internally to indicate a specific case.
Diffstat (limited to 'src/creds')
-rw-r--r--src/creds/creds.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/creds/creds.c b/src/creds/creds.c
index 6e3441e5a0..501eb2deb8 100644
--- a/src/creds/creds.c
+++ b/src/creds/creds.c
@@ -40,7 +40,7 @@ static bool arg_legend = true;
static bool arg_system = false;
static TranscodeMode arg_transcode = TRANSCODE_OFF;
static int arg_newline = -1;
-static sd_id128_t arg_with_key = SD_ID128_NULL;
+static sd_id128_t arg_with_key = _CRED_AUTO;
static const char *arg_tpm2_device = NULL;
static uint32_t arg_tpm2_pcr_mask = UINT32_MAX;
static const char *arg_name = NULL;
@@ -684,7 +684,7 @@ static int parse_argv(int argc, char *argv[]) {
case ARG_WITH_KEY:
if (isempty(optarg) || streq(optarg, "auto"))
- arg_with_key = SD_ID128_NULL;
+ arg_with_key = _CRED_AUTO;
else if (streq(optarg, "host"))
arg_with_key = CRED_AES256_GCM_BY_HOST;
else if (streq(optarg, "tpm2"))