sync with OpenBSD -current

This commit is contained in:
purplerain 2024-02-05 01:13:44 +00:00
parent 3f3212838f
commit 36c45cb00b
Signed by: purplerain
GPG key ID: F42C07F07E2E35B7
26 changed files with 324 additions and 349 deletions

View file

@ -46,17 +46,17 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
// NB: Offsets into ctype<char>::_M_table force a particular size
// on the mask type. Because of this, we don't use an enum.
typedef char mask;
static const mask upper = _U;
static const mask lower = _L;
static const mask alpha = _U | _L;
static const mask digit = _N;
static const mask xdigit = _N | _X;
static const mask space = _S;
static const mask print = char(_P | _U | _L | _N | _B);
static const mask graph = _P | _U | _L | _N;
static const mask cntrl = _C;
static const mask punct = _P;
static const mask alnum = _U | _L | _N;
static const mask upper = _CTYPE_U;
static const mask lower = _CTYPE_L;
static const mask alpha = _CTYPE_U | _CTYPE_L;
static const mask digit = _CTYPE_N;
static const mask xdigit = _CTYPE_N | _CTYPE_X;
static const mask space = _CTYPE_S;
static const mask print = char(_CTYPE_P | _CTYPE_U | _CTYPE_L | _CTYPE_N | _CTYPE_B);
static const mask graph = _CTYPE_P | _CTYPE_U | _CTYPE_L | _CTYPE_N;
static const mask cntrl = _CTYPE_C;
static const mask punct = _CTYPE_P;
static const mask alnum = _CTYPE_U | _CTYPE_L | _CTYPE_N;
};
_GLIBCXX_END_NAMESPACE

View file

@ -41,15 +41,15 @@
// NB: Offsets into ctype<char>::_M_table force a particular size
// on the mask type. Because of this, we don't use an enum.
typedef char mask;
static const mask upper = _U;
static const mask lower = _L;
static const mask alpha = _U | _L;
static const mask digit = _N;
static const mask xdigit = _N | _X;
static const mask space = _S;
static const mask print = _P | _U | _L | _N | _B;
static const mask graph = _P | _U | _L | _N;
static const mask cntrl = _C;
static const mask punct = _P;
static const mask alnum = _U | _L | _N;
static const mask upper = _CTYPE_U;
static const mask lower = _CTYPE_L;
static const mask alpha = _CTYPE_U | _CTYPE_L;
static const mask digit = _CTYPE_N;
static const mask xdigit = _CTYPE_N | _CTYPE_X;
static const mask space = _CTYPE_S;
static const mask print = _CTYPE_P | _CTYPE_U | _CTYPE_L | _CTYPE_N | _CTYPE_B;
static const mask graph = _CTYPE_P | _CTYPE_U | _CTYPE_L | _CTYPE_N;
static const mask cntrl = _CTYPE_C;
static const mask punct = _CTYPE_P;
static const mask alnum = _CTYPE_U | _CTYPE_L | _CTYPE_N;
};

View file

@ -2703,6 +2703,7 @@ get_segment_type (unsigned long p_type)
case PT_GNU_EH_FRAME:
return "GNU_EH_FRAME";
case PT_GNU_STACK: return "GNU_STACK";
case PT_GNU_PROPERTY: return "GNU_PROPERTY";
case PT_GNU_RELRO: return "GNU_RELRO";
case PT_OPENBSD_RANDOMIZE:
return "OPENBSD_RANDOMIZE";

View file

@ -310,6 +310,7 @@
#define PT_SUNW_EH_FRAME PT_GNU_EH_FRAME /* Solaris uses the same value */
#define PT_GNU_STACK (PT_LOOS + 0x474e551) /* Stack flags */
#define PT_GNU_RELRO (PT_LOOS + 0x474e552) /* Read-only after relocation */
#define PT_GNU_PROPERTY (PT_LOOS + 0x474e553) /* Program property note */
#define PT_OPENBSD_RANDOMIZE 0x65a3dbe6 /* Fill with random data. */
#define PT_OPENBSD_WXNEEDED 0x65a3dbe7 /* Program does W^X violations */

View file

