Commit Graph

30319 Commits

Author SHA1 Message Date
Jeffrey Altman
1ebebe1d2f lib/hcrypto: RSA_check_key if rsa->n is NULL cannot call RSA_size
Avoid a theoretical NULL pointer dereference.

Change-Id: Ia7b8671152b5444fd5cfdb3e37fd62e4db68c9c5
2022-01-17 21:36:49 -05:00
Jeffrey Altman
ee3cd2e4a9 lib/hcrypto: RSA_new_method pass correct ptr to ENGINE_finish
Pass rsa->engine not engine.

Change-Id: I1251c50898b267d14cbf0bb2adb40516d24fa369
2022-01-17 21:28:37 -05:00
Jeffrey Altman
94a7e97e09 lib/hcrypto: DH_new_method pass correct ptr to ENGINE_finish
Pass dh->engine not engine.

Change-Id: Id7294a5ac3715d557202349bf20755d873ced7ae
2022-01-17 21:27:00 -05:00
Jeffrey Altman
5c7a4436e3 lib/hcrypto: dh-ltm update use of libtommath
warning: 'mp_read_unsigned_bin' is deprecated
(declared at ./libtommath/tommath.h:732): replaced by mp_from_ubin
[-Wdeprecated-declarations]

warning: 'mp_unsigned_bin_size' is deprecated
(declared at ./libtommath/tommath.h:731): replaced by mp_ubin_size
[-Wdeprecated-declarations]

warning: 'mp_to_unsigned_bin' is deprecated
(declared at ./libtommath/tommath.h:733): replaced by mp_to_ubin
[-Wdeprecated-declarations]

warning: 'mp_unsigned_bin_size' is deprecated
(declared at ./libtommath/tommath.h:731): replaced by mp_ubin_size
[-Wdeprecated-declarations]

warning: ignoring return value of 'mp_init_multi',
declared with attribute warn_unused_result [-Wunused-result]

warning: ignoring return value of 'mp_to_unsigned_bin',
declared with attribute warn_unused_result [-Wunused-result]

warning: ignoring return value of 'mp_read_unsigned_bin',
declared with attribute warn_unused_result [-Wunused-result]

Change-Id: I510fd7a57c9cd52b59086a85d13aa6204ebb9fd9
2022-01-17 21:11:54 -05:00
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