Commit Graph

1967 Commits

Author SHA1 Message Date
Luke Howard befe1b8f90 always load plugins with RTLD_LOCAL/RTLD_GROUP if available 2019-01-03 20:06:27 -06: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
Nicolas Williams 620862049e Use roken_get_*() instead of getpwuuid()
Using non-reentrant getpwuid() (or getpwnam(), or getspnam())  can be
dangerous.  We had a report of a login application / PAM that calls
those, and Heimdal, by calling them too, clobbered the cached struct
passwd used by the login app / PAM.
2018-12-25 22:11:19 -06:00
Luke Howard 6561afff3a hx509: update gen_req.sh for OpenSSL 1.1 (#392)
OpenSSL 1.1 has the pkInitKDC OID built in, which breaks as it was redefined by
openssl.cnf in Heimdal. Try to determine if OpenSSL >= 1.1 and if so, use a
configuration file that omits this OID definition. The implementation is not
robust but as this is simply an example (not run by the test suites), it should
be adequete.
2018-12-24 12:13:29 -06:00
Luke Howard 572a6fd7ac hx509: fix dependency, hxtool requires ASN.1 headers 2018-12-24 02:25:19 +00:00
Chris Lamb 7f834b63cc Correct "explicity" typos.
Signed-off-by: Chris Lamb <chris@chris-lamb.co.uk>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
(cherry picked from Samba commit 45b14b18fe3f01ae8ea22afcd112205b8a4cf9bc)
2018-09-10 14:42:18 -04:00
Chris Lamb 6d4da04566 Correct "existence" typos.
Signed-off-by: Chris Lamb <chris@chris-lamb.co.uk>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
(cherry picked from Samba commit 5482e5426e09667d26e04dd0c6e0107e46e1028f)
2018-09-10 14:42:18 -04:00
Chris Lamb aa119d1792 Correct "doesnt" typos.
Signed-off-by: Chris Lamb <chris@chris-lamb.co.uk>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
(cherry picked from Samba commit c4feed0b8cb6df71e14a30c07e4b5560368f54cc)
2018-09-10 14:42:18 -04:00
Chris Lamb 9c2351eb25 Correct "paramaters" typos.
Signed-off-by: Chris Lamb <chris@chris-lamb.co.uk>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>

(cherry-picked from Samba commit e0366ea49d5daa8fbf8b2ca22b1d3c77cc2daf9a)
2018-09-10 14:42:18 -04:00
Nicolas Williams c551ad9458 Fix Appveyor build: lib/hx509 2017-05-26 23:24:30 -04:00
Jeffrey Altman 12afd9c4b7 include field separators in comparison
When comparing the first component of a multi-component
string that uses a field separator (e.g., '/' or ':'), be sure
to include the separator in the comparison to ensure that the
comparison does not succeed due to a prefix match.

Change-Id: Ieec3e73cb015a83bb652ec11cd7d83e57755c3d2
2017-04-29 01:05:59 -04:00
Jeffrey Altman 93518bfab4 use memset_s
lib roken includes support for memset_s() but it was not applied
to the Heimdal source tree.

Change-Id: I8362ec97a9be50205bb2d398e65b629b88ce1acd
2017-04-29 01:05:59 -04:00
Nicolas Williams 7dfad1ab0b Use secure_getenv() instead of issuid() 2017-04-17 18:02:30 -04:00
Viktor Dukhovni aad3b229ae Fix off by 1 write. 2017-03-17 11:51:30 -04:00
Viktor Dukhovni 14135e90aa Add rationale comments for conditional yyparse redefinition 2017-03-15 19:15:57 -04:00
Nicolas Williams 3cec979cc4 Don't #define yyparse when using bison/flex
Originally by Christos Zoulas.
2017-03-13 18:39:41 -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
Quanah Gibson-Mount 7c16ce3457 Minor typo/grammar fixes 2017-03-10 15:47:43 -05:00
Nicolas Williams 3e65dfbc32 Fix make dist missing files (#228) 2016-12-15 12:15:56 -06:00
Viktor Dukhovni 3657f23a9e Fix more doxygen bitrot 2016-12-15 04:28:21 -05:00
Nicolas Williams 2ebec2e4ec Fix some Doxygen warnings 2016-12-14 22:05:46 -06:00
Nicolas Williams 3ba12317a0 Misc fixes (coverity) 2016-11-28 15:09:55 -06:00
Nicolas Williams 943e76f99b Fix leak in hx509_general_name_unparse() 2016-11-20 17:43:51 -06:00
Nicolas Williams 52a562a3a4 Misc fixes (coverity) 2016-11-18 22:21:45 -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
Ed Maste 8ef0071d96 Remove duplicate symbols from libhx509 version-script.map
Commit 7758a5d0 (r21331) added semiprivate function
_hx509_request_to_pkcs10 twice.
2016-07-21 14:39:37 -04:00
Viktor Dukhovni 1017a594ef Use OpenSSL include path as needed
For consistency make "-I" part of the macro value set by autoconf.

For now, don't attempt to handle OpenSSL rpath in cf/crypto.m4.
That's much easier by just setting LDFLAGS when running configure.
Otherwise too many Makefiles to edit and libtool and automake do
their best to undo the rpath.
2016-05-07 05:29:12 -04:00
Viktor Dukhovni 131c8dd30e Export new ASN1 oid symbols and fix build
We added some new OID symbols in libasn1, make them public.

When an older Heimdal is already installed and its libraries don't
have some newly created symbols we run into build or test problems,
if libtool decides to use installed rather than just-built libraries.
This was happening with a few of test programs in libhx509.  Fixed.
2016-05-06 21:09:03 -04:00
Viktor Dukhovni 8078e089f1 Add support for ECDSA w/ SHA-2 signature algs 2016-04-15 10:32:50 -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 9df88205ba Fix double-free in lib/hx509/crypto.c 2016-04-15 00:16:16 -05:00
Nicolas Williams 97425a44a2 hx509/crypto.c: fix invalid pointer deref 2016-02-29 19:13:11 -06:00
Luke Howard f789d8403e hx509: explicitly include ref/pkcs11.h
review comment from Nico Williams: explicitly include ref/pkcs11.h to
avoid any conflict with system PKCS#11 header
2015-12-09 11:03:48 +11:00
Luke Howard ed3e748c75 hx509: update to newer PKCS#11 header
newer PKCS#11 reference header file, sourced from SoftHSM
2015-12-09 10:59:08 +11:00
Timothy Pearson 042b1ee7cb Do not crash if private key not found 2015-09-24 15:48:14 -05:00
Timothy Pearson 1d07f08351 Add ability to specifiy PKCS#11 slot number when using hx509
Example usage: kinit -C PKCS11:/usr/lib/opensc-pkcs11.so,slot=3 foo@BAR.TLD
2015-09-24 15:34:51 -05:00
HenryJacques 5a4e9d1539 Fix typo 2015-07-20 10:45:06 +02:00
HenryJacques 35a569bd83 Allow to use more than one token
This is needed if the first is not usable
2015-07-20 10:14:38 +02:00
HenryJacques 1639697c97 add error codes related to User PIN 2015-07-20 10:12:50 +02:00
HenryJacques 75a304c452 Fix typo 2015-07-20 10:08:57 +02:00
HenryJacques 5cf302def7 Add new error codes related to PIN
Not all error codes have been added, only the most common ones.
2015-07-20 10:07:08 +02:00
Love Hörnquist Åstrand a26007cebc (keychain_init): free ctx on error 2015-04-18 17:08:09 -07:00
Viktor Dukhovni 745eeb1252 Ensure DER form of hxtool ca random serial numbers 2015-03-05 03:57:30 -05:00
Viktor Dukhovni b7ca6bbc7a Revert "make sure that serial number is valid DER when done ..."
A simpler fix will be the next commit.

This reverts commit 35add96d37.
2015-03-05 03:56:04 -05:00
Love Hörnquist Åstrand 35add96d37 make sure that serial number is valid DER when done (found by Viktor Dukhovni) 2015-03-05 00:26:03 -08:00
Viktor Dukhovni ba39f42b81 TBS vs Certificate sigalg consistency for RSA 2015-03-04 19:51:11 -05:00
Love Hörnquist Åstrand 30768c75bb make quiet 2014-08-22 21:25:01 -07:00
Love Hörnquist Åstrand 37afa01be3 rename roken base64, fixes #107 2014-08-22 20:57:24 -07:00
Jelmer Vernooij 70e43e9808 Fix some typos. 2014-04-25 02:42:17 +02:00