Commit: 27d5bde363d7b879bba390086fb28673789dee4d Parent: ab639b1652af1b979edb3b0df461e136cd156b4d Author: Michael Forney Date: Tue, 27 Oct 2026 11:56:32 -0700 openbsd: Update to 8.0 Diffstat:
16 files changed, 387 insertions(+), 332 deletions(-)
diff --git a/pkg/openbsd/patch/0012-readpassphrase-Support-systems-without-VSTATUS-and-T.patch b/pkg/openbsd/patch/0012-readpassphrase-Support-systems-without-VSTATUS-and-T.patch @@ -1,4 +1,4 @@ -From d36036bbd959091b6442d003128342ed515af01b Mon Sep 17 00:00:00 2001 +From f45a3941114454bf560fdd45a1e5990c8e1c5c32 Mon Sep 17 00:00:00 2001 From: Michael Forney <mforney@mforney.org> Date: Sun, 26 Feb 2017 17:01:33 -0800 Subject: [PATCH] readpassphrase: Support systems without VSTATUS and TCSASOFT @@ -8,7 +8,7 @@ Subject: [PATCH] readpassphrase: Support systems without VSTATUS and TCSASOFT 1 file changed, 6 insertions(+) diff --git a/lib/libc/gen/readpassphrase.c b/lib/libc/gen/readpassphrase.c -index a1aeb342b..a50eaf003 100644 +index 51b407efd57..01bff7d306c 100644 --- a/lib/libc/gen/readpassphrase.c +++ b/lib/libc/gen/readpassphrase.c @@ -32,6 +32,10 @@ @@ -22,7 +22,7 @@ index a1aeb342b..a50eaf003 100644 static volatile sig_atomic_t signo[_NSIG]; static void handler(int); -@@ -81,8 +85,10 @@ restart: +@@ -96,8 +100,10 @@ restart: memcpy(&term, &oterm, sizeof(term)); if (!(flags & RPP_ECHO_ON)) term.c_lflag &= ~(ECHO | ECHONL); @@ -34,5 +34,5 @@ index a1aeb342b..a50eaf003 100644 } else { memset(&term, 0, sizeof(term)); -- -2.12.2 +2.54.0 diff --git a/pkg/openbsd/patch/0013-Remove-getpass-definition.patch b/pkg/openbsd/patch/0013-Remove-getpass-definition.patch @@ -1,4 +1,4 @@ -From e76fda424564544bc8298fb5be7cda966451497d Mon Sep 17 00:00:00 2001 +From c5f80115a04b3714b73e1f4dc1359b8e51ae8aa0 Mon Sep 17 00:00:00 2001 From: Michael Forney <mforney@mforney.org> Date: Sun, 26 Feb 2017 17:12:56 -0800 Subject: [PATCH] Remove getpass definition @@ -9,10 +9,10 @@ It is a legacy function and musl already provides an implementation. 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/lib/libc/gen/readpassphrase.c b/lib/libc/gen/readpassphrase.c -index a50eaf003..57c6dc527 100644 +index 01bff7d306c..f9d91263bc8 100644 --- a/lib/libc/gen/readpassphrase.c +++ b/lib/libc/gen/readpassphrase.c -@@ -183,16 +183,8 @@ restart: +@@ -198,16 +198,8 @@ restart: } DEF_WEAK(readpassphrase); @@ -32,5 +32,5 @@ index a50eaf003..57c6dc527 100644 signo[s] = 1; } -- -2.12.2 +2.54.0 diff --git a/pkg/openbsd/patch/0014-doas-Port-to-linux-musl.patch b/pkg/openbsd/patch/0014-doas-Port-to-linux-musl.patch @@ -1,4 +1,4 @@ -From cca6c84b472255c4d015d7d97225791796f61392 Mon Sep 17 00:00:00 2001 +From ce3fbebc0e4fba14f5af877b8c0bdd91bf9e5d4b Mon Sep 17 00:00:00 2001 From: Michael Forney <mforney@mforney.org> Date: Sun, 26 Feb 2017 16:50:55 -0800 Subject: [PATCH] doas: Port to linux/musl @@ -11,8 +11,6 @@ persist. Use initgroups/setgid/setuid instead of setusercontext. -Provide UID_MAX and GID_MAX defaults. - Use LOGIN_NAME_MAX instead of _PW_NAME_LEN. Remove call to closefrom. @@ -27,12 +25,12 @@ Simplify handling of PATH in the environment since we don't have login.conf with per-user default PATH. --- usr.bin/doas/doas.1 | 9 --- - usr.bin/doas/doas.c | 168 +++++++++++++---------------------------- + usr.bin/doas/doas.c | 160 ++++++++++++----------------------------- usr.bin/doas/doas.h | 6 +- usr.bin/doas/env.c | 17 ++--- usr.bin/doas/parse.y | 1 + - usr.bin/doas/persist.c | 133 ++++++++++++++++++++++++++++++++ - 6 files changed, 198 insertions(+), 136 deletions(-) + usr.bin/doas/persist.c | 133 ++++++++++++++++++++++++++++++++++ + 6 files changed, 190 insertions(+), 136 deletions(-) create mode 100644 usr.bin/doas/persist.c diff --git a/usr.bin/doas/doas.1 b/usr.bin/doas/doas.1 @@ -63,7 +61,7 @@ index 25827cc7104..3542680faf5 100644 Parse and check the configuration file .Ar config , diff --git a/usr.bin/doas/doas.c b/usr.bin/doas/doas.c -index 3999b2e2f64..32532359267 100644 +index cb4a8616a92..f6c184338fa 100644 --- a/usr.bin/doas/doas.c +++ b/usr.bin/doas/doas.c @@ -20,8 +20,6 @@ @@ -75,7 +73,7 @@ index 3999b2e2f64..32532359267 100644 #include <readpassphrase.h> #include <string.h> #include <stdio.h> -@@ -33,13 +31,22 @@ +@@ -33,13 +31,14 @@ #include <syslog.h> #include <errno.h> #include <fcntl.h> @@ -83,14 +81,6 @@ index 3999b2e2f64..32532359267 100644 #include "doas.h" -+#ifndef UID_MAX -+#define UID_MAX 65535 -+#endif -+ -+#ifndef GID_MAX -+#define GID_MAX 65535 -+#endif -+ static void __dead usage(void) { @@ -99,7 +89,7 @@ index 3999b2e2f64..32532359267 100644 " command [arg ...]\n"); exit(1); } -@@ -203,16 +210,28 @@ checkconfig(const char *confpath, int argc, char **argv, +@@ -203,16 +202,28 @@ checkconfig(const char *confpath, int argc, char **argv, } static int @@ -135,7 +125,7 @@ index 3999b2e2f64..32532359267 100644 if (!challenge) { char host[HOST_NAME_MAX + 1]; -@@ -225,14 +244,12 @@ authuser_checkpass(char *myname, char *login_style) +@@ -225,14 +236,12 @@ authuser_checkpass(char *myname, char *login_style) response = readpassphrase(challenge, rbuf, sizeof(rbuf), RPP_REQUIRE_TTY); if (response == NULL && errno == ENOTTY) { @@ -153,7 +143,7 @@ index 3999b2e2f64..32532359267 100644 warnx("Authentication failed"); return AUTH_FAILED; } -@@ -241,79 +258,36 @@ authuser_checkpass(char *myname, char *login_style) +@@ -241,79 +250,36 @@ authuser_checkpass(char *myname, char *login_style) } static void @@ -241,7 +231,7 @@ index 3999b2e2f64..32532359267 100644 struct passwd mypwstore, targpwstore; struct passwd *mypw, *targpw; const struct rule *rule; -@@ -326,28 +300,20 @@ main(int argc, char **argv) +@@ -326,28 +292,20 @@ main(int argc, char **argv) int nflag = 0; char cwdpath[PATH_MAX]; const char *cwd; @@ -273,7 +263,7 @@ index 3999b2e2f64..32532359267 100644 case 'u': if (parseuid(optarg, &target) != 0) errx(1, "unknown user"); -@@ -418,50 +384,30 @@ main(int argc, char **argv) +@@ -418,50 +376,30 @@ main(int argc, char **argv) rv = permit(uid, groups, ngroups, &rule, target, cmd, (const char **)argv + 1); if (rv != 0) { @@ -334,7 +324,7 @@ index 3999b2e2f64..32532359267 100644 if (pledge("stdio rpath exec", NULL) == -1) err(1, "pledge"); -@@ -475,23 +421,17 @@ main(int argc, char **argv) +@@ -475,23 +413,17 @@ main(int argc, char **argv) err(1, "pledge"); if (!(rule->options & NOLOG)) { @@ -577,5 +567,5 @@ index 00000000000..4ad1bf1efbf + return 0; +} -- -2.49.0 +2.54.0 diff --git a/pkg/openbsd/patch/0034-acme-client-Fix-signed-ness-of-base64buf_url-input.patch b/pkg/openbsd/patch/0034-acme-client-Fix-signed-ness-of-base64buf_url-input.patch @@ -1,4 +1,4 @@ -From 0f55823084233ab6980c6c1beb9a2fedadc7a5ee Mon Sep 17 00:00:00 2001 +From d29604bf36c2364b8d0a752e6753a345f2e431af Mon Sep 17 00:00:00 2001 From: Michael Forney <mforney@mforney.org> Date: Fri, 23 Apr 2021 20:10:05 -0700 Subject: [PATCH] acme-client: Fix signed-ness of base64buf_url input @@ -13,10 +13,10 @@ This make most of the pointer casts unnecessary. 5 files changed, 17 insertions(+), 14 deletions(-) diff --git a/usr.sbin/acme-client/acctproc.c b/usr.sbin/acme-client/acctproc.c -index da3d49107ae..9e97a8bb760 100644 +index f98826ab698..7a0b9811990 100644 --- a/usr.sbin/acme-client/acctproc.c +++ b/usr.sbin/acme-client/acctproc.c -@@ -42,8 +42,9 @@ +@@ -43,8 +43,9 @@ static char * bn2string(const BIGNUM *bn) { @@ -28,7 +28,7 @@ index da3d49107ae..9e97a8bb760 100644 /* Extract big-endian representation of BIGNUM. */ -@@ -51,7 +52,7 @@ bn2string(const BIGNUM *bn) +@@ -52,7 +53,7 @@ bn2string(const BIGNUM *bn) if ((buf = malloc(len)) == NULL) { warn("malloc"); return NULL; @@ -37,7 +37,7 @@ index da3d49107ae..9e97a8bb760 100644 warnx("BN_bn2bin"); free(buf); return NULL; -@@ -167,7 +168,7 @@ op_thumbprint(int fd, EVP_PKEY *pkey) +@@ -168,7 +169,7 @@ op_thumbprint(int fd, EVP_PKEY *pkey) warnx("EVP_Digest"); goto out; } @@ -46,7 +46,7 @@ index da3d49107ae..9e97a8bb760 100644 warnx("base64buf_url"); goto out; } -@@ -281,7 +282,7 @@ op_sign(int fd, EVP_PKEY *pkey, enum acctop op) +@@ -278,7 +279,7 @@ op_sign(int fd, EVP_PKEY *pkey, enum acctop op) /* Base64-encode the payload. */ @@ -55,7 +55,7 @@ index da3d49107ae..9e97a8bb760 100644 warnx("base64buf_url"); goto out; } -@@ -324,7 +325,7 @@ op_sign(int fd, EVP_PKEY *pkey, enum acctop op) +@@ -325,7 +326,7 @@ op_sign(int fd, EVP_PKEY *pkey, enum acctop op) /* The header combined with the nonce, base64. */ @@ -64,7 +64,7 @@ index da3d49107ae..9e97a8bb760 100644 warnx("base64buf_url"); goto out; } -@@ -363,7 +364,7 @@ op_sign(int fd, EVP_PKEY *pkey, enum acctop op) +@@ -364,7 +365,7 @@ op_sign(int fd, EVP_PKEY *pkey, enum acctop op) switch (EVP_PKEY_base_id(pkey)) { case EVP_PKEY_RSA: @@ -73,7 +73,7 @@ index da3d49107ae..9e97a8bb760 100644 warnx("base64buf_url"); goto out; } -@@ -402,7 +403,7 @@ op_sign(int fd, EVP_PKEY *pkey, enum acctop op) +@@ -403,7 +404,7 @@ op_sign(int fd, EVP_PKEY *pkey, enum acctop op) goto out; } @@ -83,10 +83,10 @@ index da3d49107ae..9e97a8bb760 100644 goto out; } diff --git a/usr.sbin/acme-client/base64.c b/usr.sbin/acme-client/base64.c -index 2b6377f0d81..0d84ad4b458 100644 +index a665143e74f..b3ea459abac 100644 --- a/usr.sbin/acme-client/base64.c +++ b/usr.sbin/acme-client/base64.c -@@ -39,7 +39,7 @@ base64len(size_t len) +@@ -40,7 +40,7 @@ base64len(size_t len) * Returns NULL on allocation failure (not logged). */ char * @@ -96,18 +96,18 @@ index 2b6377f0d81..0d84ad4b458 100644 size_t i, sz; char *buf; diff --git a/usr.sbin/acme-client/extern.h b/usr.sbin/acme-client/extern.h -index 8b500561744..990c784f706 100644 +index 352e90a77db..b1d697412ed 100644 --- a/usr.sbin/acme-client/extern.h +++ b/usr.sbin/acme-client/extern.h -@@ -241,7 +241,7 @@ int checkexit_ext(int *, pid_t, enum comp); +@@ -243,7 +243,7 @@ int checkexit_ext(int *, pid_t, enum comp); * Returns a buffer or NULL on allocation error. */ size_t base64len(size_t); -char *base64buf_url(const char *, size_t); +char *base64buf_url(const unsigned char *, size_t); + int unbase64buf_url(const unsigned char *, unsigned char **); /* - * JSON parsing routines. diff --git a/usr.sbin/acme-client/keyproc.c b/usr.sbin/acme-client/keyproc.c index bab74c2b385..4360156b9c0 100644 --- a/usr.sbin/acme-client/keyproc.c @@ -132,10 +132,10 @@ index bab74c2b385..4360156b9c0 100644 goto out; } else if ((der64 = base64buf_url(der, len)) == NULL) { diff --git a/usr.sbin/acme-client/revokeproc.c b/usr.sbin/acme-client/revokeproc.c -index 6fe34043129..c0963a278fb 100644 +index b001c96cb3a..081a68786f2 100644 --- a/usr.sbin/acme-client/revokeproc.c +++ b/usr.sbin/acme-client/revokeproc.c -@@ -79,7 +79,8 @@ revokeproc(int fd, const char *certfile, int force, +@@ -87,7 +87,8 @@ revokeproc(int fd, const char *certfile, int force, int revocate, struct domain_c *domain) { GENERAL_NAMES *sans = NULL; @@ -145,7 +145,7 @@ index 6fe34043129..c0963a278fb 100644 int rc = 0, cc, sanidx, len, j, k; int *found_altnames = NULL; FILE *f = NULL; -@@ -320,7 +321,7 @@ revokeproc(int fd, const char *certfile, int force, +@@ -328,7 +329,7 @@ revokeproc(int fd, const char *certfile, int force, } else if ((der = dercp = malloc(len)) == NULL) { warn("malloc"); goto out; diff --git a/pkg/openbsd/patch/0035-acme-client-Port-to-BearSSL.patch b/pkg/openbsd/patch/0035-acme-client-Port-to-BearSSL.patch @@ -1,22 +1,22 @@ -From 4ad4ffcb7c731ae48c97b93760d7625724a991bc Mon Sep 17 00:00:00 2001 +From 1c035ffeee5beaaef9907f7b1a17c64e384085b5 Mon Sep 17 00:00:00 2001 From: Michael Forney <mforney@mforney.org> Date: Fri, 23 Apr 2021 23:14:16 -0700 Subject: [PATCH] acme-client: Port to BearSSL --- - usr.sbin/acme-client/acctproc.c | 298 +++++++++------------------ + usr.sbin/acme-client/acctproc.c | 322 ++++++++++------------------- usr.sbin/acme-client/certproc.c | 5 - usr.sbin/acme-client/key.c | 329 ++++++++++++++++++++++++------ usr.sbin/acme-client/key.h | 22 +- usr.sbin/acme-client/keyproc.c | 192 ++++++----------- - usr.sbin/acme-client/revokeproc.c | 319 +++++++++++------------------ - 6 files changed, 568 insertions(+), 597 deletions(-) + usr.sbin/acme-client/revokeproc.c | 327 +++++++++++------------------ + 6 files changed, 580 insertions(+), 617 deletions(-) diff --git a/usr.sbin/acme-client/acctproc.c b/usr.sbin/acme-client/acctproc.c -index 9e97a8bb760..8d66dac49d9 100644 +index 7a0b9811990..adbe6e8c2ab 100644 --- a/usr.sbin/acme-client/acctproc.c +++ b/usr.sbin/acme-client/acctproc.c -@@ -19,73 +19,29 @@ +@@ -19,74 +19,29 @@ #include <err.h> #include <errno.h> @@ -29,6 +29,7 @@ index 9e97a8bb760..8d66dac49d9 100644 -#include <openssl/bn.h> -#include <openssl/ec.h> -#include <openssl/evp.h> +-#include <openssl/hmac.h> -#include <openssl/rsa.h> -#include <openssl/err.h> +#include <bearssl.h> @@ -97,7 +98,7 @@ index 9e97a8bb760..8d66dac49d9 100644 else if ((json = json_fmt_thumb_rsa(exp, mod)) == NULL) warnx("json_fmt_thumb_rsa"); -@@ -99,31 +55,23 @@ op_thumb_rsa(EVP_PKEY *pkey) +@@ -100,31 +55,23 @@ op_thumb_rsa(EVP_PKEY *pkey) * thumbprint from them. */ static char * @@ -139,7 +140,7 @@ index 9e97a8bb760..8d66dac49d9 100644 free(x); free(y); return json; -@@ -133,26 +81,26 @@ op_thumb_ec(EVP_PKEY *pkey) +@@ -134,26 +81,26 @@ op_thumb_ec(EVP_PKEY *pkey) * The thumbprint operation is used for the challenge sequence. */ static int @@ -175,7 +176,7 @@ index 9e97a8bb760..8d66dac49d9 100644 goto out; } -@@ -163,12 +111,10 @@ op_thumbprint(int fd, EVP_PKEY *pkey) +@@ -164,12 +111,10 @@ op_thumbprint(int fd, EVP_PKEY *pkey) * it up in the read loop). */ @@ -192,22 +193,18 @@ index 9e97a8bb760..8d66dac49d9 100644 warnx("base64buf_url"); goto out; } -@@ -183,11 +129,10 @@ out: +@@ -184,20 +129,17 @@ out: } static int --op_sign_rsa(char **prot, EVP_PKEY *pkey, const char *nonce, const char *url) -+op_sign_rsa(char **prot, struct key *key, const char *nonce, const char *url) +-op_sign_rsa(char **jwk, EVP_PKEY *pkey) ++op_sign_rsa(char **jwk, struct key *key) { char *exp = NULL, *mod = NULL; int rc = 0; - RSA *r; - *prot = NULL; - -@@ -196,12 +141,10 @@ op_sign_rsa(char **prot, EVP_PKEY *pkey, const char *nonce, const char *url) - * Finally, format the header combined with the nonce. - */ + *jwk = NULL; - if ((r = EVP_PKEY_get0_RSA(pkey)) == NULL) - warnx("EVP_PKEY_get0_RSA"); @@ -219,15 +216,15 @@ index 9e97a8bb760..8d66dac49d9 100644 + warnx("base64buf_url"); + else if ((exp = base64buf_url(key->rsa.pk.e, key->rsa.pk.elen)) == NULL) + warnx("base64buf_url"); - else if ((*prot = json_fmt_protected_rsa(exp, mod, nonce, url)) == NULL) - warnx("json_fmt_protected_rsa"); + else if ((*jwk = json_fmt_jwk_rsa(exp, mod)) == NULL) + warnx("json_fmt_jwk_rsa"); else -@@ -213,35 +156,27 @@ op_sign_rsa(char **prot, EVP_PKEY *pkey, const char *nonce, const char *url) +@@ -209,35 +151,27 @@ op_sign_rsa(char **jwk, EVP_PKEY *pkey) } static int --op_sign_ec(char **prot, EVP_PKEY *pkey, const char *nonce, const char *url) -+op_sign_ec(char **prot, struct key *key, const char *nonce, const char *url) +-op_sign_ec(char **jwk, EVP_PKEY *pkey) ++op_sign_ec(char **jwk, struct key *key) { - BIGNUM *X = NULL, *Y = NULL; - EC_KEY *ec = NULL; @@ -235,7 +232,7 @@ index 9e97a8bb760..8d66dac49d9 100644 char *x = NULL, *y = NULL; int rc = 0; - *prot = NULL; + *jwk = NULL; - if ((ec = EVP_PKEY_get0_EC_KEY(pkey)) == NULL) - warnx("EVP_PKEY_get0_EC_KEY"); @@ -258,8 +255,8 @@ index 9e97a8bb760..8d66dac49d9 100644 + warnx("base64buf_url"); + else if ((y = base64buf_url(key->ec.pk.q + 1 + len, len)) == NULL) + warnx("base64buf_url"); - else if ((*prot = json_fmt_protected_ec(x, y, nonce, url)) == NULL) - warnx("json_fmt_protected_ec"); + else if ((*jwk = json_fmt_jwk_ec(x, y)) == NULL) + warnx("json_fmt_jwk_ec"); else rc = 1; @@ -268,7 +265,7 @@ index 9e97a8bb760..8d66dac49d9 100644 free(x); free(y); return rc; -@@ -252,20 +187,18 @@ op_sign_ec(char **prot, EVP_PKEY *pkey, const char *nonce, const char *url) +@@ -248,21 +182,19 @@ op_sign_ec(char **jwk, EVP_PKEY *pkey) * This requires the sender ("fd") to provide the payload and a nonce. */ static int @@ -288,6 +285,7 @@ index 9e97a8bb760..8d66dac49d9 100644 - char *sign = NULL, *dig64 = NULL, *fin = NULL; + char *sign = NULL, *sig64 = NULL, *fin = NULL; char *url = NULL, *kid = NULL, *alg = NULL; + char *jwk = NULL; - const unsigned char *digp; - unsigned char *dig = NULL, *buf = NULL; - size_t digsz; @@ -297,7 +295,7 @@ index 9e97a8bb760..8d66dac49d9 100644 /* Read our payload and nonce from the requestor. */ -@@ -282,19 +215,22 @@ op_sign(int fd, EVP_PKEY *pkey, enum acctop op) +@@ -279,19 +211,22 @@ op_sign(int fd, EVP_PKEY *pkey, enum acctop op) /* Base64-encode the payload. */ @@ -326,22 +324,22 @@ index 9e97a8bb760..8d66dac49d9 100644 break; default: warnx("unknown account key type"); -@@ -308,17 +244,17 @@ op_sign(int fd, EVP_PKEY *pkey, enum acctop op) +@@ -305,17 +240,17 @@ op_sign(int fd, EVP_PKEY *pkey, enum acctop op) goto out; } } else { - switch (EVP_PKEY_base_id(pkey)) { - case EVP_PKEY_RSA: -- if (!op_sign_rsa(&prot, pkey, nonce, url)) +- if (!op_sign_rsa(&jwk, pkey)) + switch (key->type) { + case BR_KEYTYPE_RSA: -+ if (!op_sign_rsa(&prot, key, nonce, url)) ++ if (!op_sign_rsa(&jwk, key)) goto out; break; - case EVP_PKEY_EC: -- if (!op_sign_ec(&prot, pkey, nonce, url)) +- if (!op_sign_ec(&jwk, pkey)) + case BR_KEYTYPE_EC: -+ if (!op_sign_ec(&prot, key, nonce, url)) ++ if (!op_sign_ec(&jwk, key)) goto out; break; default: @@ -349,8 +347,8 @@ index 9e97a8bb760..8d66dac49d9 100644 + warnx("unknown key type"); goto out; } - } -@@ -341,76 +277,34 @@ op_sign(int fd, EVP_PKEY *pkey, enum acctop op) + +@@ -342,76 +277,34 @@ op_sign(int fd, EVP_PKEY *pkey, enum acctop op) /* Sign the message. */ @@ -402,13 +400,8 @@ index 9e97a8bb760..8d66dac49d9 100644 - digp = dig; - if ((ec_sig = d2i_ECDSA_SIG(NULL, &digp, digsz)) == NULL) { - warnx("d2i_ECDSA_SIG"); -+ case BR_KEYTYPE_EC: -+ sigsz = br_ecdsa_sign_raw_get_default()(br_ec_get_default(), -+ ctx.vtable, dig, &key->ec.sk, sig); -+ if (sigsz == 0 || sigsz % 2 != 0) { -+ warnx("br_ecdsa_sign_raw"); - goto out; - } +- goto out; +- } - - if ((ec_sig_r = ECDSA_SIG_get0_r(ec_sig)) == NULL || - (ec_sig_s = ECDSA_SIG_get0_s(ec_sig)) == NULL) { @@ -423,8 +416,13 @@ index 9e97a8bb760..8d66dac49d9 100644 - - if ((buf = calloc(2, bn_len)) == NULL) { - warnx("calloc"); -- goto out; -- } ++ case BR_KEYTYPE_EC: ++ sigsz = br_ecdsa_sign_raw_get_default()(br_ec_get_default(), ++ ctx.vtable, dig, &key->ec.sk, sig); ++ if (sigsz == 0 || sigsz % 2 != 0) { ++ warnx("br_ecdsa_sign_raw"); + goto out; + } - - if (BN_bn2binpad(ec_sig_r, buf, bn_len) != bn_len || - BN_bn2binpad(ec_sig_s, buf + bn_len, bn_len) != bn_len) { @@ -444,7 +442,7 @@ index 9e97a8bb760..8d66dac49d9 100644 goto out; } -@@ -420,7 +314,11 @@ op_sign(int fd, EVP_PKEY *pkey, enum acctop op) +@@ -421,7 +314,11 @@ op_sign(int fd, EVP_PKEY *pkey, enum acctop op) * when we next enter the read loop). */ @@ -457,7 +455,7 @@ index 9e97a8bb760..8d66dac49d9 100644 warnx("json_fmt_signed"); goto out; } else if (writestr(fd, COMM_REQ, fin) < 0) -@@ -428,8 +326,6 @@ op_sign(int fd, EVP_PKEY *pkey, enum acctop op) +@@ -429,8 +326,6 @@ op_sign(int fd, EVP_PKEY *pkey, enum acctop op) rc = 1; out: @@ -466,7 +464,7 @@ index 9e97a8bb760..8d66dac49d9 100644 free(pay); free(sign); free(pay64); -@@ -438,10 +334,9 @@ out: +@@ -440,15 +335,14 @@ out: free(kid); free(prot); free(prot64); @@ -479,8 +477,65 @@ index 9e97a8bb760..8d66dac49d9 100644 return rc; } -@@ -449,7 +344,7 @@ int - acctproc(int netsock, const char *acctkey, enum keytype keytype) + static int +-op_eab(int fd, EVP_PKEY *pkey, const char *eab_kid, ++op_eab(int fd, struct key *pkey, const char *eab_kid, + const unsigned char *eab_key, int eab_key_len) + { + char *url = NULL; +@@ -456,9 +350,11 @@ op_eab(int fd, EVP_PKEY *pkey, const char *eab_kid, + char *jwk = NULL, *pay64 = NULL; + char *sign = NULL; + char *dig64 = NULL, *fin = NULL; +- unsigned char dig[EVP_MAX_MD_SIZE]; ++ unsigned char dig[64]; + unsigned int digsz; + int sign_len, rc = 0; ++ br_hmac_key_context kc; ++ br_hmac_context hc; + + if ((url = readstr(fd, COMM_URL)) == NULL) + goto out; +@@ -475,17 +371,17 @@ op_eab(int fd, EVP_PKEY *pkey, const char *eab_kid, + } + + /* payload component: account public key */ +- switch (EVP_PKEY_base_id(pkey)) { +- case EVP_PKEY_RSA: ++ switch (pkey->type) { ++ case BR_KEYTYPE_RSA: + if (!op_sign_rsa(&jwk, pkey)) + goto out; + break; +- case EVP_PKEY_EC: ++ case BR_KEYTYPE_EC: + if (!op_sign_ec(&jwk, pkey)) + goto out; + break; + default: +- warnx("EVP_PKEY_base_id"); ++ warnx("unknown key type"); + goto out; + } + +@@ -502,11 +398,10 @@ op_eab(int fd, EVP_PKEY *pkey, const char *eab_kid, + } + + /* sign with the EAB key */ +- if (HMAC(EVP_sha256(), eab_key, eab_key_len, sign, sign_len, dig, +- &digsz) == NULL) { +- warnx("HMAC"); +- goto out; +- } ++ br_hmac_key_init(&kc, &br_sha256_vtable, eab_key, eab_key_len); ++ br_hmac_init(&hc, &kc, 0); ++ br_hmac_update(&hc, sign, sign_len); ++ digsz = br_hmac_out(&hc, dig); + + if ((dig64 = base64buf_url((char *)dig, digsz)) == NULL) { + warnx("base64buf_url"); +@@ -539,7 +434,7 @@ acctproc(int netsock, const char *acctkey, enum keytype keytype, + const char *eab_kid, const unsigned char *eab_key, int eab_key_len) { FILE *f = NULL; - EVP_PKEY *pkey = NULL; @@ -488,7 +543,7 @@ index 9e97a8bb760..8d66dac49d9 100644 long lval; enum acctop op; int rc = 0, cc, newacct = 0; -@@ -475,8 +370,6 @@ acctproc(int netsock, const char *acctkey, enum keytype keytype) +@@ -565,8 +460,6 @@ acctproc(int netsock, const char *acctkey, enum keytype keytype, /* File-system, user, and sandbox jailing. */ @@ -497,7 +552,7 @@ index 9e97a8bb760..8d66dac49d9 100644 if (pledge("stdio", NULL) == -1) { warn("pledge"); goto out; -@@ -554,8 +447,7 @@ out: +@@ -650,8 +543,7 @@ out: close(netsock); if (f != NULL) fclose(f); @@ -1210,7 +1265,7 @@ index 4360156b9c0..19b8077a8fb 100644 return rc; } diff --git a/usr.sbin/acme-client/revokeproc.c b/usr.sbin/acme-client/revokeproc.c -index c0963a278fb..2109d7a8799 100644 +index 081a68786f2..785d8aea346 100644 --- a/usr.sbin/acme-client/revokeproc.c +++ b/usr.sbin/acme-client/revokeproc.c @@ -15,8 +15,6 @@ @@ -1222,7 +1277,7 @@ index c0963a278fb..2109d7a8799 100644 #include <assert.h> #include <ctype.h> #include <err.h> -@@ -24,71 +22,54 @@ +@@ -24,79 +22,54 @@ #include <stdio.h> #include <stdlib.h> #include <string.h> @@ -1241,13 +1296,13 @@ index c0963a278fb..2109d7a8799 100644 -/* - * Convert the X509's notAfter time into a time_t value. - */ --static time_t --X509notafter(X509 *x) +-static int +-X509notafter(const X509 *x, time_t *notafter) -{ -- ASN1_TIME *atim; +- const ASN1_TIME *atim; - struct tm t; - -- if ((atim = X509_getm_notAfter(x)) == NULL) +- if ((atim = X509_get0_notAfter(x)) == NULL) - return -1; - - memset(&t, 0, sizeof(t)); @@ -1255,21 +1310,25 @@ index c0963a278fb..2109d7a8799 100644 - if (!ASN1_TIME_to_tm(atim, &t)) - return -1; - -- return timegm(&t); +- t.tm_wday = -1; /* sentinel for error */ +- if ((*notafter = timegm(&t)) == -1 && t.tm_wday == -1) +- return -1; +- +- return 0; -} - -/* - * Convert the X509's notBefore time into a time_t value. - */ --static time_t --X509notbefore(X509 *x) +-static int +-X509notbefore(const X509 *x, time_t *notbefore) +static void +append_cert(void *ctx, const void *buf, size_t len) { -- ASN1_TIME *atim; +- const ASN1_TIME *atim; - struct tm t; - -- if ((atim = X509_getm_notBefore(x)) == NULL) +- if ((atim = X509_get0_notBefore(x)) == NULL) - return -1; - - memset(&t, 0, sizeof(t)); @@ -1277,7 +1336,11 @@ index c0963a278fb..2109d7a8799 100644 - if (!ASN1_TIME_to_tm(atim, &t)) - return -1; - -- return timegm(&t); +- t.tm_wday = -1; /* sentinel for error */ +- if ((*notbefore = timegm(&t)) == -1 && t.tm_wday == -1) +- return -1; +- +- return 0; + br_x509_certificate *cert = ctx; + size_t newlen; + unsigned char *newdata; @@ -1324,7 +1387,7 @@ index c0963a278fb..2109d7a8799 100644 /* * First try to open the certificate before we drop privileges -@@ -103,8 +84,6 @@ revokeproc(int fd, const char *certfile, int force, +@@ -111,8 +84,6 @@ revokeproc(int fd, const char *certfile, int force, /* File-system and sandbox jailing. */ @@ -1333,7 +1396,7 @@ index c0963a278fb..2109d7a8799 100644 if (pledge("stdio", NULL) == -1) { warn("pledge"); goto out; -@@ -128,45 +107,89 @@ revokeproc(int fd, const char *certfile, int force, +@@ -136,45 +107,89 @@ revokeproc(int fd, const char *certfile, int force, goto out; } @@ -1386,7 +1449,7 @@ index c0963a278fb..2109d7a8799 100644 /* Read out the expiration date. */ -- if ((notafter = X509notafter(x)) == -1) { +- if (X509notafter(x, ¬after) == -1) { - warnx("X509notafter"); + br_x509_decoder_init(&xd, NULL, NULL); + br_x509_decoder_push(&xd, cert.data, cert.data_len); @@ -1395,7 +1458,7 @@ index c0963a278fb..2109d7a8799 100644 goto out; } - -- if ((notbefore = X509notbefore(x)) == -1) { +- if (X509notbefore(x, ¬before) == -1) { - warnx("X509notbefore"); + br_x509_decoder_get_notafter(&xd, &days, &secs); + notafter = 86400ll * (days - 719528) + 86400; @@ -1450,7 +1513,7 @@ index c0963a278fb..2109d7a8799 100644 goto out; } -@@ -175,121 +198,37 @@ revokeproc(int fd, const char *certfile, int force, +@@ -183,121 +198,37 @@ revokeproc(int fd, const char *certfile, int force, * configuration file and that all domains are represented only once. */ @@ -1481,13 +1544,8 @@ index c0963a278fb..2109d7a8799 100644 - break; - default: - ip = NULL; -+ TAILQ_FOREACH(ac, &domain->altname_list, entry) { -+ for (i = 0; i < eltsz; i++) { -+ if (elts[i].status == 1 && -+ strcmp(ac->domain, elts[i].buf) == 0) { -+ elts[i].status = 0; - break; - } +- break; +- } - if (ip == NULL) { - warnx("invalid IP address"); - continue; @@ -1504,14 +1562,19 @@ index c0963a278fb..2109d7a8799 100644 - if (name_len == -1) { - warn("asprintf"); - continue; - } +- } - - j = 0; - TAILQ_FOREACH(ac, &domain->altname_list, entry) { - if (strcmp(name_buf, ac->domain) == 0) { - found_altnames[j]++; -- break; -- } ++ TAILQ_FOREACH(ac, &domain->altname_list, entry) { ++ for (i = 0; i < eltsz; i++) { ++ if (elts[i].status == 1 && ++ strcmp(ac->domain, elts[i].buf) == 0) { ++ elts[i].status = 0; + break; + } - /* increment if didn't match */ - j++; - } @@ -1536,7 +1599,7 @@ index c0963a278fb..2109d7a8799 100644 - } - force = 2; - continue; -- } + } - /* should not reach here if j is out of bounds */ - if (found_altnames[j] > 1) { + if (i == eltsz) { @@ -1590,7 +1653,7 @@ index c0963a278fb..2109d7a8799 100644 goto out; } force = 2; -@@ -315,16 +254,7 @@ revokeproc(int fd, const char *certfile, int force, +@@ -323,16 +254,7 @@ revokeproc(int fd, const char *certfile, int force, if (cc <= 0) goto out; @@ -1608,7 +1671,7 @@ index c0963a278fb..2109d7a8799 100644 warnx("base64buf_url"); goto out; } else if (writestr(fd, COMM_CSR, der64) >= 0) -@@ -398,12 +328,9 @@ out: +@@ -406,12 +328,9 @@ out: close(fd); if (f != NULL) fclose(f); diff --git a/pkg/openbsd/patch/0040-Explicitly-cast-arguments-to-functions-expecting-cha.patch b/pkg/openbsd/patch/0040-Explicitly-cast-arguments-to-functions-expecting-cha.patch @@ -0,0 +1,148 @@ +From bd8db951717def72440051dae7dc0a8b71489a1a Mon Sep 17 00:00:00 2001 +From: Michael Forney <mforney@mforney.org> +Date: Thu, 2 Apr 2026 17:02:47 -0700 +Subject: [PATCH] Explicitly cast arguments to functions expecting char pointer + with other sign + +--- + usr.bin/diff/diffreg.c | 10 +++++----- + usr.bin/nc/socks.c | 30 +++++++++++++++--------------- + usr.sbin/acme-client/acctproc.c | 3 ++- + 3 files changed, 22 insertions(+), 21 deletions(-) + +diff --git a/usr.bin/diff/diffreg.c b/usr.bin/diff/diffreg.c +index f3af03bc232..aab4a3b9fc8 100644 +--- a/usr.bin/diff/diffreg.c ++++ b/usr.bin/diff/diffreg.c +@@ -1269,19 +1269,19 @@ match_function(const long *f, int pos, FILE *fp) + nc = fread(buf, 1, nc, fp); + if (nc > 0) { + buf[nc] = '\0'; +- buf[strcspn(buf, "\n")] = '\0'; ++ buf[strcspn((char *)buf, "\n")] = '\0'; + if (isalpha(buf[0]) || buf[0] == '_' || buf[0] == '$') { +- if (begins_with(buf, "private:")) { ++ if (begins_with((char *)buf, "private:")) { + if (!state) + state = " (private)"; +- } else if (begins_with(buf, "protected:")) { ++ } else if (begins_with((char *)buf, "protected:")) { + if (!state) + state = " (protected)"; +- } else if (begins_with(buf, "public:")) { ++ } else if (begins_with((char *)buf, "public:")) { + if (!state) + state = " (public)"; + } else { +- strlcpy(lastbuf, buf, sizeof lastbuf); ++ strlcpy(lastbuf, (char *)buf, sizeof lastbuf); + if (state) + strlcat(lastbuf, state, + sizeof lastbuf); +diff --git a/usr.bin/nc/socks.c b/usr.bin/nc/socks.c +index 1f1fb96e2af..37a18f191f2 100644 +--- a/usr.bin/nc/socks.c ++++ b/usr.bin/nc/socks.c +@@ -88,7 +88,7 @@ decode_addrport(const char *h, const char *p, struct sockaddr *addr, + } + + static int +-proxy_read_line(int fd, char *buf, size_t bufsz) ++proxy_read_line(int fd, unsigned char *buf, size_t bufsz) + { + size_t off; + +@@ -315,7 +315,7 @@ socks_connect(const char *host, const char *port, + wlen = 9; + if (socksv == 44) { + /* SOCKS4A has nul-terminated hostname after user */ +- if (strlcpy(buf + 9, host, ++ if (strlcpy((char *)buf + 9, host, + sizeof(buf) - 9) >= sizeof(buf) - 9) + errx(1, "hostname too big"); + wlen = 9 + strlen(host) + 1; +@@ -340,17 +340,17 @@ socks_connect(const char *host, const char *port, + + /* Try to be sane about numeric IPv6 addresses */ + if (strchr(host, ':') != NULL) { +- r = snprintf(buf, sizeof(buf), ++ r = snprintf((char *)buf, sizeof(buf), + "CONNECT [%s]:%d HTTP/1.0\r\n", + host, ntohs(serverport)); + } else { +- r = snprintf(buf, sizeof(buf), ++ r = snprintf((char *)buf, sizeof(buf), + "CONNECT %s:%d HTTP/1.0\r\n", + host, ntohs(serverport)); + } + if (r < 0 || (size_t)r >= sizeof(buf)) + errx(1, "hostname too long"); +- r = strlen(buf); ++ r = strlen((char *)buf); + + cnt = atomicio(vwrite, proxyfd, buf, r); + if (cnt != r) +@@ -362,18 +362,18 @@ socks_connect(const char *host, const char *port, + + getproxypass(proxyuser, proxyhost, + proxypass, sizeof proxypass); +- r = snprintf(buf, sizeof(buf), "%s:%s", ++ r = snprintf((char *)buf, sizeof(buf), "%s:%s", + proxyuser, proxypass); + explicit_bzero(proxypass, sizeof proxypass); + if (r == -1 || (size_t)r >= sizeof(buf) || +- b64_ntop(buf, strlen(buf), resp, ++ b64_ntop(buf, strlen((char *)buf), resp, + sizeof(resp)) == -1) + errx(1, "Proxy username/password too long"); +- r = snprintf(buf, sizeof(buf), "Proxy-Authorization: " +- "Basic %s\r\n", resp); ++ r = snprintf((char *)buf, sizeof(buf), ++ "Proxy-Authorization: Basic %s\r\n", resp); + if (r < 0 || (size_t)r >= sizeof(buf)) + errx(1, "Proxy auth response too long"); +- r = strlen(buf); ++ r = strlen((char *)buf); + if ((cnt = atomicio(vwrite, proxyfd, buf, r)) != r) + err(1, "write failed (%zu/%d)", cnt, r); + explicit_bzero(proxypass, sizeof proxypass); +@@ -387,17 +387,17 @@ socks_connect(const char *host, const char *port, + /* Read status reply */ + proxy_read_line(proxyfd, buf, sizeof(buf)); + if (proxyuser != NULL && +- (strncmp(buf, "HTTP/1.0 407 ", 13) == 0 || +- strncmp(buf, "HTTP/1.1 407 ", 13) == 0)) { ++ (strncmp((char *)buf, "HTTP/1.0 407 ", 13) == 0 || ++ strncmp((char *)buf, "HTTP/1.1 407 ", 13) == 0)) { + if (authretry > 1) { + fprintf(stderr, "Proxy authentication " + "failed\n"); + } + close(proxyfd); + goto again; +- } else if (strncmp(buf, "HTTP/1.0 200 ", 13) != 0 && +- strncmp(buf, "HTTP/1.1 200 ", 13) != 0) +- errx(1, "Proxy error: \"%s\"", buf); ++ } else if (strncmp((char *)buf, "HTTP/1.0 200 ", 13) != 0 && ++ strncmp((char *)buf, "HTTP/1.1 200 ", 13) != 0) ++ errx(1, "Proxy error: \"%s\"", (char *)buf); + + /* Headers continue until we hit an empty line */ + for (r = 0; r < HTTP_MAXHDRS; r++) { +diff --git a/usr.sbin/acme-client/acctproc.c b/usr.sbin/acme-client/acctproc.c +index 2a3c7babb12..e2ef3607b24 100644 +--- a/usr.sbin/acme-client/acctproc.c ++++ b/usr.sbin/acme-client/acctproc.c +@@ -211,7 +211,8 @@ op_sign(int fd, struct key *key, enum acctop op) + + /* Base64-encode the payload. */ + +- if ((pay64 = base64buf_url(pay, strlen(pay))) == NULL) { ++ if ((pay64 = base64buf_url((unsigned char *)pay, ++ strlen(pay))) == NULL) { + warnx("base64buf_url"); + goto out; + } +-- +2.54.0 + diff --git a/pkg/openbsd/patch/0040-acme-client-Fix-enum-int-mismatch-in-declaration-of-.patch b/pkg/openbsd/patch/0040-acme-client-Fix-enum-int-mismatch-in-declaration-of-.patch @@ -1,26 +0,0 @@ -From ef9e08a9597e02425f9da0f43486e0cdfa1a4a1e Mon Sep 17 00:00:00 2001 -From: Michael Forney <mforney@mforney.org> -Date: Wed, 4 Mar 2026 15:27:54 -0800 -Subject: [PATCH] acme-client: Fix enum/int mismatch in declaration of - json_parse_response - ---- - usr.sbin/acme-client/extern.h | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/usr.sbin/acme-client/extern.h b/usr.sbin/acme-client/extern.h -index 990c784f706..32127182548 100644 ---- a/usr.sbin/acme-client/extern.h -+++ b/usr.sbin/acme-client/extern.h -@@ -249,7 +249,7 @@ char *base64buf_url(const unsigned char *, size_t); - */ - struct jsmnn *json_parse(const char *, size_t); - void json_free(struct jsmnn *); --int json_parse_response(struct jsmnn *); -+enum chngstatus json_parse_response(struct jsmnn *); - void json_free_challenge(struct chng *); - int json_parse_challenge(struct jsmnn *, struct chng *); - void json_free_order(struct order *); --- -2.54.0 - diff --git a/pkg/openbsd/patch/0041-Explicitly-cast-arguments-to-functions-expecting-cha.patch b/pkg/openbsd/patch/0041-Explicitly-cast-arguments-to-functions-expecting-cha.patch @@ -1,148 +0,0 @@ -From d74af6c05b11f5d000f0a4aae3c287b6d4e2829f Mon Sep 17 00:00:00 2001 -From: Michael Forney <mforney@mforney.org> -Date: Thu, 2 Apr 2026 17:02:47 -0700 -Subject: [PATCH] Explicitly cast arguments to functions expecting char pointer - with other sign - ---- - usr.bin/diff/diffreg.c | 10 +++++----- - usr.bin/nc/socks.c | 30 +++++++++++++++--------------- - usr.sbin/acme-client/acctproc.c | 3 ++- - 3 files changed, 22 insertions(+), 21 deletions(-) - -diff --git a/usr.bin/diff/diffreg.c b/usr.bin/diff/diffreg.c -index 3470f54c337..c36765a44c8 100644 ---- a/usr.bin/diff/diffreg.c -+++ b/usr.bin/diff/diffreg.c -@@ -1269,19 +1269,19 @@ match_function(const long *f, int pos, FILE *fp) - nc = fread(buf, 1, nc, fp); - if (nc > 0) { - buf[nc] = '\0'; -- buf[strcspn(buf, "\n")] = '\0'; -+ buf[strcspn((char *)buf, "\n")] = '\0'; - if (isalpha(buf[0]) || buf[0] == '_' || buf[0] == '$') { -- if (begins_with(buf, "private:")) { -+ if (begins_with((char *)buf, "private:")) { - if (!state) - state = " (private)"; -- } else if (begins_with(buf, "protected:")) { -+ } else if (begins_with((char *)buf, "protected:")) { - if (!state) - state = " (protected)"; -- } else if (begins_with(buf, "public:")) { -+ } else if (begins_with((char *)buf, "public:")) { - if (!state) - state = " (public)"; - } else { -- strlcpy(lastbuf, buf, sizeof lastbuf); -+ strlcpy(lastbuf, (char *)buf, sizeof lastbuf); - if (state) - strlcat(lastbuf, state, - sizeof lastbuf); -diff --git a/usr.bin/nc/socks.c b/usr.bin/nc/socks.c -index 1f1fb96e2af..37a18f191f2 100644 ---- a/usr.bin/nc/socks.c -+++ b/usr.bin/nc/socks.c -@@ -88,7 +88,7 @@ decode_addrport(const char *h, const char *p, struct sockaddr *addr, - } - - static int --proxy_read_line(int fd, char *buf, size_t bufsz) -+proxy_read_line(int fd, unsigned char *buf, size_t bufsz) - { - size_t off; - -@@ -315,7 +315,7 @@ socks_connect(const char *host, const char *port, - wlen = 9; - if (socksv == 44) { - /* SOCKS4A has nul-terminated hostname after user */ -- if (strlcpy(buf + 9, host, -+ if (strlcpy((char *)buf + 9, host, - sizeof(buf) - 9) >= sizeof(buf) - 9) - errx(1, "hostname too big"); - wlen = 9 + strlen(host) + 1; -@@ -340,17 +340,17 @@ socks_connect(const char *host, const char *port, - - /* Try to be sane about numeric IPv6 addresses */ - if (strchr(host, ':') != NULL) { -- r = snprintf(buf, sizeof(buf), -+ r = snprintf((char *)buf, sizeof(buf), - "CONNECT [%s]:%d HTTP/1.0\r\n", - host, ntohs(serverport)); - } else { -- r = snprintf(buf, sizeof(buf), -+ r = snprintf((char *)buf, sizeof(buf), - "CONNECT %s:%d HTTP/1.0\r\n", - host, ntohs(serverport)); - } - if (r < 0 || (size_t)r >= sizeof(buf)) - errx(1, "hostname too long"); -- r = strlen(buf); -+ r = strlen((char *)buf); - - cnt = atomicio(vwrite, proxyfd, buf, r); - if (cnt != r) -@@ -362,18 +362,18 @@ socks_connect(const char *host, const char *port, - - getproxypass(proxyuser, proxyhost, - proxypass, sizeof proxypass); -- r = snprintf(buf, sizeof(buf), "%s:%s", -+ r = snprintf((char *)buf, sizeof(buf), "%s:%s", - proxyuser, proxypass); - explicit_bzero(proxypass, sizeof proxypass); - if (r == -1 || (size_t)r >= sizeof(buf) || -- b64_ntop(buf, strlen(buf), resp, -+ b64_ntop(buf, strlen((char *)buf), resp, - sizeof(resp)) == -1) - errx(1, "Proxy username/password too long"); -- r = snprintf(buf, sizeof(buf), "Proxy-Authorization: " -- "Basic %s\r\n", resp); -+ r = snprintf((char *)buf, sizeof(buf), -+ "Proxy-Authorization: Basic %s\r\n", resp); - if (r < 0 || (size_t)r >= sizeof(buf)) - errx(1, "Proxy auth response too long"); -- r = strlen(buf); -+ r = strlen((char *)buf); - if ((cnt = atomicio(vwrite, proxyfd, buf, r)) != r) - err(1, "write failed (%zu/%d)", cnt, r); - explicit_bzero(proxypass, sizeof proxypass); -@@ -387,17 +387,17 @@ socks_connect(const char *host, const char *port, - /* Read status reply */ - proxy_read_line(proxyfd, buf, sizeof(buf)); - if (proxyuser != NULL && -- (strncmp(buf, "HTTP/1.0 407 ", 13) == 0 || -- strncmp(buf, "HTTP/1.1 407 ", 13) == 0)) { -+ (strncmp((char *)buf, "HTTP/1.0 407 ", 13) == 0 || -+ strncmp((char *)buf, "HTTP/1.1 407 ", 13) == 0)) { - if (authretry > 1) { - fprintf(stderr, "Proxy authentication " - "failed\n"); - } - close(proxyfd); - goto again; -- } else if (strncmp(buf, "HTTP/1.0 200 ", 13) != 0 && -- strncmp(buf, "HTTP/1.1 200 ", 13) != 0) -- errx(1, "Proxy error: \"%s\"", buf); -+ } else if (strncmp((char *)buf, "HTTP/1.0 200 ", 13) != 0 && -+ strncmp((char *)buf, "HTTP/1.1 200 ", 13) != 0) -+ errx(1, "Proxy error: \"%s\"", (char *)buf); - - /* Headers continue until we hit an empty line */ - for (r = 0; r < HTTP_MAXHDRS; r++) { -diff --git a/usr.sbin/acme-client/acctproc.c b/usr.sbin/acme-client/acctproc.c -index 8d66dac49d9..6bc647c6009 100644 ---- a/usr.sbin/acme-client/acctproc.c -+++ b/usr.sbin/acme-client/acctproc.c -@@ -215,7 +215,8 @@ op_sign(int fd, struct key *key, enum acctop op) - - /* Base64-encode the payload. */ - -- if ((pay64 = base64buf_url(pay, strlen(pay))) == NULL) { -+ if ((pay64 = base64buf_url((unsigned char *)pay, -+ strlen(pay))) == NULL) { - warnx("base64buf_url"); - goto out; - } --- -2.49.0 - diff --git a/pkg/openbsd/patch/0042-fts-Use-prototype-in-declaration-of-fts_compar.patch b/pkg/openbsd/patch/0041-fts-Use-prototype-in-declaration-of-fts_compar.patch diff --git a/pkg/openbsd/patch/0042-nc-Use-explicit-cast-for-pointer-sign-conversion.patch b/pkg/openbsd/patch/0042-nc-Use-explicit-cast-for-pointer-sign-conversion.patch @@ -0,0 +1,25 @@ +From 2945d5ff85734cad7ade43f5ea00d9cbf1f4295d Mon Sep 17 00:00:00 2001 +From: Michael Forney <mforney@mforney.org> +Date: Sun, 17 May 2026 01:40:40 -0700 +Subject: [PATCH] nc: Use explicit cast for pointer sign conversion + +--- + usr.bin/nc/netcat.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/usr.bin/nc/netcat.c b/usr.bin/nc/netcat.c +index 6ce6eecfa15..5a8cbbaee7b 100644 +--- a/usr.bin/nc/netcat.c ++++ b/usr.bin/nc/netcat.c +@@ -1763,7 +1763,7 @@ save_peer_cert(struct tls *tls_ctx, FILE *fp) + const char *pem; + size_t plen; + +- if ((pem = tls_peer_cert_unverified_bundle_pem(tls_ctx, &plen)) == NULL) ++ if ((pem = (char *)tls_peer_cert_unverified_bundle_pem(tls_ctx, &plen)) == NULL) + errx(1, "Can't get peer certificate"); + if (fprintf(fp, "%.*s", (int)plen, pem) < 0) + err(1, "unable to save peer cert"); +-- +2.54.0 + diff --git a/pkg/openbsd/patch/0044-Add-fallback-define-for-__pledge_open.patch b/pkg/openbsd/patch/0043-Add-fallback-define-for-__pledge_open.patch diff --git a/pkg/openbsd/patch/0043-nc-Use-explicit-cast-for-pointer-sign-conversion.patch b/pkg/openbsd/patch/0043-nc-Use-explicit-cast-for-pointer-sign-conversion.patch @@ -1,25 +0,0 @@ -From bcaddae8de94a8d2d448a287b42a75a7306999b7 Mon Sep 17 00:00:00 2001 -From: Michael Forney <mforney@mforney.org> -Date: Sun, 17 May 2026 01:40:40 -0700 -Subject: [PATCH] nc: Use explicit cast for pointer sign conversion - ---- - usr.bin/nc/netcat.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/usr.bin/nc/netcat.c b/usr.bin/nc/netcat.c -index 982b65592fe..82f1686fa6f 100644 ---- a/usr.bin/nc/netcat.c -+++ b/usr.bin/nc/netcat.c -@@ -1763,7 +1763,7 @@ save_peer_cert(struct tls *tls_ctx, FILE *fp) - const char *pem; - size_t plen; - -- if ((pem = tls_peer_cert_chain_pem(tls_ctx, &plen)) == NULL) -+ if ((pem = (char *)tls_peer_cert_chain_pem(tls_ctx, &plen)) == NULL) - errx(1, "Can't get peer certificate"); - if (fprintf(fp, "%.*s", (int)plen, pem) < 0) - err(1, "unable to save peer cert"); --- -2.54.0 - diff --git a/pkg/openbsd/patch/0044-nc-Revert-to-libressl-4.3-libtls-API.patch b/pkg/openbsd/patch/0044-nc-Revert-to-libressl-4.3-libtls-API.patch @@ -0,0 +1,28 @@ +From 6aa6476b05becacf50fab5371eb8764337c87e7f Mon Sep 17 00:00:00 2001 +From: Michael Forney <mforney@mforney.org> +Date: Tue, 27 Oct 2026 11:44:18 -0700 +Subject: [PATCH] nc: Revert to libressl-4.3 libtls API + +Until we sync libtls-bearssl with libressl-4.4, we don't have +tls_peer_cert_unverified_bundle_pem. Revert to tls_peer_cert_chain_pem +for now. +--- + usr.bin/nc/netcat.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/usr.bin/nc/netcat.c b/usr.bin/nc/netcat.c +index 5a8cbbaee7b..1a1a612b103 100644 +--- a/usr.bin/nc/netcat.c ++++ b/usr.bin/nc/netcat.c +@@ -1763,7 +1763,7 @@ save_peer_cert(struct tls *tls_ctx, FILE *fp) + const char *pem; + size_t plen; + +- if ((pem = (char *)tls_peer_cert_unverified_bundle_pem(tls_ctx, &plen)) == NULL) ++ if ((pem = (char *)tls_peer_cert_chain_pem(tls_ctx, &plen)) == NULL) + errx(1, "Can't get peer certificate"); + if (fprintf(fp, "%.*s", (int)plen, pem) < 0) + err(1, "unable to save peer cert"); +-- +2.54.0 + diff --git a/pkg/openbsd/sha256 b/pkg/openbsd/sha256 @@ -1,2 +1,2 @@ -fb305c553059b48e8ee64539f392b783cb38a67865823f6f6a94f3b220a1268b src.tar.gz -c9ef294021ef7aafd5f18ffe8ebfed63394e5a86d65d7436d6db78551f9d57f1 sys.tar.gz +9984c74ff875b5ff041e4676a7f3e4e1ead2cc47a284d705eb9f37cbec4fe795 src.tar.gz +964b1aed7839b86f4e010a0fdd03dcd409e6f569e69fe85f95e5fceb740c2aaf sys.tar.gz diff --git a/pkg/openbsd/url b/pkg/openbsd/url @@ -1,5 +1,5 @@ remote-name -url = "https://cloudflare.cdn.openbsd.org/pub/OpenBSD/7.9/src.tar.gz" +url = "https://cloudflare.cdn.openbsd.org/pub/OpenBSD/8.0/src.tar.gz" remote-name -url = "https://cloudflare.cdn.openbsd.org/pub/OpenBSD/7.9/sys.tar.gz" +url = "https://cloudflare.cdn.openbsd.org/pub/OpenBSD/8.0/sys.tar.gz" diff --git a/pkg/openbsd/ver b/pkg/openbsd/ver @@ -1 +1 @@ -7.9 +8.0