Commit Graph

92 Commits

Author SHA1 Message Date
Jeffrey Altman
dba026b5ef Introduce and apply krb5_storage_from_socket
On Windows a file descriptor is an int value allocated by the
local module instance of the C Run Time Library.  A socket handle is a
SOCKET value allocated by a Winsock Provider for the requested family and
protocol.   These two values cannot be mixed and there is no mechanism for
converting between the two.   The _get_osfhandle() and _open_osfhandle()
functions can work with a standard HANDLE (file, pipe, etc) but cannot be
used for a SOCKET.

The Heimdal krb5_storage_from_fd() routine counted on the osf conversion
functions working on SOCKET values.  Since they do not any attempt to call
krb5_storage_from_fd() on a socket resulted in an assertion being thrown
by the C RTL.

Another problem is SOCKET value truncation when storing a 64-bit value
into a 32-bit int.

To address these problems a new krb5_storage_from_socket() routine is
introduced.  This routine setups a krb5_storage that stores a socket value
as a rk_socket_t and provides a set of helper routines that always use
network ready functions.

The krb5_storage_from_fd() routines no longer use net_read() and
net_write() but provide helpers that follow their logic so that pipes can
be processed.

All call sites that allocate a socket now store the socket as rk_socket_t
and call krb5_storage_from_socket().

All locations that previously called the bare close() on a socket value
now call rk_closesocket().

Change-Id: I045f775b2a5dbf5cf803751409490bc27fffe597
2014-02-04 23:20:08 -05:00
Jeffrey Altman
b845424a86 krb5: sync export lists
Sync the Windows and UNIX export lists for lib/krb5

Change-Id: I992921058c463335d0a3037ec035afd7f9d511b0
2013-09-10 22:31:39 -04:00
Love Hornquist Astrand
a3f21747aa move to new plugin system 2013-06-04 00:16:55 -07:00
Love Hornquist Astrand
060474df16 quel 64bit warnings, fixup implicit encoding for template, fix spelling 2013-06-03 21:46:20 -07:00
Viktor Dukhovni
2433496ea6 Simplify user_realm support by removing krb5_parse_name_flags_realm()
and setting the realm as necessary in the caller.
2013-05-16 23:15:00 -04:00
Viktor Dukhovni
a2127d091d New krb5_parse_name_flags_realm supports explicit default realm.
Set the realm argument to NULL to get the usual default realm.

The krb5_parse_name_flags() function is now a wrapper around
krb5_parse_name_flags_realm().
2013-05-16 00:32:08 -04:00
Love Hornquist Astrand
de61953108 handle creation of DIR caches 2013-04-29 22:54:11 -07:00
Love Hornquist Astrand
a7e86affd8 add basic DIR support for file caches 2013-04-29 12:30:21 -07:00
Nicolas Williams
d4f23fe2ae Revert c1423a8 and fix things up
Also, we were stopping as soon as one registered plugin returned
something other than KRB5_PLUGIN_NO_HANDLE, but we weren't doing the
same for discovered plugins.  Add KRB5_PLUGIN_INVOKE_ALL flag to deal
with this; by default we'll stop at the first plugin that returns
anything other than KRB5_PLUGIN_NO_HANDLE.

Other buglets fixed as in c1423a8.
2013-03-05 21:44:43 -06:00
Love Hornquist Astrand
54078654e7 add _krb5_plugin_run_f 2013-03-04 10:28:18 -08:00
Love Hornquist Astrand
c1423a8eea redo plugin interface 2013-02-10 22:50:49 -08:00
Nicolas Williams
dadcf3beb4 Fix bug in _krb5_expand_path_tokensv() 2012-07-15 01:30:09 -05:00
Jeffrey Altman
21b03df57a Remove krb5_425_xx and krb4 compat glue from exports
The lib/krb5 export lists contained the following functions
that are no longer in the tree:

  krb5_425_conv_principal
  krb5_425_conv_principal_ext2
  krb5_425_conv_principal_ext
  krb5_524_conv_principal
  _krb5_krb_tf_setup
  _krb5_krb_dest_tkt
  _krb5_krb_life_to_time
  _krb5_krb_decomp_ticket
  _krb5_krb_create_ticket
  _krb5_krb_create_ciph
  _krb5_krb_create_auth_reply
  _krb5_krb_rd_req
  _krb5_krb_free_auth_data
  _krb5_krb_time_to_life
  _krb5_krb_cr_err_reply

Change-Id: I1f73768de2f7e9243e4e7a623b54af282ec54641
2012-06-12 18:55:32 -04:00
Jeffrey Altman
aed7a3b948 Windows: missing exports on Windows
synchronize the export lists on Windows and UNIX.
When new functions are exported on UNIX or Windows,
the "test" build target on Windows will verify if
the export lists are in sync.

