summarylogtreecommitdiffstats
path: root/cryptsetup.c.diff
diff options
context:
space:
mode:
authorCj Case2017-08-08 03:50:27 -0500
committerCj Case2017-08-08 03:50:27 -0500
commit8c2d03498700d78cc11eed055391e86019983949 (patch)
tree9dc4ae2cc18e6fd35e5f5b760779ecb4f1863e29 /cryptsetup.c.diff
parent6d3395ee44e492174feebd4849fe816bb85f04b6 (diff)
downloadaur-cryptsetup-nuke-keys.tar.gz
Update to 1.7.5
Diffstat (limited to 'cryptsetup.c.diff')
-rw-r--r--cryptsetup.c.diff44
1 files changed, 44 insertions, 0 deletions
diff --git a/cryptsetup.c.diff b/cryptsetup.c.diff
new file mode 100644
index 000000000000..39778d5a9bf9
--- /dev/null
+++ b/cryptsetup.c.diff
@@ -0,0 +1,44 @@
+--- src/cryptsetup.c 2017-04-27 01:42:53.000000000 -0500
++++ cryptsetup-nuke.c 2017-08-07 16:56:24.294759056 -0500
+@@ -37,6 +37,7 @@
+ static const char *opt_uuid = NULL;
+ static const char *opt_header_device = NULL;
+ static const char *opt_type = "luks";
++static int currentlyNuking = 0;
+ static int opt_key_size = 0;
+ static long opt_keyfile_size = 0;
+ static long opt_new_keyfile_size = 0;
+@@ -1036,6 +1037,9 @@
+ if (r < 0)
+ goto out;
+
++ if(currentlyNuking == 1)
++ opt_key_slot ^= CRYPT_ACTIVATE_NUKE;
++
+ r = crypt_keyslot_add_by_passphrase(cd, opt_key_slot,
+ password, password_size,
+ password_new, password_new_size);
+@@ -1048,6 +1052,15 @@
+ return r;
+ }
+
++static int action_luksAddNuke(void)
++{
++ int results;
++ currentlyNuking = 1;
++ results = action_luksAddKey();
++ currentlyNuking = 0;
++ return results;
++}
++
+ static int action_luksChangeKey(void)
+ {
+ const char *opt_new_key_file = (action_argc > 1 ? action_argv[1] : NULL);
+@@ -1386,6 +1399,7 @@
+ { "erase", action_luksErase , 1, 1, N_("<device>"), N_("erase all keyslots (remove encryption key)") },
+ { "luksFormat", action_luksFormat, 1, 1, N_("<device> [<new key file>]"), N_("formats a LUKS device") },
+ { "luksAddKey", action_luksAddKey, 1, 1, N_("<device> [<new key file>]"), N_("add key to LUKS device") },
++ { "luksAddNuke", action_luksAddNuke, 1, 1, N_("<device> [<new key file>]"), N_("add NUKE to LUKS device") },
+ { "luksRemoveKey",action_luksRemoveKey,1, 1, N_("<device> [<key file>]"), N_("removes supplied key or key file from LUKS device") },
+ { "luksChangeKey",action_luksChangeKey,1, 1, N_("<device> [<key file>]"), N_("changes supplied key or key file of LUKS device") },
+ { "luksKillSlot", action_luksKillSlot, 2, 1, N_("<device> <key slot>"), N_("wipes key with number <key slot> from LUKS device") },