sync code with last improvements from OpenBSD

This commit is contained in:
purplerain 2023-08-23 09:28:13 +00:00
parent c346c8d04f
commit ab8d6e7bca
Signed by: purplerain
GPG Key ID: F42C07F07E2E35B7
7 changed files with 44 additions and 42 deletions

View File

@ -1 +1 @@
# SecBSD 1.3-7d242c1: Fri Aug 11 00:00:00 UTC 2023 (Tezcatlipoca) # SecBSD 1.3-5b707e8: Wed Aug 23 00:00:00 UTC 2023 (Tezcatlipoca)

View File

@ -1,4 +1,4 @@
/* $OpenBSD: cms_lib.c,v 1.19 2023/07/28 10:28:02 tb Exp $ */ /* $OpenBSD: cms_lib.c,v 1.21 2023/08/22 08:59:44 tb Exp $ */
/* /*
* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL * Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
* project. * project.
@ -144,46 +144,43 @@ cms_content_bio(CMS_ContentInfo *cms)
BIO * BIO *
CMS_dataInit(CMS_ContentInfo *cms, BIO *icont) CMS_dataInit(CMS_ContentInfo *cms, BIO *icont)
{ {
BIO *cmsbio, *cont; BIO *cmsbio = NULL, *cont = NULL;
if (icont) if ((cont = icont) == NULL)
cont = icont;
else
cont = cms_content_bio(cms); cont = cms_content_bio(cms);
if (!cont) { if (cont == NULL) {
CMSerror(CMS_R_NO_CONTENT); CMSerror(CMS_R_NO_CONTENT);
return NULL; goto err;
} }
switch (OBJ_obj2nid(cms->contentType)) {
switch (OBJ_obj2nid(cms->contentType)) {
case NID_pkcs7_data: case NID_pkcs7_data:
return cont; return cont;
case NID_pkcs7_signed: case NID_pkcs7_signed:
cmsbio = cms_SignedData_init_bio(cms); if ((cmsbio = cms_SignedData_init_bio(cms)) == NULL)
goto err;
break; break;
case NID_pkcs7_digest: case NID_pkcs7_digest:
cmsbio = cms_DigestedData_init_bio(cms); if ((cmsbio = cms_DigestedData_init_bio(cms)) == NULL)
goto err;
break; break;
case NID_pkcs7_encrypted: case NID_pkcs7_encrypted:
cmsbio = cms_EncryptedData_init_bio(cms); if ((cmsbio = cms_EncryptedData_init_bio(cms)) == NULL)
goto err;
break; break;
case NID_pkcs7_enveloped: case NID_pkcs7_enveloped:
cmsbio = cms_EnvelopedData_init_bio(cms); if ((cmsbio = cms_EnvelopedData_init_bio(cms)) == NULL)
goto err;
break; break;
default: default:
CMSerror(CMS_R_UNSUPPORTED_TYPE); CMSerror(CMS_R_UNSUPPORTED_TYPE);
return NULL; goto err;
} }
if (cmsbio) return BIO_push(cmsbio, cont);
return BIO_push(cmsbio, cont);
if (!icont) err:
if (cont != icont)
BIO_free(cont); BIO_free(cont);
return NULL; return NULL;

View File

@ -1,4 +1,4 @@
/* $OpenBSD: ts_rsp_sign.c,v 1.31 2023/07/07 07:25:21 beck Exp $ */ /* $OpenBSD: ts_rsp_sign.c,v 1.32 2023/08/22 08:09:36 tb Exp $ */
/* Written by Zoltan Glozik (zglozik@stones.com) for the OpenSSL /* Written by Zoltan Glozik (zglozik@stones.com) for the OpenSSL
* project 2002. * project 2002.
*/ */
@ -98,18 +98,21 @@ static ASN1_GENERALIZEDTIME *TS_RESP_set_genTime_with_precision(
static ASN1_INTEGER * static ASN1_INTEGER *
def_serial_cb(struct TS_resp_ctx *ctx, void *data) def_serial_cb(struct TS_resp_ctx *ctx, void *data)
{ {
ASN1_INTEGER *serial = ASN1_INTEGER_new(); ASN1_INTEGER *serial;
if (!serial) if ((serial = ASN1_INTEGER_new()) == NULL)
goto err; goto err;
if (!ASN1_INTEGER_set(serial, 1)) if (!ASN1_INTEGER_set(serial, 1))
goto err; goto err;
return serial; return serial;
err: err:
ASN1_INTEGER_free(serial);
TSerror(ERR_R_MALLOC_FAILURE); TSerror(ERR_R_MALLOC_FAILURE);
TS_RESP_CTX_set_status_info(ctx, TS_STATUS_REJECTION, TS_RESP_CTX_set_status_info(ctx, TS_STATUS_REJECTION,
"Error during serial number generation."); "Error during serial number generation.");
return NULL; return NULL;
} }

View File

@ -1,4 +1,4 @@
/* $OpenBSD: ber.c,v 1.24 2022/11/03 17:58:10 martijn Exp $ */ /* $OpenBSD: ber.c,v 1.25 2023/08/22 12:50:27 gerhard Exp $ */
/* /*
* Copyright (c) 2007, 2012 Reyk Floeter <reyk@openbsd.org> * Copyright (c) 2007, 2012 Reyk Floeter <reyk@openbsd.org>
@ -797,7 +797,7 @@ ober_scanf_elements(struct ber_element *ber, char *fmt, ...)
if (ber->be_encoding != BER_TYPE_SEQUENCE && if (ber->be_encoding != BER_TYPE_SEQUENCE &&
ber->be_encoding != BER_TYPE_SET) ber->be_encoding != BER_TYPE_SET)
goto fail; goto fail;
if (ber->be_sub == NULL || level >= _MAX_SEQ-1) if (level >= _MAX_SEQ-1)
goto fail; goto fail;
parent[++level] = ber; parent[++level] = ber;
ber = ber->be_sub; ber = ber->be_sub;

View File

@ -1,4 +1,4 @@
.\" $OpenBSD: bsd.port.mk.5,v 1.581 2023/08/21 12:54:04 espie Exp $ .\" $OpenBSD: bsd.port.mk.5,v 1.582 2023/08/22 03:51:45 jsg Exp $
.\" .\"
.\" Copyright (c) 2000-2008 Marc Espie .\" Copyright (c) 2000-2008 Marc Espie
.\" .\"
@ -24,7 +24,7 @@
.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
.\" .\"
.Dd $Mdocdate: August 21 2023 $ .Dd $Mdocdate: August 22 2023 $
.Dt BSD.PORT.MK 5 .Dt BSD.PORT.MK 5
.Os .Os
.Sh NAME .Sh NAME
@ -4124,7 +4124,7 @@ Holds the output of
.Xr cksum 1 , .Xr cksum 1 ,
using using
.Xr sha256 1 .Xr sha256 1
for the port's ${DISTFILES*}, ${SUPDISFILES*} and ${PATCHFILES*}, for the port's ${DISTFILES*}, ${SUPDISTFILES*} and ${PATCHFILES*},
as well as the sizes of these files. as well as the sizes of these files.
.It Pa ${DISTDIR}/${CHECKSUMFILES} .It Pa ${DISTDIR}/${CHECKSUMFILES}
Cache of normal distribution files for a given port. Cache of normal distribution files for a given port.

View File

@ -1,4 +1,4 @@
/* $OpenBSD: clock.c,v 1.65 2023/07/25 18:16:20 cheloha Exp $ */ /* $OpenBSD: clock.c,v 1.66 2023/08/22 17:13:22 cheloha Exp $ */
/* $NetBSD: clock.c,v 1.39 1996/05/12 23:11:54 mycroft Exp $ */ /* $NetBSD: clock.c,v 1.39 1996/05/12 23:11:54 mycroft Exp $ */
/*- /*-
@ -430,10 +430,16 @@ i8254_initclocks(void)
clockintr_cpu_init(NULL); clockintr_cpu_init(NULL);
/* When using i8254 for clock, we also use the rtc for profclock */ /*
(void)isa_intr_establish(NULL, 0, IST_PULSE, IPL_CLOCK, * When using i8254 for clock, we also use the rtc for profclock.
*
* These IRQs are not MP-safe, but it is harmless to lie about it
* because we cannot reach this point unless we are only booting
* a single CPU.
*/
(void)isa_intr_establish(NULL, 0, IST_PULSE, IPL_CLOCK | IPL_MPSAFE,
clockintr, 0, "clock"); clockintr, 0, "clock");
(void)isa_intr_establish(NULL, 8, IST_PULSE, IPL_STATCLOCK, (void)isa_intr_establish(NULL, 8, IST_PULSE, IPL_STATCLOCK | IPL_MPSAFE,
rtcintr, 0, "rtc"); rtcintr, 0, "rtc");
rtcstart(); /* start the mc146818 clock */ rtcstart(); /* start the mc146818 clock */

