ca
16 months agobin/cycle-root-key: New program to make a new root key. master
Mark Wooding [Wed, 30 Nov 2022 10:32:24 +0000 (10:32 +0000)]
bin/cycle-root-key: New program to make a new root key.

I really should have done this earlier.

16 months agobin/setup, lib/func.tcl: Move root key generation into the library.
Mark Wooding [Wed, 30 Nov 2022 10:31:31 +0000 (10:31 +0000)]
bin/setup, lib/func.tcl: Move root key generation into the library.

16 months ago.gitignore: Mark directories clearly.
Mark Wooding [Wed, 30 Nov 2022 10:42:57 +0000 (10:42 +0000)]
.gitignore: Mark directories clearly.

3 years agoetc/config.tcl: Don't reissue long-term certificates daily.
Mark Wooding [Thu, 14 May 2020 12:45:58 +0000 (13:45 +0100)]
etc/config.tcl: Don't reissue long-term certificates daily.

We end up with a huuuge pile of unnecessary certificates.

3 years agotest/unit: Add some tests to verify my ideas of how stuff works.
Mark Wooding [Thu, 14 May 2020 12:45:36 +0000 (13:45 +0100)]
test/unit: Add some tests to verify my ideas of how stuff works.

No bugs found, as expected.

3 years agotest/unit: Use plain `tclsh' to run the code.
Mark Wooding [Thu, 14 May 2020 12:12:43 +0000 (13:12 +0100)]
test/unit: Use plain `tclsh' to run the code.

6 years agolib/func.tcl: Cope with a gratuitous OpenSSL output-format change.
Mark Wooding [Sun, 2 Jul 2017 23:55:41 +0000 (00:55 +0100)]
lib/func.tcl: Cope with a gratuitous OpenSSL output-format change.

