Commit Graph

17873 Commits

Author SHA1 Message Date
Jeffrey Altman
923067e099 lib/kadm5: kadm_connect do not close 's' more than once
If 's' is closed before exiting, it must be set to rk_INVALID_SOCKET.

Change-Id: I63caf992aa3a6b2c86c918a660025fc054d396d6
2022-01-14 23:21:16 -05:00
Nicolas Williams
a4e6c33780 asn1: Fix double-free in asn1parse.y 2022-01-14 22:16:50 -06:00
Jeffrey Altman
9f3004bfd5 gssapi/krb5: _gsskrb5_export_sec_context copy/paste error
80f3194a76
("gssapi/krb5/{export,import}_sec_context: make smaller tokens.")
stored the source principal when it should have stored the target
principal.

Change-Id: Ife6b137f9fe8f63cdb78b4212f74d502080ec2a2
2022-01-14 23:01:30 -05:00
Luke Howard
4891d713fb bn_s_mp_rand_platform.c: s_read_urandom: correctly handle split read
s_read_urandom has a while loop to handle read() that returns less
than the full buffer (either due to EINTR or because more than the
atomic guarantee from urandom was requested). However, the target
of the read was always the base pointer p instead of the updated
pointer q, so in the end less than the requested randomness is returned.

Use q instead of p in the read() call.

Upstream pull request:
https://github.com/libtom/libtommath/pull/512

Signed-off-by: Arnout Vandecappelle <arnout@mind.be>
2022-01-15 13:38:18 +11:00
Luke Howard
046675ce0e Revert "tommath: Fix warning in s_read_getrandom()"
This reverts commit 489da75e65.

Will be replaced with upstream commit.
2022-01-15 13:37:33 +11:00
Nicolas Williams
f076ed57cc Fix make dist 2022-01-14 20:10:19 -06:00
Nicolas Williams
754a49bd6b test_set_kvno0: Fix leak 2022-01-14 17:59:49 -06:00
Nicolas Williams
c4e962ea04 kafs: Fix a warning 2022-01-14 17:54:55 -06:00
Nicolas Williams
55fa5bf7d2 gsskrb5: Fix warnings 2022-01-14 17:39:05 -06:00
Nicolas Williams
96b7ea671d gss: Fix warnings 2022-01-14 17:39:05 -06:00
Nicolas Williams
65caff79a3 gss-token: Fix leak 2022-01-14 17:39:05 -06:00
Nicolas Williams
4f8399a433 hdb: Fix warnings and leaks 2022-01-14 17:10:16 -06:00
Nicolas Williams
fb553dde1d krb5: Fix warnings 2022-01-14 17:10:16 -06:00
Nicolas Williams
82a8744787 krb5: Fix SQLite3 ccache bugs/warnings 2022-01-14 17:10:16 -06:00
Nicolas Williams
aea18c3006 Use fallthrough statement attribute (moar)
GCC is very finicky.
2022-01-14 16:58:59 -06: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
367f9ddd7d kadm5: Revert part of 69eee19541 2022-01-14 15:41:32 -06:00
Nicolas Williams
489da75e65 tommath: Fix warning in s_read_getrandom()
See https://github.com/libtom/libtommath/pull/512

(Note: this has not shipped.  Only OS X would be affected, specifically
RSA key gen would be affected on OS X.)
2022-01-14 15:26:59 -06:00
Nicolas Williams
318b73f002 krb5: Drop duplicated krb5.conf.5 content 2022-01-14 14:59:02 -06:00
Nicolas Williams
69eee19541 kadm5: Fix warnings 2022-01-14 14:58:59 -06:00
Nicolas Williams
6f467b8097 wind: Fix some warnings 2022-01-14 14:47:13 -06:00
Nicolas Williams
005a43da96 gsspa: Quiet GCC fallthrough warning
Somehow GCC was honoring lower-case "fallthrough" comments elsewhere but
not here.  Anyways, there was no need to fall through, so now we don't.
2022-01-14 14:47:13 -06:00
Jeffrey Altman
6426e7550f roken: do not globally define 'timezone' and 'tzname'
ec866e635e
("Windows 10 SDK build fixes") introduced CPP macros

  timezone -> _timezone
  tzname   -> _tzname

but these names are common and the macros rewrite too much.

The name mapping is only required when building strftime.c
with Visual Studio 2017 and later.  Move the definitions
into strftime.c.

