summaryrefslogtreecommitdiff
path: root/src/cryptenroll/cryptenroll-password.c
Commit message (Collapse)AuthorAgeFilesLines
* cryptenroll: fix an assertion with weak passwordsFrantisek Sumsal2023-05-091-1/+1
| | | | | | | | | Passing 0 to log_xxx_errno() leads to an assertion, so let's not do that: $ NEWPASSWORD="" build-san/systemd-cryptenroll --unlock-key-file=/tmp/password --password "$img" /tmp/password has 0644 mode that is too permissive, please adjust the ownership and access mode. Assertion '(_error) != 0' failed at src/cryptenroll/cryptenroll-password.c:164, function enroll_password(). Aborting. Aborted (core dumped)
* cryptenroll: Implement support for unlocking via FIDO2 tokensPeter Cai2022-12-221-0/+80
| | | | | | | | | | | | This allows FIDO2 users to wipe out password slots and still be able to enroll new key slots via systemd-cryptenroll. Note that when the user wants to both unlock with a FIDO2 token and enroll a new FIDO2 token, they cannot be set to automatic discovery. This is to safeguard against confusion, because there will be multiple tokens connected to the system when doing so -- and we require users to explicitly confirm which one to use for unlocking and which one to use for enrollment. Addresses #20230 for the FIDO2 case.
* env-util: replace unsetenv_erase() by new getenv_steal_erase() helperLennart Poettering2022-02-201-11/+4
| | | | | | | | The new helper combines a bunch of steps every invocation of unsetenv_erase() did so far: getenv() + strdup() + unsetenv_erase(). Let's unify this into one helper that is harder to use incorrectly. It's in inspired by TAKE_PTR() in a way: get the env var out and invalidate where it was before.
* env-util: add unsetenv_erase() helperLennart Poettering2021-08-171-2/+2
| | | | Let's unify how we remove secrets from the env block.
* ask-password: when querying for a password, try to read from credential ↵Lennart Poettering2021-03-261-2/+2
| | | | | | | | | | | | store first This adds generic support for the SetCredential=/LoadCredential= logic to our password querying infrastructure: if a password is requested by a program that has a credential store configured via $CREDENTIALS_DIRECTORY we'll look in it for a password. The "systemd-ask-password" tool is updated with an option to specify the credential to look for.
* cryptenroll: add new "systemd-cryptenroll" tool for enrolling FIDO2+PKCS#11 ↵Lennart Poettering2020-12-171-0/+105
security tokens