OpenBSD CVS

CVS log for src/usr.sbin/ikectl/ikeca.c


[BACK] Up to [local] / src / usr.sbin / ikectl

Request diff between arbitrary revisions


Default branch: MAIN


Revision 1.51 / (download) - annotate - [select for diffs], Sat Jan 23 22:04:55 2021 UTC (3 years, 4 months ago) by tobhe
Branch: MAIN
CVS Tags: OPENBSD_7_5_BASE, OPENBSD_7_5, OPENBSD_7_4_BASE, OPENBSD_7_4, OPENBSD_7_3_BASE, OPENBSD_7_3, OPENBSD_7_2_BASE, OPENBSD_7_2, OPENBSD_7_1_BASE, OPENBSD_7_1, OPENBSD_7_0_BASE, OPENBSD_7_0, OPENBSD_6_9_BASE, OPENBSD_6_9, HEAD
Changes since 1.50: +5 -3 lines
Diff to previous 1.50 (colored)

Handle write() errors.

ok patrick@

Revision 1.50 / (download) - annotate - [select for diffs], Sat Jan 23 21:51:29 2021 UTC (3 years, 4 months ago) by tobhe
Branch: MAIN
Changes since 1.49: +220 -74 lines
Diff to previous 1.49 (colored)

Handle errors and truncated output from snprintf().

ok patrick@

Revision 1.49 / (download) - annotate - [select for diffs], Wed May 8 23:59:19 2019 UTC (5 years ago) by tedu
Branch: MAIN
CVS Tags: OPENBSD_6_8_BASE, OPENBSD_6_8, OPENBSD_6_7_BASE, OPENBSD_6_7, OPENBSD_6_6_BASE, OPENBSD_6_6
Changes since 1.48: +153 -123 lines
Diff to previous 1.48 (colored)

convert system() calls to an execv() like interface.
avoids sh difficulties, etc.
from Matthew Martin.
ok deraadt reyk

Revision 1.48 / (download) - annotate - [select for diffs], Tue Feb 26 14:21:30 2019 UTC (5 years, 3 months ago) by sthen
Branch: MAIN
CVS Tags: OPENBSD_6_5_BASE, OPENBSD_6_5
Changes since 1.47: +2 -2 lines
Diff to previous 1.47 (colored)

ikectl's built-in CA command for simple configurations has a fixed certificate
validity for the ca certificate. Raise this from 365 days to 4500 as expiry means
installing new CA certificates on all client machines which can cause significant
pain. This doesn't change the default validity for server certificates which
remains at 1 year (controlled by ikeca.cnf) - refreshing key and certificate
on these can be done easily without visiting all machines.   ok deraadt@

Revision 1.47 / (download) - annotate - [select for diffs], Wed Nov 8 09:33:37 2017 UTC (6 years, 6 months ago) by patrick
Branch: MAIN
CVS Tags: OPENBSD_6_4_BASE, OPENBSD_6_4, OPENBSD_6_3_BASE, OPENBSD_6_3
Changes since 1.46: +10 -4 lines
Diff to previous 1.46 (colored)

Since r1.41 the extensions are included in the CSR.  Thus ca_request()
already sets the extension values and returns.  ca_sign() re-uses the
information to write out the extension file.  Since ca_request() uses
strings stored on the stack, on return the pointers to those strings
will be unusable.  To fix this, strdup() the strings passed ca_setenv()
so we can re-use them in another scope.  And free() them when we clear
the environment in ca_clrenv().

Initial report and diff from Andrei-Marius Radu.

ok markus@

Revision 1.46 / (download) - annotate - [select for diffs], Thu Jun 8 11:45:44 2017 UTC (6 years, 11 months ago) by jsg
Branch: MAIN
CVS Tags: OPENBSD_6_2_BASE, OPENBSD_6_2
Changes since 1.45: +5 -41 lines
Diff to previous 1.45 (colored)

