Commit Graph

30165 Commits

Author SHA1 Message Date
Nicolas Williams
00dd104b96 gsskrb5: Fix dead code issues in deleg cred path 2022-01-17 18:10:08 -06:00
Nicolas Williams
82b8c906e9 gsskrb5: Fix incorrect allocation failure check 2022-01-17 18:00:51 -06:00
Nicolas Williams
77c048db9b gss: Check add_builtin() errors 2022-01-17 17:59:10 -06:00
Nicolas Williams
0bbf13722d roken: Remove dead code in rk_strsvisx() 2022-01-17 17:49:29 -06:00
Nicolas Williams
990816bc4b roken: Cast ignored function returns to void 2022-01-17 17:46:26 -06:00
Nicolas Williams
b4f9c8772b roken: Fix base32(1) crash on empty file 2022-01-17 17:43:23 -06:00
Nicolas Williams
68ddc50020 roken: Fix base64(1) crash on empty file 2022-01-17 17:42:17 -06:00
Nicolas Williams
dd71303a2f hx509: Fix coverity warnings 2022-01-17 17:36:48 -06:00
Nicolas Williams
2e729a9aa2 hdb: Fix coverity warnings 2022-01-17 17:32:24 -06:00
Nicolas Williams
b9a915c163 base: Fix various coverity warnings 2022-01-17 16:23:36 -06:00
Jeffrey Altman
9c41d66447 kcm: kcm_op_do_ntlm dead code removal
duplicate error check introduced by
fe2dfe83a8
("clean up and make work, require libheim-ipcs")
2022-01-17 17:07:14 -05:00
Nicolas Williams
68e2135361 asn1: Fix coverity warnings 2022-01-17 16:00:07 -06:00
Nicolas Williams
a0278f7da2 asn1: Add error checking for open types 2022-01-17 16:00:07 -06:00
Jeffrey Altman
9ab9fe04f2 lib/ntlm: ret_string fix memory allocation check
Assignment to '*s'.   Do not test 's'.
s
2022-01-17 16:59:06 -05:00
Jeffrey Altman
15ef584f59 lib/sl: gen_wrapper free 'n' before return 2022-01-17 16:59:06 -05:00
Jeffrey Altman
3a52803e19 appl/kf: doit close socket before returning
Change-Id: Ida564ea4c27c1bd50004340ac7dbab5f11dbf531
2022-01-17 16:50:42 -05:00
Jeffrey Altman
27a2ad7bfc lib/kerb: verify_user_opt_int pass krb5_creds by ptr verify_common
Refactor the call to verify_common() to pass the krb5_cred by
pointer to and call krb5_free_cred_contents() in
verify_user_opt_int() instead of verify_common().
2022-01-17 16:31:48 -05:00
Nicolas Williams
b6114c5492 krb5: Make krb5_data_cmp() be good for sorting
The doc comment says it's good for sorting, but it wasn't really.  Now
it should be.
2022-01-17 15:17:33 -06:00
Nicolas Williams
4b7ad8ee43 hx509: Fix strerror(negative); streamline code
Calling strerror() with a negative value is an error.

Besides fixing that, we streamline hx509_get_error_string(), making it much
simpler and easier to read.
2022-01-17 15:17:33 -06:00
Nicolas Williams
7cfab00e37 kdc: One more memcmp() implicit comparison to 0 2022-01-17 15:17:33 -06:00
Joseph Sutton
9a0372d992 kdc: Still prefer encryption types with "not default" salts except for des-cbc-crc
Samba clients are often machine accounts with non-default salts that
will fail if they can't use the AES encryption type they know the KDC
supports.  The problem is that arcfour-hmac-md5 has no salt so was
being used in preference.

Samba started to fail when

kdc_config->preauth_use_strongest_session_key = true;

was forced into the KDC configuration.

The history here is an attempt to avoid Kerberos v4 salts in des-cbc-crc
keys, but this instead broke Samba clients with AES-keys on machine accounts
as these have a non-default salt by default.  These accounts were incorrectly
restricted to arcfour-hmac-md5 and they didn't like that.

A broader fix than Samba commit 8e1efd8bd3bf698dc0b6ed2081919f49b1412b53

REF: https://lists.samba.org/archive/samba/2021-October/237844.html

Samba BUG: https://bugzilla.samba.org/show_bug.cgi?id=14864

Change-Id: Ia8908a5a2eef107e6b133d7f0e4343c1988c18bb
2022-01-17 15:42:03 -05:00
Nicolas Williams
9fb444983e asn1: Better handling of >63 named bits/ints
First, we enlarge Member's val field to int64_t.

Then we warn about skipping 2int, int2, and parse units glue for such
things with too-large members.

And we error out when generating the template for such things with
>UINT32_MAX members.

