Commit Graph

3641 Commits

Author SHA1 Message Date
Jeffrey Altman
d4622f12e5 gssmask: HandleOp unused var principal
Always NULL.

Change-Id: I65074562b029effcec62c4edb5d33e3289a634db
2016-11-18 21:59:18 -05: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
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
Nicolas Williams
76c596ceb8 Complete support for --disable-afs-support 2016-08-10 19:51:11 -05:00
Jeffrey Altman
22c5327287 gssmask: check return of krb5_init_context
Check the return value so that a more obtuse error does not occur
later on.

Change-Id: I2115cc58e6fc24b63272b2ae811d64a4966de5d4
2016-04-17 15:11:14 -05:00
Nicolas Williams
490337f4f9 Make OpenSSL an hcrypto backend proper
This adds a new backend for libhcrypto: the OpenSSL backend.

Now libhcrypto has these backends:

 - hcrypto itself (i.e., the algorithms coded in lib/hcrypto)
 - Common Crypto (OS X)
 - PKCS#11 (specifically for Solaris, but not Solaris-specific)
 - Windows CNG (Windows)
 - OpenSSL (generic)

The ./configure --with-openssl=... option no longer disables the use of
hcrypto.  Instead it enables the use of OpenSSL as a (and the default)
backend in libhcrypto.  The libhcrypto framework is now always used.

OpenSSL should no longer be used directly within Heimdal, except in the
OpenSSL hcrypto backend itself, and files where elliptic curve (EC)
crypto is needed.

Because libhcrypto's EC support is incomplete, we can only use OpenSSL
for EC.  Currently that means separating all EC-using code so that it
does not use hcrypto, thus the libhx509/hxtool and PKINIT EC code has
been moved out of the files it used to be in.
2016-04-15 00:16:17 -05:00
Nicolas Williams
c6f24e99f0 Revamp cf/db.m4; test LMDB 2016-02-26 00:55:32 -06:00
vdukhovni
beb187b9ac Merge pull request #127 from jelmer/typo-fixes
Typo: enviroment -> environment.
2015-04-25 13:58:46 -04:00
Jelmer Vernooij
9eb31585c0 Typo: enviroment -> environment. 2015-04-25 17:37:17 +00:00
Nicolas Williams
73c4db7269 coverity 745505 2015-04-18 23:19:25 -05:00
Love Hörnquist Åstrand
920eccc59e X11 tools have outlived their usefulness, use SSH and pam with native locker 2015-03-04 19:18:00 -08:00
Viktor Dukhovni
a71fa7b04d Silence LLVM compiler warnings
Should we simply drop FTP from the source at some point?
2015-03-04 19:44:20 -05:00
Love Hörnquist Åstrand
37afa01be3 rename roken base64, fixes #107 2014-08-22 20:57:24 -07:00
Jelmer Vernooij
ea062e4bb2 Remove references to KRBTKFILE from login.1 and kinit.1. 2014-06-02 00:32:37 +02:00
Jelmer Vernooij
5a75d6fe43 afslog.1: Remove documentation for removed no-v4 argument. 2014-06-02 00:32:37 +02:00
Jelmer Vernooij
70e43e9808 Fix some typos. 2014-04-25 02:42:17 +02:00
Love Hörnquist Åstrand
9c560f8443 use noinst_HEADERS for login-protos.h 2014-02-16 10:04:49 -08:00
Love Hörnquist Åstrand
e55b0d0ca5 delete POP3, telnet and rsh/rcp support 2014-02-16 09:14:19 -08:00
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
Love Hornquist Astrand
2107924b37 catch error from krb5_ functions
Reported by http://www.forallsecure.com/bug-reports/2f227b78584144ab1f55549b36ea16ba2d1664e0/ via
Brian May <bam@debian.org>
2013-06-28 08:46:26 +02:00
Nicolas Williams
a53f3a49e2 Fix unused variable warnings 2013-06-02 15:52:41 -05:00
Viktor Dukhovni
bf40b8cc63 Comment wordsmithing 2013-05-02 01:31:01 -04:00
Love Hornquist Astrand
f17c4a6c5c only check for keytab content where its needed 2013-04-24 16:42:30 -07:00
Love Hornquist Astrand
f97f15a86c bound len 2012-11-27 22:01:37 -08:00
Love Hornquist Astrand
764e701e2d try to unconfuse coverity 2012-11-27 21:58:05 -08:00
Roland C. Dowdeswell
be5afdbf7f Make concurrent builds work.
To stop the errors when building concurrently, we make a number of
changes:

        1.  stop including generated files in *_SOURCES,

        2.  make *-protos.h and *-private.h depend on the *_SOURCES,

        3.  make all objects depend on *-{protos,private}.h,

        4.  in a few places change dir/header.h to $(srcdir)/dir/header.h,

