Commit Graph

17824 Commits

Author SHA1 Message Date
Joseph Sutton
1c93a6ff26 heimdal: Avoid overflow when performing bitwise shift operations
Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
2022-01-18 00:31:45 -05:00
Jeffrey Altman
5fa0b7b6ff lib/krb5: krb5_sento_context KRB5_SENDTO_DONE KRB5_SENDTO_FAILED
Let the KRB5_SENDTO_DONE and KRB5_SENDTO_FAILED action states be
handled by the provided switch blocks.   This ensures that the
'ret' value is set appropriately before exiting the loop.

Change-Id: I56f4cea83efd86203a9a7a36cf48c80f632cf779
2022-01-17 23:02:01 -05:00
Jeffrey Altman
0e3acff241 lib/hcrypto: mpz2BN unsafe to call mp_to_ubin with NULL
remove the (size != 0) exception to malloc() failure.

Change-Id: I7a678b0fadd51c673491b61c06afd4203c871318
2022-01-17 21:41:21 -05:00
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
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
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
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
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
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
Luke Howard
dca1048e96 gss: use memset rather than {0} to initialize channel bindings 2022-01-17 22:18:44 +11:00
Nicolas Williams
fc5f917a66 hdb: Fix SQLite3 backend EXISTS error 2022-01-17 00:45:37 -06:00
Nicolas Williams
6fc38099f7 ipropd: Initialize struct sigaction 2022-01-16 23:09:17 -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
ff18c32ae4 lib/gssapi/ntlm: from_file do not leak 'f' on error
Change-Id: Ica774bc3c156c384a2cf7084259d31f445d24a7d
2022-01-16 23:10:33 -05:00
Jeffrey Altman
6e8ab0c204 lib/gssapi/spnego: _gss_negoex_accept do not leak error message
Change-Id: I464b3c5e5b96b36da2cda71b1dacc8ad971fda35
2022-01-16 23:04:54 -05:00
Jeffrey Altman
ac53ce5c99 lib/gssapi/spnego: _gss_negoex_init do not leak error message
Change-Id: I870ed0bd8de7bc6ab5b8cf7c6d3816d04de354fa
2022-01-16 23:02:38 -05:00
Jeffrey Altman
8254c01ae7 lib/gssapi/spnego: accept_sec_context free 'supported_mechs'
If no preferred mechanism was found 'supported_mechs' was leaked.

Change-Id: I2982f94d7e9569461f562987609ff7bff57b3f88
2022-01-16 22:57:15 -05:00
Jeffrey Altman
401bdd8bf3 lib/hx509: hx509_request_get_san SAN_TYPE_PKINIT return failure
if _hx509_unparse_KRB5PrincipalName() fails return the error code
to the hx509_request_get_san() caller.

Change-Id: I3ad8ceda23f00263890115f292ca7e4c8ce9317b
2022-01-16 22:43:02 -05:00
Jeffrey Altman
424aa1cb78 lib/asn1: _asn1_print_open_type free 'indents'
'indents' was leaked on one code path.

Change-Id: Ib4a7a8dcf7aae05a79ac6738da3a87a61e85c48e
2022-01-16 22:22:48 -05:00
Jeffrey Altman
73e2f335c2 lib/hdb: entry2mit_string_int free unparsed name on error
if append_string() fails do not leak the unparsed name.

Change-Id: I29d909c35e0e5d7282577ce37ec283efc33edbbf
2022-01-16 22:19:39 -05:00