Commit Graph

35 Commits

Author SHA1 Message Date
christos 2882a9c896 List all cgd's no matter if they are not contiguously allocated 2013-06-09 18:37:40 +00:00
christos 0f179f793d add cgdconfig -l like vnconfig -l 2012-12-05 02:23:20 +00:00
joerg baa8e84b6f Use __dead 2011-08-29 14:34:58 +00:00
pooka 5f732a29cb Convert from the oldstyle cgd_kops.op_open to the newstyle prog_open
and define RUMPPRG.  Get rid of the Makefile.inc stuff, since it was
useful only for the oldstyle regime.
2010-12-14 17:46:21 +00:00
elric 297cd81a0d Remove a line that was intended only for my personal testing and that
breaks things.
2010-12-02 18:02:58 +00:00
elric 7de6a71be4 In -G, refuse to operate if KEYGEN_URANDOM is specified as we already do
for KEYGEN_RANDOMKEY.

Print a warning if such a refusal is made---this will help the user understand
why there is an error.

Patch provided by:  Taylor R Campbell <campbell+netbsd@mumble.net>.
2010-12-02 04:54:32 +00:00
elric f130bae6f7 Remove trailing whitespace (patch provided by: Taylor R Campbell
<campbell+netbsd@mumble.net>)
2010-11-27 17:08:36 +00:00
pooka 7ae6c0a6f6 * allow specification of kernel operations vector
* make it possible to build cgdconfig as a library
2009-09-08 21:36:35 +00:00
christos 1a43d7316a PR/39525: Joachim Schueth, Frederik Sausmikat:
cgd inadvertently encrypts blkno eight times to generate IV

Add "encblkno1" IV type to encrypt only once, rename old "encblkno" to
"encblkno8" for clarity, and make "encblkno" an alias for "encblkno8"
for backward compatibility.
2008-07-24 19:07:36 +00:00
dholland e3b90707f6 bzero the passphrase before freeing it, to discourage chill attacks. 2008-07-24 05:35:59 +00:00
dholland 2c1061aba6 Adjust this to not need -Wno-pointer-sign. 2008-07-24 05:32:45 +00:00
lukem 6543a91fea Remove the \n and tabs from the __COPYRIGHT() strings.
(Tweak some to use a consistent format.)
2008-07-20 01:20:21 +00:00
elric 98059cd502 Add a new keygen method which will execute an external command and
take its output as the key.  I've been meaning to do this for quite
a while...
2008-05-11 03:15:21 +00:00
elric ba6026f365 Add -p flag to retrieve passphrases from stdin. This is mainly aimed
at programatic use where the caller wants to be able to use PKCS#5.

Disable looping on invalid verifications unless both a passphrase method
is in use and the -p flag is not specified.

Update man page to document -p flag.
2008-05-10 21:38:40 +00:00
martin ce099b4099 Remove clause 3 and 4 from TNF licenses 2008-04-28 20:22:51 +00:00
martin 309213c31a Do not use %d for size_t 2007-11-06 10:44:23 +00:00
christos ad18d2e41e 3 month roland feedback timeout:
- Pass lint
- knf
- convert ints to size_t's
2007-11-06 02:50:48 +00:00
cbiere a91470cccd Fixed format string in opendisk_werror() which was wrong since my previous
commit.
2007-02-06 14:04:01 +00:00
cbiere a63e176c73 * 1 -> EXIT_FAILURE.
* Replaced atoi() with parse_int().
 * Use an enum for ACTION_* instead of #define.
 * Use strdup() or asnprintf() instead of strlcpy() to avoid truncation.
 * pread() returns ssize_t not int.
 * Suppress "unused parameter" warnings.
 * verify_disklabel(): Pass the correct size to disklabel_scan().
 * verify_ffs():
   * Don't indicate success if pread() fails.
   * Check the amount of bytes read.
   * Don't cast buf to (struct fs *), it's not aligned.
 * eliminate_cores(): No need for a temporary variable.
2007-02-06 02:09:19 +00:00
christos cc9c2b575d - constify.
- don't dup extern declarations on each file because they end up being
  inconsistent (yyerror).
