diff options
author | 2019-06-08 07:52:55 +0000 | |
---|---|---|
committer | 2019-06-08 07:52:55 +0000 | |
commit | 2570ecd04a88c37c5b6ec15136b64f8f02f6e5ff (patch) | |
tree | 57fc3ed23a1553a1cb7be19795c56bfd53be4aff /usr.sbin/acme-client/keyproc.c | |
parent | Update Spleen kernel fonts to the latest released version, bringing (diff) | |
download | wireguard-openbsd-2570ecd04a88c37c5b6ec15136b64f8f02f6e5ff.tar.xz wireguard-openbsd-2570ecd04a88c37c5b6ec15136b64f8f02f6e5ff.zip |
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.
Diffstat (limited to 'usr.sbin/acme-client/keyproc.c')
-rw-r--r-- | usr.sbin/acme-client/keyproc.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/usr.sbin/acme-client/keyproc.c b/usr.sbin/acme-client/keyproc.c index 1d18bdeb408..9e6b469c6fa 100644 --- a/usr.sbin/acme-client/keyproc.c +++ b/usr.sbin/acme-client/keyproc.c @@ -1,4 +1,4 @@ -/* $Id: keyproc.c,v 1.11 2018/07/29 20:22:02 tb Exp $ */ +/* $Id: keyproc.c,v 1.12 2019/06/08 07:52:55 florian Exp $ */ /* * Copyright (c) 2016 Kristaps Dzonsons <kristaps@bsd.lv> * @@ -75,7 +75,7 @@ add_ext(STACK_OF(X509_EXTENSION) *sk, int nid, const char *value) */ int keyproc(int netsock, const char *keyfile, - const char **alts, size_t altsz, int newkey) + const char **alts, size_t altsz) { char *der64 = NULL, *der = NULL, *dercp; char *sans = NULL, *san = NULL; @@ -85,7 +85,7 @@ keyproc(int netsock, const char *keyfile, EVP_PKEY *pkey = NULL; X509_REQ *x = NULL; X509_NAME *name = NULL; - int len, rc = 0, cc, nid; + int len, rc = 0, cc, nid, newkey = 0; mode_t prev; STACK_OF(X509_EXTENSION) *exts = NULL; @@ -96,7 +96,10 @@ keyproc(int netsock, const char *keyfile, */ prev = umask((S_IWUSR | S_IXUSR) | S_IRWXG | S_IRWXO); - f = fopen(keyfile, newkey ? "wx" : "r"); + if ((f = fopen(keyfile, "r")) == NULL && errno == ENOENT) { + f = fopen(keyfile, "wx"); + newkey = 1; + } umask(prev); if (f == NULL) { |