Commit Graph

28337 Commits

Author SHA1 Message Date
Jeffrey Altman
9e72c475ae hdb: need prototypes for hdb_ldap[i]_create
Commit 4b6bd40106 made hdb_ldap_create and
hdb_ldapi_create static in the OPENLDAP_MODULE case.  However, by
failing to leave a blank line between the static and the function
declaration the perl program that produces the hdb-protos.h file
skips the functions.

Add appropriate spacing.

Change-Id: I9ad24176fc31a0bce92b51f7adab141e8fa70fa3
2016-11-19 01:23:08 -05:00
Jeffrey Altman
11d1c81c27 kadmin: add_users leaks 'words'
Change-Id: I2607c8f0d774dd31d3b7f2341a65f4d43867548f
2016-11-19 00:21:42 -05:00
Jeffrey Altman
e772511b78 hdb: read_master_keytab free memory on failure
read_master_keytab() should always return with *mkey == NULL on
failure.  Doing otherwise can result in memory leaks or use of
an uninitialized pointer.

Change-Id: Ice1fd504ca573d73bb51dd3b01770c3f8bc59fd4
2016-11-19 00:16:59 -05:00
Jeffrey Altman
cdf5d324e3 kdc: _kdc_fast_unwrap_request leaks 'buf'
Change-Id: If4d3852112dadc331db1d3601b2c7bd6b3129429
2016-11-18 23:59:47 -05:00
Jeffrey Altman
a3e95f16b7 krb5: _kdc_encode_reply leaks 'buf' if early exit
Change-Id: I9e94535cd974ba463f813982325440a4ad8ba217
2016-11-18 23:53:53 -05:00
Nicolas Williams
52a562a3a4 Misc fixes (coverity) 2016-11-18 22:21:45 -06:00
Nicolas Williams
4b6bd40106 Quiet warning in --enable-hdb-openldap-module case
Functions that are not exported in this case should be static in this
case.
2016-11-18 22:21:45 -06:00
Jeffrey Altman
2fda484c2f kuser: generate_requests leaks 'words'
Change-Id: I67a4b4cdab5bf32b9d2b28d8429bb31202cd3b6b
2016-11-18 23:06:04 -05:00
Jeffrey Altman
5debfae6d1 er: klist print_tickets leaks 'str'
Change-Id: Ie86f3a9d64ceb6d44cd36be06700194b978247c9
2016-11-18 23:04:06 -05:00
Jeffrey Altman
26dd1edaa9 kswitch: memory leaks
ids and name must be freed before they go out of scope.

Change-Id: I0133c27994f7dc2832cea6b8529c060ed779c2ab
2016-11-18 22:51:59 -05:00
Jeffrey Altman
d4622f12e5 gssmask: HandleOp unused var principal
Always NULL.

Change-Id: I65074562b029effcec62c4edb5d33e3289a634db
2016-11-18 21:59:18 -05:00
Jeffrey Altman
69fbbfdfcb krb5: fix verify_conf syslog facility check
search for facility not severity

Change-Id: I79e9104d1fd27e8d11f7f9c6006676d947086ac5
2016-11-18 21:24:26 -05:00
Jeffrey Altman
89d87ab66a kadmin: do_mod_entry copy and paste error
when testing hist_kvno_diff_svc_integer do not use
hist_kvno_diff_clnt_integer.

Change-Id: Ib1d0224cdb1bab95ef0b104026f854cbfd8f736f
2016-11-18 21:18:55 -05:00
Jeffrey Altman
5cf454ca54 krb5: _krb5_expand_path_tokens missing va_end()
when returning early due to memory allocation error must call va_end()

Change-Id: Icc42771c166453f67679334cea19ed9be692bd87
2016-11-18 21:12:36 -05:00
Jeffrey Altman
97a40d8838 hdb: hdb_add_aliases frees uninitialized memory
This bug was never shipped in a release.  It was introduced by commit
1c81ddf4e2.

Change-Id: Ia9f6d69b2858a75cc51e50034fe70e29f13b8fc1
2016-11-18 20:58:39 -05:00
Jeffrey Altman
d07fe95b61 krb5: krb5_data_free() do not test before free()
Change-Id: I739eb0b227eb7885bb83b6e68eaf39db81b1ceb5
2016-11-18 20:43:19 -05:00
Nicolas Williams
7fa85e6d6d Round #3 of scan-build warnings cleanup 2016-11-16 23:27:27 -06:00
Nicolas Williams
1c81ddf4e2 Round #2 of scan-build warnings cleanup 2016-11-16 17:03:14 -06:00
Nicolas Williams
953dc07391 Round #1 of scan-build warnings cleanup 2016-11-15 21:27:20 -06:00
Nicolas Williams
274021f7db Make check-ldap run on Ubuntu
Apparmor on Ubuntu prevents slapd from using the Unix domain socket we
want it to.  The fix is to copy the slapd executable into the objdir,
which disables the apparmor profile for slapd.

