Commit Graph

24 Commits

Author SHA1 Message Date
Daria Phoebe Brashear
133f517482 rewrite fallthrough to HEIM_FALLTHROUGH to deal with new Apple SDKs
Apple clang version 14.0.0 (clang-1400.0.17.3.1) fails the build
because stds.h defines `fallthrough` as a macro which is then
expanded when base.h evaluates

  # if __has_attribute(fallthrough) && __clang_major__ >= 5

The macOS SDK defines `DISPATCH_FALLTHROUGH` as the macro instead
of `fallthrough`.

This change replaces the use of `fallthrough` in the tree with
`HEIM_FALLTHROUGH` and updates the declaration in configure logic
to define `HEIM_FALLTHROUGH` based upon existing definitions
(if any) of `fallthrough` or `DISPATCH_FALLTHROUGH`.
2022-09-16 15:58:45 -04:00
Jeffrey Altman
04527412e3 Follow the Linux kernel's lead on "fallthrough"
The pseudo keyword 'fallthrough' is defined such that case statement
blocks must end with any of these keywords:
 * break;
 * fallthrough;
 * continue;
 * goto <label>;
 * return [expression];
 *
 *  gcc: https://gcc.gnu.org/onlinedocs/gcc/Statement-Attributes.html#Statement-Attributes

The macro is defined either as

  __attribute__((__fallthrough__))

or as

  do {} while (0)  /* fallthrough */

not including the semicolon.

This change implements the Linux kernel style and updates several locations
where "/*fallthrough*/ and /* FALLTHROUGH */ were not previously replaced.

Externally imported code such as libedit, libtommath and sqlite are
restored to their unaltered state.

Change-Id: I69db8167b0d5884f55d96d72de3059a0235a1ba3
2022-01-21 10:39:47 -05:00
Nicolas Williams
dd71303a2f hx509: Fix coverity warnings 2022-01-17 17:36:48 -06:00
Jeffrey Altman
363bc7d983 handle negative return values
do not pass negative values to malloc

do not pass negative values to strerror

do not pass negative values to ftruncate

do not pass negative values to fclose

Change-Id: I79ebef4e22edd14343ebeebb2ef8308785064fe8
2022-01-16 00:48:09 -05:00
Nicolas Williams
c607135a03 Use fallthrough statement attribute (moar) 2022-01-14 16:53:34 -06:00
Nicolas Williams
ddc6113610 Use fallthrough statement attribute 2022-01-14 16:32:58 -06:00
Nicolas Williams
fdc13c4aac Fix switch fallthrough warnings/errors 2020-09-07 22:04:59 -05:00
Nicolas Williams
41fcafd20c hx509: add hx509_certs_destroy() 2019-10-03 13:09:18 -05:00
Jeffrey Altman
1dd38cc3de lib/hx509: declare and apply HX509_LIB_xxx macros
libhx509 is not built according to the same export and calling conventions
on Windows as the other libraries.  This change declares and applies
HX509_LIB_FUNCTION, HX509_LIB_NORETURN_FUNCTION, HX509_LIB_CALL and
HX509_LIB_VARIABLE to lib/hx509.

As a result of this change the calling convention for exported functions
will be __stdcall instead of __cdecl.

Change-Id: Ibc3f05e8088030ef7d13798f1d9c9b190bc57797
2019-01-02 10:23:39 -06:00
Love Hörnquist Åstrand
37afa01be3 rename roken base64, fixes #107 2014-08-22 20:57:24 -07:00
Love Hornquist Astrand
0879b9831a remove trailing whitespace 2011-05-21 11:57:31 -07:00
Love Hornquist Astrand
64835d0836 Rename header to print_pem_stamp in the global namespace to avoid -Wshadow warning
Based on a report from Matthias Dieter Wallnöfer.
2009-10-03 11:24:03 -07:00
Love Hörnquist Åstrand
ff5dab4f4a remove rcsid
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@24795 ec53bebd-3082-4978-b11e-865c3cabbd6b
2009-02-22 23:28:18 +00:00
Love Hörnquist Åstrand
6937d41a02 remove trailing whitespace
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@23815 ec53bebd-3082-4978-b11e-865c3cabbd6b
2008-09-13 09:21:03 +00:00
Love Hörnquist Åstrand
e172367898 switch to utf8 encoding of all files
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@23814 ec53bebd-3082-4978-b11e-865c3cabbd6b
2008-09-13 08:53:55 +00:00
Love Hörnquist Åstrand
b1f885befe use rk_undumpdata, spelling
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@23413 ec53bebd-3082-4978-b11e-865c3cabbd6b
2008-07-26 18:34:53 +00:00
Love Hörnquist Åstrand
fedd7ad133 PEM encode/decoding functions.
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@21307 ec53bebd-3082-4978-b11e-865c3cabbd6b
2007-06-25 18:23:01 +00:00
Love Hörnquist Åstrand
e1fcd85fb3 (hx509_pem_write): Add.
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@21301 ec53bebd-3082-4978-b11e-865c3cabbd6b
2007-06-25 16:44:24 +00:00
Love Hörnquist Åstrand
9b8384b209 Allow mapping using heim_octet_string.
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@20170 ec53bebd-3082-4978-b11e-865c3cabbd6b
2007-02-03 22:46:13 +00:00
Love Hörnquist Åstrand
34b94bcd88 _hx509_map_file changed prototype, returns struct stat if requested.
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@16868 ec53bebd-3082-4978-b11e-865c3cabbd6b
2006-03-31 01:48:48 +00:00
Love Hörnquist Åstrand
43470798fb update (c)
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@16739 ec53bebd-3082-4978-b11e-865c3cabbd6b
2006-02-14 10:45:47 +00:00
Love Hörnquist Åstrand
c6496bc8bf (_hx509_write_file): in case of write error, return errno
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@15721 ec53bebd-3082-4978-b11e-865c3cabbd6b
2005-07-24 20:22:39 +00:00
Love Hörnquist Åstrand
4c75ad55b0 (_hx509_write_file): add a function that write a data blob to disk too
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@15720 ec53bebd-3082-4978-b11e-865c3cabbd6b
2005-07-24 20:21:29 +00:00
Love Hörnquist Åstrand
0a70228c08 Initial revision
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@15716 ec53bebd-3082-4978-b11e-865c3cabbd6b
2005-07-24 16:59:14 +00:00