diff --git a/bin/pax/cpio.c b/bin/pax/cpio.c index 92fe96516..be0316d8d 100644 --- a/bin/pax/cpio.c +++ b/bin/pax/cpio.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cpio.c,v 1.33 2017/09/16 07:42:34 otto Exp $ */ +/* $OpenBSD: cpio.c,v 1.34 2023/06/26 18:00:59 millert Exp $ */ /* $NetBSD: cpio.c,v 1.5 1995/03/21 09:07:13 cgd Exp $ */ /*- @@ -294,7 +294,7 @@ cpio_rd(ARCHD *arcn, char *buf) arcn->sb.st_rdev = (dev_t)asc_ul(hd->c_rdev, sizeof(hd->c_rdev), OCT); val = asc_ull(hd->c_mtime, sizeof(hd->c_mtime), OCT); if (val > MAX_TIME_T) - arcn->sb.st_mtime = INT_MAX; /* XXX 2038 */ + arcn->sb.st_mtime = MAX_TIME_T; else arcn->sb.st_mtime = val; arcn->sb.st_mtim.tv_nsec = 0; diff --git a/bin/pax/tar.c b/bin/pax/tar.c index 686ec524f..b47c96bf0 100644 --- a/bin/pax/tar.c +++ b/bin/pax/tar.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tar.c,v 1.70 2022/03/01 21:19:11 sthen Exp $ */ +/* $OpenBSD: tar.c,v 1.71 2023/06/26 18:00:59 millert Exp $ */ /* $NetBSD: tar.c,v 1.5 1995/03/21 09:07:49 cgd Exp $ */ /*- @@ -411,7 +411,7 @@ tar_rd(ARCHD *arcn, char *buf) arcn->sb.st_size = (off_t)asc_ull(hd->size, sizeof(hd->size), OCT); val = asc_ull(hd->mtime, sizeof(hd->mtime), OCT); if (val > MAX_TIME_T) - arcn->sb.st_mtime = INT_MAX; /* XXX 2038 */ + arcn->sb.st_mtime = MAX_TIME_T; else arcn->sb.st_mtime = val; arcn->sb.st_ctime = arcn->sb.st_atime = arcn->sb.st_mtime; @@ -788,7 +788,7 @@ reset: if (arcn->sb.st_mtime == 0) { val = asc_ull(hd->mtime, sizeof(hd->mtime), OCT); if (val > MAX_TIME_T) - arcn->sb.st_mtime = INT_MAX; /* XXX 2038 */ + arcn->sb.st_mtime = MAX_TIME_T; else arcn->sb.st_mtime = val; } diff --git a/bin/pax/tty_subs.c b/bin/pax/tty_subs.c index a07264ae6..c93708b77 100644 --- a/bin/pax/tty_subs.c +++ b/bin/pax/tty_subs.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tty_subs.c,v 1.17 2016/08/26 04:22:13 guenther Exp $ */ +/* $OpenBSD: tty_subs.c,v 1.18 2023/06/26 16:58:50 millert Exp $ */ /* $NetBSD: tty_subs.c,v 1.5 1995/03/21 09:07:52 cgd Exp $ */ /*- @@ -90,14 +90,14 @@ void tty_prnt(const char *fmt, ...) { va_list ap; + char buf[8192]; - va_start(ap, fmt); - if (ttyoutf == NULL) { - va_end(ap); + if (ttyoutf == NULL) return; - } - (void)vfprintf(ttyoutf, fmt, ap); + va_start(ap, fmt); + (void)vsnprintf(buf, sizeof(buf), fmt, ap); va_end(ap); + safe_print(buf, ttyoutf); (void)fflush(ttyoutf); } @@ -132,8 +132,8 @@ void paxwarn(int set, const char *fmt, ...) { va_list ap; + char buf[8192]; - va_start(ap, fmt); if (set) exit_val = 1; /* @@ -146,8 +146,10 @@ paxwarn(int set, const char *fmt, ...) vfpart = 0; } (void)fprintf(stderr, "%s: ", argv0); - (void)vfprintf(stderr, fmt, ap); + va_start(ap, fmt); + (void)vsnprintf(buf, sizeof(buf), fmt, ap); va_end(ap); + safe_print(buf, stderr); (void)fputc('\n', stderr); } @@ -161,8 +163,8 @@ void syswarn(int set, int errnum, const char *fmt, ...) { va_list ap; + char buf[8192]; - va_start(ap, fmt); if (set) exit_val = 1; /* @@ -175,8 +177,10 @@ syswarn(int set, int errnum, const char *fmt, ...) vfpart = 0; } (void)fprintf(stderr, "%s: ", argv0); - (void)vfprintf(stderr, fmt, ap); + va_start(ap, fmt); + (void)vsnprintf(buf, sizeof(buf), fmt, ap); va_end(ap); + safe_print(buf, stderr); /* * format and print the errno diff --git a/lib/libc/gen/posix_spawn.3 b/lib/libc/gen/posix_spawn.3 index f56abab10..f386c3465 100644 --- a/lib/libc/gen/posix_spawn.3 +++ b/lib/libc/gen/posix_spawn.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: posix_spawn.3,v 1.10 2023/06/26 06:58:18 jmc Exp $ +.\" $OpenBSD: posix_spawn.3,v 1.11 2023/06/26 15:28:52 tb Exp $ .\" .\" Copyright (c) 2012 Marc Espie .\" @@ -132,4 +132,4 @@ These functions were ported from to .Ox 5.2 . .Sh AUTHORS -.An \&Ed Shouten Aq Mt ed@FreeBSD.org +.An \&Ed Schouten Aq Mt ed@FreeBSD.org diff --git a/lib/libcrypto/ec/ec_asn1.c b/lib/libcrypto/ec/ec_asn1.c index 36a413a99..6aedab977 100644 --- a/lib/libcrypto/ec/ec_asn1.c +++ b/lib/libcrypto/ec/ec_asn1.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ec_asn1.c,v 1.45 2023/05/04 05:59:38 tb Exp $ */ +/* $OpenBSD: ec_asn1.c,v 1.46 2023/06/27 07:28:57 tb Exp $ */ /* * Written by Nils Larsch for the OpenSSL project. */ @@ -70,23 +70,7 @@ int EC_GROUP_get_basis_type(const EC_GROUP *group) { - int i = 0; - - if (EC_METHOD_get_field_type(EC_GROUP_method_of(group)) != - NID_X9_62_characteristic_two_field) - /* everything else is currently not supported */ - return 0; - - while (group->poly[i] != 0) - i++; - - if (i == 4) - return NID_X9_62_ppBasis; - else if (i == 2) - return NID_X9_62_tpBasis; - else - /* everything else is currently not supported */ - return 0; + return 0; } /* some structures needed for the asn1 encoding */ diff --git a/lib/libcrypto/ec/ec_local.h b/lib/libcrypto/ec/ec_local.h index 9bdc3e733..a058878a6 100644 --- a/lib/libcrypto/ec/ec_local.h +++ b/lib/libcrypto/ec/ec_local.h @@ -1,4 +1,4 @@ -/* $OpenBSD: ec_local.h,v 1.21 2023/06/25 19:22:21 tb Exp $ */ +/* $OpenBSD: ec_local.h,v 1.22 2023/06/27 07:31:18 tb Exp $ */ /* * Originally written by Bodo Moeller for the OpenSSL project. */ @@ -205,22 +205,9 @@ struct ec_group_st { */ BIGNUM field; - /* - * Field specification for GF(2^m). The irreducible polynomial is - * f(t) = t^poly[0] + t^poly[1] + ... + t^poly[k], - * where - * m = poly[0] > poly[1] > ... > poly[k] = 0, - * and the array is terminated with poly[k+1] = -1. All elliptic curve - * irreducibles have at most 5 non-zero terms. - */ - int poly[6]; - /* * Curve coefficients. In characteristic > 3, the curve is defined by a - * Weierstrass equation of the form - * y^2 = x^3 + a*x + b. - * For characteristic 2, the curve is defined by an equation of the form - * y^2 + x*y = x^3 + a*x^2 + b. + * Weierstrass equation of the form y^2 = x^3 + a*x + b. */ BIGNUM a, b; diff --git a/lib/libcrypto/ec/eck_prn.c b/lib/libcrypto/ec/eck_prn.c index f7ce8debb..e1f734cbe 100644 --- a/lib/libcrypto/ec/eck_prn.c +++ b/lib/libcrypto/ec/eck_prn.c @@ -1,4 +1,4 @@ -/* $OpenBSD: eck_prn.c,v 1.20 2022/11/19 07:29:29 tb Exp $ */ +/* $OpenBSD: eck_prn.c,v 1.21 2023/06/27 07:32:29 tb Exp $ */ /* * Written by Nils Larsch for the OpenSSL project. */ @@ -163,6 +163,7 @@ ECPKParameters_print(BIO *bp, const EC_GROUP *x, int off) unsigned char *buffer = NULL; size_t buf_len = 0, i; int ret = 0, reason = ERR_R_BIO_LIB; + int nid; BN_CTX *ctx = NULL; const EC_POINT *point = NULL; BIGNUM *p = NULL, *a = NULL, *b = NULL, *gen = NULL, *order = NULL, @@ -186,8 +187,6 @@ ECPKParameters_print(BIO *bp, const EC_GROUP *x, int off) } if (EC_GROUP_get_asn1_flag(x)) { /* the curve parameter are given by an asn1 OID */ - int nid; - if (!BIO_indent(bp, off, 128)) goto err; @@ -209,12 +208,7 @@ ECPKParameters_print(BIO *bp, const EC_GROUP *x, int off) } } else { /* explicit parameters */ - int is_char_two = 0; point_conversion_form_t form; - int tmp_nid = EC_METHOD_get_field_type(EC_GROUP_method_of(x)); - - if (tmp_nid == NID_X9_62_characteristic_two_field) - is_char_two = 1; if ((p = BN_new()) == NULL || (a = BN_new()) == NULL || (b = BN_new()) == NULL || (order = BN_new()) == NULL || @@ -266,32 +260,13 @@ ECPKParameters_print(BIO *bp, const EC_GROUP *x, int off) if (!BIO_indent(bp, off, 128)) goto err; + nid = EC_METHOD_get_field_type(EC_GROUP_method_of(x)); /* print the 'short name' of the field type */ - if (BIO_printf(bp, "Field Type: %s\n", OBJ_nid2sn(tmp_nid)) - <= 0) + if (BIO_printf(bp, "Field Type: %s\n", OBJ_nid2sn(nid)) <= 0) goto err; - if (is_char_two) { - /* print the 'short name' of the base type OID */ - int basis_type = EC_GROUP_get_basis_type(x); - if (basis_type == 0) - goto err; - - if (!BIO_indent(bp, off, 128)) - goto err; - - if (BIO_printf(bp, "Basis Type: %s\n", - OBJ_nid2sn(basis_type)) <= 0) - goto err; - - /* print the polynomial */ - if ((p != NULL) && !ASN1_bn_print(bp, "Polynomial:", p, buffer, - off)) - goto err; - } else { - if ((p != NULL) && !ASN1_bn_print(bp, "Prime:", p, buffer, off)) - goto err; - } + if ((p != NULL) && !ASN1_bn_print(bp, "Prime:", p, buffer, off)) + goto err; if ((a != NULL) && !ASN1_bn_print(bp, "A: ", a, buffer, off)) goto err; if ((b != NULL) && !ASN1_bn_print(bp, "B: ", b, buffer, off)) diff --git a/lib/libssl/ssl_kex.c b/lib/libssl/ssl_kex.c index cab2f1c78..85caf25e3 100644 --- a/lib/libssl/ssl_kex.c +++ b/lib/libssl/ssl_kex.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ssl_kex.c,v 1.10 2022/01/14 09:11:22 tb Exp $ */ +/* $OpenBSD: ssl_kex.c,v 1.11 2023/06/27 11:03:41 tb Exp $ */ /* * Copyright (c) 2020, 2021 Joel Sing * @@ -63,17 +63,17 @@ ssl_kex_generate_dhe_params_auto(DH *dh, size_t key_bits) int ret = 0; if (key_bits >= 8192) - p = get_rfc3526_prime_8192(NULL); + p = BN_get_rfc3526_prime_8192(NULL); else if (key_bits >= 4096) - p = get_rfc3526_prime_4096(NULL); + p = BN_get_rfc3526_prime_4096(NULL); else if (key_bits >= 3072) - p = get_rfc3526_prime_3072(NULL); + p = BN_get_rfc3526_prime_3072(NULL); else if (key_bits >= 2048) - p = get_rfc3526_prime_2048(NULL); + p = BN_get_rfc3526_prime_2048(NULL); else if (key_bits >= 1536) - p = get_rfc3526_prime_1536(NULL); + p = BN_get_rfc3526_prime_1536(NULL); else - p = get_rfc2409_prime_1024(NULL); + p = BN_get_rfc2409_prime_1024(NULL); if (p == NULL) goto err; diff --git a/regress/sys/kern/xonly/xonly.c b/regress/sys/kern/xonly/xonly.c index 89268d947..c54b97c91 100644 --- a/regress/sys/kern/xonly/xonly.c +++ b/regress/sys/kern/xonly/xonly.c @@ -1,4 +1,4 @@ -/* $OpenBSD: xonly.c,v 1.1 2023/01/18 19:18:49 anton Exp $ */ +/* $OpenBSD: xonly.c,v 1.2 2023/06/26 19:03:03 guenther Exp $ */ #include #include @@ -26,6 +26,8 @@ void *setup_mmap_nrx(void); void *setup_mmap_nwx(void); void *setup_mmap_xnwx(void); +char ***_csu_finish(char **_argv, char **_envp, void (*_cleanup)(void)); + struct outcome { int uu; int ku; @@ -46,11 +48,11 @@ struct readable { { "mmap nwx", setup_mmap_nwx, 0, NULL, 0, {} }, { "mmap xnwx", setup_mmap_xnwx, 0, NULL, 0, {} }, { "main", NULL, 1, &main, 0, {} }, - { "libc", NULL, 1, &open, 0, {} }, + { "libc", NULL, 1, &_csu_finish, 0, {} }, }; static struct outcome expectations[2][8] = { -#if defined(__aarch64__) +#if defined(__aarch64__) || defined(__amd64__) [0] = { /* ld.so */ { UNREADABLE, UNREADABLE }, /* mmap xz */ { UNREADABLE, UNREADABLE }, @@ -61,20 +63,21 @@ static struct outcome expectations[2][8] = { /* main */ { UNREADABLE, UNREADABLE }, /* libc */ { UNREADABLE, UNREADABLE }, }, -#elif defined(__amd64__) +#else +#error "unknown architecture" +#endif +#if defined(__amd64__) /* PKU not available. */ - [0] = { - /* ld.so */ { READABLE, READABLE }, + [1] = { + /* ld.so */ { READABLE, UNREADABLE }, /* mmap xz */ { UNREADABLE, UNREADABLE }, /* mmap x */ { READABLE, READABLE }, /* mmap nrx */ { READABLE, READABLE }, /* mmap nwx */ { READABLE, READABLE }, /* mmap xnwx */ { READABLE, READABLE }, - /* main */ { READABLE, READABLE }, - /* libc */ { READABLE, READABLE }, + /* main */ { READABLE, UNREADABLE }, + /* libc */ { READABLE, UNREADABLE }, }, -#else -#error "unknown architecture" #endif }; @@ -186,6 +189,17 @@ main(void) size_t i; int p[2]; int error = 0; + const struct outcome *desires = expectations[0]; + +#if defined(__amd64__) + { + uint32_t ebx, ecx, edx; + asm("cpuid" : "=b" (ebx), "=c" (ecx), "=d" (edx) : "a" (7), "c" (0)); + if ((ecx & 8) == 0) /* SEFF0ECX_PKU */ + desires = expectations[1]; + } +#endif + signal(SIGSEGV, sigsegv); signal(SIGBUS, sigsegv); @@ -222,7 +236,7 @@ main(void) printf("%-16s %18p %-12s %-12s\n", r->name, r->addr, "skipped", "skipped"); } else { - const struct outcome *want = &expectations[0][i]; + const struct outcome *want = &desires[i]; if (r->got.uu != want->uu || r->got.ku != want->ku) error++; diff --git a/regress/usr.sbin/rpki-client/aspa/2338bd30cba1ff30fe3cf930824f39b45569d458de356729cb0121400ee3616a.asa b/regress/usr.sbin/rpki-client/aspa/2338bd30cba1ff30fe3cf930824f39b45569d458de356729cb0121400ee3616a.asa deleted file mode 100644 index f5754d6c8..000000000 Binary files a/regress/usr.sbin/rpki-client/aspa/2338bd30cba1ff30fe3cf930824f39b45569d458de356729cb0121400ee3616a.asa and /dev/null differ diff --git a/regress/usr.sbin/rpki-client/aspa/5c67c85c9fbdf4daea0034480c2c3da10ef241738cb4f5a16e6cf60ec812713d.asa b/regress/usr.sbin/rpki-client/aspa/5c67c85c9fbdf4daea0034480c2c3da10ef241738cb4f5a16e6cf60ec812713d.asa deleted file mode 100644 index f08316f55..000000000 Binary files a/regress/usr.sbin/rpki-client/aspa/5c67c85c9fbdf4daea0034480c2c3da10ef241738cb4f5a16e6cf60ec812713d.asa and /dev/null differ diff --git a/regress/usr.sbin/rpki-client/aspa/5m80fwYws_3FiFD7JiQjAqZ1RYQ.asa b/regress/usr.sbin/rpki-client/aspa/5m80fwYws_3FiFD7JiQjAqZ1RYQ.asa new file mode 100644 index 000000000..e9884ecfe Binary files /dev/null and b/regress/usr.sbin/rpki-client/aspa/5m80fwYws_3FiFD7JiQjAqZ1RYQ.asa differ diff --git a/regress/usr.sbin/rpki-client/aspa/63bbc4571294a06f5e7533166179bafcb0252e0484708e6d45924e1e479c8636.asa b/regress/usr.sbin/rpki-client/aspa/63bbc4571294a06f5e7533166179bafcb0252e0484708e6d45924e1e479c8636.asa deleted file mode 100644 index 961793647..000000000 Binary files a/regress/usr.sbin/rpki-client/aspa/63bbc4571294a06f5e7533166179bafcb0252e0484708e6d45924e1e479c8636.asa and /dev/null differ diff --git a/regress/usr.sbin/rpki-client/aspa/AS1000.asa b/regress/usr.sbin/rpki-client/aspa/AS1000.asa new file mode 100644 index 000000000..88421771f Binary files /dev/null and b/regress/usr.sbin/rpki-client/aspa/AS1000.asa differ diff --git a/regress/usr.sbin/rpki-client/aspa/c27f17d94c8a2f9e4c6d07e69f58c33c48c28c77ff602040e02bb19f6ffd3dfd.asa b/regress/usr.sbin/rpki-client/aspa/c27f17d94c8a2f9e4c6d07e69f58c33c48c28c77ff602040e02bb19f6ffd3dfd.asa deleted file mode 100644 index cbd61d598..000000000 Binary files a/regress/usr.sbin/rpki-client/aspa/c27f17d94c8a2f9e4c6d07e69f58c33c48c28c77ff602040e02bb19f6ffd3dfd.asa and /dev/null differ diff --git a/regress/usr.sbin/rpki-client/aspa/d6915eb78c75cab0bc46b48568232ec971819eab2b0009060c463f636bd7c204.asa b/regress/usr.sbin/rpki-client/aspa/d6915eb78c75cab0bc46b48568232ec971819eab2b0009060c463f636bd7c204.asa deleted file mode 100644 index 30a08a917..000000000 Binary files a/regress/usr.sbin/rpki-client/aspa/d6915eb78c75cab0bc46b48568232ec971819eab2b0009060c463f636bd7c204.asa and /dev/null differ diff --git a/sys/arch/amd64/include/profile.h b/sys/arch/amd64/include/profile.h index 7f63b92c8..cee883809 100644 --- a/sys/arch/amd64/include/profile.h +++ b/sys/arch/amd64/include/profile.h @@ -1,4 +1,4 @@ -/* $OpenBSD: profile.h,v 1.5 2021/09/04 22:15:33 bluhm Exp $ */ +/* $OpenBSD: profile.h,v 1.6 2023/06/27 10:11:15 cheloha Exp $ */ /* $NetBSD: profile.h,v 1.3 2003/11/28 23:22:45 fvdl Exp $ */ /* @@ -72,6 +72,6 @@ __asm(" .globl __mcount \n" \ #ifdef _KERNEL -#define MCOUNT_ENTER (void)&s; __asm__("cli"); -#define MCOUNT_EXIT __asm__("sti"); +#define MCOUNT_ENTER s = intr_disable() +#define MCOUNT_EXIT intr_restore(s) #endif /* _KERNEL */ diff --git a/sys/dev/pci/if_iwx.c b/sys/dev/pci/if_iwx.c index 407a0616a..8fe16a7f7 100644 --- a/sys/dev/pci/if_iwx.c +++ b/sys/dev/pci/if_iwx.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_iwx.c,v 1.172 2023/06/21 23:24:10 mlarkin Exp $ */ +/* $OpenBSD: if_iwx.c,v 1.173 2023/06/27 15:31:27 stsp Exp $ */ /* * Copyright (c) 2014, 2016 genua gmbh @@ -10430,6 +10430,7 @@ static const struct pci_matchid iwx_devices[] = { /* _14 is an MA device, not yet supported */ { PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_WL_22500_15,}, { PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_WL_22500_16,}, + { PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_WL_22500_17,}, }; @@ -10520,6 +10521,8 @@ static const struct iwx_dev_info iwx_dev_info_table[] = { IWX_DEV_INFO(0x2725, 0x1674, iwx_2ax_cfg_ty_gf_a0), /* killer_1675x */ IWX_DEV_INFO(0x51f0, 0x1691, iwx_2ax_cfg_so_gf4_a0), /* killer_1690s */ IWX_DEV_INFO(0x51f0, 0x1692, iwx_2ax_cfg_so_gf4_a0), /* killer_1690i */ + IWX_DEV_INFO(0x51f1, 0x1691, iwx_2ax_cfg_so_gf4_a0), + IWX_DEV_INFO(0x51f1, 0x1692, iwx_2ax_cfg_so_gf4_a0), IWX_DEV_INFO(0x54f0, 0x1691, iwx_2ax_cfg_so_gf4_a0), /* killer_1690s */ IWX_DEV_INFO(0x54f0, 0x1692, iwx_2ax_cfg_so_gf4_a0), /* killer_1690i */ IWX_DEV_INFO(0x7a70, 0x0090, iwx_2ax_cfg_so_gf_a0_long), @@ -11122,7 +11125,6 @@ iwx_attach(struct device *parent, struct device *self, void *aux) case PCI_PRODUCT_INTEL_WL_22500_9: case PCI_PRODUCT_INTEL_WL_22500_10: case PCI_PRODUCT_INTEL_WL_22500_11: - case PCI_PRODUCT_INTEL_WL_22500_12: case PCI_PRODUCT_INTEL_WL_22500_13: /* _14 is an MA device, not yet supported */ case PCI_PRODUCT_INTEL_WL_22500_15: @@ -11137,6 +11139,19 @@ iwx_attach(struct device *parent, struct device *self, void *aux) sc->sc_tx_with_siso_diversity = 0; sc->sc_uhb_supported = 1; break; + case PCI_PRODUCT_INTEL_WL_22500_12: + case PCI_PRODUCT_INTEL_WL_22500_17: + sc->sc_fwname = IWX_SO_A_GF_A_FW; + sc->sc_pnvm_name = IWX_SO_A_GF_A_PNVM; + sc->sc_device_family = IWX_DEVICE_FAMILY_AX210; + sc->sc_integrated = 1; + sc->sc_ltr_delay = IWX_SOC_FLAGS_LTR_APPLY_DELAY_2500; + sc->sc_low_latency_xtal = 1; + sc->sc_xtal_latency = 12000; + sc->sc_tx_with_siso_diversity = 0; + sc->sc_uhb_supported = 0; + sc->sc_imr_enabled = 1; + break; default: printf("%s: unknown adapter type\n", DEVNAME(sc)); return; diff --git a/sys/dev/pci/pcidevs b/sys/dev/pci/pcidevs index b26041f94..62fb70b73 100644 --- a/sys/dev/pci/pcidevs +++ b/sys/dev/pci/pcidevs @@ -1,4 +1,4 @@ -$OpenBSD: pcidevs,v 1.2039 2023/06/13 02:43:39 jcs Exp $ +$OpenBSD: pcidevs,v 1.2040 2023/06/27 15:30:25 stsp Exp $ /* $NetBSD: pcidevs,v 1.30 1997/06/24 06:20:24 thorpej Exp $ */ /* @@ -5875,6 +5875,7 @@ product INTEL 600SERIES_LP_XHCI 0x51ed 600 Series xHCI product INTEL 600SERIES_LP_XDCI 0x51ee 600 Series xDCI product INTEL 600SERIES_LP_SRAM 0x51ef 600 Series SRAM product INTEL WL_22500_11 0x51f0 Wi-Fi 6 AX211 +product INTEL WL_22500_17 0x51f1 Wi-Fi 6 AX211 product INTEL 600SERIES_LP_GSPI_2 0x51fb 600 Series GSPI product INTEL 600SERIES_LP_ISH 0x51fc 600 Series ISH product INTEL 600SERIES_LP_UFS 0x51ff 600 Series UFS diff --git a/sys/dev/pci/pcidevs.h b/sys/dev/pci/pcidevs.h index 1bb0e95df..31843d0c0 100644 --- a/sys/dev/pci/pcidevs.h +++ b/sys/dev/pci/pcidevs.h @@ -2,7 +2,7 @@ * THIS FILE AUTOMATICALLY GENERATED. DO NOT EDIT. * * generated from: - * OpenBSD: pcidevs,v 1.2039 2023/06/13 02:43:39 jcs Exp + * OpenBSD: pcidevs,v 1.2040 2023/06/27 15:30:25 stsp Exp */ /* $NetBSD: pcidevs,v 1.30 1997/06/24 06:20:24 thorpej Exp $ */ @@ -5880,6 +5880,7 @@ #define PCI_PRODUCT_INTEL_600SERIES_LP_XDCI 0x51ee /* 600 Series xDCI */ #define PCI_PRODUCT_INTEL_600SERIES_LP_SRAM 0x51ef /* 600 Series SRAM */ #define PCI_PRODUCT_INTEL_WL_22500_11 0x51f0 /* Wi-Fi 6 AX211 */ +#define PCI_PRODUCT_INTEL_WL_22500_17 0x51f1 /* Wi-Fi 6 AX211 */ #define PCI_PRODUCT_INTEL_600SERIES_LP_GSPI_2 0x51fb /* 600 Series GSPI */ #define PCI_PRODUCT_INTEL_600SERIES_LP_ISH 0x51fc /* 600 Series ISH */ #define PCI_PRODUCT_INTEL_600SERIES_LP_UFS 0x51ff /* 600 Series UFS */ diff --git a/sys/dev/pci/pcidevs_data.h b/sys/dev/pci/pcidevs_data.h index 0cc895a90..265a5d6df 100644 --- a/sys/dev/pci/pcidevs_data.h +++ b/sys/dev/pci/pcidevs_data.h @@ -2,7 +2,7 @@ * THIS FILE AUTOMATICALLY GENERATED. DO NOT EDIT. * * generated from: - * OpenBSD: pcidevs,v 1.2039 2023/06/13 02:43:39 jcs Exp + * OpenBSD: pcidevs,v 1.2040 2023/06/27 15:30:25 stsp Exp */ /* $NetBSD: pcidevs,v 1.30 1997/06/24 06:20:24 thorpej Exp $ */ @@ -20875,6 +20875,10 @@ static const struct pci_known_product pci_known_products[] = { PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_WL_22500_11, "Wi-Fi 6 AX211", }, + { + PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_WL_22500_17, + "Wi-Fi 6 AX211", + }, { PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_600SERIES_LP_GSPI_2, "600 Series GSPI", diff --git a/sys/dev/usb/uaudio.c b/sys/dev/usb/uaudio.c index 96ab39d23..d8e300a52 100644 --- a/sys/dev/usb/uaudio.c +++ b/sys/dev/usb/uaudio.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uaudio.c,v 1.172 2022/10/26 20:19:09 kn Exp $ */ +/* $OpenBSD: uaudio.c,v 1.173 2023/06/27 09:28:08 ratchov Exp $ */ /* * Copyright (c) 2018 Alexandre Ratchov * @@ -2216,7 +2216,7 @@ uaudio_process_ac(struct uaudio_softc *sc, struct uaudio_blob *p, int ifnum) &u->rates)) { printf("%s: failed to read clock rates\n", DEVNAME(sc)); - return 1; + return 0; } #ifdef UAUDIO_DEBUG if (uaudio_debug) { diff --git a/sys/kern/kern_timeout.c b/sys/kern/kern_timeout.c index 3af064086..0df0ac73e 100644 --- a/sys/kern/kern_timeout.c +++ b/sys/kern/kern_timeout.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kern_timeout.c,v 1.90 2022/12/31 16:06:24 cheloha Exp $ */ +/* $OpenBSD: kern_timeout.c,v 1.91 2023/06/26 16:26:20 cheloha Exp $ */ /* * Copyright (c) 2001 Thomas Nordin * Copyright (c) 2000-2001 Artur Grabowski @@ -542,13 +542,11 @@ timeout_hardclock_update(void) { struct timespec elapsed, now; struct kclock *kc; - struct timespec *lastscan; - int b, done, first, i, last, level, need_softclock, off; + struct timespec *lastscan = &timeout_kclock[KCLOCK_UPTIME].kc_lastscan; + int b, done, first, i, last, level, need_softclock = 1, off; nanouptime(&now); - lastscan = &timeout_kclock[KCLOCK_UPTIME].kc_lastscan; timespecsub(&now, lastscan, &elapsed); - need_softclock = 1; mtx_enter(&timeout_mutex); diff --git a/usr.sbin/btrace/bt.5 b/usr.sbin/btrace/bt.5 index ab76ea4f4..12ae54c71 100644 --- a/usr.sbin/btrace/bt.5 +++ b/usr.sbin/btrace/bt.5 @@ -1,4 +1,4 @@ -.\" $OpenBSD: bt.5,v 1.14 2022/03/31 17:27:29 naddy Exp $ +.\" $OpenBSD: bt.5,v 1.15 2023/06/27 14:13:33 claudio Exp $ .\" .\" Copyright (c) 2019 Martin Pieuchot .\" @@ -14,7 +14,7 @@ .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" -.Dd $Mdocdate: March 31 2022 $ +.Dd $Mdocdate: June 27 2023 $ .Dt BT 5 .Os .Sh NAME @@ -111,8 +111,8 @@ Full name of the probe. Return value of the traced syscall. .It Va tid Thread ID of the current thread. -.\".It Va ustack -.\"Userland stack of the current thread. +.It Va ustack +Userland stack of the current thread. .El .Pp Functions: @@ -141,10 +141,6 @@ and with buckets of .Va step size. -.It Fn max -Returns the maximum recorded value. -.It Fn min -Returns the minimum recorded value. .It Fn print "@map" Print all pairs from .Va @map . @@ -162,8 +158,6 @@ Return the string from argument truncated to .Va index characters (up to 64, the default) including a guaranteed NUL-terminator. -.It Fn sum -Returns the sum of all recorded values. .It Fn time timefmt Print timestamps using .Xr strftime 3 . @@ -172,6 +166,23 @@ Set all values from .Va @map to 0. .El +.Pp +The following functions only work on a sepcific map entry. +.Bl -tag -width "lhist(value, min, max, step)" +.It "@map[key]" = Fn count +Increase the stored value for +.Va key +by one. +.It "@map[key]" = Fn max "value" +Store the maximum recorded value for +.Va key . +.It "@map[key]" = Fn min "value" +Store the minimum recorded value for +.Va key . +.It "@map[key]" = Fn sum "value" +Store the sum of all recorded values for +.Va key . +.El .Sh SEE ALSO .Xr awk 1 , .Xr dt 4 , diff --git a/usr.sbin/btrace/btrace.c b/usr.sbin/btrace/btrace.c index 21c91884a..25333f985 100644 --- a/usr.sbin/btrace/btrace.c +++ b/usr.sbin/btrace/btrace.c @@ -1,4 +1,4 @@ -/* $OpenBSD: btrace.c,v 1.70 2023/05/12 14:14:16 claudio Exp $ */ +/* $OpenBSD: btrace.c,v 1.71 2023/06/27 14:17:00 claudio Exp $ */ /* * Copyright (c) 2019 - 2021 Martin Pieuchot @@ -450,6 +450,37 @@ rules_do(int fd) } } +static uint64_t +rules_action_scan(struct bt_stmt *bs) +{ + struct bt_arg *ba; + uint64_t evtflags = 0; + + while (bs != NULL) { + SLIST_FOREACH(ba, &bs->bs_args, ba_next) + evtflags |= ba2dtflags(ba); + + /* Also check the value for map/hist insertion */ + switch (bs->bs_act) { + case B_AC_BUCKETIZE: + case B_AC_INSERT: + ba = (struct bt_arg *)bs->bs_var; + evtflags |= ba2dtflags(ba); + break; + case B_AC_TEST: + evtflags |= rules_action_scan( + (struct bt_stmt *)bs->bs_var); + break; + default: + break; + } + + bs = SLIST_NEXT(bs, bs_next); + } + + return evtflags; +} + void rules_setup(int fd) { @@ -474,21 +505,7 @@ rules_setup(int fd) evtflags |= ba2dtflags(ba); } - SLIST_FOREACH(bs, &r->br_action, bs_next) { - SLIST_FOREACH(ba, &bs->bs_args, ba_next) - evtflags |= ba2dtflags(ba); - - /* Also check the value for map/hist insertion */ - switch (bs->bs_act) { - case B_AC_BUCKETIZE: - case B_AC_INSERT: - ba = (struct bt_arg *)bs->bs_var; - evtflags |= ba2dtflags(ba); - break; - default: - break; - } - } + evtflags |= rules_action_scan(SLIST_FIRST(&r->br_action)); SLIST_FOREACH(bp, &r->br_probes, bp_next) { debug("parsed probe '%s'", debug_probe_name(bp)); @@ -1685,10 +1702,17 @@ ba2dtflags(struct bt_arg *ba) long bacmp(struct bt_arg *a, struct bt_arg *b) { - assert(a->ba_type == b->ba_type); - assert(a->ba_type == B_AT_LONG); + if (a->ba_type != b->ba_type) + return a->ba_type - b->ba_type; - return ba2long(a, NULL) - ba2long(b, NULL); + switch (a->ba_type) { + case B_AT_LONG: + return ba2long(a, NULL) - ba2long(b, NULL); + case B_AT_STR: + return strcmp(ba2str(a, NULL), ba2str(b, NULL)); + default: + errx(1, "no compare support for type %d", a->ba_type); + } } __dead void diff --git a/usr.sbin/btrace/map.c b/usr.sbin/btrace/map.c index c35d2a4fb..be416e226 100644 --- a/usr.sbin/btrace/map.c +++ b/usr.sbin/btrace/map.c @@ -1,4 +1,4 @@ -/* $OpenBSD: map.c,v 1.20 2022/04/30 01:29:05 tedu Exp $ */ +/* $OpenBSD: map.c,v 1.21 2023/06/27 14:17:00 claudio Exp $ */ /* * Copyright (c) 2020 Martin Pieuchot @@ -176,6 +176,11 @@ map_insert(struct map *map, const char *key, struct bt_arg *bval, val += ba2long(bval->ba_value, dtev); mep->mval->ba_value = (void *)val; break; + case B_AT_BI_KSTACK: + case B_AT_BI_USTACK: + free(mep->mval); + mep->mval = ba_new(ba2str(bval, dtev), B_AT_STR); + break; default: errx(1, "no insert support for type %d", bval->ba_type); } diff --git a/usr.sbin/pkg_add/OpenBSD/PkgAdd.pm b/usr.sbin/pkg_add/OpenBSD/PkgAdd.pm index 8de3f3c8e..d7d02430f 100644 --- a/usr.sbin/pkg_add/OpenBSD/PkgAdd.pm +++ b/usr.sbin/pkg_add/OpenBSD/PkgAdd.pm @@ -1,7 +1,7 @@ #! /usr/bin/perl # ex:ts=8 sw=4: -# $OpenBSD: PkgAdd.pm,v 1.141 2023/06/13 09:07:17 espie Exp $ +# $OpenBSD: PkgAdd.pm,v 1.142 2023/06/27 11:11:46 espie Exp $ # # Copyright (c) 2003-2014 Marc Espie # @@ -906,12 +906,7 @@ sub newer_is_bad_arch($set, $state) sub may_tie_files($set, $state) { -<<<<<<< PkgAdd.pm - my ($set, $state) = @_; if ($set->newer > 0 && $set->older_to_do > 0 && -======= - if ($set->newer > 0 && $set->older_to_do > 0 && ->>>>>>> 1.141 !$state->defines('donttie')) { my $sha = {}; @@ -1186,7 +1181,6 @@ sub process_parameters($self, $state) if (@ARGV == 0) { @ARGV = sort(installed_packages()); - $state->{allupdates} = 1; } my $inst = $state->repo->installed; for my $pkgname (@ARGV) { diff --git a/usr.sbin/rpki-client/aspa.c b/usr.sbin/rpki-client/aspa.c index 1fdd3cb84..07448fabe 100644 --- a/usr.sbin/rpki-client/aspa.c +++ b/usr.sbin/rpki-client/aspa.c @@ -1,4 +1,4 @@ -/* $OpenBSD: aspa.c,v 1.18 2023/06/07 10:46:34 job Exp $ */ +/* $OpenBSD: aspa.c,v 1.19 2023/06/26 18:39:53 job Exp $ */ /* * Copyright (c) 2022 Job Snijders * Copyright (c) 2022 Theo Buehler @@ -46,33 +46,16 @@ extern ASN1_OBJECT *aspa_oid; * Types and templates for ASPA eContent draft-ietf-sidrops-aspa-profile-08 */ -typedef struct { - ASN1_INTEGER *providerASID; - ASN1_OCTET_STRING *afiLimit; -} ProviderAS; - -DECLARE_STACK_OF(ProviderAS); - -#ifndef DEFINE_STACK_OF -#define sk_ProviderAS_num(sk) SKM_sk_num(ProviderAS, (sk)) -#define sk_ProviderAS_value(sk, i) SKM_sk_value(ProviderAS, (sk), (i)) -#endif - -ASN1_SEQUENCE(ProviderAS) = { - ASN1_SIMPLE(ProviderAS, providerASID, ASN1_INTEGER), - ASN1_OPT(ProviderAS, afiLimit, ASN1_OCTET_STRING), -} ASN1_SEQUENCE_END(ProviderAS); - typedef struct { ASN1_INTEGER *version; ASN1_INTEGER *customerASID; - STACK_OF(ProviderAS) *providers; + STACK_OF(ASN1_INTEGER) *providers; } ASProviderAttestation; ASN1_SEQUENCE(ASProviderAttestation) = { ASN1_EXP_OPT(ASProviderAttestation, version, ASN1_INTEGER, 0), ASN1_SIMPLE(ASProviderAttestation, customerASID, ASN1_INTEGER), - ASN1_SEQUENCE_OF(ASProviderAttestation, providers, ProviderAS), + ASN1_SEQUENCE_OF(ASProviderAttestation, providers, ASN1_INTEGER), } ASN1_SEQUENCE_END(ASProviderAttestation); DECLARE_ASN1_FUNCTIONS(ASProviderAttestation); @@ -83,13 +66,13 @@ IMPLEMENT_ASN1_FUNCTIONS(ASProviderAttestation); * Return zero on failure, non-zero on success. */ static int -aspa_parse_providers(struct parse *p, const STACK_OF(ProviderAS) *providers) +aspa_parse_providers(struct parse *p, const STACK_OF(ASN1_INTEGER) *providers) { - ProviderAS *pa; - struct aspa_provider provider; + const ASN1_INTEGER *pa; + uint32_t provider; size_t providersz, i; - if ((providersz = sk_ProviderAS_num(providers)) == 0) { + if ((providersz = sk_ASN1_INTEGER_num(providers)) == 0) { warnx("%s: ASPA: ProviderASSet needs at least one entry", p->fn); return 0; @@ -106,39 +89,33 @@ aspa_parse_providers(struct parse *p, const STACK_OF(ProviderAS) *providers) err(1, NULL); for (i = 0; i < providersz; i++) { - pa = sk_ProviderAS_value(providers, i); + pa = sk_ASN1_INTEGER_value(providers, i); memset(&provider, 0, sizeof(provider)); - if (!as_id_parse(pa->providerASID, &provider.as)) { + if (!as_id_parse(pa, &provider)) { warnx("%s: ASPA: malformed ProviderAS", p->fn); return 0; } - if (p->res->custasid == provider.as) { + if (p->res->custasid == provider) { warnx("%s: ASPA: CustomerASID can't also be Provider", p->fn); return 0; } if (i > 0) { - if (p->res->providers[i - 1].as > provider.as) { + if (p->res->providers[i - 1] > provider) { warnx("%s: ASPA: invalid ProviderASSet order", p->fn); return 0; } - if (p->res->providers[i - 1].as == provider.as) { + if (p->res->providers[i - 1] == provider) { warnx("%s: ASPA: duplicate ProviderAS", p->fn); return 0; } } - if (pa->afiLimit != NULL && !ip_addr_afi_parse(p->fn, - pa->afiLimit, &provider.afi)) { - warnx("%s: ASPA: invalid afiLimit", p->fn); - return 0; - } - p->res->providers[p->res->providersz++] = provider; } @@ -161,7 +138,7 @@ aspa_parse_econtent(const unsigned char *d, size_t dsz, struct parse *p) goto out; } - if (!valid_econtent_version(p->fn, aspa->version, 0)) + if (!valid_econtent_version(p->fn, aspa->version, 1)) goto out; if (!as_id_parse(aspa->customerASID, &p->res->custasid)) { @@ -314,8 +291,7 @@ aspa_read(struct ibuf *b) io_read_buf(b, &p->expires, sizeof(p->expires)); io_read_buf(b, &p->providersz, sizeof(size_t)); - if ((p->providers = calloc(p->providersz, - sizeof(struct aspa_provider))) == NULL) + if ((p->providers = calloc(p->providersz, sizeof(uint32_t))) == NULL) err(1, NULL); io_read_buf(b, p->providers, p->providersz * sizeof(p->providers[0])); @@ -328,12 +304,12 @@ aspa_read(struct ibuf *b) } /* - * Insert a new aspa_provider at index idx in the struct vap v. + * Insert a new uint32_t at index idx in the struct vap v. * All elements in the provider array from idx are moved up by one * to make space for the new element. */ static void -insert_vap(struct vap *v, uint32_t idx, struct aspa_provider *p) +insert_vap(struct vap *v, uint32_t idx, uint32_t *p) { if (idx < v->providersz) memmove(v->providers + idx + 1, v->providers + idx, @@ -391,21 +367,15 @@ aspa_insert_vaps(struct vap_tree *tree, struct aspa *aspa, struct repo *rp) */ for (i = 0, j = 0; i < aspa->providersz; ) { if (j == v->providersz || - aspa->providers[i].as < v->providers[j].as) { + aspa->providers[i] < v->providers[j]) { /* merge provider from aspa into v */ repo_stat_inc(rp, v->talid, RTYPE_ASPA, - STYPE_BOTH + aspa->providers[i].afi); + STYPE_BOTH + aspa->providers[i]); insert_vap(v, j, &aspa->providers[i]); i++; - } else if (aspa->providers[i].as == v->providers[j].as) { - /* duplicate provider, merge afi */ - if (v->providers[j].afi != aspa->providers[i].afi) { - repo_stat_inc(rp, v->talid, RTYPE_ASPA, - STYPE_BOTH + aspa->providers[i].afi); - v->providers[j].afi = 0; - } + } else if (aspa->providers[i] == v->providers[j]) i++; - } + if (j < v->providersz) j++; } diff --git a/usr.sbin/rpki-client/extern.h b/usr.sbin/rpki-client/extern.h index abc945c41..142442c37 100644 --- a/usr.sbin/rpki-client/extern.h +++ b/usr.sbin/rpki-client/extern.h @@ -1,4 +1,4 @@ -/* $OpenBSD: extern.h,v 1.185 2023/06/23 11:36:24 claudio Exp $ */ +/* $OpenBSD: extern.h,v 1.186 2023/06/26 18:39:53 job Exp $ */ /* * Copyright (c) 2019 Kristaps Dzonsons * @@ -351,11 +351,6 @@ struct gbr { int talid; /* TAL the GBR is chained up to */ }; -struct aspa_provider { - uint32_t as; - enum afi afi; -}; - /* * A single ASPA record */ @@ -367,7 +362,7 @@ struct aspa { char *sia; /* SIA signedObject */ char *ski; /* SKI */ uint32_t custasid; /* the customerASID */ - struct aspa_provider *providers; /* the providers */ + uint32_t *providers; /* the providers */ size_t providersz; /* number of providers */ time_t signtime; /* CMS signing-time attribute */ time_t notbefore; /* EE cert's Not Before */ @@ -382,7 +377,7 @@ struct aspa { struct vap { RB_ENTRY(vap) entry; uint32_t custasid; - struct aspa_provider *providers; + uint32_t *providers; size_t providersz; time_t expires; int talid; diff --git a/usr.sbin/rpki-client/output-bgpd.c b/usr.sbin/rpki-client/output-bgpd.c index 5709ec77f..1207f46d5 100644 --- a/usr.sbin/rpki-client/output-bgpd.c +++ b/usr.sbin/rpki-client/output-bgpd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: output-bgpd.c,v 1.27 2023/04/19 19:26:26 job Exp $ */ +/* $OpenBSD: output-bgpd.c,v 1.28 2023/06/26 18:39:53 job Exp $ */ /* * Copyright (c) 2019 Kristaps Dzonsons * @@ -63,18 +63,8 @@ output_bgpd(FILE *out, struct vrp_tree *vrps, struct brk_tree *brks, (long long)vap->expires) < 0) return -1; for (i = 0; i < vap->providersz; i++) { - if (fprintf(out, "%u", vap->providers[i].as) < 0) + if (fprintf(out, "%u", vap->providers[i]) < 0) return -1; - switch (vap->providers[i].afi) { - case AFI_IPV4: - if (fprintf(out, " inet") < 0) - return -1; - break; - case AFI_IPV6: - if (fprintf(out, " inet6") < 0) - return -1; - break; - } if (i + 1 < vap->providersz) if (fprintf(out, ", ") < 0) return -1; diff --git a/usr.sbin/rpki-client/output-json.c b/usr.sbin/rpki-client/output-json.c index dce33e631..ddb8b8cda 100644 --- a/usr.sbin/rpki-client/output-json.c +++ b/usr.sbin/rpki-client/output-json.c @@ -1,4 +1,4 @@ -/* $OpenBSD: output-json.c,v 1.39 2023/06/05 14:19:13 claudio Exp $ */ +/* $OpenBSD: output-json.c,v 1.40 2023/06/26 18:39:53 job Exp $ */ /* * Copyright (c) 2019 Claudio Jeker * @@ -82,24 +82,18 @@ outputheader_json(struct stats *st) } static void -print_vap(struct vap *v, enum afi afi) +print_vap(struct vap *v) { size_t i; - int found = 0; json_do_object("aspa", 1); json_do_int("customer_asid", v->custasid); json_do_int("expires", v->expires); json_do_array("providers"); - for (i = 0; i < v->providersz; i++) { - if (v->providers[i].afi != 0 && v->providers[i].afi != afi) - continue; - found = 1; - json_do_int("provider", v->providers[i].as); - } - if (!found) - json_do_int("provider", 0); + for (i = 0; i < v->providersz; i++) + json_do_int("provider", v->providers[i]); + json_do_end(); } @@ -108,18 +102,9 @@ output_aspa(struct vap_tree *vaps) { struct vap *v; - json_do_object("provider_authorizations", 0); - - json_do_array("ipv4"); - RB_FOREACH(v, vap_tree, vaps) { - print_vap(v, AFI_IPV4); - } - json_do_end(); - - json_do_array("ipv6"); - RB_FOREACH(v, vap_tree, vaps) { - print_vap(v, AFI_IPV6); - } + json_do_array("aspas"); + RB_FOREACH(v, vap_tree, vaps) + print_vap(v); json_do_end(); } diff --git a/usr.sbin/rpki-client/print.c b/usr.sbin/rpki-client/print.c index 1b58bf20a..5221d29d2 100644 --- a/usr.sbin/rpki-client/print.c +++ b/usr.sbin/rpki-client/print.c @@ -1,4 +1,4 @@ -/* $OpenBSD: print.c,v 1.40 2023/06/05 14:19:13 claudio Exp $ */ +/* $OpenBSD: print.c,v 1.41 2023/06/26 18:39:53 job Exp $ */ /* * Copyright (c) 2021 Claudio Jeker * Copyright (c) 2019 Kristaps Dzonsons @@ -613,59 +613,23 @@ rsc_print(const X509 *x, const struct rsc *p) } static void -aspa_provider(uint32_t as, enum afi afi) +aspa_provider(uint32_t as) { if (outformats & FORMAT_JSON) { json_do_object("aspa", 1); json_do_uint("asid", as); - if (afi == AFI_IPV4) - json_do_string("afi_limit", "ipv4"); - if (afi == AFI_IPV6) - json_do_string("afi_limit", "ipv6"); json_do_end(); } else { printf("AS: %u", as); - if (afi == AFI_IPV4) - printf(" (IPv4 only)"); - if (afi == AFI_IPV6) - printf(" (IPv6 only)"); printf("\n"); } } -static void -aspa_providers(const struct aspa *a) -{ - size_t i; - int hasv4 = 0, hasv6 = 0; - - for (i = 0; i < a->providersz; i++) { - if ((outformats & FORMAT_JSON) == 0 && i > 0) - printf("%26s", ""); - aspa_provider(a->providers[i].as, a->providers[i].afi); - - switch (a->providers[i].afi) { - case AFI_IPV4: - hasv4 = 1; - break; - case AFI_IPV6: - hasv6 = 1; - break; - default: - hasv4 = hasv6 = 1; - break; - } - } - - if (!hasv4) - aspa_provider(0, AFI_IPV4); - if (!hasv6) - aspa_provider(0, AFI_IPV6); -} - void aspa_print(const X509 *x, const struct aspa *p) { + size_t i; + if (outformats & FORMAT_JSON) { json_do_string("type", "aspa"); json_do_string("ski", pretty_key_id(p->ski)); @@ -697,7 +661,11 @@ aspa_print(const X509 *x, const struct aspa *p) printf("Provider set: "); } - aspa_providers(p); + for (i = 0; i < p->providersz; i++) { + if ((outformats & FORMAT_JSON) == 0 && i > 0) + printf("%26s", ""); + aspa_provider(p->providers[i]); + } if (outformats & FORMAT_JSON) json_do_end(); diff --git a/usr.sbin/rpki-client/rpki-client.8 b/usr.sbin/rpki-client/rpki-client.8 index 68e28a453..0644f3309 100644 --- a/usr.sbin/rpki-client/rpki-client.8 +++ b/usr.sbin/rpki-client/rpki-client.8 @@ -1,4 +1,4 @@ -.\" $OpenBSD: rpki-client.8,v 1.96 2023/06/07 16:23:02 job Exp $ +.\" $OpenBSD: rpki-client.8,v 1.97 2023/06/26 18:39:53 job Exp $ .\" .\" Copyright (c) 2019 Kristaps Dzonsons .\" @@ -14,7 +14,7 @@ .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" -.Dd $Mdocdate: June 7 2023 $ +.Dd $Mdocdate: June 26 2023 $ .Dt RPKI-CLIENT 8 .Os .Sh NAME @@ -389,7 +389,7 @@ agreement regarding ARIN service restrictions. .Rs .%T A Profile for Autonomous System Provider Authorization (ASPA) .%U https://datatracker.ietf.org/doc/html/draft-ietf-sidrops-aspa-profile -.%D Jan, 2023 +.%D Jun, 2023 .Re .Pp .Rs