6 years agobin/*: Use plain `/usr/bin/tclsh' in shebang lines.
Mark Wooding [Sun, 2 Jul 2017 23:55:23 +0000 (00:55 +0100)]
bin/*: Use plain `/usr/bin/tclsh' in shebang lines.

9 years agoetc/config.tcl: Copy the symlinks as well.
Mark Wooding [Mon, 6 Apr 2015 21:13:28 +0000 (22:13 +0100)]
etc/config.tcl: Copy the symlinks as well.

Cretin.

9 years agoetc/config.tcl: New (better?) upload arrangements.
Mark Wooding [Sun, 5 Apr 2015 14:09:03 +0000 (15:09 +0100)]
etc/config.tcl: New (better?) upload arrangements.

9 years ago.gitignore: Ignore some infrastructure directories.
Mark Wooding [Sun, 5 Apr 2015 14:08:44 +0000 (15:08 +0100)]
.gitignore: Ignore some infrastructure directories.

9 years agoconfig.tcl: New profile for devices which can't accept certificate updates.
Mark Wooding [Sun, 5 Apr 2015 14:07:25 +0000 (15:07 +0100)]
config.tcl: New profile for devices which can't accept certificate updates.

11 years agoMerge branch 'master' of git://git.distorted.org.uk/~mdw/ca
Mark Wooding [Wed, 2 Jan 2013 19:44:26 +0000 (19:44 +0000)]
Merge branch 'master' of git://git.distorted.org.uk/~mdw/ca

* 'master' of git://git.distorted.org.uk/~mdw/ca:
  bin/withdraw: Lowercase `u' in `usage:', for consistency.
  bin/withdraw: Make sure the database is actually open.

11 years agobin/withdraw: Lowercase `u' in `usage:', for consistency.
Mark Wooding [Wed, 2 Jan 2013 19:44:15 +0000 (19:44 +0000)]
bin/withdraw: Lowercase `u' in `usage:', for consistency.

11 years agobin/withdraw: Make sure the database is actually open.
Mark Wooding [Wed, 2 Jan 2013 19:43:56 +0000 (19:43 +0000)]
bin/withdraw: Make sure the database is actually open.

11 years agoMerge branch 'master' of git://git.distorted.org.uk/~mdw/ca
Mark Wooding [Thu, 6 Dec 2012 03:43:25 +0000 (03:43 +0000)]
Merge branch 'master' of git://git.distorted.org.uk/~mdw/ca

* 'master' of git://git.distorted.org.uk/~mdw/ca:
  lib/func.tcl: Stupid long-standing typo in `sync-profiles'.
  test/update: Run `bin/update' before adding requests.
  bin/add: Don't allow adding requests with defunct profiles.
  bin/update: Refresh the profiles in the database from the configuration.
  lib/func.tcl, test/unit: Fix spin in `next-matching-date' and test.
  test/{init->update}: Less mad name for this test.

11 years agolib/func.tcl: Stupid long-standing typo in `sync-profiles'.
Mark Wooding [Thu, 6 Dec 2012 03:41:05 +0000 (03:41 +0000)]
lib/func.tcl: Stupid long-standing typo in `sync-profiles'.

11 years agotest/update: Run `bin/update' before adding requests.
Mark Wooding [Thu, 6 Dec 2012 03:40:05 +0000 (03:40 +0000)]
test/update: Run `bin/update' before adding requests.

Adding a request exercises the update hook, which expects the CRL to
exist.  This makes sure it actually does.

11 years agobin/add: Don't allow adding requests with defunct profiles.
Mark Wooding [Thu, 6 Dec 2012 03:18:45 +0000 (03:18 +0000)]
bin/add: Don't allow adding requests with defunct profiles.

That's why we have the tombstoning.

11 years agobin/update: Refresh the profiles in the database from the configuration.
Mark Wooding [Thu, 6 Dec 2012 03:18:11 +0000 (03:18 +0000)]
bin/update: Refresh the profiles in the database from the configuration.

I must have always intended this, and just forgot.

11 years agolib/func.tcl, test/unit: Fix spin in `next-matching-date' and test.
Mark Wooding [Thu, 6 Dec 2012 03:17:35 +0000 (03:17 +0000)]
lib/func.tcl, test/unit: Fix spin in `next-matching-date' and test.

Consider the pattern `*-*-* 10:20:30' applied to the reference date
`2012-12-06 10:21:42'.  The year, month and day are wildcards, so they're
fine.  The hour matches, so we recurse to the minutes.  That match fails,
so the recursive call returns `step'.  At this point, we consider the
hours again: we step `nn' on by one to perturb the matching process and
iterate, attempting to match the literal pattern `10'.  This will compare
the literal with the original unstepped reference value, which is still
`10', and drag `nn' back down.  The result is that we spin, making no
progress and using all available CPU.  Of course, the precise values aren't
important: the significant bit is a literal pattern matching the reference
time, followed by a mismatch which forces a step.

Also include a number of tests for this function, because it's the main
algorithmically fiddly piece of the system.

11 years agoetc/config.tcl: Move the re-issue time back to midnight.
Mark Wooding [Thu, 6 Dec 2012 03:21:15 +0000 (03:21 +0000)]
etc/config.tcl: Move the re-issue time back to midnight.

We must reissue certificates early, because hosts stagger their update
of the certificate store throughout the night.

11 years agoetc/config.tcl: Fix the validity duration for certificates.
Mark Wooding [Thu, 6 Dec 2012 03:20:22 +0000 (03:20 +0000)]
etc/config.tcl: Fix the validity duration for certificates.

I misremembered that the durations are measured in hours, not days.
But actually 28 hours isn't enough, because hosts refresh their cache
of the certificate store at different times of night: we must have the
new certificates ready for the early risers, and the old ones must
still be valid until time that the late risers are done.

11 years agotest/{init->update}: Less mad name for this test.
Mark Wooding [Thu, 6 Dec 2012 02:58:43 +0000 (02:58 +0000)]
test/{init->update}: Less mad name for this test.

11 years agoMerge branch 'master' of git://git.distorted.org.uk/~mdw/ca
Mark Wooding [Sat, 1 Dec 2012 22:00:24 +0000 (22:00 +0000)]
Merge branch 'master' of git://git.distorted.org.uk/~mdw/ca

* 'master' of git://git.distorted.org.uk/~mdw/ca:
  bin/add: Run the update hook after adding a certificate request.

11 years agobin/add: Run the update hook after adding a certificate request.
Mark Wooding [Sat, 1 Dec 2012 22:00:07 +0000 (22:00 +0000)]
bin/add: Run the update hook after adding a certificate request.

11 years agoMerge branch 'master' of git://git.distorted.org.uk/~mdw/ca
Mark Wooding [Sat, 1 Dec 2012 20:01:27 +0000 (20:01 +0000)]
Merge branch 'master' of git://git.distorted.org.uk/~mdw/ca

* 'master' of git://git.distorted.org.uk/~mdw/ca:
  lib/func.tcl: Hack output of `openssl dgst -hex'.
  etc/openssl.conf: Allow `keyEncipherment' for TLS clients.

11 years agoConfiguration for production.
Mark Wooding [Sat, 1 Dec 2012 20:01:05 +0000 (20:01 +0000)]
Configuration for production.

11 years agolib/func.tcl: Hack output of `openssl dgst -hex'.
Mark Wooding [Sat, 1 Dec 2012 19:51:12 +0000 (19:51 +0000)]
lib/func.tcl: Hack output of `openssl dgst -hex'.

Remove the gratuitous incompatibility from the front.

11 years agoetc/openssl.conf: Allow `keyEncipherment' for TLS clients.
Mark Wooding [Sat, 1 Dec 2012 19:50:08 +0000 (19:50 +0000)]
etc/openssl.conf: Allow `keyEncipherment' for TLS clients.

For some reason libvirt doesn't accept client certificates without this,
even though TLS client authentication doesn't involve encipherting keys.

11 years agobin/setup: Fix permissions on `ca.key' and `ca.cert'.
Mark Wooding [Sat, 1 Dec 2012 14:26:21 +0000 (14:26 +0000)]
bin/setup: Fix permissions on `ca.key' and `ca.cert'.

The previous thing was a mix of both, and didn't work properly.

11 years ago.gitignore: Remove old things which aren't meant to exist any more.
Mark Wooding [Sat, 1 Dec 2012 13:54:50 +0000 (13:54 +0000)]
.gitignore: Remove old things which aren't meant to exist any more.

Provides a useful clue to which things can be deleted.

11 years agoAdd an `update-hook' configuration tweak.
Mark Wooding [Sat, 1 Dec 2012 13:52:31 +0000 (13:52 +0000)]
Add an `update-hook' configuration tweak.

This is for publishing the archive to a web server or similar.

11 years agobin: Produce output PEM files with text descriptions of their contents.
Mark Wooding [Sat, 1 Dec 2012 13:40:23 +0000 (13:40 +0000)]
bin: Produce output PEM files with text descriptions of their contents.

This makes them easier to read.  There's a slight risk of someone being
confused by a malicious file whose text representation doesn't contain
an accurate description of the actual contents, but I think that's a
fairly minor consideration.  The files are also larger than they were
previously, but we'll have to put up with that.

11 years agotest/init: Some more updates to check expiry and archiving.
Mark Wooding [Sat, 1 Dec 2012 13:39:53 +0000 (13:39 +0000)]
test/init: Some more updates to check expiry and archiving.

11 years agoAlmost a complete rewrite.
Mark Wooding [Sat, 1 Dec 2012 13:03:41 +0000 (13:03 +0000)]
Almost a complete rewrite.

The scripts are now written in Tcl, using Sqlite3 to store information
about the certificates.  There's a comprehensive library for hacking the
database, and fiddling with certificates.  There are even tests, which
seem to work properly.

12 years agobin/make-ca-key, lib/func.sh: Make user and group names configurable.
Mark Wooding [Sun, 31 Jul 2011 17:28:36 +0000 (18:28 +0100)]
bin/make-ca-key, lib/func.sh: Make user and group names configurable.

This makes testing in a sandpit much easier.

The defaults are good, so I've left the configuration file out of the
repository.

12 years agobin/make-ca-key, etc/issuer: Split the issuer name out.
Mark Wooding [Sun, 31 Jul 2011 17:27:03 +0000 (18:27 +0100)]
bin/make-ca-key, etc/issuer: Split the issuer name out.

Makes the configuration-file nature of the issuer name more apparent.

12 years agobin/clean: Simple new program to reset the directory to a clean state.
Mark Wooding [Sun, 31 Jul 2011 17:25:46 +0000 (18:25 +0100)]
bin/clean: Simple new program to reset the directory to a clean state.

12 years agoMinimal X.509 certificate authority.
Mark Wooding [Sun, 10 Jul 2011 22:11:40 +0000 (23:11 +0100)]
Minimal X.509 certificate authority.