This appears to work for me with make -j16 on a 4-way box.
2012-08-08 00:04:04 +01:00
Roland C. Dowdeswell
5459558dea Move #undef ENABLE_PTHREAD_SUPPORT lower in appl/gssmask/common.h
This wasn't having the intended effect because after we #include
config.h and #undef ENABLE_PTHREAD_SUPPORT we then #include other
headers that also #include config.h.  I've moved this lower so that
it has the effect that appears to be intended but the correct answer
may be to make it work but this will require #including pthread.h
as the build fails with -Werror when pthread functions are called.
2012-06-07 16:57:51 +01:00
Marco Molteni
8cdcd53a5a Add comments to tcp_server.c, to make it easier for a newcomer to understand the krb5 API usage.
Signed-off-by: Love Hornquist Astrand <lha@h5l.org>
2012-05-09 08:15:51 +02:00
Marco Molteni
e242c40746 Verify the existence of the keytab for tcp_server, gssapi_server
appl/test/tcp_server and gssapi_server try to open the keytab file only when processing a connection.

This patch verifies the existence of the keytab file on program startup, so that troubleshooting is easier. In addition it adds some comments.

Signed-off-by: Love Hornquist Astrand <lha@h5l.org>
2012-05-01 23:01:19 +02:00
Jelmer Vernooij
15696d9b90 telnet.1: Avoid undefined macro 'B'.
Signed-off-by: Love Hörnquist Åstrand <lha@h5l.org>
2012-03-18 11:25:55 -07:00
Love Hörnquist Åstrand
d791e70894 support ipv6 2012-03-07 07:58:50 -08:00
Roland C. Dowdeswell
e8779d5d4a Add -Wshadow and deal with the warnings. 2012-02-21 11:17:55 +00:00
Roland C. Dowdeswell
cc47c8fa7b Turn on -Wextra -Wno-sign-compare -Wno-unused-paramter and fix issues.
We turn on a few extra warnings and fix the fallout that occurs
when building with --enable-developer.  Note that we get different
warnings on different machines and so this will be a work in
progress.  So far, we have built on NetBSD/amd64 5.99.64 (which
uses gcc 4.5.3) and Ubuntu 10.04.3 LTS (which uses gcc 4.4.3).

Notably, we fixed

	1.  a lot of missing structure initialisers,

	2.  unchecked return values for functions that glibc
	    marks as __attribute__((warn-unused-result)),

	3.  made minor modifications to slc and asn1_compile
	    which can generate code which generates warnings,
	    and

	4.  a few stragglers here and there.

We turned off the extended warnings for many programs in appl/ as
they are nearing the end of their useful lifetime, e.g.  rsh, rcp,
popper, ftp and telnet.

Interestingly, glibc's strncmp() macro needed to be worked around
whereas the function calls did not.

