Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sbin/cgdconfig If reading an old style parameters file then ...



details:   https://anonhg.NetBSD.org/src/rev/793fd3b7444d
branches:  trunk
changeset: 545521:793fd3b7444d
user:      elric <elric%NetBSD.org@localhost>
date:      Thu Apr 10 05:45:29 2003 +0000

description:
If reading an old style parameters file then default a missing
keygen_iteration to 128.  This will not default the iteration count
on a new style parameter file as it is an error in the new style
to fail to specify the iteration count.

Addresses PR: bin/21056

diffstat:

 sbin/cgdconfig/params.c |  9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)

diffs (33 lines):

diff -r 465aa938c5eb -r 793fd3b7444d sbin/cgdconfig/params.c
--- a/sbin/cgdconfig/params.c   Thu Apr 10 05:08:55 2003 +0000
+++ b/sbin/cgdconfig/params.c   Thu Apr 10 05:45:29 2003 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: params.c,v 1.5 2003/03/24 02:02:51 elric Exp $ */
+/* $NetBSD: params.c,v 1.6 2003/04/10 05:45:29 elric Exp $ */
 
 /*-
  * Copyright (c) 2002, 2003 The NetBSD Foundation, Inc.
@@ -38,7 +38,7 @@
 
 #include <sys/cdefs.h>
 #ifndef lint
-__RCSID("$NetBSD: params.c,v 1.5 2003/03/24 02:02:51 elric Exp $");
+__RCSID("$NetBSD: params.c,v 1.6 2003/04/10 05:45:29 elric Exp $");
 #endif
 
 #include <sys/types.h>
@@ -531,10 +531,13 @@
         * to the list of keygens, so that the rest of the code does not
         * have to deal with this backwards compat issue.  The deprecated
         * ``xor_key'' field may be stored in p->dep_keygen->kg_key.  If
-        * it exists, we construct a storedkey keygen struct as well.
+        * it exists, we construct a storedkey keygen struct as well.  Also,
+        * default the iteration count to 128 as the old code did.
         */
 
        if (p->dep_keygen) {
+               if (p->dep_keygen->kg_iterations == -1)
+                       p->dep_keygen->kg_iterations = 128;
                p->dep_keygen->next = p->keygen;
                if (p->dep_keygen->kg_key) {
                        p->keygen = keygen_generate(KEYGEN_STOREDKEY);



Home | Main Index | Thread Index | Old Index