Also, make sure the ldapi: URI has the right path for the socket in
krb5.conf.
2016-11-15 15:35:29 -06:00
Nicolas Williams
995966f9d1 Fix hdb_create() HDB dbname parsing 2016-11-15 15:35:19 -06:00
Nicolas Williams
2c20a5a8bc Set KRB5_CONFIG earlier in check-ldap
Otherwise the kdc won't find the plugin.
2016-11-15 14:16:54 -06:00
Nicolas Williams
475c222472 Fix lib/hdb/test_hdbplugin 2016-11-15 13:54:45 -06:00
Nicolas Williams
09f0a25fda kdc --builtin-hdb should list loadable backends
This fixes the following problems from #210:

 - hdb_ldap doesn't load even when installed correctly
 - loadable hdb backends not listed by kdc --builtin-hdb

Not fixed:

 - hdb_ldap.so not installed in plugin dir
2016-11-15 11:34:54 -06:00
Viktor Dukhovni
c69a205b4c Properly integrate upstream vis/unvis
Adding appropriate changes to configure.ac and config.h
2016-11-15 02:17:58 -05:00
Viktor Dukhovni
f5b9ec280e Import (unmodified) updated upstream vis/unvis
Will not compile, full integration in next commit.
2016-11-15 02:17:03 -05:00
Jeffrey Altman
f561b55d38 krb5: windows tests require HEIMBASE
When building the lib/krb5 tests link against HEIMBASE in order to
make use of heim_abort() and friends.

Change-Id: Ifaf54177bbb14cddf0f3544add370cda158783d1
2016-11-15 00:33:55 -05:00
Nicolas Williams
22790e4508 Test RODC interop fix 2016-11-14 21:29:47 -06:00
Nicolas Williams
9e2b696190 Make kdc name type strictness configurable 2016-11-14 21:29:47 -06:00
Jeffrey Altman
961f543a27 Set princ type to NT-SMTP-NAME when parsing
In krb5_parse_name_flags(), if the principal name is not an enterprise
name, is one component in length and contains an '@', set the principal
type to NT-SMTP-NAME as specified by RFC 4120.
2016-11-14 21:29:47 -06:00
Jeffrey Altman
6a1db3fb1c princ type NT-UNKNOWN + "host" == NT-SRV-HST
Treat principals of type NT-UNKNOWN as NT-SRV-HST if the first component
of the principal name is "host".

Change-Id: I28fb619379daac827436040e701d4ab7b279852b
2016-11-14 21:29:47 -06:00
Jeffrey Altman
5aef50c800 gss-krb5: do_delegate remove dead comment
The check on principal type has been commented out since do_delegate()
was committed.  Remove it.

Change-Id: Id98f35471e346cb3d0e9666b7cdb6f564191e6c1
2016-11-14 21:29:47 -06:00
Jeffrey Altman
09bdb3ab3e Set the right name type for anon princ (client)
In fast_wrap_req() set the correct type in KDC_REQ client principal
name.

Also fix ENOMEM handling.
2016-11-14 21:29:47 -06:00
Jeffrey Altman
020f2c733e kdc: principals of type NT-UNKNOWN can be anonymous
The _kdc_is_anonymous() helper function must take into account
that principals of type NT-UNKNOWN can match any other principal
type including NT-WELLKNOWN.

Change-Id: I6085b9471f6f1d662119e359491bbdce629ef048
2016-11-14 21:29:47 -06:00
Nicolas Williams
a59bb7132f When building a princ name pick a sane def type
This is part of the fix to #173.  MSFT RODCs insist on the name type for
krbtgt principals be set to KRB5_NT_SRV_INST.

Commentary from Jeffrey Altman <jaltman@secure-endpoints.com>

As reported by David Mulder of Dell's Quest, Active Directory will
return a BAD_INTEGRITY error when a request for a krbtgt service
ticket is received with principal type NT-PRINCIPAL instead of NT-SRV-INST
as required by RFC 4120.

