summaryrefslogtreecommitdiffstats
path: root/sbin
diff options
context:
space:
mode:
authorpjd <pjd@FreeBSD.org>2005-08-14 14:13:07 +0000
committerpjd <pjd@FreeBSD.org>2005-08-14 14:13:07 +0000
commitf8b8e82885c0f48bb4d7fbe5ce85bcab7508533c (patch)
tree3b2cdbdca32944b82a1932fe94a014f63979a61d /sbin
parenta43c6eba96776482bfaf4580048b3acc60f9e314 (diff)
downloadFreeBSD-src-f8b8e82885c0f48bb4d7fbe5ce85bcab7508533c.zip
FreeBSD-src-f8b8e82885c0f48bb4d7fbe5ce85bcab7508533c.tar.gz
When keys were configured without passphrase, number of iterations in
metadata is equal to -1. if we then wanted to attach provider (or change keys) and forget about '-p' flag it failed on assertion (quite ok, without assertion it could call PKCS#5v2 with 4294967295 iterations). Instead of failing on assertion, remind about '-p' flag. MFC after: 3 days
Diffstat (limited to 'sbin')
-rw-r--r--sbin/geom/class/eli/geom_eli.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/sbin/geom/class/eli/geom_eli.c b/sbin/geom/class/eli/geom_eli.c
index f01f557..8d900f1 100644
--- a/sbin/geom/class/eli/geom_eli.c
+++ b/sbin/geom/class/eli/geom_eli.c
@@ -344,6 +344,10 @@ eli_genkey(struct gctl_req *req, struct g_eli_metadata *md, unsigned char *key,
if (!*nopassphrase) {
char buf1[BUFSIZ], buf2[BUFSIZ], *p;
+ if (!new && md->md_iterations == -1) {
+ gctl_error(req, "Missing -p flag.");
+ return (NULL);
+ }
for (;;) {
p = readpassphrase(
new ? "Enter new passphrase:" : "Enter passphrase:",
OpenPOWER on IntegriCloud