.Pp
.Dl "gbde setkey ada0s1f -n 2 -P foo -L key2.lockfile"
.Pp
-To destroy all copies of the masterkey:
+To invalidate your own masterkey:
+.Pp
+.Dl "gbde nuke ada0s1f"
+.Pp
+This will overwrite your masterkey sector with zeros, and results in
+a diagnostic if you try to use the key again.
+You can also destroy the other three copies of the masterkey with the
+-n argument.
+.Pp
+You can also invalidate your masterkey without leaving a tell-tale sector
+full of zeros:
.Pp
.Dl "gbde destroy ada0s1f"
+.Pp
+This will overwrite the information fields in your masterkey sector,
+encrypt it and write it back.
+You get a (different) diagnostic if you try to use it.
.Sh SEE ALSO
.Xr gbde 4 ,
.Xr geom 4
gctl_ro_param(r, "key", 16, buf);
close(ffd);
}
- /* gctl_dump(r, stdout); */
errstr = gctl_issue(r);
if (errstr != NULL)
errx(1, "Attach to %s failed: %s", dest, errstr);
if (error != 0)
errx(1, "Error %d decrypting lock", error);
if (nkey)
- printf("Opened with key %u\n", *nkey);
+ printf("Opened with key %u\n", 1 + *nkey);
return;
}
free(sbuf);
if (i != (int)gl->sectorsize)
err(1, "write");
- printf("Nuked key %d\n", key);
+ printf("Nuked key %d\n", 1 + key);
}
static void
bzero(&gl->sector0, sizeof gl->sector0);
bzero(&gl->sectorN, sizeof gl->sectorN);
bzero(&gl->keyoffset, sizeof gl->keyoffset);
- bzero(&gl->flags, sizeof gl->flags);
+ gl->flags &= GBDE_F_SECT0;
bzero(gl->mkey, sizeof gl->mkey);
for (i = 0; i < G_BDE_MAXKEYS; i++)
if (i != nkey)