]> git.ipfire.org Git - thirdparty/krb5.git/commit
Fix minor logic errors 1392/head
authorGreg Hudson <ghudson@mit.edu>
Sun, 17 Nov 2024 18:54:12 +0000 (13:54 -0500)
committerGreg Hudson <ghudson@mit.edu>
Tue, 10 Dec 2024 02:27:27 +0000 (21:27 -0500)
commite50f46b210ddafe85cc917e2571516ade46bc65f
tree528b969cc11c4fe48060a2d65f83a1d84d3609f5
parentad72f357ceba3f8210393d03cf29cfc3140db3ec
Fix minor logic errors

In k5_externalize_auth_context(), serialize the correct field when
remote_port is set.  This is not a reachable bug because the function
is only accessible via gss_export_sec_context(), and the GSS library
does not set a remote port.

In generic_gss_oid_to_str(), remove an inconsistently-applied test for
a null minor_status.  Also remove minor_status null checks from
generic_gss_release_oid() and generic_gss_str_to_oid(), but add output
initializations and pointer checks to the API functions in g_oid_ops.c
in a similar manner to other GSSAPI functions.  Remove
gssint_copy_oid_set() and replace its one call with a call to
generic_gss_copy_oid_set().

In the checksum functions, avoid crashing if the caller passes a null
key and checksum type 0.  An error will be returned instead when
find_cksumtype() can't find the checksum type.
(krb5_k_verify_checksum() already had this check.)

In pkinit_open_session(), remove an unnecessary null check for
ctx->p11_module_name, and add a check for p11name being null due to an
asprintf() failure.

In profile_add_node(), add a check for null ret_node in the duplicate
subsection check.  This is not a reachable bug because the function is
currently never called with null ret_node and null value.

In ksu's main(), check for krb5_cc_default_name() returning NULL
(which only happens on allocation failure).  Also clean up some
vestiges left behind by commit
9ebae7cb434b9b177c0af85c67a6d6267f46bc68.

In ksu's get_authorized_princ_names(), close login_fp if we fail to
open k5users_path.

In the KDC and kpropd write_pid_file(), avoid briefly leaking the file
handle on write failure.

Reported by Valery Fedorenko.
15 files changed:
src/clients/ksu/heuristic.c
src/clients/ksu/main.c
src/kadmin/server/ovsec_kadmd.c
src/kdc/main.c
src/kprop/kpropd.c
src/lib/crypto/krb/make_checksum.c
src/lib/crypto/krb/make_checksum_iov.c
src/lib/crypto/krb/verify_checksum_iov.c
src/lib/gssapi/generic/oid_ops.c
src/lib/gssapi/mechglue/g_oid_ops.c
src/lib/gssapi/mechglue/mglueP.h
src/lib/gssapi/spnego/spnego_mech.c
src/lib/krb5/krb/ser_actx.c
src/plugins/preauth/pkinit/pkinit_crypto_openssl.c
src/util/profile/prof_tree.c