OpenBSD CVS

CVS log for src/usr.sbin/acme-client/main.c


[BACK] Up to [local] / src / usr.sbin / acme-client

Request diff between arbitrary revisions


Default branch: MAIN


Revision 1.55 / (download) - annotate - [select for diffs], Thu May 5 19:51:35 2022 UTC (2 years ago) by florian
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, HEAD
Changes since 1.54: +5 -1 lines
Diff to previous 1.54 (colored)

Check that the challenge token which is turned into a filename is
base64url encoded.
We have only the challenge directory unveil(2)'ed so funny business
like ../ will not work, but we shouldn't generate garbage filenames
that someone else might trip over either.
Pointed out and diff by Ali Farzanrad (ali_farzanrad AT riseup.net)
OK beck

Revision 1.54 / (download) - annotate - [select for diffs], Sun May 10 12:06:18 2020 UTC (4 years ago) by benno
Branch: MAIN
CVS Tags: OPENBSD_7_1_BASE, OPENBSD_7_1, OPENBSD_7_0_BASE, OPENBSD_7_0, OPENBSD_6_9_BASE, OPENBSD_6_9, OPENBSD_6_8_BASE, OPENBSD_6_8
Changes since 1.53: +3 -3 lines
Diff to previous 1.53 (colored)

Allow to have multiple domain ... {} sextions with the same domain
name, by adding a new (optional) config option "domain name".
This can be used to create a rsa and an ecdsa key for the same domain
name.
The old domain name in the 'title' line continues to be used as domain
name in the abscence of the domain name argument, i.e. the change is
backward compatible with current config files.
tested by sthen@
ok florian@ sthen@

Revision 1.53 / (download) - annotate - [select for diffs], Fri Feb 7 14:34:15 2020 UTC (4 years, 3 months ago) by florian
Branch: MAIN
CVS Tags: OPENBSD_6_7_BASE, OPENBSD_6_7
Changes since 1.52: +4 -3 lines
Diff to previous 1.52 (colored)

Do not define variables in extern.h since this will lead to duplicate
definitions in every source file that includes extern.h.
From Michael Forney (mforney AT mforney DOT org), thanks!
OK jca

Revision 1.52 / (download) - annotate - [select for diffs], Mon Jun 17 12:42:52 2019 UTC (4 years, 11 months ago) by florian
Branch: MAIN
CVS Tags: OPENBSD_6_6_BASE, OPENBSD_6_6
Changes since 1.51: +3 -2 lines
Diff to previous 1.51 (colored)

    Implement elliptic curve account keys.
    OK benno
    Input & OK tb

Revision 1.51 / (download) - annotate - [select for diffs], Sun Jun 16 19:49:13 2019 UTC (4 years, 11 months ago) by florian
Branch: MAIN
Changes since 1.50: +24 -33 lines
Diff to previous 1.50 (colored)

Trade unveil(2) for chroot(2).
This uses less code and unveil(2) seems to be the better tool here.
The directory one chroots into needs to be carefully setup (they are
not) and comon wisedom is that root can break out of chroots.
There is probably nothing wrong with the chroot code because of pledge
but it still makes me feel uneasy.
input & OK on previous version mestre
OK on previous version deraadt
bug found, input & OK benno

Revision 1.50 / (download) - annotate - [select for diffs], Sun Jun 16 07:24:28 2019 UTC (4 years, 11 months ago) by florian
Branch: MAIN
Changes since 1.49: +2 -5 lines
Diff to previous 1.49 (colored)

acctkey indirection is unnecessary, just pass authority->account

Revision 1.49 / (download) - annotate - [select for diffs], Fri Jun 14 19:55:08 2019 UTC (4 years, 11 months ago) by florian
Branch: MAIN
Changes since 1.48: +3 -7 lines
Diff to previous 1.48 (colored)

Track key type (RSA or ECDSA) in an enum and clean up a bit while here.
Originaly from Renaud Allard following input from benno, tweaked by me.
OK benno

Revision 1.48 / (download) - annotate - [select for diffs], Wed Jun 12 11:09:25 2019 UTC (4 years, 11 months ago) by gilles
Branch: MAIN
Changes since 1.47: +6 -1 lines
Diff to previous 1.47 (colored)

use acme-client to sign certificated with ecdsa keys

diff from Renaud Allard <renaud@allard.it>, ok to get in from florian@