[Nico: RFC4120 does not require this.  See the description of the
       name-type field of PrincipalName on page 55.]

  ERROR: VAS_ERR_KRB5: Failed to obtain credentials.
  Client: SLED10-32$@F.QAS,
  Service: SLED10-32$@F.QAS, Server: ad2-f.f.qas
  Caused by: KRB5KRB_AP_ERR_BAD_INTEGRITY (-1765328353): Decrypt integrity check failed

Microsoft began enforcing principal type checking for RODCs in 2008R2.
Microsoft does state that ALL krgtgt/REALM tickets SHOULD be sent using
principal name type of KRB5_NT_SRV_INST instead of KRB5_NT_PRINCIPAL.

From Microsoft:

  "I believe we discovered the problem. There isn't a bug in Windows.
  There's been a code change to address another issue which puts in additional
  checks for Kerberos tickets. The problem is with the Unix clients when the
  client request a TGT. The Unix clients are using Name-type Principal
  [KRB_NT_PRINCIPAL (1)] instead of using Name-type Service and Instance
  [KRB_NT_SRV_INST (2)]...."

This change assigns the NT-SRV-INST principal type each time a krbtgt
service principal is created.  Unlike Microsoft, the Heimdal mostly does
not care about the name-type of any principals, with the exception of
referrals, where the name type is needed to decide how to find a
next-hop realm.
2016-11-14 21:29:47 -06:00
Jeffrey Altman
84e959a752 gssmask: log_function memory leak
Do not leak 'file' on error and reduce clutter. free() in common exit
path.

Change-Id: Icb187ea50e9c3d405076a192aa61cbade4b6d7d4
2016-11-14 17:02:02 -05:00
Jeffrey Altman
d3fc257245 gssmask: client_connect addrinfo leak
In client_connect() getaddrinfo() stores the head of the allocated
addrinfo structure list in 'res0'.  'res' is used to walk the list
and will be NULL at the end of the for() loop when freeaddrinfo(res)
is executed.  Pass 'res0' to freeaddrinfo() instead of 'res'.

Change-Id: Ie1358c0356b6b0f98470e46e25216cfa0ab4adac
2016-11-14 16:56:08 -05:00
Jeffrey Altman
19e8852697 hdb: hdb_ldap_common NULL dereference
In hdb_ldap_common() the test

  if (search_base == NULL && search_base[0] == '\0')
     error handling ...

must be

  if (search_base == NULL || search_base[0] == '\0')
     error handling ...

Change-Id: I8d876a9c56833431b3c4b582fbb0a8cc7353893d
2016-11-14 16:33:51 -05:00
Jeffrey Altman
95c2940a02 hdb: LDAP_message2entry fix ntPasswordIN leak
free ntPasswordIN from all exit paths.  Do not leak it.

Change-Id: I90c5240439eefabca4458fe4791eb0de693a50f7
2016-11-14 16:25:36 -05:00
Viktor Dukhovni
6ee0e99cf3 Upstream NetBSD libedit has readline.h in readline/ not editline/ 2016-11-14 16:13:42 -05:00
Viktor Dukhovni
a3eb786491 Finish X removal 2016-11-14 16:02:43 -05:00
Jeffrey Altman
f917c9d17b configure.ac: remove AC_CHECK_XUA
The prior patch removed the definition of the XUA check but failed
to remove the execution of the check.  Do so now.

Change-Id: I648a374370d3549db0d98b90f810bd018dc28962
2016-11-14 15:38:09 -05:00
Viktor Dukhovni
d454492d01 Drop X11 autoconf and travis deps 2016-11-14 14:34:43 -05:00
Viktor Dukhovni
bb507cd4d4 Goodbye push 2016-11-14 14:19:58 -05:00
Viktor Dukhovni
b77e701a22 Goodbye login 2016-11-14 02:59:12 -05:00
Viktor Dukhovni
63d2935c4f Goodbye FTP 2016-11-14 02:42:08 -05:00
Viktor Dukhovni
eeeb216451 Restore unconditional use of getpwent vs. non-POSIX getpwent_r 2016-11-14 02:22:52 -05:00
Viktor Dukhovni
77ff7185d7 Updated libedit to NetBSD upstream
Note: This unconditionally assumes wchar_t support.  May need revision
if some platforms prove problematic.
2016-11-14 02:22:51 -05:00
Viktor Dukhovni
e1c1cdb1b6 HDB compiler warnings 2016-11-14 02:22:51 -05:00
Viktor Dukhovni
e4ba666221 hcrypto compiler warnings 2016-11-14 02:22:32 -05:00