Invoke openssl with -passin file rather than -key in ca_revoke().
From Andrei-Marius Radu via sthen@

Revision 1.45 / (download) - annotate - [select for diffs], Wed May 31 06:46:57 2017 UTC (7 years ago) by jsg
Branch: MAIN
Changes since 1.44: +4 -2 lines
Diff to previous 1.44 (colored)

ca_revoke() gets called two ways.  Directly from ca_opt() with keyname
set to the cert to revoke, and indirectly from ca_create() with a
keyname set to NULL.

ca_create() sets REQ_EXT so avoid setting it in ca_revoke() when keyname
is NULL and the crl database is being initialised.

Avoids "REQ_EXT already set" when creating a CA error introduced
in rev 1.44 which set REQ_EXT unconditionally in ca_revoke().

Revision 1.44 / (download) - annotate - [select for diffs], Wed May 24 04:55:57 2017 UTC (7 years ago) by jsg
Branch: MAIN
Changes since 1.43: +2 -1 lines
Diff to previous 1.43 (colored)

Set REQ_EXT in req section so ikectl ca certificate revoke will work again.

Revision 1.43 / (download) - annotate - [select for diffs], Sun May 21 02:37:52 2017 UTC (7 years ago) by deraadt
Branch: MAIN
Changes since 1.42: +2 -4 lines
Diff to previous 1.42 (colored)

A few more freezero() uses
ok yasuoka mikeb

Revision 1.42 / (download) - annotate - [select for diffs], Wed Mar 29 08:19:13 2017 UTC (7 years, 2 months ago) by sthen
Branch: MAIN
CVS Tags: OPENBSD_6_1_BASE, OPENBSD_6_1
Changes since 1.41: +2 -1 lines
Diff to previous 1.41 (colored)

set REQ_EXT to x509v3_CA, fixing "ikectl ca XX create" inadvertently broken
in r1.41.  ok reyk deraadt

Revision 1.41 / (download) - annotate - [select for diffs], Tue Jan 31 21:35:07 2017 UTC (7 years, 4 months ago) by sthen
Branch: MAIN
Changes since 1.40: +25 -15 lines
Diff to previous 1.40 (colored)

Teach ikectl to include extensions in the CSR, rather than just adding them
when signing the certificates by the local CA. This can make things easier if
you want to take a CSR from ikectl to another CA for signing, they often copy
extensions from the request.  ok reyk@

Revision 1.40 / (download) - annotate - [select for diffs], Mon Nov 2 12:21:27 2015 UTC (8 years, 7 months ago) by jsg
Branch: MAIN
CVS Tags: OPENBSD_6_0_BASE, OPENBSD_6_0, OPENBSD_5_9_BASE, OPENBSD_5_9
Changes since 1.39: +2 -1 lines
Diff to previous 1.39 (colored)

switch from using sha1 to sha256

As the ca section of the cnf file requires a default_md line
(unlike req) this change also requires updating the installed ikeca.cnf
or equivalent files.

Requested by and ok reyk@ who also tested this against ios9 with iked.

Revision 1.39 / (download) - annotate - [select for diffs], Mon Nov 2 12:01:28 2015 UTC (8 years, 7 months ago) by jsg
Branch: MAIN
Changes since 1.38: +59 -24 lines
Diff to previous 1.38 (colored)

sign csrs with openssl ca instead of x509 -req

This way openssl will add valid signed certs to the index file
which is required to use the builtin openssl OCSP server.

This change requires installing a new ikeca.cnf or updating
the default cnf files with equivalent sections.

Requested by and ok reyk@

Revision 1.38 / (download) - annotate - [select for diffs], Mon Nov 2 10:27:44 2015 UTC (8 years, 7 months ago) by jsg
Branch: MAIN
Changes since 1.37: +6 -1 lines
Diff to previous 1.37 (colored)

Accept an ocsp option when creating certificates to set the extended
key usage for OCSP signing.