Revision 1.47 / (download) - annotate - [select for diffs], Sat Jun 8 07:52:55 2019 UTC (4 years, 11 months ago) by florian
Branch: MAIN
Changes since 1.46: +5 -28 lines
Diff to previous 1.46 (colored)

    Remove A and D flag, they are superfluous.
    One could always use them on the command line and acme-client would do
    the right thing.

Revision 1.46 / (download) - annotate - [select for diffs], Fri Jun 7 08:07:52 2019 UTC (4 years, 11 months ago) by florian
Branch: MAIN
Changes since 1.45: +2 -2 lines
Diff to previous 1.45 (colored)

Implement RFC 8555 "Automatic Certificate Management Environment
(ACME)" to be able to talk to the v02 Let's Encrypt API.

With this acme-client(1) will no longer be able to talk to the v01
API. Users must change the api url in /etc/acme-client.conf to
https://acme-v02.api.letsencrypt.org/directory
Existing accounts (and certs of course) stay valid and after the url
change acme-client will be able to renew certs.

Tested by Renaud Allard and benno
Input & OK benno

Revision 1.45 / (download) - annotate - [select for diffs], Sat Mar 9 18:07:40 2019 UTC (5 years, 2 months ago) by benno
Branch: MAIN
CVS Tags: OPENBSD_6_5_BASE, OPENBSD_6_5
Changes since 1.44: +1 -22 lines
Diff to previous 1.44 (colored)

remove free() before exit() from main(), in ongoing work to make
things more readable. otto notes that free() does some checks, but
in this case readability is better than complete cleanup.
ok florian@ deraadt@

Revision 1.44 / (download) - annotate - [select for diffs], Sat Mar 9 10:11:53 2019 UTC (5 years, 2 months ago) by benno
Branch: MAIN
Changes since 1.43: +20 -13 lines
Diff to previous 1.43 (colored)

use temporary strings for calls to basename(), because it may change
the contents of its argument (on other platforms). Also strdup() the result,
because basename returns a pointer to static memory.
ok florian@

Revision 1.43 / (download) - annotate - [select for diffs], Fri Mar 8 18:42:44 2019 UTC (5 years, 2 months ago) by benno
Branch: MAIN
Changes since 1.42: +20 -16 lines
Diff to previous 1.42 (colored)

fix dirname usage in acme-client: dirname() can modify its argument
(it does not on OpenBSD) so we need to us a copy of the string.  In
addition, copy the result of dirname() as well, because it's static
storage and if we call dirname() again it will be overwritten.
Original problem noted and fix suggested by Wolf (wolf AT wolfsden DOT
cz)
ok florian@

Revision 1.42 / (download) - annotate - [select for diffs], Tue Jan 29 16:38:29 2019 UTC (5 years, 4 months ago) by benno
Branch: MAIN
Changes since 1.41: +1 -6 lines
Diff to previous 1.41 (colored)

add an extra check for existing "api ..." line in the config.
move the check of existing "account ..." line from main.c to the parser.
ok deraadt@

Revision 1.41 / (download) - annotate - [select for diffs], Mon Jul 30 09:59:03 2018 UTC (5 years, 10 months ago) by benno
Branch: MAIN
CVS Tags: OPENBSD_6_4_BASE, OPENBSD_6_4
Changes since 1.40: +4 -7 lines
Diff to previous 1.40 (colored)

cleanup initialization of chngdir. inspired by Ross L Richardson.
ok tb@

Revision 1.40 / (download) - annotate - [select for diffs], Mon Jul 30 09:56:50 2018 UTC (5 years, 10 months ago) by benno
Branch: MAIN
Changes since 1.39: +4 -4 lines
Diff to previous 1.39 (colored)

replace exit() with return(), from Ross L Richardson.
ok tb@ (previous 3 commits to main.c as well)

Revision 1.39 / (download) - annotate - [select for diffs], Mon Jul 30 09:54:35 2018 UTC (5 years, 10 months ago) by benno
Branch: MAIN
Changes since 1.38: +3 -5 lines
Diff to previous 1.38 (colored)

replace warn() + exit() with err()
From Ross L Richardson.

Revision 1.38 / (download) - annotate - [select for diffs], Mon Jul 30 09:53:14 2018 UTC (5 years, 10 months ago) by benno
Branch: MAIN
Changes since 1.37: +5 -4 lines
Diff to previous 1.37 (colored)

line too long and whitespace. From Ross L Richardson.

Revision 1.37 / (download) - annotate - [select for diffs], Mon Jul 30 09:51:49 2018 UTC (5 years, 10 months ago) by benno
Branch: MAIN
Changes since 1.36: +12 -12 lines
Diff to previous 1.36 (colored)