What about too-negative members?  That could be a thing for INTEGER /
ENUMERATED.  We'll look at that later.
2022-01-17 12:39:19 -06:00
Nicolas Williams
bf243c1f41 kdc: Fix ENOMEM path null deref (synthetic princs) 2022-01-17 12:20:15 -06:00
Nicolas Williams
a25cf6335e krb5: Fix ENOMEM path null deref in _krb5_pac_sign 2022-01-17 12:16:28 -06:00
Nicolas Williams
e15657679c krb5: Check for errors in pa_announce() 2022-01-17 12:14:23 -06:00
Nicolas Williams
014aa4569d krb5: Attempt to quiet coverity in warning user
We sometimes use this idiom where we ignore the result of some function
such as krb5_unparse_name() and then we log something and we use the
ternary operator to handle any error from that function by substituting
a string like "<unknown>" or "<out-of-memory>".  This yields some static
analyzer complaints.  Maybe casting the function's result to void will
help.
2022-01-17 12:11:49 -06:00
Nicolas Williams
2e631d3b1b krb5: FAST: Remove dead code 2022-01-17 11:53:42 -06:00
Nicolas Williams
7fe5799090 gsskrb5: Fix dead code in get_transited() 2022-01-17 11:50:16 -06:00
Nicolas Williams
e894ed0162 krb5: Remove dead code in enc_chal_step() 2022-01-17 11:35:12 -06:00
Nicolas Williams
5c68a02407 krb5: FAST: Fix potential double-free
Coverity incorrectly thinks this is a NULL dereference after NULL check,
but it's not.  If anything, this could be a double-free.
2022-01-17 11:22:19 -06:00
Nicolas Williams
fc42ff0212 krb5: Fix NULL-deref in send_to_kdc
Coverity thinks `handle` in lib/krb5/send_to_kdc.c:krb5_sendto_context()
at 1241 can be NULL, leading to a NULL derefence in `get_next()`.  This
is an attempt to fix this by having `get_next()` check handle for NULL.
2022-01-17 11:16:07 -06:00
Nicolas Williams
04b07ff8b6 kdc: Quiet a coverity warning (TGS) 2022-01-17 11:05:05 -06:00
Nicolas Williams
3e51a0b84a kdc: Quiet a coverity warning 2022-01-17 11:04:21 -06:00
Nicolas Williams
fe63ddc487 gsskrb5: Remove dead code in split_attr() 2022-01-17 11:01:19 -06:00
Nicolas Williams
ad4e055831 base: Add r->kv not-null check before using it 2022-01-17 10:58:40 -06:00
Nicolas Williams
cf37c99222 krb5: get_cred: Add missing enc retval check 2022-01-17 10:53:13 -06:00
Nicolas Williams
c3643bb607 krb5: Remove KEYRING ccache dead code 2022-01-17 10:48:28 -06:00
Nicolas Williams
d658aa9b11 kadm5: Fix error-path leak 2022-01-17 10:48:07 -06:00
Nicolas Williams
4d5c5c6737 kdc: Add missing encryption retval check 2022-01-17 10:47:41 -06:00
Luke Howard
dca1048e96 gss: use memset rather than {0} to initialize channel bindings 2022-01-17 22:18:44 +11:00
Nicolas Williams
0f843189a4 kadmin: Check for errors in init 2022-01-17 00:45:37 -06:00
Nicolas Williams
fc5f917a66 hdb: Fix SQLite3 backend EXISTS error 2022-01-17 00:45:37 -06:00
Jeffrey Altman
63f9fc172c kadmin: kadmind_dispatch free 'ks_tuple' before overwriting
Change-Id: I8719c610a34ca128cc8a0b3d7f94dafc26b21e01
2022-01-17 00:16:27 -05:00
Nicolas Williams
6fc38099f7 ipropd: Initialize struct sigaction 2022-01-16 23:09:17 -06:00
Nicolas Williams
3d9333cefa kdc: Fix build 2022-01-16 23:08:49 -06:00
Nicolas Williams
d974c37a90 kadmin: Remove dead code in add_one_namespace() 2022-01-16 23:08:32 -06:00
Luke Howard
7f2cf34b1d gss: _gss_negoex_accept make error const
krb5_get_error_message() returns a const char *, not a char *. Amends
Change-Id I464b3c5.
2022-01-17 15:46:45 +11:00
Luke Howard
ce0ba125d9 gss: _gss_negoex_init make error const
krb5_get_error_message() returns a const char *, not a char *. Amends
Change-Id I870ed0b.
2022-01-17 15:46:41 +11:00
Jeffrey Altman
231aa68895 kadmin: add_one_namespace do not leak princ_ent
princ_ent must be saved to princ.principal early in order to
ensure that it is not leaked.

Change-Id: Ic74b48f434c727401c00e6fdcaecead988fe4263
2022-01-16 23:42:21 -05:00
Jeffrey Altman
54adba6023 kadmin: format_field KRB5_TL_ETYPES do not leak enctype string
Change-Id: I745216c334c038f55711c27f7885d8f96f656e79
2022-01-16 23:32:10 -05:00