diff options
Diffstat (limited to 'src/cryptsetup/cryptsetup-pkcs11.c')
-rw-r--r-- | src/cryptsetup/cryptsetup-pkcs11.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/cryptsetup/cryptsetup-pkcs11.c b/src/cryptsetup/cryptsetup-pkcs11.c index 4b2b5bbf00..c8008533f3 100644 --- a/src/cryptsetup/cryptsetup-pkcs11.c +++ b/src/cryptsetup/cryptsetup-pkcs11.c @@ -3,10 +3,11 @@ #include <fcntl.h> #include <unistd.h> #include <sys/stat.h> - #include <p11-kit/p11-kit.h> #include <p11-kit/uri.h> +#include "sd-json.h" + #include "alloc-util.h" #include "ask-password-api.h" #include "cryptsetup-pkcs11.h" @@ -15,7 +16,6 @@ #include "fileio.h" #include "format-util.h" #include "hexdecoct.h" -#include "json.h" #include "macro.h" #include "memory-util.h" #include "parse-util.h" @@ -109,8 +109,8 @@ int find_pkcs11_auto_data( /* Loads PKCS#11 metadata from LUKS2 JSON token headers. */ for (int token = 0; token < sym_crypt_token_max(CRYPT_LUKS2); token++) { - _cleanup_(json_variant_unrefp) JsonVariant *v = NULL; - JsonVariant *w; + _cleanup_(sd_json_variant_unrefp) sd_json_variant *v = NULL; + sd_json_variant *w; int ks; r = cryptsetup_get_token_as_json(cd, token, "systemd-pkcs11", &v); @@ -134,12 +134,12 @@ int find_pkcs11_auto_data( assert(keyslot < 0); keyslot = ks; - w = json_variant_by_key(v, "pkcs11-uri"); - if (!w || !json_variant_is_string(w)) + w = sd_json_variant_by_key(v, "pkcs11-uri"); + if (!w || !sd_json_variant_is_string(w)) return log_error_errno(SYNTHETIC_ERRNO(EINVAL), "PKCS#11 token data lacks 'pkcs11-uri' field."); - uri = strdup(json_variant_string(w)); + uri = strdup(sd_json_variant_string(w)); if (!uri) return log_oom(); @@ -147,14 +147,14 @@ int find_pkcs11_auto_data( return log_error_errno(SYNTHETIC_ERRNO(EINVAL), "PKCS#11 token data contains invalid PKCS#11 URI."); - w = json_variant_by_key(v, "pkcs11-key"); - if (!w || !json_variant_is_string(w)) + w = sd_json_variant_by_key(v, "pkcs11-key"); + if (!w || !sd_json_variant_is_string(w)) return log_error_errno(SYNTHETIC_ERRNO(EINVAL), "PKCS#11 token data lacks 'pkcs11-key' field."); assert(!key); assert(key_size == 0); - r = unbase64mem(json_variant_string(w), &key, &key_size); + r = unbase64mem(sd_json_variant_string(w), &key, &key_size); if (r < 0) return log_error_errno(r, "Failed to decode base64 encoded key."); } |