aboutsummaryrefslogtreecommitdiff
path: root/nitrocli/src/pinentry.rs
diff options
context:
space:
mode:
authorDaniel Mueller <deso@posteo.net>2018-12-24 17:49:38 -0800
committerDaniel Mueller <deso@posteo.net>2018-12-24 17:49:38 -0800
commit27ed7f31128cf17dee1ab8e7cfa49f45ca123aec (patch)
treea8525a70a1b7536130d9a07c85b9150f3b09ae87 /nitrocli/src/pinentry.rs
parente1147d2f2eb98ef5a39a37fd63d98dae9a301ee2 (diff)
downloadnitrocli-27ed7f31128cf17dee1ab8e7cfa49f45ca123aec.tar.gz
nitrocli-27ed7f31128cf17dee1ab8e7cfa49f45ca123aec.tar.bz2
Refactor the pinentry call into new helper functions
Currently, `open` directly calls the `pinentry` module and loops until the user entered a correct passphrase or the retry limit is reached. This patch moves the pinentry call and the loop into the `try_with_passphrase_and_data` function. This function queries a passphrase of a given type and executes a function with that passphrase. This function has a data argument and may return data that is passed to the next call of the function (if it failed). This data-passing mechanism is required for the `nitrokey` authentication functions: These functions take ownership of the device and either return an authenticated device after successful authentication, or an error including the unauthenticated device if the authentication failed. This patch enables the usage of these functions in future patches.
Diffstat (limited to 'nitrocli/src/pinentry.rs')
0 files changed, 0 insertions, 0 deletions