Requested by and ok reyk@

Revision 1.37 / (download) - annotate - [select for diffs], Wed Aug 19 21:07:23 2015 UTC (8 years, 9 months ago) by reyk
Branch: MAIN
Changes since 1.36: +5 -10 lines
Diff to previous 1.36 (colored)

ca_hier() und ca_newpass() abort on failure, return void instead of int.

Based on previous observation by semarie@

Revision 1.36 / (download) - annotate - [select for diffs], Wed Aug 19 21:03:11 2015 UTC (8 years, 9 months ago) by reyk
Branch: MAIN
Changes since 1.35: +2 -2 lines
Diff to previous 1.35 (colored)

spacing

Revision 1.35 / (download) - annotate - [select for diffs], Wed Aug 19 21:01:20 2015 UTC (8 years, 9 months ago) by reyk
Branch: MAIN
Changes since 1.34: +3 -5 lines
Diff to previous 1.34 (colored)

fcopy_env() should return void as it aborts on failure.

Pointed out by semarie@

Revision 1.34 / (download) - annotate - [select for diffs], Wed Aug 19 13:30:54 2015 UTC (8 years, 9 months ago) by reyk
Branch: MAIN
Changes since 1.33: +5 -5 lines
Diff to previous 1.33 (colored)

Use C99 integer types in ikectl(8).

OK jsg@

Revision 1.33 / (download) - annotate - [select for diffs], Wed Aug 19 12:25:59 2015 UTC (8 years, 9 months ago) by reyk
Branch: MAIN
Changes since 1.32: +167 -44 lines
Diff to previous 1.32 (colored)

Support for overwriting $ENV:: variables in OpenSSL .cnf files from
the environment has been removed in LibreSSL.  This was a good step
but it unintentionally broke the "ikectl ca" commands.  Rework the
implementation for copying the .cnf files and expanding the $ENV::
variables ourselves before passing the generated .cnf file to the
"openssl" command.

Reported and tested by Jona Joachim (thanks!)
OK jsg@

Revision 1.32 / (download) - annotate - [select for diffs], Sat Aug 15 04:47:28 2015 UTC (8 years, 9 months ago) by semarie
Branch: MAIN
Changes since 1.31: +2 -2 lines
Diff to previous 1.31 (colored)

correct mode_t 644 to 0644

ok sthen@

Revision 1.31 / (download) - annotate - [select for diffs], Sat Aug 15 04:45:49 2015 UTC (8 years, 9 months ago) by semarie
Branch: MAIN
Changes since 1.30: +4 -4 lines
Diff to previous 1.30 (colored)

corrects three err() to errx() calls
  - a if condition don't set errno
  - strlcpy(3) don't set errno (no mention is man page)
  - ca_readpass() already manage errno error message with warn(3)

ok sthen@