2005-06-27 03:07:45 +00:00
elric 1cdd98012f setprogname(3) needs to come before calls to err(3). 2005-03-30 20:59:34 +00:00
elric 6230b2ec40 Lock all memory. 2005-03-30 19:56:05 +00:00
elric 2dcfc0c616 Turn off core dumps. 2005-03-30 15:45:56 +00:00
tv 21840e450a Add "urandomkey" key generation method as described in PR kern/22766;
useful for configuring a throwaway key for cgd-on-swap at boot time.
2004-08-13 15:03:57 +00:00
rumble 6b72b5c789 In getkey(), check the return values of the various keygen functions
and abort if necessary. Also, check for errors in its callers and
handle them gracefully.

OK'd by elric.
2004-08-10 02:29:34 +00:00
dan 064ca2e3d1 Fix a longstanding algorithmic flaw in PKCS#5 key generation.
The existing pkcs5_pbdkf2 keygen method is retained functionally
as-is, for compatibility with existing params files.  The corrected
algorithm, which is now the default for new params file generation, is
called pkcs5_pbkdf2/sha1.

NB. The backwards compatibility for the miscreant keygen method will
be removed at the same time as support for the previous parameters
file syntax. Sometime between now and then, users should update their
params files using -G, which will create a new params file including
an xor value so that the resulting generated key is the same; they
should also

Problem discovery and 2-char algorithm fix by Charles Blundell, messy
compat goop by me, long complicated names by Roland Dowdeswell.

Update manpage accordingly and bump date.
2004-03-17 01:29:13 +00:00
cb 7543b55c56 add a new verification method that prompts for the pkcs#5 pbkdf2
passphrase again and checks the generated key against the original.
2003-09-23 17:24:45 +00:00
itojun fe09a0efcb use strlcpy 2003-05-17 23:03:28 +00:00
fvdl 42614ed3f3 Add support for UFS2. UFS2 is an enhanced FFS, adding support for
64 bit block pointers, extended attribute storage, and a few
other things.

This commit does not yet include the code to manipulate the extended
storage (for e.g. ACLs), this will be done later.

Originally written by Kirk McKusick and Network Associates Laboratories for
FreeBSD.
2003-04-02 10:39:19 +00:00
elric 7687f10a7a Quick bugfix:
o  need to do keygen_filldefaults() in generate_convert no
	   matter what, not only if there are no existing keygen
	   methods in the new parameters.
2003-03-24 03:12:22 +00:00
elric 8c6033d202 substantial rototill of the code.
o  added new features:
		o  -G:  generate a new paramsfile that produces the same
			key as the old paramsfile,
		o  ffs verify_method,
		o  multiple keygen methods that are xor'ed together
		   (for n-factor authentication), and
		o  calibrating the iteration count of PKCS#5 PBKDF2 to
		   the current machine's speed.
	o  changed paramsfile format to allow for the new features.
	o  replaced open-coded parser with yacc grammar.
	o  lots of supporting changes.
	o  updated documentation to reflect new features and new
	   paramsfile format.
2003-03-24 02:02:49 +00:00
elric ae48183d48 bugfix: was still pulling random bits from /dev/random when generating
a paramsfile of type randomkey which does not need them.  Pointed out
by dan@netbsd.org.
2002-10-28 05:46:01 +00:00
elric 1242e52a64 Add the concept of a verification method which allows cgdconfig(8)
to reprompt for the passphrase if the key does not meet certain
criteria.  The currently implemented methods are ``none'' and
``disklabel''.  The first behaves in the original fashion, the
second will scan for a disklabel on the cgd after configuration
and if it does not find a disklabel then it will reprompt for the
password and reconfigure the disk.
2002-10-12 21:02:18 +00:00
elric 13daed40b1 Small usage enhancement: open the cgd before prompting for the passphrase
so that errors can be reported w/o asking for the passphrase unnec.
2002-10-12 15:56:26 +00:00
elric 49ec72f444 Initial checkin of cgdconfig(8), a program to configure a cgd. 2002-10-04 18:37:19 +00:00