@ -1,4 +1,4 @@
/* $OpenBSD: ctype.h,v 1.25 2017/09/05 03:16:13 schwarze Exp $ */
/* $OpenBSD: ctype.h,v 1.26 2024/02/04 13:03:18 jca Exp $ */
/* $NetBSD: ctype.h,v 1.14 1994/10/26 00:55:47 cgd Exp $ */
/*
@ -42,14 +42,14 @@
#include <sys/cdefs.h>
#define _U 0x01
#define _L 0x02
#define _N 0x04
#define _S 0x08
#define _P 0x10
#define _C 0x20
#define _X 0x40
#define _B 0x80
#define _CTYPE_U 0x01
#define _CTYPE_L 0x02
#define _CTYPE_N 0x04
#define _CTYPE_S 0x08
#define _CTYPE_P 0x10
#define _CTYPE_C 0x20
#define _CTYPE_X 0x40
#define _CTYPE_B 0x80
#if __POSIX_VISIBLE >= 200809
#ifndef _LOCALE_T_DEFINED_
@ -114,57 +114,62 @@ int toupper_l(int, locale_t);
__only_inline int isalnum(int _c)
{
return (_c == -1 ? 0 : ((_ctype_ + 1)[(unsigned char)_c] & (_U|_L|_N)));
return (_c == -1 ? 0 : ((_ctype_ + 1)[(unsigned char)_c] &
(_CTYPE_U|_CTYPE_L|_CTYPE_N)));
}
__only_inline int isalpha(int _c)
{
return (_c == -1 ? 0 : ((_ctype_ + 1)[(unsigned char)_c] & (_U|_L)));
return (_c == -1 ? 0 : ((_ctype_ + 1)[(unsigned char)_c] &
(_CTYPE_U|_CTYPE_L)));
}
__only_inline int iscntrl(int _c)
{
return (_c == -1 ? 0 : ((_ctype_ + 1)[(unsigned char)_c] & _C));
return (_c == -1 ? 0 : ((_ctype_ + 1)[(unsigned char)_c] & _CTYPE_C));
}
__only_inline int isdigit(int _c)
{
return (_c == -1 ? 0 : ((_ctype_ + 1)[(unsigned char)_c] & _N));
return (_c == -1 ? 0 : ((_ctype_ + 1)[(unsigned char)_c] & _CTYPE_N));
}
__only_inline int isgraph(int _c)
{
return (_c == -1 ? 0 : ((_ctype_ + 1)[(unsigned char)_c] & (_P|_U|_L|_N)));
return (_c == -1 ? 0 : ((_ctype_ + 1)[(unsigned char)_c] &
(_CTYPE_P|_CTYPE_U|_CTYPE_L|_CTYPE_N)));
}
__only_inline int islower(int _c)
{
return (_c == -1 ? 0 : ((_ctype_ + 1)[(unsigned char)_c] & _L));
return (_c == -1 ? 0 : ((_ctype_ + 1)[(unsigned char)_c] & _CTYPE_L));
}
__only_inline int isprint(int _c)
{
return (_c == -1 ? 0 : ((_ctype_ + 1)[(unsigned char)_c] & (_P|_U|_L|_N|_B)));
return (_c == -1 ? 0 : ((_ctype_ + 1)[(unsigned char)_c] &
(_CTYPE_P|_CTYPE_U|_CTYPE_L|_CTYPE_N|_CTYPE_B)));
}
__only_inline int ispunct(int _c)
{
return (_c == -1 ? 0 : ((_ctype_ + 1)[(unsigned char)_c] & _P));
return (_c == -1 ? 0 : ((_ctype_ + 1)[(unsigned char)_c] & _CTYPE_P));
}
__only_inline int isspace(int _c)
{
return (_c == -1 ? 0 : ((_ctype_ + 1)[(unsigned char)_c] & _S));
return (_c == -1 ? 0 : ((_ctype_ + 1)[(unsigned char)_c] & _CTYPE_S));
}
__only_inline int isupper(int _c)
{
return (_c == -1 ? 0 : ((_ctype_ + 1)[(unsigned char)_c] & _U));
return (_c == -1 ? 0 : ((_ctype_ + 1)[(unsigned char)_c] & _CTYPE_U));
}
__only_inline int isxdigit(int _c)
{
return (_c == -1 ? 0 : ((_ctype_ + 1)[(unsigned char)_c] & (_N|_X)));
return (_c == -1 ? 0 : ((_ctype_ + 1)[(unsigned char)_c] &
(_CTYPE_N|_CTYPE_X)));
}
__only_inline int tolower(int _c)

View file

@ -1,4 +1,4 @@
/* $OpenBSD: ctype_.c,v 1.12 2015/09/19 04:02:21 guenther Exp $ */
/* $OpenBSD: ctype_.c,v 1.13 2024/02/04 13:03:18 jca Exp $ */
/*
* Copyright (c) 1989 The Regents of the University of California.
* All rights reserved.
@ -36,6 +36,16 @@
#include <ctype.h>
#include "ctype_private.h"
/* Shorter names for the defines provided by <ctype.h> */
#define _U _CTYPE_U
#define _L _CTYPE_L
#define _N _CTYPE_N
#define _S _CTYPE_S
#define _P _CTYPE_P
#define _C _CTYPE_C
#define _X _CTYPE_X
#define _B _CTYPE_B
const char _C_ctype_[1 + CTYPE_NUM_CHARS] = {
0,
_C, _C, _C, _C, _C, _C, _C, _C,

View file

@ -1,4 +1,4 @@
/* $OpenBSD: isctype.c,v 1.12 2015/09/13 11:38:08 guenther Exp $ */
/* $OpenBSD: isctype.c,v 1.13 2024/02/04 13:03:18 jca Exp $ */
/*
* Copyright (c) 1989 The Regents of the University of California.
* All rights reserved.
@ -41,7 +41,8 @@
int
isalnum(int c)
{
return (c == EOF ? 0 : ((_ctype_ + 1)[(unsigned char)c] & (_U|_L|_N)));
return (c == EOF ? 0 : ((_ctype_ + 1)[(unsigned char)c] &
(_CTYPE_U|_CTYPE_L|_CTYPE_N)));
}
DEF_STRONG(isalnum);
@ -49,7 +50,8 @@ DEF_STRONG(isalnum);
int
isalpha(int c)
{
return (c == EOF ? 0 : ((_ctype_ + 1)[(unsigned char)c] & (_U|_L)));
return (c == EOF ? 0 : ((_ctype_ + 1)[(unsigned char)c] &
(_CTYPE_U|_CTYPE_L)));
}
DEF_STRONG(isalpha);
@ -65,7 +67,7 @@ DEF_STRONG(isblank);
int
iscntrl(int c)
{
return (c == EOF ? 0 : ((_ctype_ + 1)[(unsigned char)c] & _C));
return (c == EOF ? 0 : ((_ctype_ + 1)[(unsigned char)c] & _CTYPE_C));
}
DEF_STRONG(iscntrl);
@ -73,7 +75,7 @@ DEF_STRONG(iscntrl);
int
isdigit(int c)
{
return (c == EOF ? 0 : ((_ctype_ + 1)[(unsigned char)c] & _N));
return (c == EOF ? 0 : ((_ctype_ + 1)[(unsigned char)c] & _CTYPE_N));
}
DEF_STRONG(isdigit);
@ -81,7 +83,8 @@ DEF_STRONG(isdigit);
int
isgraph(int c)
{
return (c == EOF ? 0 : ((_ctype_ + 1)[(unsigned char)c] & (_P|_U|_L|_N)));
return (c == EOF ? 0 : ((_ctype_ + 1)[(unsigned char)c] &
(_CTYPE_P|_CTYPE_U|_CTYPE_L|_CTYPE_N)));
}
DEF_STRONG(isgraph);
@ -89,7 +92,7 @@ DEF_STRONG(isgraph);
int
islower(int c)
{
return (c == EOF ? 0 : ((_ctype_ + 1)[(unsigned char)c] & _L));
return (c == EOF ? 0 : ((_ctype_ + 1)[(unsigned char)c] & _CTYPE_L));
}
DEF_STRONG(islower);
@ -97,7 +100,8 @@ DEF_STRONG(islower);
int
isprint(int c)
{
return (c == EOF ? 0 : ((_ctype_ + 1)[(unsigned char)c] & (_P|_U|_L|_N|_B)));
return (c == EOF ? 0 : ((_ctype_ + 1)[(unsigned char)c] &
(_CTYPE_P|_CTYPE_U|_CTYPE_L|_CTYPE_N|_CTYPE_B)));
}
DEF_STRONG(isprint);
@ -105,7 +109,7 @@ DEF_STRONG(isprint);
int
ispunct(int c)
{
return (c == EOF ? 0 : ((_ctype_ + 1)[(unsigned char)c] & _P));
return (c == EOF ? 0 : ((_ctype_ + 1)[(unsigned char)c] & _CTYPE_P));
}
DEF_STRONG(ispunct);
@ -113,7 +117,7 @@ DEF_STRONG(ispunct);
int
isspace(int c)
{
return (c == EOF ? 0 : ((_ctype_ + 1)[(unsigned char)c] & _S));
return (c == EOF ? 0 : ((_ctype_ + 1)[(unsigned char)c] & _CTYPE_S));
}
DEF_STRONG(isspace);
@ -121,7 +125,7 @@ DEF_STRONG(isspace);
int
isupper(int c)
{
return (c == EOF ? 0 : ((_ctype_ + 1)[(unsigned char)c] & _U));
return (c == EOF ? 0 : ((_ctype_ + 1)[(unsigned char)c] & _CTYPE_U));
}
DEF_STRONG(isupper);
@ -129,7 +133,8 @@ DEF_STRONG(isupper);
int
isxdigit(int c)
{
return (c == EOF ? 0 : ((_ctype_ + 1)[(unsigned char)c] & (_N|_X)));
return (c == EOF ? 0 : ((_ctype_ + 1)[(unsigned char)c] &
(_CTYPE_N|_CTYPE_X)));
}
DEF_STRONG(isxdigit);

View file

@ -1,4 +1,4 @@
/* $OpenBSD: iswctype.c,v 1.8 2022/07/25 21:38:24 guenther Exp $ */
/* $OpenBSD: iswctype.c,v 1.9 2024/02/04 12:46:01 jca Exp $ */
/* $NetBSD: iswctype.c,v 1.15 2005/02/09 21:35:46 kleink Exp $ */
/*
@ -80,75 +80,75 @@ __tolower_w(wint_t c)
int
iswalnum(wint_t c)
{
return (__isctype_w((c), _CTYPE_A|_CTYPE_D));
return (__isctype_w((c), _RUNETYPE_A|_RUNETYPE_D));
}
int
iswalpha(wint_t c)
{
return (__isctype_w((c), _CTYPE_A));
return (__isctype_w((c), _RUNETYPE_A));
}
int
iswblank(wint_t c)
{
return (__isctype_w((c), _CTYPE_B));
return (__isctype_w((c), _RUNETYPE_B));
}
int
iswcntrl(wint_t c)
{
return (__isctype_w((c), _CTYPE_C));
return (__isctype_w((c), _RUNETYPE_C));
}
int
iswdigit(wint_t c)
{
return (__isctype_w((c), _CTYPE_D));
return (__isctype_w((c), _RUNETYPE_D));
}
int
iswgraph(wint_t c)
{
return (__isctype_w((c), _CTYPE_G));
return (__isctype_w((c), _RUNETYPE_G));
}
int
iswlower(wint_t c)
{
return (__isctype_w((c), _CTYPE_L));
return (__isctype_w((c), _RUNETYPE_L));
}
int
iswprint(wint_t c)
{
return (__isctype_w((c), _CTYPE_R));
return (__isctype_w((c), _RUNETYPE_R));
}
int
iswpunct(wint_t c)
{
return (__isctype_w((c), _CTYPE_P));
return (__isctype_w((c), _RUNETYPE_P));
}
int
iswspace(wint_t c)
{
return (__isctype_w((c), _CTYPE_S));
return (__isctype_w((c), _RUNETYPE_S));
}
DEF_STRONG(iswspace);
int
iswupper(wint_t c)
{
return (__isctype_w((c), _CTYPE_U));
return (__isctype_w((c), _RUNETYPE_U));
}
DEF_STRONG(iswupper);
int
iswxdigit(wint_t c)
{
return (__isctype_w((c), _CTYPE_X));
return (__isctype_w((c), _RUNETYPE_X));
}
wint_t
@ -167,8 +167,9 @@ DEF_STRONG(towlower);
int
wcwidth(wchar_t c)
{
if (__isctype_w((c), _CTYPE_R))
return (((unsigned)__runetype_w(c) & _CTYPE_SWM) >> _CTYPE_SWS);
if (__isctype_w((c), _RUNETYPE_R))
return (((unsigned)__runetype_w(c) & _RUNETYPE_SWM) >>
_RUNETYPE_SWS);
return -1;
}
DEF_WEAK(wcwidth);

View file

@ -1,4 +1,4 @@
/* $OpenBSD: iswctype_l.c,v 1.2 2022/07/25 21:38:24 guenther Exp $ */
/* $OpenBSD: iswctype_l.c,v 1.3 2024/02/04 12:46:01 jca Exp $ */
/* $NetBSD: iswctype.c,v 1.15 2005/02/09 21:35:46 kleink Exp $ */
/*
@ -82,73 +82,73 @@ __isctype_wl(wint_t c, _RuneType f, locale_t locale)
int
iswalnum_l(wint_t c, locale_t locale)
{
return __isctype_wl(c, _CTYPE_A|_CTYPE_D, locale);
return __isctype_wl(c, _RUNETYPE_A|_RUNETYPE_D, locale);
}
int
iswalpha_l(wint_t c, locale_t locale)
{
return __isctype_wl(c, _CTYPE_A, locale);
return __isctype_wl(c, _RUNETYPE_A, locale);
}
int
iswblank_l(wint_t c, locale_t locale)
{
return __isctype_wl(c, _CTYPE_B, locale);
return __isctype_wl(c, _RUNETYPE_B, locale);
}
int
iswcntrl_l(wint_t c, locale_t locale)
{
return __isctype_wl(c, _CTYPE_C, locale);
return __isctype_wl(c, _RUNETYPE_C, locale);
}
int
iswdigit_l(wint_t c, locale_t locale)
{
return __isctype_wl(c, _CTYPE_D, locale);
return __isctype_wl(c, _RUNETYPE_D, locale);
}
int
iswgraph_l(wint_t c, locale_t locale)
{
return __isctype_wl(c, _CTYPE_G, locale);
return __isctype_wl(c, _RUNETYPE_G, locale);
}
int
iswlower_l(wint_t c, locale_t locale)
{
return __isctype_wl(c, _CTYPE_L, locale);
return __isctype_wl(c, _RUNETYPE_L, locale);
}
int
iswprint_l(wint_t c, locale_t locale)
{
return __isctype_wl(c, _CTYPE_R, locale);
return __isctype_wl(c, _RUNETYPE_R, locale);
}
int
iswpunct_l(wint_t c, locale_t locale)
{
return __isctype_wl(c, _CTYPE_P, locale);
return __isctype_wl(c, _RUNETYPE_P, locale);
}
int
iswspace_l(wint_t c, locale_t locale)
{
return __isctype_wl(c, _CTYPE_S, locale);
return __isctype_wl(c, _RUNETYPE_S, locale);
}
int
iswupper_l(wint_t c, locale_t locale)
{
return __isctype_wl(c, _CTYPE_U, locale);
return __isctype_wl(c, _RUNETYPE_U, locale);
}
int
iswxdigit_l(wint_t c, locale_t locale)
{
return __isctype_wl(c, _CTYPE_X, locale);
return __isctype_wl(c, _RUNETYPE_X, locale);
}
wint_t

View file

@ -1,4 +1,4 @@
/* $OpenBSD: rune.h,v 1.4 2017/09/05 03:16:13 schwarze Exp $ */
/* $OpenBSD: rune.h,v 1.5 2024/02/04 12:46:01 jca Exp $ */
/* $NetBSD: rune.h,v 1.9 2003/08/07 16:43:04 agc Exp $ */
/*-
@ -47,34 +47,6 @@
#define _LOCALE_C (locale_t)1
#define _LOCALE_UTF8 (locale_t)2
/*
* map _RTYPE_x to _CTYPE_x
*
* XXX: these should be defined in ctype.h and used in isxxx macros.
* (note: current isxxx macros use "old" NetBSD masks and
* _CTYPE_x are not public.)
*/
#define _CTYPE_A _RUNETYPE_A
#define _CTYPE_C _RUNETYPE_C
#define _CTYPE_D _RUNETYPE_D
#define _CTYPE_G _RUNETYPE_G
#define _CTYPE_L _RUNETYPE_L
#define _CTYPE_P _RUNETYPE_P
#define _CTYPE_S _RUNETYPE_S
#define _CTYPE_U _RUNETYPE_U
#define _CTYPE_X _RUNETYPE_X
#define _CTYPE_B _RUNETYPE_B
#define _CTYPE_R _RUNETYPE_R
#define _CTYPE_I _RUNETYPE_I
#define _CTYPE_T _RUNETYPE_T
#define _CTYPE_Q _RUNETYPE_Q
#define _CTYPE_SWM _RUNETYPE_SWM
#define _CTYPE_SWS _RUNETYPE_SWS
#define _CTYPE_SW0 _RUNETYPE_SW0
#define _CTYPE_SW1 _RUNETYPE_SW1
#define _CTYPE_SW2 _RUNETYPE_SW2
#define _CTYPE_SW3 _RUNETYPE_SW3
__BEGIN_HIDDEN_DECLS
extern _RuneLocale _DefaultRuneLocale;
extern _RuneLocale *_Utf8RuneLocale;

View file

@ -48,134 +48,134 @@ _RuneLocale _DefaultRuneLocale = {
"NONE",
_DEFAULT_INVALID_RUNE,
{ /*00*/ _CTYPE_C,
_CTYPE_C,
_CTYPE_C,
_CTYPE_C,
_CTYPE_C,
_CTYPE_C,
_CTYPE_C,
_CTYPE_C,
/*08*/ _CTYPE_C,
_CTYPE_C|_CTYPE_S|_CTYPE_B,
_CTYPE_C|_CTYPE_S,
_CTYPE_C|_CTYPE_S,
_CTYPE_C|_CTYPE_S,
_CTYPE_C|_CTYPE_S,
_CTYPE_C,
_CTYPE_C,
/*10*/ _CTYPE_C,
_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|_RUNETYPE_G|_RUNETYPE_A|_RUNETYPE_SW1,
_RUNETYPE_L|_RUNETYPE_R|_RUNETYPE_G|_RUNETYPE_A|_RUNETYPE_SW1,
_RUNETYPE_P|_RUNETYPE_R|_RUNETYPE_G|_RUNETYPE_SW1,
_RUNETYPE_P|_RUNETYPE_R|_RUNETYPE_G|_RUNETYPE_SW1,
_RUNETYPE_P|_RUNETYPE_R|_RUNETYPE_G|_RUNETYPE_SW1,
_RUNETYPE_P|_RUNETYPE_R|_RUNETYPE_G|_RUNETYPE_SW1,
_RUNETYPE_C,
},
{ 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,

View file

@ -1,4 +1,4 @@
/* $OpenBSD: wctype.c,v 1.1 2022/07/25 21:38:24 guenther Exp $ */
/* $OpenBSD: wctype.c,v 1.2 2024/02/04 12:46:01 jca Exp $ */
/* $NetBSD: iswctype.c,v 1.15 2005/02/09 21:35:46 kleink Exp $ */
/*
@ -43,18 +43,18 @@
static struct _WCTypeEntry wctype_entries[_WCTYPE_NINDEXES] =
{
{ "alnum", _CTYPE_A|_CTYPE_D },
{ "alpha", _CTYPE_A },
{ "blank", _CTYPE_B },
{ "cntrl", _CTYPE_C },
{ "digit", _CTYPE_D },
{ "graph", _CTYPE_G },
{ "lower", _CTYPE_L },
{ "print", _CTYPE_R },
{ "punct", _CTYPE_P },
{ "space", _CTYPE_S },
{ "upper", _CTYPE_U },
{ "xdigit", _CTYPE_X },
{ "alnum", _RUNETYPE_A|_RUNETYPE_D },
{ "alpha", _RUNETYPE_A },
{ "blank", _RUNETYPE_B },
{ "cntrl", _RUNETYPE_C },
{ "digit", _RUNETYPE_D },
{ "graph", _RUNETYPE_G },
{ "lower", _RUNETYPE_L },
{ "print", _RUNETYPE_R },
{ "punct", _RUNETYPE_P },
{ "space", _RUNETYPE_S },
{ "upper", _RUNETYPE_U },
{ "xdigit", _RUNETYPE_X },
};
wctype_t

View file

@ -1,4 +1,4 @@
/* $OpenBSD: ssl_lib.c,v 1.319 2024/02/03 15:58:34 beck Exp $ */
/* $OpenBSD: ssl_lib.c,v 1.320 2024/02/04 20:50:23 tb Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
@ -1068,7 +1068,7 @@ SSL_is_server(const SSL *s)
LSSL_ALIAS(SSL_is_server);
static long
ssl_get_default_timeout()
ssl_get_default_timeout(void)
{
/*
* 2 hours, the 24 hours mentioned in the TLSv1 spec

View file

@ -1,4 +1,4 @@
/* $OpenBSD: tls13_handshake_msg.c,v 1.6 2022/07/22 19:33:53 jsing Exp $ */
/* $OpenBSD: tls13_handshake_msg.c,v 1.7 2024/02/04 20:50:23 tb Exp $ */
/*
* Copyright (c) 2018, 2019 Joel Sing <jsing@openbsd.org>
*
@ -34,7 +34,7 @@ struct tls13_handshake_msg {
};
struct tls13_handshake_msg *
tls13_handshake_msg_new()
tls13_handshake_msg_new(void)
{
struct tls13_handshake_msg *msg = NULL;

View file

@ -1,4 +1,4 @@
/* $OpenBSD: timingsafe.c,v 1.3 2014/06/21 22:57:15 tedu Exp $ */
/* $OpenBSD: timingsafe.c,v 1.4 2024/02/04 20:51:21 tb Exp $ */
/*
* Copyright (c) 2014 Google Inc.
*
@ -28,7 +28,7 @@ enum {
static unsigned char bufone[N], buftwo[N];
void
check()
check(void)
{
int cmp = memcmp(bufone, buftwo, N);
@ -49,7 +49,7 @@ check()
}
int
main()
main(void)
{
int i, j;

View file

@ -1,4 +1,4 @@
/* $OpenBSD: asn1basic.c,v 1.15 2023/08/15 21:05:44 tb Exp $ */
/* $OpenBSD: asn1basic.c,v 1.16 2024/02/04 13:07:02 tb Exp $ */
/*
* Copyright (c) 2017, 2021 Joel Sing <jsing@openbsd.org>
* Copyright (c) 2023 Theo Buehler <tb@openbsd.org>
@ -699,7 +699,7 @@ asn1_integer_null_data_test(void)
ASN1_INTEGER *aint = NULL;
uint8_t *p = NULL, *pp;
int len;
int failed = 0;
int failed = 1;
if ((aint = ASN1_INTEGER_new()) == NULL) {
fprintf(stderr, "FAIL: ASN1_INTEGER_new() == NULL\n");

View file

@ -1,4 +1,4 @@
/* $OpenBSD: codepatch.c,v 1.10 2023/07/31 01:33:57 guenther Exp $ */
/* $OpenBSD: codepatch.c,v 1.11 2024/02/04 20:18:48 guenther Exp $ */
/*
* Copyright (c) 2014-2015 Stefan Fritsch <sf@sfritsch.de>
*
@ -39,8 +39,9 @@ extern struct codepatch codepatch_end;
extern char __cptext_start[];
extern char __cptext_end[];
void codepatch_control_flow(uint16_t _tag, void *_func, int _opcode,
const char *_op);
enum op_type { OP_CALL, OP_JMP };
__cptext void codepatch_control_flow(uint16_t _tag, void *_func,
enum op_type _type);
void
codepatch_fill_nop(void *caddr, uint16_t len)
@ -155,26 +156,27 @@ codepatch_replace(uint16_t tag, const void *code, size_t len)
void
codepatch_call(uint16_t tag, void *func)
{
/* 0xe8 == call near */
codepatch_control_flow(tag, func, 0xe8, "call");
codepatch_control_flow(tag, func, OP_CALL);
}
void
codepatch_jmp(uint16_t tag, void *func)
{
/* 0xe9 == jmp near */
codepatch_control_flow(tag, func, 0xe9, "jmp");
codepatch_control_flow(tag, func, OP_JMP);
}
/* Patch with call or jump to func */
void
codepatch_control_flow(uint16_t tag, void *func, int opcode, const char *op)
codepatch_control_flow(uint16_t tag, void *func, enum op_type type)
{
struct codepatch *patch;
unsigned char *rwaddr;
int32_t offset;
int i = 0;
vaddr_t rwmap = 0;
const char *op = type == OP_JMP ? "jmp" : "call";
char opcode = type == OP_JMP ? 0xe9 /* jmp near */
: 0xe8 /* call near */;
DBGPRINT("patching tag %u with %s %p", tag, op, func);
@ -189,7 +191,10 @@ codepatch_control_flow(uint16_t tag, void *func, int opcode, const char *op)
rwaddr = codepatch_maprw(&rwmap, patch->addr);
rwaddr[0] = opcode;
memcpy(rwaddr + 1, &offset, sizeof(offset));
codepatch_fill_nop(rwaddr + 5, patch->len - 5);
if (type == OP_CALL)
codepatch_fill_nop(rwaddr + 5, patch->len - 5);
else /* OP_JMP */
memset(rwaddr + 5, 0xCC /* int3 */, patch->len - 5);
i++;
}
codepatch_unmaprw(rwmap);

View file

@ -1,4 +1,4 @@
/* $OpenBSD: efiboot.c,v 1.48 2023/05/12 16:43:00 kettenis Exp $ */
/* $OpenBSD: efiboot.c,v 1.49 2024/02/04 18:44:23 kettenis Exp $ */
/*
* Copyright (c) 2015 YASUOKA Masahiko <yasuoka@yasuoka.net>
@ -587,6 +587,8 @@ efi_dma_constraint(void)
fdt_node_is_compatible(node, "rockchip,rk3588") ||
fdt_node_is_compatible(node, "rockchip,rk3588s"))
dma_constraint[1] = htobe64(0xffffffff);
if (fdt_node_is_compatible(node, "lenovo,thinkpad-x13s"))
dma_constraint[1] = htobe64(0xffffffff);
/* Pass DMA constraint. */
node = fdt_find_node("/chosen");

View file

@ -1,4 +1,4 @@
/* $OpenBSD: qwx.c,v 1.16 2024/02/03 20:07:19 kettenis Exp $ */
/* $OpenBSD: qwx.c,v 1.17 2024/02/04 17:51:59 kettenis Exp $ */
/*
* Copyright 2023 Stefan Sperling <stsp@openbsd.org>
@ -8368,7 +8368,7 @@ qwx_qmi_load_bdf_qmi(struct qwx_softc *sc, int regdb)
if (regdb)
bdf_type = ATH11K_QMI_BDF_TYPE_REGDB;
else if (len >= QWX_SELFMAG &&
else if (boardfw_len >= QWX_SELFMAG &&
memcmp(boardfw, QWX_ELFMAG, QWX_SELFMAG) == 0)
bdf_type = ATH11K_QMI_BDF_TYPE_ELF;
else
@ -8376,9 +8376,9 @@ qwx_qmi_load_bdf_qmi(struct qwx_softc *sc, int regdb)
DPRINTF("%s: bdf_type %d\n", __func__, bdf_type);
fw_size = MIN(sc->hw_params.fw.board_size, len);
fw_size = MIN(sc->hw_params.fw.board_size, boardfw_len);
ret = qwx_qmi_load_file_target_mem(sc, boardfw, boardfw_len, bdf_type);
ret = qwx_qmi_load_file_target_mem(sc, boardfw, fw_size, bdf_type);
if (ret < 0) {
printf("%s: failed to load bdf file\n", __func__);
goto out;

View file

@ -1,4 +1,4 @@
/* $OpenBSD: ca.c,v 1.57 2023/11/13 12:43:08 tb Exp $ */
/* $OpenBSD: ca.c,v 1.58 2024/02/04 13:08:29 tb Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
@ -2576,7 +2576,6 @@ get_certificate_status(const char *serial, CA_DB *db)
goto err;
}
if (strlen(serial) % 2) {
/* Set the first char to 0 */ ;
row[DB_serial][0] = '0';
/* Copy String from serial to row[DB_serial] */

View file

@ -1,4 +1,4 @@
/* $OpenBSD: cert.c,v 1.124 2024/02/03 14:43:15 tb Exp $ */
/* $OpenBSD: cert.c,v 1.125 2024/02/04 07:43:27 tb Exp $ */
/*
* Copyright (c) 2022 Theo Buehler <tb@openbsd.org>
* Copyright (c) 2021 Job Snijders <job@openbsd.org>
@ -737,7 +737,8 @@ struct cert *
cert_parse_pre(const char *fn, const unsigned char *der, size_t len)
{
const unsigned char *oder;
int i;
size_t j;
int i, extsz;
X509 *x = NULL;
X509_EXTENSION *ext = NULL;
const X509_ALGOR *palg;
@ -808,8 +809,12 @@ cert_parse_pre(const char *fn, const unsigned char *der, size_t len)
goto out;
/* Look for X509v3 extensions. */
if ((extsz = X509_get_ext_count(x)) <= 0) {
warnx("%s: certificate without X.509v3 extensions", fn);
goto out;
}
for (i = 0; i < X509_get_ext_count(x); i++) {
for (i = 0; i < extsz; i++) {
ext = X509_get_ext(x, i);
assert(ext != NULL);
obj = X509_EXTENSION_get_object(ext);
@ -938,8 +943,8 @@ cert_parse_pre(const char *fn, const unsigned char *der, size_t len)
p.fn);
goto out;
}
for (i = 0; (size_t)i < p.res->asz; i++) {
if (p.res->as[i].type == CERT_AS_INHERIT) {
for (j = 0; j < p.res->asz; j++) {
if (p.res->as[j].type == CERT_AS_INHERIT) {
warnx("%s: inherit elements not allowed in EE"
" cert", p.fn);
goto out;

View file

@ -1,4 +1,4 @@
/* $OpenBSD: mft.c,v 1.104 2024/02/03 14:30:47 job Exp $ */
/* $OpenBSD: mft.c,v 1.105 2024/02/04 00:53:27 job Exp $ */
/*
* Copyright (c) 2022 Theo Buehler <tb@openbsd.org>
* Copyright (c) 2019 Kristaps Dzonsons <kristaps@bsd.lv>
@ -89,58 +89,6 @@ IMPLEMENT_ASN1_FUNCTIONS(Manifest);
#define GENTIME_LENGTH 15
/*
* Convert an ASN1_GENERALIZEDTIME to a struct tm.
* Returns 1 on success, 0 on failure.
*/
static int
generalizedtime_to_tm(const ASN1_GENERALIZEDTIME *gtime, struct tm *tm)
{
/*
* ASN1_GENERALIZEDTIME is another name for ASN1_STRING. Check type and
* length, so we don't accidentally accept a UTCTime. Punt on checking
* Zulu time for OpenSSL: we don't want to mess about with silly flags.
*/
if (ASN1_STRING_type(gtime) != V_ASN1_GENERALIZEDTIME)
return 0;
if (ASN1_STRING_length(gtime) != GENTIME_LENGTH)
return 0;
memset(tm, 0, sizeof(*tm));
return ASN1_TIME_to_tm(gtime, tm);
}
/*
* Validate and verify the time validity of the mft.
* Returns 1 if all is good and for any other case 0.
*/
static int
mft_parse_time(const ASN1_GENERALIZEDTIME *from,
const ASN1_GENERALIZEDTIME *until, struct parse *p)
{
struct tm tm_from, tm_until;
if (!generalizedtime_to_tm(from, &tm_from)) {
warnx("%s: embedded from time format invalid", p->fn);
return 0;
}
if (!generalizedtime_to_tm(until, &tm_until)) {
warnx("%s: embedded until time format invalid", p->fn);
return 0;
}
if ((p->res->thisupdate = timegm(&tm_from)) == -1 ||
(p->res->nextupdate = timegm(&tm_until)) == -1)
errx(1, "%s: timegm failed", p->fn);
if (p->res->thisupdate > p->res->nextupdate) {
warnx("%s: bad update interval", p->fn);
return 0;
}
return 1;
}
/*
* Determine rtype corresponding to file extension. Returns RTYPE_INVALID
* on error or unkown extension.
@ -301,8 +249,32 @@ mft_parse_econtent(const unsigned char *d, size_t dsz, struct parse *p)
if (p->res->seqnum == NULL)
goto out;
if (!mft_parse_time(mft->thisUpdate, mft->nextUpdate, p))
/*
* OpenSSL's DER decoder implementation will accept a GeneralizedTime
* which doesn't conform to RFC 5280. So, double check.
*/
if (ASN1_STRING_length(mft->thisUpdate) != GENTIME_LENGTH) {
warnx("%s: embedded from time format invalid", p->fn);
goto out;
}
if (ASN1_STRING_length(mft->nextUpdate) != GENTIME_LENGTH) {
warnx("%s: embedded until time format invalid", p->fn);
goto out;
}
if (!x509_get_time(mft->thisUpdate, &p->res->thisupdate)) {
warn("%s: parsing manifest thisUpdate failed", p->fn);
goto out;
}
if (!x509_get_time(mft->nextUpdate, &p->res->nextupdate)) {
warn("%s: parsing manifest nextUpdate failed", p->fn);
goto out;
}
if (p->res->thisupdate > p->res->nextupdate) {
warnx("%s: bad update interval", p->fn);
goto out;
}
if (OBJ_obj2nid(mft->fileHashAlg) != NID_sha256) {
warnx("%s: RFC 6486 section 4.2.1: fileHashAlg: "

View file

@ -1,4 +1,4 @@
/* $OpenBSD: fw_cfg.c,v 1.7 2023/02/06 20:33:34 dv Exp $ */
/* $OpenBSD: fw_cfg.c,v 1.8 2024/02/04 14:53:12 dv Exp $ */
/*
* Copyright (c) 2018 Claudio Jeker <claudio@openbsd.org>
*
@ -396,7 +396,7 @@ fw_cfg_add_file(const char *name, const void *data, size_t len)
if (fw_cfg_lookup_file(name))
fatalx("%s: fw_cfg: file %s exists", __progname, name);
if ((f = calloc(sizeof(*f), 1)) == NULL)
if ((f = calloc(1, sizeof(*f))) == NULL)
fatal("%s", __func__);
if ((f->data = malloc(len)) == NULL)

View file

@ -1,4 +1,4 @@
/* $OpenBSD: vioblk.c,v 1.10 2024/02/03 00:28:07 jsg Exp $ */
/* $OpenBSD: vioblk.c,v 1.11 2024/02/04 14:54:51 dv Exp $ */
/*
* Copyright (c) 2023 Dave Voutila <dv@openbsd.org>
@ -301,7 +301,7 @@ vioblk_notifyq(struct vioblk_dev *dev)
uint8_t ds;
off_t offset;
ssize_t sz;
int is_write, notify, i;
int is_write, notify = 0, i;
char *vr;
struct vring_desc *table, *desc;
struct vring_avail *avail;

View file

@ -1,4 +1,4 @@
/* $OpenBSD: vmd.c,v 1.153 2024/01/18 14:49:59 claudio Exp $ */
/* $OpenBSD: vmd.c,v 1.154 2024/02/04 14:56:45 dv Exp $ */
/*
* Copyright (c) 2015 Reyk Floeter <reyk@openbsd.org>
@ -527,9 +527,8 @@ vmd_dispatch_vmm(int fd, struct privsep_proc *p, struct imsg *imsg)
imsg->hdr.peerid == IMSG_AGENTX_PEERID ?
PROC_AGENTX : PROC_CONTROL, -1, imsg->hdr.type,
imsg->hdr.peerid, -1, &vir, sizeof(vir)) == -1) {
log_debug("%s: GET_INFO_VM failed for vm %d, removing",
__func__, vm->vm_vmid);
vm_terminate(vm, __func__);
if (vm)
vm_terminate(vm, __func__);
return (-1);
}
break;

View file

@ -1,4 +1,4 @@
/* $OpenBSD: vmm.c,v 1.117 2024/01/18 14:49:59 claudio Exp $ */
/* $OpenBSD: vmm.c,v 1.118 2024/02/04 14:57:00 dv Exp $ */
/*
* Copyright (c) 2015 Mike Larkin <mlarkin@openbsd.org>
@ -650,8 +650,7 @@ vmm_start_vm(struct imsg *imsg, uint32_t *id, pid_t *pid)
if ((vm = vm_getbyvmid(imsg->hdr.peerid)) == NULL) {
log_warnx("%s: can't find vm", __func__);
ret = ENOENT;
goto err;
return (ENOENT);
}
vcp = &vm->vm_params.vmc_params;
@ -747,7 +746,6 @@ vmm_start_vm(struct imsg *imsg, uint32_t *id, pid_t *pid)
if (vmm_pipe(vm, fds[0], vmm_dispatch_vm) == -1)
fatal("setup vm pipe");
return (0);
} else {
/* Child. Create a new session. */
if (setsid() == -1)