We have not yet tried this on 32 bit platforms, so there will be
a few more warnings when we do.
2012-02-20 19:45:41 +00:00
Roland C. Dowdeswell
083780d5b5 Eliminate warning.
On NetBSD, cgetent has a prototype of ``const char *const *'' for
argument two.  Many other OSes have ``char **''.  It seems that
gcc will generate a warning if you pass a char ** to it.  Casting
the value to void avoids this warning.
2012-02-15 13:08:33 +00:00
Roland C. Dowdeswell
db484e73a2 Fix a few warnings. 2012-02-15 12:01:12 +00:00
Nicolas Williams
f4ba41ebdd Pluggable libheimbase interface for DBs and misc libheimbase enhancements
[Code reviewed by Love Hörnquist Åstrand <lha@kth.se>]

    Added heim_db_*() entry points for dealing with databases, and
    make krb5_aname_to_localname() use it.

    The following enhancements to libheimbase are included:

     - Add heim_data_t and heim_string_t "reference" variants to
       avoid memory copies of potentially large data/strings.

       See heim_data_ref_create() and heim_string_ref_create().

     - Added enhancements to heim_array_t to allow their use for
       queues and stacks, and to improve performance.  See
       heim_array_insert_value().

     - Added XPath-like accessors for heim_object_t.  See
       heim_path_get(), heim_path_copy(), heim_path_create(), and
       heim_path_delete().  These are used extensively in the DB
       framework's generic composition of ACID support and in the
       test_base program

     - Made libheimbase more consistent with Core Foundation naming
       conventions.  See heim_{dict, array}_{get, copy}_value() and
       heim_path_{get, copy}().

     - Added functionality to and fixed bugs in base/json.c:
        - heim_serialize();
        - depth limit for JSON parsing (for DoS protection);
        - pretty-printing;
        - JSON compliance (see below);
        - flag options for parsing and serializing; these are needed
          because of impedance mismatches between heim_object_t and
          JSON (e.g., heim_dict_t allows non-string keys, but JSON
          does not; heimbase supports binary data, while JSON does
          not).

     - Added heim_error_enomem().

     - Enhanced the test_base program to test new functionality and
       to use heim_path*() to better test JSON encoding.  This
       includes some fuzz testing of JSON parsing, and running the
       test under valgrind.

     - Started to add doxygen documentation for libheimbase (but doc
       build for libheimbase is still incomplete).

    Note that there's still some incomplete JSON support:

     - JSON string quoting is not fully implemented;

     - libheimbase lacks support for real numbers, while JSON has
       it -- otherwise libheimbase is a superset of JSON,
       specifically in that any heim_object_t can be a key for an
       associative array.

    The following DB backends are supported natively:

     - "sorted-text", a binary search of sorted (in C locale), flat
       text files;

     - "json", a backend that stores DB contents serialized as JSON
       (this is intended for configuration-like contents).

    The DB framework supports:

     - multiple key/value tables per-DB
     - ACID transactions

    The DB framework also natively implements ACID transactions for
    any DB backends that a) do not provide transactions natively, b)
    do provide lock/unlock/sync methods (even on Windows).  This
    includes autocommit of DB updates outside transactions.

    Future DB enhancements may include:

     - add backends for various DB types (BDB, CDB, MDB, ...);

     - make libhdb use heim_db_t;

     - add a command-line tool for interfacing to databases via
       libheimbase (e.g., to get/set/delete values, create/copy/
       backup DBs, inspect history, check integrity);

     - framework-level transaction logging (with redo and undo
       logging), for generic incremental replication;

     - framework-level DB integrity checking.

       We could store a MAC of the XOR of a hash function applied to
       {key, value} for every entry in the DB, then use this to check
       DB integrity incrementally during incremental replication, as
       well as for the whole DB.
2012-02-05 16:26:32 -06:00
Nicolas Williams
7d7624f7f7 Fix CVE-2011-4862 Buffer overflow in libtelnet/encrypt.c in telnetd
http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2011-4862
    http://security.freebsd.org/advisories/FreeBSD-SA-11:08.telnetd.asc
    http://security.freebsd.org/patches/SA-11:08/telnetd.patch
2011-12-28 17:50:30 -06:00
Nicolas Williams
89bae59b49 Fix error clobbering bug and code review comments 2011-12-02 01:04:22 -06:00
Nicolas Williams
659c761213 Add private text file binary search API to libheimbase 2011-12-02 01:02:44 -06:00
Nicolas Williams
265d9ba5ca Error/warning cleanups for clang (LLVM) 2011-11-28 14:42:06 -06:00
Love Hornquist Astrand
84caf5bbd8 jgssapi_server is a java file 2011-11-09 08:04:52 -08:00
Nicolas Williams
40a7d4b62f More fixes for -Werror (GCC 4.6 catches more stuff) 2011-11-02 23:20:55 -05:00
Nicolas Williams
3bebbe5323 Fixes to make Heimdal -Wall -Werror clean
These fixes make developer mode build, at least on Ubuntu.
2011-11-02 21:42:08 -05:00
Love Hornquist Astrand
483afb3390 avoid compile warning 2011-10-29 19:14:14 -07:00
Love Hornquist Astrand
00773b4119 test verify_mic is both directions 2011-09-25 20:38:17 +02:00
Love Hornquist Astrand
d9dc7c9761 try read message in java code too 2011-09-25 19:40:02 +02:00
Love Hornquist Astrand
aabe9f0f4a let client do unwrap, handle keytab for gss 2011-09-22 16:10:06 +02:00