Commit Graph

220 Commits

Author SHA1 Message Date
Viktor Dukhovni
96fd393d29 Disable Nagle in iprop master and slave 2019-10-03 15:52:15 -05:00
Rod Widdowson
e143639400 Windows: Windows CRT doesn't support %k as format for strftime
The fix involves:
  - Removing HAVE_STRFTIME from config.h.w32
  - Adding strftime.c to the makefile
  - Defining timezone and tzname to their windows equivalent
    for the compile of this module
2019-05-22 09:47:59 -04:00
Jeffrey Altman
1dd38cc3de lib/hx509: declare and apply HX509_LIB_xxx macros
libhx509 is not built according to the same export and calling conventions
on Windows as the other libraries.  This change declares and applies
HX509_LIB_FUNCTION, HX509_LIB_NORETURN_FUNCTION, HX509_LIB_CALL and
HX509_LIB_VARIABLE to lib/hx509.

As a result of this change the calling convention for exported functions
will be __stdcall instead of __cdecl.

Change-Id: Ibc3f05e8088030ef7d13798f1d9c9b190bc57797
2019-01-02 10:23:39 -06:00
Jeffrey Altman
bec4818943 WIN32: hint noreturn functions
apply __declspec(noreturn) compiler hints to functions that
do not return.

Change-Id: I3c6c4703c7235d1df3e21dccad5272ea4cddfd36
2019-01-02 10:23:39 -06:00
Luke Howard
7098aa038b Windows: remove reference to NetInfo 2019-01-01 12:53:17 +11:00
Luke Howard
b9dcbe505d Windows: default client keytab to %{LOCAL_APPDATA}/Kerberos/client.keytab 2019-01-01 12:53:17 +11:00
Luke Howard
af0d8ef677 gssapi: support for client keytab in gss_acquire_cred (#383)
For compatibility with MIT Kerberos, support automatic acquisition of initiator
credentials if a client keytab is available. The default path on non-Windows is
/var/heimdal/user/%{euid}/client.keytab, but can be overriden with the
KRB5_CLIENT_KTNAME environment variable or the default_client_keytab_name
configuration option. If a client keytab does not exist, or exists but does not
contain the principal for which initiator credentials are being acquired, the
system keytab is tried.
2018-12-31 18:20:37 +11:00
Nicolas Williams
e2685c5b7c Add check for getpw*_r() 2018-12-25 22:11:19 -06:00
Nicolas Williams
a988692434 Add check for getlogin_r() 2018-12-25 22:11:19 -06:00
Nicolas Williams
8fae8a1826 Remove iruserok() 2018-12-25 22:11:19 -06:00
Nicolas Williams
3b8c762dd0 Remove lib/roken glob()
We no longer use it since removing ftp from appl/.

Note that expansion of ~username/ couldn't have been working because
k_getpwnam() was being called with an unsigned short * that was forcibly
cast to char *, but it really was shorts, not chars...  Anyone who ever
feels like reviving lib/roken/glob.[ch] will want to fix that...
2018-12-25 22:11:19 -06:00
Luke Howard
fb81598d44 krb5: port MIT Linux keyring credentials cache (#166) 2018-12-24 18:17:32 +11:00
Daria Phoebe Brashear
39b78ad6ce sunpro c defines __SUNPRO_C not __SUNPRO_CC
CC is the c++ compiler; C is the c compiler. use the correct define
2018-04-19 13:12:59 -04:00
Nicolas Williams
123f702001 lib/roken: add fseeko()/ftello() 2017-05-26 23:24:30 -04:00
Nicolas Williams
6a0f45c4d7 Use __attribute__ ((__name__)) form
Protect against macros named noreturn and so on.
2017-03-13 18:39:41 -04:00
Nicolas Williams
3e65dfbc32 Fix make dist missing files (#228) 2016-12-15 12:15:56 -06:00
Nicolas Williams
e75be174e0 Fix Windows build perl issue 2016-12-08 17:52:52 -06:00
Nicolas Williams
1c81ddf4e2 Round #2 of scan-build warnings cleanup 2016-11-16 17:03:14 -06:00
Viktor Dukhovni
a3eb786491 Finish X removal 2016-11-14 16:02: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
Jelmer Vernooij
0113798b18 Don't put system architecture in generated headers.
Including HOST causes the build to be unreproducible.
2016-05-15 23:04:49 +00:00
Jeffrey Altman
a4dae2513f Windows: add HCRYPTO_FALLBACK config to build system
HCRYPTO_FALLBACK is a required definition for building lib/hcrypto.
However, it wasn't added to the Windows build system.  This change
does so and enables fallback functionality.

Change-Id: I4a711c6da58e8832a61a3c0b2b8d9b10038425f0
2016-04-23 19:02:20 -04:00
Nicolas Williams
2cd233db43 Add HEIMDAL_THREAD_create() macros 2016-04-15 00:16:17 -05:00
Nicolas Williams
2f0c45f784 Add thread-locals for WIN32 2016-04-15 00:16:17 -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
22934bae7c Fix heim_threads.h rwlocks macros for pthreads 2016-04-15 00:16:13 -05:00
Nicolas Williams
c2fafff992 WIN32 thread primitives must return int
Also, zero return means "success", non-zero means "failure" and the
non-zero value is a system error.  That's how it is for the other
platforms' thread primitives.

(The no-threads defaults are still wrong though, as then are macros that
expand into do..while, which can't be used as expressions and don't
"return" values.)
2016-04-15 00:16:13 -05:00
Nicolas Williams
1f53a40827 threads: Windows mutex and rwlock implementation
Change-Id: I087bd5884eca9f232f4b5a2a6463b06b38a488e7
2016-04-10 17:05:07 -05:00
Roland C. Dowdeswell
3e6fffed60 include/Makefile.am: don't clean files that are distributed.
We stop cleaning crypto-headers.h and heim_threads.h.
2015-11-06 17:06:26 -05:00
Bernard Spil
858480145b Refactor EGD conditional support
As per Jeremy's request in #124
Windows does not define HAVE_RAND_EGD resulting in the same conditional
support for EGD.
2015-04-21 10:04:08 +02:00
Viktor Dukhovni
08c628b240 BN_is_negative is no longer a macro in OpenSSL master 2015-03-04 19:49:40 -05:00
Viktor Dukhovni
529f17bbec OpenSSL master requires more explicit #includes 2015-03-04 19:46:54 -05:00
Ken Dreyer
10a7fb0bfa Properly terminate ifdef conditional in krb5-types.h 2014-02-17 13:25:16 -07:00
Love Hörnquist Åstrand
1223428b85 add missing files, sort stuff 2014-02-16 11:47:27 -08:00
Jeffrey Altman
d9bc256199 define HEIMDAL_WARN_UNUSED_RESULT_ATTRIBUTE
Always define HEIMDAL_WARN_UNUSED_RESULT_ATTRIBUTE even if attributes are
not supported.

Change-Id: Ibc2110d809d81f546723853038c69176075d6013
2014-02-04 23:20:10 -05:00
Love Hornquist Astrand
516c12c9a9 intruduce krb5_generate_random() that can fail and return an error, check for it at krb5_context creation time 2013-10-21 08:22:02 -07:00
Jeffrey Altman
466953b6ee Windows: remove unintended text string
patchset b9d7e33a2f introduced some
garbage at the beginning of the include/NTMakefile.  remove it.

Change-Id: Ia24ea3a03aa9ed10b8076112b6486e23f1c36b7c
2013-09-15 00:48:45 -04:00
Tony Acero
b9d7e33a2f Windows: Fix perl string equality for Debug Builds
Use "eq" and not "=~"

Change-Id: Iac38ff9859ab40fc30aba0df90956b6029c04cb6
2013-09-13 22:18:57 -04:00
Nicolas Williams
3e74e2e3bb Fix some DLL hell: use dladdr() to find plugin dir
Normally one would dlopen() a shared object's basename, not its absolute
path.  However, lib/krb5/plugin.c, in an effort to be zero-conf-ish,
wants to readdir() to find plugins to load, and in the process it ends
up defeating the RTLD's search-the-caller's-rpath.

This commit partially addresses this by allowing the use of $ORIGIN in
plugin_dir values and using them for the default (except on OS X).

This allows multiple Heimdal versions installed on the same host, but
with different plugin ABIs, to co-exist.  A step forward for doing make
check on hosts where Heimdal is installed.

For now we hardcode $ORIGIN/../lib/plugin/krb5 (linux, Solaris, *BSD),
or $ORIGIN (Windows; for assemblies objects need to be in the same
directory) and we eval $ORIGIN by using dladdr() (Linux, Solaris) or
GetModuleHandleEx() (Win32, via a dladdr() wrapper in libroken) to find
the path to libkrb5 whose dirname to use as $ORIGIN.  For Windows,
because we need the plugins to be in the same directory as libkrb5, we
require a prefix on plugin DLLs ("plugin_krb5_") to distinguish them
from other objects.

We should add a special token to mean "look in $ORIGIN, sure, but
dlopen() the plugin basenames only (so the RTLD can search the rpath)".
2013-09-06 16:51:53 -05:00
Nico Williams
1f78baf198 Make krb5-types.h define int64_t on Win32 2013-07-16 21:04:32 -05:00
Ben Kaduk
5dfaa0d10b Be friendly to krb5_generate_random_block consumers
Allow them to disable the EGD/profile access and the use of a
random seed file.

These facilities are not tenable when running in the kernel.
2013-07-03 23:17:38 -05:00
Nicolas Williams
6dd66df594 Make master build on Windows
Add strtoll()/strtoull() to lib/roken
    Add stdint.h to lib/roken (Windows only)
    Add logic to detect whether to use lib/roken's stdint.h based on
        Visual Studio version
    Add include of stdint.h in generated ASN.1 code
    Export missing symbols for 64-bit integers in lib/asn1
    Export missing symbols for FAST
    Add missing sources to kdc/NTMakefile
    Fix issue in kuserok
    Fix bsearch issues
2012-01-17 12:10:14 -06:00
Jeffrey Altman
bad61548dd Windows: Version mgmt for assemblies and thirdparty
Breakout the version data from windows/NTMakefile.config
and move it to windows/NTMakefile.version.  This new file
contains only version data.  This permits version data to
be safely referenced by third party components.

In addition, add version range information for those versions
of Heimdal for which this release is a compatible upgrade.  If
there is a forward incompatible change to the assembly ABI, it
is not a compatible upgrade.  This version data is used to specify
the Windows assembly redirect range.

Change-Id: Ic9f156212599cc4277e2be812f29a6497801046c
2011-09-23 09:48:42 -04:00
Love Hörnquist Åstrand
7aaba443bc add NTMakefile and windows directories 2011-07-17 12:16:59 -07:00
Love Hörnquist Åstrand
e5eb401fcd simplify checking and start to use __has_extension 2011-06-19 10:43:12 -07:00
Love Hörnquist Åstrand
b8ddbe73c4 quite down clang analyzer warnings for the generate asn1 code 2011-06-14 22:29:49 -07:00
Love Hornquist Astrand
0879b9831a remove trailing whitespace 2011-05-21 11:57:31 -07:00
Jeffrey Altman
87aad6a13a Add NO_LOCALNAME
The pname to uid functionality at present assumes there is
an implementation of getpwnam() and that the local user
identifier is an integer.  On Windows, the local user identifier
is a SId.  Add NO_LOCALNAME as a build option so that Windows
(for now) can build without providing a getpwnam() implementation.

Change-Id: I04cfd6d2cd52e6228733f1da1dab420b453e6566
2011-05-17 13:56:37 -04:00