reorder option parsing to be alphabetical/same order as usage and
manpage. From Ross L Richardson.

Revision 1.36 / (download) - annotate - [select for diffs], Mon Nov 27 01:58:52 2017 UTC (6 years, 6 months ago) by florian
Branch: MAIN
CVS Tags: OPENBSD_6_3_BASE, OPENBSD_6_3
Changes since 1.35: +3 -5 lines
Diff to previous 1.35 (colored)

Deprecate agreement url config option and get the information from the
directory call. This way we don't need to update the acme-client.conf
file every time it changes. Still parse the option, ignore and warn about
it for a release. Sysmerge should be able to handle the removal.
"nice" deraadt@
OK benno

Revision 1.35 / (download) - annotate - [select for diffs], Sat May 27 08:31:08 2017 UTC (7 years ago) by florian
Branch: MAIN
CVS Tags: OPENBSD_6_2_BASE, OPENBSD_6_2
Changes since 1.34: +11 -15 lines
Diff to previous 1.34 (colored)

Use basename(3) instead of hand rolling it.
Gets rid of double slashes, pointed out by Raf Czlonka (rczlonka at
gmail), thanks!

OK benno

Revision 1.34 / (download) - annotate - [select for diffs], Thu Mar 23 12:58:28 2017 UTC (7 years, 2 months ago) by florian
Branch: MAIN
CVS Tags: OPENBSD_6_1_BASE, OPENBSD_6_1
Changes since 1.33: +4 -4 lines
Diff to previous 1.33 (colored)

pull root check up, the parser will bomb out anyway
OK benno

Revision 1.33 / (download) - annotate - [select for diffs], Tue Jan 24 13:32:55 2017 UTC (7 years, 4 months ago) by jsing
Branch: MAIN
Changes since 1.32: +3 -4 lines
Diff to previous 1.32 (colored)

Make returns consistent and remove parentheses per style(9).

Transformed with coccinelle.

Requested by and ok tb@

Revision 1.32 / (download) - annotate - [select for diffs], Tue Jan 24 12:53:52 2017 UTC (7 years, 4 months ago) by deraadt
Branch: MAIN
Changes since 1.31: +2 -2 lines
Diff to previous 1.31 (colored)


Complete jsing's coccinelle cleanup... by hand
ok jsing

Revision 1.31 / (download) - annotate - [select for diffs], Tue Jan 24 12:38:41 2017 UTC (7 years, 4 months ago) by deraadt
Branch: MAIN
Changes since 1.30: +4 -4 lines
Diff to previous 1.30 (colored)

errx() does not need extra newline

Revision 1.30 / (download) - annotate - [select for diffs], Tue Jan 24 12:05:14 2017 UTC (7 years, 4 months ago) by jsing
Branch: MAIN
Changes since 1.29: +38 -38 lines
Diff to previous 1.29 (colored)

Replace comparisons between a constant or enum and an expression, with
a comparison between the expression and the constant or enum. This
significantly improves readability.

Transformed with coccinelle.

Requested by deraadt@

Revision 1.29 / (download) - annotate - [select for diffs], Sat Jan 21 15:53:15 2017 UTC (7 years, 4 months ago) by jmc
Branch: MAIN
Changes since 1.28: +2 -2 lines
Diff to previous 1.28 (colored)

tweak previous;

Revision 1.28 / (download) - annotate - [select for diffs], Sat Jan 21 12:59:06 2017 UTC (7 years, 4 months ago) by benno
Branch: MAIN
Changes since 1.27: +2 -2 lines
Diff to previous 1.27 (colored)

move config data structures mostly to TAILQs, because that way we
preserve order.

ok florian@

Revision 1.27 / (download) - annotate - [select for diffs], Sat Jan 21 12:54:10 2017 UTC (7 years, 4 months ago) by florian
Branch: MAIN
Changes since 1.26: +25 -16 lines
Diff to previous 1.26 (colored)

it is ok to only specify a full chain certificate
OK benno

Revision 1.26 / (download) - annotate - [select for diffs], Sat Jan 21 09:00:29 2017 UTC (7 years, 4 months ago) by benno
Branch: MAIN
Changes since 1.25: +15 -3 lines
Diff to previous 1.25 (colored)

add option 'domain full chain certificate "path"',
revokation works, the fullchain file will be unlinked.

ok florian

Revision 1.25 / (download) - annotate - [select for diffs], Sat Jan 21 08:55:09 2017 UTC (7 years, 4 months ago) by florian
Branch: MAIN
Changes since 1.24: +14 -3 lines
Diff to previous 1.24 (colored)