View File

@ -1,4 +1,4 @@
/* $OpenBSD: kern_clock.c,v 1.113 2023/08/12 13:19:28 miod Exp $ */ /* $OpenBSD: kern_clock.c,v 1.114 2023/08/22 13:46:20 jsg Exp $ */
/* $NetBSD: kern_clock.c,v 1.34 1996/06/09 04:51:03 briggs Exp $ */ /* $NetBSD: kern_clock.c,v 1.34 1996/06/09 04:51:03 briggs Exp $ */
/*- /*-
@ -111,13 +111,9 @@ initclocks(void)
void void
hardclock(struct clockframe *frame) hardclock(struct clockframe *frame)
{ {
#if defined(MULTIPROCESSOR) || defined(__hppa__) /* XXX */
struct cpu_info *ci = curcpu();
#endif
#if NDT > 0 #if NDT > 0
DT_ENTER(profile, NULL); DT_ENTER(profile, NULL);
if (CPU_IS_PRIMARY(ci)) if (CPU_IS_PRIMARY(curcpu()))
DT_ENTER(interval, NULL); DT_ENTER(interval, NULL);
#endif #endif
@ -125,7 +121,7 @@ hardclock(struct clockframe *frame)
* If we are not the primary CPU, we're not allowed to do * If we are not the primary CPU, we're not allowed to do
* any more work. * any more work.
*/ */
if (CPU_IS_PRIMARY(ci) == 0) if (CPU_IS_PRIMARY(curcpu()) == 0)
return; return;
tc_ticktock(); tc_ticktock();