diff options
author | Lennart Poettering <lennart@poettering.net> | 2020-04-14 19:05:09 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2020-07-01 11:17:28 +0200 |
commit | c0bde0d2402b203207d1ec2f998e661ee0fe177c (patch) | |
tree | ad4f5ebdece8833fa7160d1051e2c614e8e88767 /src/shared/user-record.c | |
parent | d00f318323177268872a1fa8bc140aa76979789d (diff) | |
download | systemd-c0bde0d2402b203207d1ec2f998e661ee0fe177c.tar.gz |
user-record: rename JSON field "pkcs11Pin" to "tokenPin"
We'd like to use it for FIDO2 tokens too, and the concept is entirely
generic, hence let's just reuse the field, but rename it. Read the old
name for compatibility, and treat the old name and the new name as
identical for most purposes.
Diffstat (limited to 'src/shared/user-record.c')
-rw-r--r-- | src/shared/user-record.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/shared/user-record.c b/src/shared/user-record.c index f6f67eabc0..d4dbecaae9 100644 --- a/src/shared/user-record.c +++ b/src/shared/user-record.c @@ -120,7 +120,7 @@ static UserRecord* user_record_free(UserRecord *h) { strv_free_erase(h->hashed_password); strv_free_erase(h->ssh_authorized_keys); strv_free_erase(h->password); - strv_free_erase(h->pkcs11_pin); + strv_free_erase(h->token_pin); free(h->cifs_service); free(h->cifs_user_name); @@ -620,7 +620,8 @@ static int dispatch_secret(const char *name, JsonVariant *variant, JsonDispatchF static const JsonDispatch secret_dispatch_table[] = { { "password", _JSON_VARIANT_TYPE_INVALID, json_dispatch_strv, offsetof(UserRecord, password), 0 }, - { "pkcs11Pin", _JSON_VARIANT_TYPE_INVALID, json_dispatch_strv, offsetof(UserRecord, pkcs11_pin), 0 }, + { "tokenPin", _JSON_VARIANT_TYPE_INVALID, json_dispatch_strv, offsetof(UserRecord, token_pin), 0 }, + { "pkcs11Pin", /* legacy alias */ _JSON_VARIANT_TYPE_INVALID, json_dispatch_strv, offsetof(UserRecord, token_pin), 0 }, { "pkcs11ProtectedAuthenticationPathPermitted", JSON_VARIANT_BOOLEAN, json_dispatch_tristate, offsetof(UserRecord, pkcs11_protected_authentication_path_permitted), 0 }, {}, }; |