Implement domain chain certificate.
OK benno

Revision 1.24 / (download) - annotate - [select for diffs], Sat Jan 21 08:54:26 2017 UTC (7 years, 4 months ago) by florian
Branch: MAIN
Changes since 1.23: +17 -6 lines
Diff to previous 1.23 (colored)

Split certificate file from config file into certdir and certfile.
This way we can still chroot to certdir but the the certificate file
is not fixed to "cert.pem".

Writing of chain.pem and fullchain.pem is currently broken with this.

OK benno

Revision 1.23 / (download) - annotate - [select for diffs], Sat Jan 21 08:52:30 2017 UTC (7 years, 4 months ago) by florian
Branch: MAIN
Changes since 1.22: +4 -8 lines
Diff to previous 1.22 (colored)

Remove backup option. This is not acme-client's business; also it gets
in the way.
OK benno

Revision 1.22 / (download) - annotate - [select for diffs], Sat Jan 21 08:51:00 2017 UTC (7 years, 4 months ago) by florian
Branch: MAIN
Changes since 1.21: +2 -12 lines
Diff to previous 1.21 (colored)

We are only dealing with one domain on the command line
OK benno

Revision 1.21 / (download) - annotate - [select for diffs], Sat Jan 21 08:49:59 2017 UTC (7 years, 4 months ago) by florian
Branch: MAIN
Changes since 1.20: +2 -2 lines
Diff to previous 1.20 (colored)

typo; ok benno

Revision 1.20 / (download) - annotate - [select for diffs], Sat Jan 21 08:48:11 2017 UTC (7 years, 4 months ago) by florian
Branch: MAIN
Changes since 1.19: +2 -2 lines
Diff to previous 1.19 (colored)

typo; ok benno

Revision 1.19 / (download) - annotate - [select for diffs], Sat Jan 21 08:47:21 2017 UTC (7 years, 4 months ago) by benno
Branch: MAIN
Changes since 1.18: +9 -3 lines
Diff to previous 1.18 (colored)

acme-client use configuration file [5 of 5]
implement new -n option to check and print configuration

ok florian

Revision 1.18 / (download) - annotate - [select for diffs], Sat Jan 21 08:45:52 2017 UTC (7 years, 4 months ago) by benno
Branch: MAIN
Changes since 1.17: +2 -2 lines
Diff to previous 1.17 (colored)

acme-client use configuration file [4 of 5]

fix getopt()

ok florian

Revision 1.17 / (download) - annotate - [select for diffs], Sat Jan 21 08:44:35 2017 UTC (7 years, 4 months ago) by benno
Branch: MAIN
Changes since 1.16: +4 -4 lines
Diff to previous 1.16 (colored)

acme-client use configuration file [3 of 5]

change command line options:

    n -> A   new Account key
    N -> D   new Domain key

With this acme-client has these main usage patterns:

* create new Account Key and Domain Key and get a certificate:

  acme-client -A -D www.example.com

* renew certificate:

  acme-client www.example.com

* revoke certificate:

  acme-client -r www.example.com

ok florian

Revision 1.16 / (download) - annotate - [select for diffs], Sat Jan 21 08:43:09 2017 UTC (7 years, 4 months ago) by benno
Branch: MAIN
Changes since 1.15: +7 -15 lines
Diff to previous 1.15 (colored)

acme-client use configuration file [2 of 5]

- add challengedir option to config file
- remove -C option from command line

ok florian

Revision 1.15 / (download) - annotate - [select for diffs], Sat Jan 21 08:41:42 2017 UTC (7 years, 4 months ago) by benno
Branch: MAIN
Changes since 1.14: +70 -125 lines
Diff to previous 1.14 (colored)

acme-client use configuration file [1 of 5]

start using the configuration file and delete command line arguments:

-a agreement    -> agreement url ...
-c certdir      -> domain certificate "path"
-f accountkey   -> account key "path"
-k domainkey    -> domain key "path"
-s authority    -> sign with "name"

new argument:
-f configfile

the changes needed to use the new configuration are local to main.c for now.
While the configuration could be passed directly to netproc(), keyproc() etc,
the diff is smaller this way.

This also removes the multidir (-m) mode for now - specify different paths in
each domain {} block instead.

ok florian

Revision 1.14 / (download) - annotate - [select for diffs], Sun Sep 18 20:18:25 2016 UTC (7 years, 8 months ago) by benno
Branch: MAIN
Changes since 1.13: +2 -18 lines
Diff to previous 1.13 (colored)

