diff options
author | 2016-08-31 22:42:19 +0000 | |
---|---|---|
committer | 2016-08-31 22:42:19 +0000 | |
commit | 99418fdee5b3d589f0f8251f5dc9ee986df2ebd4 (patch) | |
tree | ea6f3fdd8a28ba8ebc8654fe74274f69565e2c84 | |
parent | whitespace (diff) | |
download | wireguard-openbsd-99418fdee5b3d589f0f8251f5dc9ee986df2ebd4.tar.xz wireguard-openbsd-99418fdee5b3d589f0f8251f5dc9ee986df2ebd4.zip |
whitespace cleanup
-rw-r--r-- | usr.sbin/acme-client/acctproc.c | 18 | ||||
-rw-r--r-- | usr.sbin/acme-client/base64.c | 17 | ||||
-rw-r--r-- | usr.sbin/acme-client/certproc.c | 21 |
3 files changed, 28 insertions, 28 deletions
diff --git a/usr.sbin/acme-client/acctproc.c b/usr.sbin/acme-client/acctproc.c index 9c0a04dfce3..ae3880c6cd8 100644 --- a/usr.sbin/acme-client/acctproc.c +++ b/usr.sbin/acme-client/acctproc.c @@ -1,4 +1,4 @@ -/* $Id: acctproc.c,v 1.1 2016/08/31 22:01:42 florian Exp $ */ +/* $Id: acctproc.c,v 1.2 2016/08/31 22:42:19 benno Exp $ */ /* * Copyright (c) 2016 Kristaps Dzonsons <kristaps@bsd.lv> * @@ -174,9 +174,9 @@ op_sign_rsa(char **head, char **prot, EVP_PKEY *pkey, const char *nonce) *head = *prot = exp = mod = NULL; rc = 0; - /* - * First, extract relevant portions of our private key. - * Then construct the public header. + /* + * First, extract relevant portions of our private key. + * Then construct the public header. * Finally, format the header combined with the nonce. */ @@ -206,7 +206,7 @@ static int op_sign(int fd, EVP_PKEY *pkey) { char *nonce, *pay, - *pay64, *prot, *prot64, *head, + *pay64, *prot, *prot64, *head, *sign, *dig64, *fin; int cc, rc; unsigned int digsz; @@ -223,7 +223,7 @@ op_sign(int fd, EVP_PKEY *pkey) if (NULL == (pay = readstr(fd, COMM_PAY))) goto out; - else if (NULL == (nonce = readstr(fd, COMM_NONCE))) + else if (NULL == (nonce = readstr(fd, COMM_NONCE))) goto out; /* Base64-encode the payload. */ @@ -286,8 +286,8 @@ op_sign(int fd, EVP_PKEY *pkey) goto out; } - /* - * Write back in the correct JSON format. + /* + * Write back in the correct JSON format. * If the reader is closed, just ignore it (we'll pick it up * when we next enter the read loop). */ @@ -331,7 +331,7 @@ acctproc(int netsock, const char *acctkey, int newacct) pkey = NULL; rc = 0; - /* + /* * First, open our private key file read-only or write-only if * we're creating from scratch. * Set our umask to be maximally restrictive. diff --git a/usr.sbin/acme-client/base64.c b/usr.sbin/acme-client/base64.c index 6f4364ddaa5..664cad7badf 100644 --- a/usr.sbin/acme-client/base64.c +++ b/usr.sbin/acme-client/base64.c @@ -1,4 +1,4 @@ -/* $Id: base64.c,v 1.1 2016/08/31 22:01:42 florian Exp $ */ +/* $Id: base64.c,v 1.2 2016/08/31 22:42:19 benno Exp $ */ /* * Copyright (c) 2016 Kristaps Dzonsons <kristaps@bsd.lv> * @@ -14,6 +14,7 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ + #ifdef HAVE_CONFIG_H # include "config.h" #endif @@ -26,7 +27,7 @@ #include "extern.h" -static const char b64[] = +static const char b64[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" "abcdefghijklmnopqrstuvwxyz" "0123456789+/"; @@ -35,7 +36,7 @@ static const char b64[] = * Compute the maximum buffer required for a base64 encoded string of * length "len". */ -size_t +size_t base64len(size_t len) { @@ -46,11 +47,11 @@ base64len(size_t len) * Base64 computation. * This is heavily "assert"-d because Coverity complains. */ -size_t +size_t base64buf(char *enc, const char *str, size_t len) { - size_t i, val; - char *p; + size_t i, val; + char *p; p = enc; @@ -59,12 +60,12 @@ base64buf(char *enc, const char *str, size_t len) assert(val < sizeof(b64)); *p++ = b64[val]; - val = ((str[i] & 0x3) << 4) | + val = ((str[i] & 0x3) << 4) | ((int)(str[i + 1] & 0xF0) >> 4); assert(val < sizeof(b64)); *p++ = b64[val]; - val = ((str[i + 1] & 0xF) << 2) | + val = ((str[i + 1] & 0xF) << 2) | ((int)(str[i + 2] & 0xC0) >> 6); assert(val < sizeof(b64)); *p++ = b64[val]; diff --git a/usr.sbin/acme-client/certproc.c b/usr.sbin/acme-client/certproc.c index 9f9e88300c4..aa2b59d564f 100644 --- a/usr.sbin/acme-client/certproc.c +++ b/usr.sbin/acme-client/certproc.c @@ -1,4 +1,4 @@ -/* $Id: certproc.c,v 1.1 2016/08/31 22:01:42 florian Exp $ */ +/* $Id: certproc.c,v 1.2 2016/08/31 22:42:19 benno Exp $ */ /* * Copyright (c) 2016 Kristaps Dzonsons <kristaps@bsd.lv> * @@ -56,8 +56,8 @@ x509buf(X509 *x, size_t *sz) return(NULL); } - /* - * Now convert bio to string. + /* + * Now convert bio to string. * Make into nil-terminated, just in case. */ @@ -65,7 +65,7 @@ x509buf(X509 *x, size_t *sz) warn("calloc"); BIO_free(bio); return(NULL); - } + } ssz = BIO_read(bio, p, bio->num_write); if (ssz < 0 || (unsigned)ssz != bio->num_write) { @@ -132,8 +132,8 @@ certproc(int netsock, int filesock) goto out; } - /* - * Pass revocation right through to fileproc. + /* + * Pass revocation right through to fileproc. * If the reader is terminated, ignore it. */ @@ -210,7 +210,7 @@ certproc(int netsock, int filesock) if (chainsz <= strlen(MARKER) || strncmp(chain, MARKER, strlen(MARKER))) { chaincp = (u_char *)chain; - chainx = d2i_X509(NULL, + chainx = d2i_X509(NULL, (const u_char **)&chaincp, chainsz); if (NULL == chainx) { warnx("d2i_X509"); @@ -219,7 +219,7 @@ certproc(int netsock, int filesock) free(chain); if (NULL == (chain = x509buf(chainx, &chainsz))) goto out; - } + } /* Allow reader termination to just push us out. */ @@ -232,8 +232,8 @@ certproc(int netsock, int filesock) if (cc <= 0) goto out; - /* - * Next, convert the X509 to a buffer and send that. + /* + * Next, convert the X509 to a buffer and send that. * Reader failure doesn't change anything. */ @@ -258,4 +258,3 @@ out: ERR_free_strings(); return(rc); } - |