Change-Id: Ic813bff842124595fd3d86761cee6dcea4ae44e4
2022-01-14 14:56:39 -05:00
Nicolas Williams
05e8c0ede6 Check HMAC_Init_ex() return value 2022-01-14 12:48:32 -06:00
Nicolas Williams
52f3dc6aa4 hcrypto: HMAC_Init_Ex(): return int like OpenSSL 2022-01-14 12:48:32 -06:00
Nicolas Williams
77392d5d9c hcrypto: Fix warnings 2022-01-14 12:48:32 -06:00
Nicolas Williams
ea61f68d55 hx509: Fix name expansion bug 2022-01-14 12:44:00 -06:00
Nicolas Williams
e23bc7d53d hx509: Fix warnings and leaks 2022-01-14 12:42:52 -06:00
Nicolas Williams
d88298649b asn1: Fix ENOMEM NULL deref 2022-01-14 12:36:34 -06:00
Nicolas Williams
f0c46e7830 asn1: Use calloc() in generated C code 2022-01-14 12:25:43 -06:00
Nicolas Williams
1fe3d293e1 asn1: Fix warnings 2022-01-14 12:25:43 -06:00
Nicolas Williams
7f8fa65c5b asn1: Fix leak in der_copy_octet_string()
This manifested as a leak via _save fields in the template backend.
2022-01-14 12:01:34 -06:00
Nicolas Williams
a7e11df142 sl: Fix warnings in lib/sl/sl.c 2022-01-14 12:01:33 -06:00
Nicolas Williams
ed0fd1263a base: Fix warnings 2022-01-14 12:01:33 -06:00
Nicolas Williams
69b3c5368c base: Context should optional in more error funcs 2022-01-14 12:01:33 -06:00
Nicolas Williams
94bb267a8b roken: Delete getcap/cgetent/cgetstr() 2022-01-14 12:01:33 -06:00
Nicolas Williams
a90e1cb65c roken: Fix warnings 2022-01-14 12:01:33 -06:00
Jeffrey Altman
3a7c2c6a7f krb5.h: define DOMAIN_X500_COMPRESS macro
db7763ca7b
("asn1: X.681/682/683 magic handling of open types")
renamed 'DOMAIN_X500_COMPRESS' to 'domain_X500_Compress'
for compliance with ASN.1 which requires values to start with
lower case and types to start with upper case.

This change adds a CPP macro DOMAIN_X500_COMPRESS for use by
third-party applications that rely upon the prior name.

Change-Id: I2eb6fec2c795c8adeeef893b00909a202257ad74
2022-01-14 12:46:08 -05:00
Jeffrey Altman
05781f22ab roken: fix net_write if _WIN32 and !SOCKET_IS_NOT_AN_FD
12826c9586
("Handle partial writes on non-blocking sockets") introduced
unconditional use of 'use_write' which is only declared if
defined(SOCKET_IS_NOT_AN_FD).

Change-Id: I0c43ed44a86b4f245acba849afabeb9ce739d0e5
2022-01-14 12:35:50 -05:00
Nicolas Williams
e56b558616 osx: Import fix for tommath #159 2022-01-13 19:56:12 -06:00
Nicolas Williams
4d8badc9a8 roken: Handle not having getpwnam_r() 2022-01-13 19:56:02 -06:00
Nicolas Williams
0c7b06f9ca cf: Check cc support of -Werror=enum-conversion 2022-01-13 15:33:04 -06:00
Marc Dionne
fc4b3ce49b hcrypto: Fix return type for null_Init, null_Update and null_Final
The hc_evp_md_init, hc_evp_md_update and hc_evp_md_final typedefs
are defined as functions returning an int, but null_Init, null_Update
and null_Final are defined as void, and cast with the typedef when
assigned to the function vector.

This might result in some uninitialized value being returned to the
caller, if some of them make use of the return value.  It also causes
warnings if the -Wcast-function-type warning is enabled.

Change the type to in to match the typedef, and return 1 (success).
2022-01-13 16:00:50 -05:00
Luke Howard
6530021f09 kdc: move auth event definitions into KDC header
Move KDC auth event macro definitions out of hdb.h and into a new KDC header,
kdc-audit.h.
2022-01-13 14:51:31 +11:00
Nicolas Williams
04523254c1 asn1: Restore styling of generated sources 2022-01-11 17:45:27 -06:00
Nicolas Williams
ff4033eb59 asn1: Fix Windows build 2022-01-11 17:15:59 -06:00
Nicolas Williams
6ee1554f3e Ignore enum-conversion errors
This is not a very good fix, though the warnings remain.  Such errors
can in principle be a problem because in C there is no standard enum
sizing.

In this case we have two enums with the same elements and so the same
size, so it's clearly not a problem.
2022-01-11 17:15:59 -06:00
Nicolas Williams
284b29a85c asn1: Fix missing LIB_heimbase dependency 2022-01-11 10:55:19 -06:00
Nicolas Williams
40d1271094 asn1: Expand decoration w/ C types
This commits allows `heim_object_t` as a type and causes the generated
code to use the `heim_retain()` and `heim_release()` functions for
copying and releasing values of such types.

Also, now one can have more than one decoration per-type.
2022-01-11 10:21:05 -06:00