Revision 1.30 / (download) - annotate - [select for diffs], Fri Jan 16 06:40:17 2015 UTC (9 years, 4 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_5_8_BASE, OPENBSD_5_8, OPENBSD_5_7_BASE, OPENBSD_5_7
Changes since 1.29: +3 -3 lines
Diff to previous 1.29 (colored)

Replace <sys/param.h> with <limits.h> and other less dirty headers where
possible.  Annotate <sys/param.h> lines with their current reasons.  Switch
to PATH_MAX, NGROUPS_MAX, HOST_NAME_MAX+1, LOGIN_NAME_MAX, etc.  Change
MIN() and MAX() to local definitions of MINIMUM() and MAXIMUM() where
sensible to avoid pulling in the pollution.  These are the files confirmed
through binary verification.
ok guenther, millert, doug (helped with the verification protocol)

Revision 1.29 / (download) - annotate - [select for diffs], Tue Aug 26 17:47:24 2014 UTC (9 years, 9 months ago) by jsing
Branch: MAIN
Changes since 1.28: +2 -2 lines
Diff to previous 1.28 (colored)

Move openssl(1) from /usr/sbin/openssl to /usr/bin/openssl, since it is not
a system/superuser binary. At the same time, move the source code from its
current lib/libssl/src/apps location to a more appropriate home under
usr.bin/openssl.

ok deraadt@ miod@

Revision 1.28 / (download) - annotate - [select for diffs], Mon Aug 25 07:50:26 2014 UTC (9 years, 9 months ago) by doug
Branch: MAIN
Changes since 1.27: +2 -2 lines
Diff to previous 1.27 (colored)

Delete secret or secret-derived data with explicit_bzero.

concept ok deraadt@
diff looks ok tedu@

Revision 1.27 / (download) - annotate - [select for diffs], Sun Jul 20 01:38:40 2014 UTC (9 years, 10 months ago) by guenther
Branch: MAIN
CVS Tags: OPENBSD_5_6_BASE, OPENBSD_5_6
Changes since 1.26: +3 -2 lines
Diff to previous 1.26 (colored)

Make sure the correct errno is reported by warn* or err* and not
the errno of an intervening cleanup operation like close/unlink/etc.

Diff from Doug Hogan (doug (at) acyclic.org)

Revision 1.26 / (download) - annotate - [select for diffs], Fri Apr 18 21:29:20 2014 UTC (10 years, 1 month ago) by tedu
Branch: MAIN
Changes since 1.25: +1 -5 lines
Diff to previous 1.25 (colored)

round up some enemy sympathizers found calling RAND_seed().
ok beck reyk

Revision 1.25 / (download) - annotate - [select for diffs], Tue Jan 8 10:38:19 2013 UTC (11 years, 4 months ago) by reyk
Branch: MAIN
CVS Tags: OPENBSD_5_5_BASE, OPENBSD_5_5, OPENBSD_5_4_BASE, OPENBSD_5_4, OPENBSD_5_3_BASE, OPENBSD_5_3
Changes since 1.24: +1 -2 lines
Diff to previous 1.24 (colored)

Remove private CVS tag from an obsolete repository and bump copyright
to 2013 while I'm here... this is my way of saying "happy new year!".

Revision 1.24 / (download) - annotate - [select for diffs], Sat Dec 8 12:51:46 2012 UTC (11 years, 5 months ago) by mikeb
Branch: MAIN
Changes since 1.23: +2 -3 lines
Diff to previous 1.23 (colored)

don't forget to include a path separator after an SSLDIR;
reported by david hill

Revision 1.23 / (download) - annotate - [select for diffs], Tue Oct 23 14:36:18 2012 UTC (11 years, 7 months ago) by reyk
Branch: MAIN
Changes since 1.22: +21 -7 lines
Diff to previous 1.22 (colored)

Allow to overwrite a few more definitions like file paths from the
Makefile.  No functional change.

Revision 1.22 / (download) - annotate - [select for diffs], Tue Sep 18 12:07:59 2012 UTC (11 years, 8 months ago) by reyk
Branch: MAIN
Changes since 1.21: +2 -2 lines
Diff to previous 1.21 (colored)

update email addresses to match reality.
sure jsg@ mikeb@

Revision 1.21 / (download) - annotate - [select for diffs], Sun Jul 8 11:48:20 2012 UTC (11 years, 10 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_5_2_BASE, OPENBSD_5_2
Changes since 1.20: +2 -1 lines
Diff to previous 1.20 (colored)

if you use nitems() in userland, you must define it yourself
discussed with guenther

Revision 1.20 / (download) - annotate - [select for diffs], Fri May 27 12:01:02 2011 UTC (13 years ago) by reyk
Branch: MAIN
CVS Tags: OPENBSD_5_1_BASE, OPENBSD_5_1, OPENBSD_5_0_BASE, OPENBSD_5_0
Changes since 1.19: +8 -8 lines
Diff to previous 1.19 (colored)

spacing

Revision 1.19 / (download) - annotate - [select for diffs], Fri Oct 8 16:15:22 2010 UTC (13 years, 7 months ago) by reyk
Branch: MAIN
CVS Tags: OPENBSD_4_9_BASE, OPENBSD_4_9
Changes since 1.18: +5 -3 lines
Diff to previous 1.18 (colored)

set the client/server certificate options with all the common keyusage
and extendedkeyusage and nscerttype flags.  the ikectl CA can now be used
with all kinds of other vpn tools in addition to iked and isakmpd.

ok phessler@

Revision 1.18 / (download) - annotate - [select for diffs], Fri Oct 8 15:45:34 2010 UTC (13 years, 7 months ago) by jsg
Branch: MAIN
Changes since 1.17: +3 -2 lines
Diff to previous 1.17 (colored)

check if a directory exists before trying to create it in the export
case as well, spotted by mikeb

Revision 1.17 / (download) - annotate - [select for diffs], Fri Oct 8 11:41:56 2010 UTC (13 years, 7 months ago) by jsg
Branch: MAIN
Changes since 1.16: +9 -8 lines
Diff to previous 1.16 (colored)

if non absolute paths are specified in install commands assume they
are relative to /etc

Revision 1.16 / (download) - annotate - [select for diffs], Fri Oct 8 10:13:47 2010 UTC (13 years, 7 months ago) by jsg
Branch: MAIN
Changes since 1.15: +76 -32 lines
Diff to previous 1.15 (colored)

allow optional paths for the install commands so we can
install into the isakmpd directory hierarchy for example.

Revision 1.15 / (download) - annotate - [select for diffs], Fri Oct 8 07:45:06 2010 UTC (13 years, 7 months ago) by reyk
Branch: MAIN
Changes since 1.14: +15 -3 lines
Diff to previous 1.14 (colored)

Allow to show certificate details (show ca x cert [y]).

Revision 1.14 / (download) - annotate - [select for diffs], Thu Oct 7 15:17:38 2010 UTC (13 years, 7 months ago) by jsg
Branch: MAIN
Changes since 1.13: +2 -2 lines
Diff to previous 1.13 (colored)

only try to setup a passfile when creating a CA

Revision 1.13 / (download) - annotate - [select for diffs], Thu Oct 7 13:30:50 2010 UTC (13 years, 7 months ago) by reyk
Branch: MAIN
Changes since 1.12: +14 -10 lines
Diff to previous 1.12 (colored)

Allow to specify the export password on the command line (optionally, for
scripting).  The "peer" argument now needs to be preceded with the "peer"
keyword, eg. ... export peer 10.1.1.1 instead of export 10.1.1.1.

Revision 1.12 / (download) - annotate - [select for diffs], Thu Oct 7 12:23:14 2010 UTC (13 years, 7 months ago) by reyk
Branch: MAIN
Changes since 1.11: +60 -46 lines
Diff to previous 1.11 (colored)

- add a -q (quiet) command line option that will be used by ikeca to
set openssl batch mode: don't ask for x509 options, use the defaults.
- allow to specify the initial ca password on the command line to also
make it scriptable.
- allow to create certificates for clientAuth or serverAuth only
(eg. ikectl ca foo certificate bar server).
- cosmetics: move double declarations of ca_*() functions to parser.h.

ok phessler@

Revision 1.11 / (download) - annotate - [select for diffs], Thu Oct 7 10:56:22 2010 UTC (13 years, 7 months ago) by phessler
Branch: MAIN
Changes since 1.10: +3 -1 lines
Diff to previous 1.10 (colored)

set saner permissions on the directory we export, so we don't change
perms of /etc/iked when extracting

OK jsg@

Revision 1.10 / (download) - annotate - [select for diffs], Thu Oct 7 09:36:33 2010 UTC (13 years, 7 months ago) by phessler
Branch: MAIN
Changes since 1.9: +22 -15 lines
Diff to previous 1.9 (colored)

When we create a new CA, also create an empty (but valid) CRL list.
While here, set our used defaults in the config file.

OK reyk@, jsg@

Revision 1.9 / (download) - annotate - [select for diffs], Wed Jun 23 19:28:18 2010 UTC (13 years, 11 months ago) by jsg
Branch: MAIN
CVS Tags: OPENBSD_4_8_BASE, OPENBSD_4_8
Changes since 1.8: +14 -5 lines
Diff to previous 1.8 (colored)

fix the permissions on directories inside the exported tarball
in the cert case.

Revision 1.8 / (download) - annotate - [select for diffs], Wed Jun 23 17:10:49 2010 UTC (13 years, 11 months ago) by jsg
Branch: MAIN
Changes since 1.7: +13 -16 lines
Diff to previous 1.7 (colored)

More appropriate contents for the exported ca tarball.

Revision 1.7 / (download) - annotate - [select for diffs], Wed Jun 23 16:01:01 2010 UTC (13 years, 11 months ago) by jsg
Branch: MAIN
Changes since 1.6: +68 -29 lines
Diff to previous 1.6 (colored)

Add a ca export command for EAP mode where we only require the CA cert,
and make both export commands optionally take an argument that will be
added to a peer.txt file in the exported output.   Additionally
include any site specific notes from /usr/share/iked if present.

man page bits and help with the parser from reyk

Revision 1.6 / (download) - annotate - [select for diffs], Mon Jun 21 10:48:12 2010 UTC (13 years, 11 months ago) by jsg
Branch: MAIN
Changes since 1.5: +2 -2 lines
Diff to previous 1.5 (colored)

use the full path to zip

Revision 1.5 / (download) - annotate - [select for diffs], Mon Jun 14 17:41:18 2010 UTC (13 years, 11 months ago) by jsg
Branch: MAIN
Changes since 1.4: +58 -7 lines
Diff to previous 1.4 (colored)

Add commands to create/delete/install/import keys without
involving certificates as suggested by reyk and don't
recreate private keys if a key already exists.

ok reyk@

Revision 1.4 / (download) - annotate - [select for diffs], Thu Jun 10 16:14:04 2010 UTC (13 years, 11 months ago) by jsg
Branch: MAIN
Changes since 1.3: +109 -4 lines
Diff to previous 1.3 (colored)

Add a command to revoke a certificate and generate a CRL;
make the ca install command install the CRL as well.

discussed with reyk@

Revision 1.3 / (download) - annotate - [select for diffs], Mon Jun 7 14:15:27 2010 UTC (13 years, 11 months ago) by jsg
Branch: MAIN
Changes since 1.2: +2 -2 lines
Diff to previous 1.2 (colored)

switch iked pki files to /etc/iked, discussed with reyk.

Revision 1.2 / (download) - annotate - [select for diffs], Fri Jun 4 13:34:38 2010 UTC (14 years ago) by jsg
Branch: MAIN
Changes since 1.1: +16 -12 lines
Diff to previous 1.1 (colored)

Install the cert as well as the keys and make certs world
readable as suggested by reyk@

Revision 1.1 / (download) - annotate - [select for diffs], Thu Jun 3 16:49:00 2010 UTC (14 years ago) by reyk
Branch: MAIN

Import iked, a new implementation of the IKEv2 protocol.

iked(8) is an automatic keying daemon for IPsec, like isakmpd(8), that
IPsec creates flows and SAs automatically.  Unlike isakmpd, iked(8)
implements the newer IKEv2 protocol instead of IKEv1/ISAKMP.  The
daemon is still work-in-progress and not enabled in the builds, but is
already able to establish IKEv2 sessions with some other IKEv2
implementations as a responder.

with lots of help and debugging by jsg@
ok deraadt@

This form allows you to request diff's between any two revisions of a file. You may select a symbolic revision name using the selection box or you may type in a numeric name using the type-in text box.