Change-Id: I9df3607983b03ee8dc6fa7cd22f85b07a6cee784
2012-06-12 18:48:37 -04:00
Roland C. Dowdeswell
df42274d96 Add krb5_storage_fsync().
We add a function to cause krb5_storage's to be sync'd to their backing
store.  For memory backed storages, this is a NOP.  For files, it calls
fsync on the file descriptor.
2012-05-28 13:14:55 +01:00
Nicolas Williams
ad60b236a0 Add missing symbols to export list 2011-11-22 17:04:03 -06:00
Love Hörnquist Åstrand
1a1bd736c0 merge support for FAST in as-req codepath 2011-10-28 19:25:48 -07:00
Love Hornquist Astrand
b1012edee3 add
krb5_auth_con_getsendsubkey
2011-10-19 21:11:12 +02:00
Love Hornquist Astrand
777b24fbb5 add krb5_is_enctype_weak 2011-09-26 08:47:37 +02:00
Linus Nordberg
bebb50797f Add krb5_init_creds symbols needed by kinit.
Signed-off-by: Love Hörnquist Åstrand <lha@h5l.org>
2011-07-24 20:24:39 -07:00
Love Hörnquist Åstrand
888780c9e7 add fast symbols 2011-07-24 20:24:39 -07:00
Love Hornquist Astrand
19e572db60 add krb5_process_last_request 2011-07-24 20:24:38 -07:00
Roland C. Dowdeswell
77c8ef2c06 krb5_free_default_realm() from mit_glue.c needs to be exported to be useful.
Signed-off-by: Love Hörnquist Åstrand <lha@h5l.org>
2011-07-19 21:25:47 -07:00
Love Hörnquist Åstrand
0f489b7b28 unexport krb5_init_etype, remove duplicate code 2011-06-14 21:08:52 -07:00
Love Hornquist Astrand
bd2d4c2f79 ->max_alloc to krb5_storage and use it 2011-05-08 00:16:02 -07:00
Love Hornquist Astrand
372db4d853 add krb5_kt_have_content 2011-04-07 07:15:27 -07:00
Love Hornquist Astrand
a70217d371 include krb5_copy_context 2011-04-01 00:27:32 -07:00
Luke Howard
841a5ed3ba export krb5_kcm_call/krb5_kcm_storage_request
Signed-off-by: Love Hornquist Astrand <lha@h5l.org>
2011-03-20 23:27:04 -07:00
Love Hornquist Astrand
ea2534a55f export krb5_enomem 2010-11-24 14:35:56 -08:00
Love Hornquist Astrand
8f2e0a7010 export internal functions so we dont need private headers 2010-11-20 14:05:54 -08:00
Love Hornquist Astrand
15f0adad02 add krb5_data_ct_cmp 2010-11-06 20:36:12 +01:00
Jan Rękorajski
99f690fd19 krb5_cc_last_change_time is missing 2010-10-18 16:07:59 -07:00
Love Hornquist Astrand
ba5c014af0 add krb5_get_permitted_enctypes 2010-09-08 22:04:03 -07:00
Russ Allbery
811d9003c1 Remove remnants of srvtab support
Support for manipulating srvtabs was previously removed, but there
were still remnants in command documentation in the ktutil man page
and some declared and exported variables for the keytab ops
definitions for srvtab manipulation.  Remove these additional
remnants.

Signed-off-by: Love Hornquist Astrand <lha@h5l.org>
2010-08-03 09:09:32 -07:00
Love Hornquist Astrand
71150bb1bc add krb5_principal_is_krbtgt 2010-03-07 01:00:48 -08:00
Russ Allbery
8a57d5cb08 Add krb5_allow_weak_crypto API to enable weak enctypes
Add krb5_allow_weak_crypto parallel to the API introduced in MIT
Kerberos 1.8.  Enables or disables all enctypes marked as weak.
Add a new enctype flag marking weak enctypes (all of the ones that
are disabled by default).

Signed-off-by: Love Hornquist Astrand <lha@h5l.org>
2010-01-27 21:50:58 -08:00
Russ Allbery
4038832098 Export krb5_principal_get_num_comp
krb5_principal_get_num_comp was prototyped as a public function but
not exported from libkrb5.  Add it to the export version map.

Signed-off-by: Love Hornquist Astrand <lha@h5l.org>
2010-01-25 22:39:14 -08:00
Love Hornquist Astrand
8df64cb195 add krb5_auth_con_getremoteseqnumber 2009-12-13 13:33:41 -08:00
Love Hornquist Astrand
722a54f6ba add missing ; 2009-12-13 13:29:02 -08:00
Gabor Gombas
b6fe5a95d3 kdc and kinit wanted to use some symbols that were not exported by
libkrb5/libkdc

Signed-off-by: Love Hornquist Astrand <lha@h5l.org>
2009-11-25 05:18:49 -08:00
Love Hornquist Astrand
d366ed823c add krb5_?prepend_error_message() 2009-10-12 10:23:28 -07:00
Love Hornquist Astrand
4bab1141d8 syntax error, from Harald Barth 2009-10-06 09:36:18 -07:00
Love Hornquist Astrand
a132ffe757 Simplify krb5_build_authenticator and unexport 2009-10-05 19:52:28 -07:00
Love Hornquist Astrand
97a511457f kinit helpers 2009-09-29 11:10:41 -07:00
Love Hornquist Astrand
a29c65b417 add krb5_free_unparsed_name for OpenSSH + gssapi patch, make it deprecated 2009-08-25 23:07:21 -07:00
Love Hornquist Astrand
0c5eeab318 move functions to private space that have no external consumers 2009-08-18 16:29:28 +02:00
Love Hornquist Astrand
b0757f7f3f Export krb5_crypto_fx_cf2 2009-08-14 05:49:02 +02:00
Love Hornquist Astrand
fa502c6648 Add support for gss_{import,export}_cred() as requested by metze
Works for krb5 and SPNEGO mechanisms. Kerberos credentials are passed as
credential cache names, or if there are memory based credentials, inband in the protocol. This means that the credentials buffers must be keep secret.

As documented by IBM (they have the wrong prototype though)
and GGF (GSS-API Extensions) back in 2001
2009-07-29 13:36:02 +02:00
Love Hörnquist Åstrand
c99b2003e2 Implement gss_wrap_iov, gss_unwrap_iov for CFX type encryption types.
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@25286 ec53bebd-3082-4978-b11e-865c3cabbd6b
2009-06-22 17:56:41 +00:00
Love Hörnquist Åstrand
1c9993d7da export krb5_cc_type_ *
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@25140 ec53bebd-3082-4978-b11e-865c3cabbd6b
2009-04-25 16:27:29 +00:00