Print verbose message about keyslot and token numbers.

Move all messages to cryptsetup tools and print these
verbose messages:

  - Key slot X unlocked.
  - Key slot X created.
  - Key slot X removed.
and
  - Token X created.
  - Token X removed.

Also print error, if unknown token is tried to be removed.
This commit is contained in:
Milan Broz
2018-07-18 16:15:23 +02:00
parent cc27088df9
commit eabd23f31e
6 changed files with 74 additions and 16 deletions

View File

@@ -62,7 +62,6 @@ extern int opt_batch_mode;
extern int opt_force_password;
extern int opt_progress_frequency;
/* Common tools */
void clogger(struct crypt_device *cd, int level, const char *file, int line,
const char *format, ...) __attribute__ ((format (printf, 5, 6)));
@@ -77,6 +76,10 @@ void usage(poptContext popt_context, int exitcode, const char *error, const char
void dbg_version_and_cmd(int argc, const char **argv);
int translate_errno(int r);
typedef enum { CREATED, UNLOCKED, REMOVED } crypt_object_op;
void tools_keyslot_msg(int keyslot, crypt_object_op op);
void tools_token_msg(int token, crypt_object_op op);
extern volatile int quit;
void set_int_block(int block);
void set_int_handler(int block);