add a config file parser to acme-client (unused at the moment, so that
it can be worked on in the tree).
ok florian@ deraadt@

Revision 1.13 / (download) - annotate - [select for diffs], Tue Sep 13 17:13:37 2016 UTC (7 years, 8 months ago) by deraadt
Branch: MAIN
Changes since 1.12: +11 -15 lines
Diff to previous 1.12 (colored)

A small amount more KNF to make this easier on our eyes.  Not going further
than this.
ok florian

Revision 1.12 / (download) - annotate - [select for diffs], Tue Sep 13 16:49:28 2016 UTC (7 years, 8 months ago) by deraadt
Branch: MAIN
Changes since 1.11: +10 -16 lines
Diff to previous 1.11 (colored)

hoist local variable initialization directly into the definitions,
rather than doing it right afterwards.
ok florian

Revision 1.11 / (download) - annotate - [select for diffs], Tue Sep 13 16:04:51 2016 UTC (7 years, 8 months ago) by deraadt
Branch: MAIN
Changes since 1.10: +15 -15 lines
Diff to previous 1.10 (colored)

Inconsistant use of case (value): idiom drives me nuts, I have no idea
what purpose it was intended to serve.

Revision 1.10 / (download) - annotate - [select for diffs], Thu Sep 1 13:47:54 2016 UTC (7 years, 9 months ago) by florian
Branch: MAIN
Changes since 1.9: +3 -3 lines
Diff to previous 1.9 (colored)

update usage(); pointed out by jmc@

Revision 1.9 / (download) - annotate - [select for diffs], Thu Sep 1 12:17:00 2016 UTC (7 years, 9 months ago) by florian
Branch: MAIN
Changes since 1.8: +29 -9 lines
Diff to previous 1.8 (colored)

Implement table driven selection to which ACME authorities we can
talk.
Suggest by and OK deraadt, OK benno.

(Later on deraadt and benno discussed if this should be handled with a
config file. This seems to be good enough for now. We can do a config
file later.)

Revision 1.8 / (download) - annotate - [select for diffs], Thu Sep 1 00:35:22 2016 UTC (7 years, 9 months ago) by florian
Branch: MAIN
Changes since 1.7: +1 -4 lines
Diff to previous 1.7 (colored)

we don't have config.h

Revision 1.7 / (download) - annotate - [select for diffs], Thu Sep 1 00:32:00 2016 UTC (7 years, 9 months ago) by deraadt
Branch: MAIN
Changes since 1.6: +5 -10 lines
Diff to previous 1.6 (colored)

line wrap usage

Revision 1.6 / (download) - annotate - [select for diffs], Thu Sep 1 00:21:36 2016 UTC (7 years, 9 months ago) by deraadt
Branch: MAIN
Changes since 1.5: +5 -9 lines
Diff to previous 1.5 (colored)

Collapse krazy abstractions for other sandbox models, using chroot and
pledge directly as needed.
ok florian

Revision 1.5 / (download) - annotate - [select for diffs], Thu Sep 1 00:03:39 2016 UTC (7 years, 9 months ago) by benno
Branch: MAIN
Changes since 1.4: +15 -15 lines
Diff to previous 1.4 (colored)

knf

Revision 1.4 / (download) - annotate - [select for diffs], Wed Aug 31 23:30:59 2016 UTC (7 years, 9 months ago) by benno
Branch: MAIN
Changes since 1.3: +26 -26 lines
Diff to previous 1.3 (colored)

whitespace

Revision 1.3 / (download) - annotate - [select for diffs], Wed Aug 31 22:57:36 2016 UTC (7 years, 9 months ago) by deraadt
Branch: MAIN
Changes since 1.2: +6 -6 lines
Diff to previous 1.2 (colored)

revoke -> revocate, to avoid alias
ok florian

Revision 1.2 / (download) - annotate - [select for diffs], Wed Aug 31 22:20:53 2016 UTC (7 years, 9 months ago) by florian
Branch: MAIN
Changes since 1.1: +5 -5 lines
Diff to previous 1.1 (colored)

store files in directories called acme

Revision 1.1 / (download) - annotate - [select for diffs], Wed Aug 31 22:01:42 2016 UTC (7 years, 9 months ago) by florian
Branch: MAIN

Import Kristaps' letskencrypt and call it acme-client in tree.
OK to get it in deraadt@ (and probably beck@)

At least deraadt@, beck@ and otto@ are fine with the name and the
disagreements stopped.

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.