Compare commits

..

144 Commits

Author SHA1 Message Date
Michele Calgaro bce38cef45
Use TDESimpleConfig
Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
4 weeks ago
Michele Calgaro 6933039a32
Replace TRUE/FALSE with boolean values true/false
Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
4 months ago
Michele Calgaro 7dfe8c376b
Use tdestandarddirs.h
Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
5 months ago
Michele Calgaro 383d0bc590
Use tdeprocess.h
Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
8 months ago
Michele Calgaro 356dd5b10f
Rename __KDE_HAVE_GCC_VISIBILITY to __TDE_HAVE_GCC_VISIBILITY
Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
1 year ago
Michele Calgaro a15d47732e
Replace kdemacros.h with tdemacros.h
Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
1 year ago
Michele Calgaro b03faff449
Replace KDE_[NO_]EXPORT with TDE_[NO_]EXPORT
Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
1 year ago
Michele Calgaro 9d769bab04
Use centralized cmake version
Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
1 year ago
Michele Calgaro 3fc205a151
Replace Qt with TQt
Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
2 years ago
Slávek Banko 613dff1a86
Raise the minimum required version of CMake to 3.5.
Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
2 years ago
Michele Calgaro e3ae8c54a1
Replace Q_OBJECT with TQ_OBJECT
Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
2 years ago
Michele Calgaro 5e4a41a6a5
Use TDE cmake macro to set version
Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
3 years ago
Michele Calgaro d4c0483c9d
Remove obsolete setting of CMAKE_MODULE_PATH in cmake files.
Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
3 years ago
Slávek Banko 452efdaaae
Raise the minimum required version of CMake to 3.1.
Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
4 years ago
Slávek Banko 85934677db
Change README to markdown format.
Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
4 years ago
Slávek Banko abc4d3e3bb
Remove cmake submodule since it has now been replaced by cmake-trinity dependency.
Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
4 years ago
TDE Gitea a5480ac3f7 Reset submodule main/libraries/libtdeldap/cmake to latest HEAD 4 years ago
Slávek Banko 7ccc7470c7
Updated to use new standalone tdehw library.
Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
4 years ago
TDE Gitea 661158c53c Reset submodule main/libraries/libtdeldap/cmake to latest HEAD 5 years ago
TDE Gitea 33b3f9a788 Reset submodule main/libraries/libtdeldap/cmake to latest HEAD 5 years ago
TDE Gitea 5afbd76730 Reset submodule main/libraries/libtdeldap/cmake to latest HEAD 5 years ago
Slávek Banko 4eb48212d0
Raise the minimum required version of CMake to 2.8.12.
Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
5 years ago
TDE Gitea 738d3037d6 Reset submodule main/libraries/libtdeldap/cmake to latest HEAD 5 years ago
TDE Gitea 982a8ab057 Reset submodule main/libraries/libtdeldap/cmake to latest HEAD 5 years ago
TDE Gitea d97b6edda1 Reset submodule main/libraries/libtdeldap/cmake to latest HEAD 5 years ago
TDE Gitea 00022c1253 Reset submodule main/libraries/libtdeldap/cmake to latest HEAD 5 years ago
TDE Gitea 8c7a710bd1 Reset submodule main/libraries/libtdeldap/cmake to latest HEAD 5 years ago
TDE Gitea 7b9007f36d Reset submodule main/libraries/libtdeldap/cmake to latest HEAD 5 years ago
TDE Gitea b428e68499 Reset submodule main/libraries/libtdeldap/cmake to latest HEAD 5 years ago
TDE Gitea d95162d46a Reset submodule main/libraries/libtdeldap/cmake to latest HEAD 5 years ago
TDE Gitea 2a4128d5d2 Reset submodule main/libraries/libtdeldap/cmake to latest HEAD 5 years ago
TDE Gitea 03ff4734a2 Reset submodule main/libraries/libtdeldap/cmake to latest HEAD 5 years ago
TDE Gitea 577a6fa8bc Reset submodule main/libraries/libtdeldap/cmake to latest HEAD 5 years ago
TDE Gitea f0a8ca3e55 Reset submodule main/libraries/libtdeldap/cmake to latest HEAD 5 years ago
Timothy Pearson 47c8c58690 Fix crash if empty certificate is provided in PKI list 5 years ago
TDE Gitea c3ddf69f51 Reset submodule main/libraries/libtdeldap/cmake to latest HEAD 5 years ago
TDE Gitea 3fc78e26b1 Reset submodule main/libraries/libtdeldap/cmake to latest HEAD 5 years ago
TDE Gitea cfbddcf986 Reset submodule main/libraries/libtdeldap/cmake to latest HEAD 5 years ago
TDE Gitea 6c8fc8cb60 Reset submodule main/libraries/libtdeldap/cmake to latest HEAD 5 years ago
TDE Gitea 4bfcb39012 Reset submodule main/libraries/libtdeldap/cmake to latest HEAD 5 years ago
TDE Gitea 5e110454bc Reset submodule main/libraries/libtdeldap/cmake to latest HEAD 5 years ago
gregory guy edec9f9049
Drop automake build support.
Add basic cmake build instructions.
Add basic README file.
Delete empty folders doc and po.
Delete empty files ChangeLog, NEWS and TODO.
Some cosmetics.

Signed-off-by: gregory guy <gregory-tde@laposte.net>
5 years ago
TDE Gitea ea50e7d0a2 Reset submodule main/libraries/libtdeldap/cmake to latest HEAD 5 years ago
TDE Gitea ba7c15d34c Reset submodule main/libraries/libtdeldap/cmake to latest HEAD 5 years ago
TDE Gitea b45d8e5212 Reset submodule main/libraries/libtdeldap/cmake to latest HEAD 5 years ago
TDE Gitea 821a17485e Reset submodule main/libraries/libtdeldap/cmake to latest HEAD 6 years ago
Slávek Banko 15d4ac1348
Switch all submodules to https.
Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
6 years ago
TDE Gitea e539599f42 Reset submodule main/libraries/libtdeldap/cmake to latest HEAD 6 years ago
Slávek Banko 582c8f0123
Fix heimdal detection on multiarch systems
in case the pkg-config file is not available.

Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
6 years ago
TDE Gitea 1ea2efad30 Reset submodule main/libraries/libtdeldap/cmake to latest HEAD 6 years ago
Slávek Banko 9ca53813e2
Fix detection of older Heimdal versions
because paths may be inaccurate in pkg-config.

Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
6 years ago
Timothy Pearson b2d89e08d0 Fix access to ldap configuration files on non-controller (workstation) systems 7 years ago
Timothy Pearson 10472c4c2b Properly set umask on login 7 years ago
Timothy Pearson 81b65a2d55 Correctly set permissions on LDAP configuration file to only allow owner / group, since this file contains a multi-master replication password in plain text 7 years ago
TDE Gitea a7e5e023a2 Reset submodule main/libraries/libtdeldap/cmake to latest HEAD 7 years ago
TDE Gitea 8af9c3b423 Reset submodule main/libraries/libtdeldap/admin to latest HEAD 7 years ago
Slávek Banko 0b1fc75762
cmake: Add missing CheckSymbolExists include.
Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
7 years ago
Slávek Banko cdbb1c0a4c
Use common CMake tests.
Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
7 years ago
Slávek Banko 77563f4f4c
Add KDE_EXPORT to public library symbols.
This allows build with gcc hidden visibility.

Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
7 years ago
Slávek Banko ed622a01c5
Added controlled conversions to char* instead of automatic ascii conversions.
The definition of -UTQT_NO_ASCII_CAST is no longer needed.

Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
7 years ago
Slávek Banko 545658deaf
Add includes to UI files to resolve FTBFS.
Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
7 years ago
Slávek Banko 08fd4a51ed
Update CMake rules
+ Prefer Heimdal during Kerberos detection.
+ Add a check whether the Kerberos is Heimdal.
+ Add a check whether the compiler supports the option -fpermissive.
+ Add an option for the user to specify SYSTEM_CA_STORE_REGENERATE_COMMAND.
+ Set the library version to 1.0.0.

Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
7 years ago
gregory guy 6d8d495faf
conversion to the cmake building system
Signed-off-by: gregory guy <g-gregory@gmx.fr>
7 years ago
TDE Gitea 910d34b10f Reset submodule main/libraries/libtdeldap/cmake to latest HEAD 7 years ago
TDE Gitea 6f74b840ad Reset submodule main/libraries/libtdeldap/cmake to latest HEAD 7 years ago
TDE Gitea 5497f512a5 Reset submodule main/libraries/libtdeldap/cmake to latest HEAD 7 years ago
TDE Gitea 16ab124224 Reset submodule main/libraries/libtdeldap/cmake to latest HEAD 7 years ago
TDE Gitea abd7e2b606 Reset submodule main/libraries/libtdeldap/cmake to latest HEAD 7 years ago
TDE Gitea c327bd1d6b Reset submodule main/libraries/libtdeldap/cmake to latest HEAD 7 years ago
TDE Gitea fef06cf622 Reset submodule main/libraries/libtdeldap/admin to latest HEAD 7 years ago
Timothy Pearson dc2d6876ff Remove invalid specification of crlhours in CRL generator when crldays was already given 7 years ago
Michele Calgaro 123de33960
More changes for bug 2961.
Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
7 years ago
TDE Gitea 9c47f1fa3d Reset submodule main/libraries/libtdeldap/cmake to latest HEAD 7 years ago
Automated System 9eec7f0ace Reset submodule main/libraries/libtdeldap/cmake to latest HEAD 7 years ago
Michele Calgaro 8bd9acb7e2
Adapted to new KPasswordEdit::password() signature. This relates to bug
2961.

Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
7 years ago
TDE Gitea 4737b7c081 Reset submodule main/libraries/libtdeldap/admin to latest HEAD 7 years ago
TDE Gitea 261c5d9647 Reset submodule main/libraries/libtdeldap/admin to latest HEAD 7 years ago
Michele Calgaro 3c194b6fd8
LIB_QT -> LIB_TQT conversion to align to updated admin module
Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
7 years ago
TDE Gitea 7d772d198f Reset submodule main/libraries/libtdeldap/cmake to latest HEAD 7 years ago
TDE Gitea c0cacf6c0f Reset submodule main/libraries/libtdeldap/admin to latest HEAD 7 years ago
Timothy Pearson bdf74509a3 OpenSSL 1.1.0 and later use a builtin OID database that conficts with our explicit OID definitions
Attempt to detect OpenSSL verisons prior to 1.1.0, and only add explicit OID definitions for those older versions
7 years ago
Timothy Pearson 84485fe607 Fix invalid OpenSSL command syntax 7 years ago
Automated System 750af4c3f1 Reset submodule main/libraries/libtdeldap/admin to latest HEAD 7 years ago
Automated System 3ad3377cdd Reset submodule main/libraries/libtdeldap/admin to latest HEAD 7 years ago
Automated System 1f1ef91380 Reset submodule main/libraries/libtdeldap/admin to latest HEAD 7 years ago
Slávek Banko 86c28564fe Reset submodule main/libraries/libtdeldap/cmake to latest HEAD 8 years ago
Automated System 84640a792c Reset submodule main/libraries/libtdeldap/cmake to latest HEAD 9 years ago
Slávek Banko 97d071cf28 Reset submodule main/libraries/libtdeldap/cmake to latest HEAD 9 years ago
Slávek Banko 317e6290c3 cmake: add tde_add_check_executable macro 9 years ago
Timothy Pearson c6be9b0e1a Merge branch 'master' of http://scm.trinitydesktop.org/scm/git/libtdeldap 9 years ago
Timothy Pearson 3086fd516f Remove invalid PAM option 9 years ago
Timothy Pearson 1ccfd00cd4 Create the PKCS#11 configuration directory if it does not exist before attempting to write the configuration file into it 9 years ago
Timothy Pearson e7fe109b39 Add method to get PKCS enablement status 9 years ago
Timothy Pearson e7d00722ef Quote filenames when generating or modifying certificates via OpenSSL 9 years ago
Timothy Pearson 2faf4b1c40 Add missing object classes during user creation 9 years ago
Timothy Pearson cc41b404ca Fixup prior commit 9 years ago
Timothy Pearson a12aeff2da Close cert file handle if already open before opening for write
Fixup missing newlines in printf warnings from last commit
9 years ago
Timothy Pearson 68049e4ac8 Don't abort on chown() failure for certificate files 9 years ago
Automated System 39848c7e7c Reset submodule main/libraries/libtdeldap/admin to latest HEAD 9 years ago
Automated System 6a612babd5 Reset submodule main/libraries/libtdeldap/cmake to latest HEAD 9 years ago
Automated System 9fe65d2d8a Reset submodule main/libraries/libtdeldap/cmake to latest HEAD 10 years ago
Slávek Banko f642cc77d7 Fix krb5 library detection
This resolves FTBFS with heimdal-krb5

Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
10 years ago
Timothy Pearson 7b0e95f329 Fix missing stirng placeholder in warning message 10 years ago
Timothy Pearson 3fdd5c964a Fix memory leak on bind failure
Fix minor issues with comments
10 years ago
Timothy Pearson 3991980d35 Revert "Fix memory leak on certificate request attempt"
Unfortunately this did not fix the leak as I originally thought.

This reverts commit 2e9737f118.
10 years ago
Timothy Pearson 2e9737f118 Fix memory leak on certificate request attempt 10 years ago
Timothy Pearson ca4c872008 Properly report certificate retrieval failures to calling application 10 years ago
Timothy Pearson f1b7b0381a Remove any chance of passwords persisting in deallocated main memory after application termination 10 years ago
Timothy Pearson e1d85d3d83 Use correct permissive flag 10 years ago
Timothy Pearson 2752bfb1d0 Fix FTBFS on ancient Heimdal versions 10 years ago
Timothy Pearson 56c2b5fc9b Add deactivated krb5 PKCS login line 10 years ago
Timothy Pearson 7ebf958b10 Write out remaining appdefaults entries on client 10 years ago
Timothy Pearson 53a442c926 Allow Kerberos ticket init via cryptographic card 10 years ago
Timothy Pearson 80c65755dc Write missing appdefaults section on client machines 10 years ago
Timothy Pearson d9172dad3c Add PKI subject mapping to user principals
Fix long-standing inability to clear user principal attribute fields
10 years ago
Timothy Pearson c70ce69a08 Convert the last methods using the kadmin utility to the Heimdal C API 10 years ago
Timothy Pearson 11869fce63 Move keytab export to native Heimdal API 10 years ago
Timothy Pearson e085706825 Convert service add to C API 10 years ago
Timothy Pearson 5ae128fb8b Remove dead code from prior commit 10 years ago
Timothy Pearson 0fbc17ac57 Convert machine add to kadmin API 10 years ago
Timothy Pearson 3d6055df7b Fix local kadmin access 10 years ago
Timothy Pearson bd30e6c655 Start to move away from using the kadmin binary to using the kadmin client API 10 years ago
Timothy Pearson a619f64455 Fix a few minor issues with PKI certificate generation 10 years ago
Timothy Pearson 6cddf7dd1c Minor fixup to cert generation code 10 years ago
Timothy Pearson 07d094fd32 Extend PKCS certificate generation routines
This breaks the ABI
10 years ago
Timothy Pearson c6eab472be Add PKCS methods 10 years ago
Timothy Pearson 30b251b05b Clean up revoked certificates when done updating CRL 10 years ago
Timothy Pearson ba7bc5afac Fix up certificate expiry detection 10 years ago
Timothy Pearson c714661bc9 Add certificate store attribute access method 10 years ago
Timothy Pearson 521c4ed590 Add additional CRL manipulation methods 10 years ago
Timothy Pearson 0fce8b42b6 Store CRL expiry in LDAP 10 years ago
Timothy Pearson efb81441de Add CRL generation 10 years ago
Timothy Pearson a97c0c3d54 Implement several methods required for PKI certificate management 10 years ago
Timothy Pearson 54d8d2580c Extend user key and certificate generation methods 10 years ago
Timothy Pearson 0a81ad9d6e Fix CN/DN ordering 10 years ago
Timothy Pearson bc95fa92b0 Properly set CRL URL and fix up a few other glitches 10 years ago
Timothy Pearson f0eeda5dc8 Allow CRL URL to be set via configuration file 10 years ago
Timothy Pearson 6df22c8ca2 Fix up Kerberos PKI certificate generation 10 years ago
Timothy Pearson d6f004658d Allow certificate expiry to be set 10 years ago
Timothy Pearson f4afc1290d Extend CA expiry to 1 year 10 years ago
Timothy Pearson 8b16aef38d Fix incorrect login causing PAM fatal error message 10 years ago
Slávek Banko f276c65480 Reset submodule main/libraries/libtdeldap/cmake to latest HEAD 10 years ago
Automated System 236003ea32 Reset submodule main/libraries/libtdeldap/cmake to latest HEAD 10 years ago
Automated System 7574e4ec3b Reset submodule main/libraries/libtdeldap/admin to latest HEAD 10 years ago

@ -7,7 +7,11 @@
############################################
cmake_minimum_required( VERSION 3.1 )
##### set project version ########################
include( TDEVersion )
cmake_minimum_required( VERSION ${TDE_CMAKE_MINIMUM_VERSION} )
tde_set_project_version( )
#### general package setup
@ -31,11 +35,6 @@ include( CheckCXXSourceCompiles )
include( TDEMacros )
##### set version number ########################
tde_set_project_version( )
##### setup install paths
include( TDESetupPaths )
@ -59,6 +58,8 @@ option( WITH_GCC_VISIBILITY "Enable fvisibility and fvisibility-inlines-hidden"
set( KDE_CONFDIR "/etc/trinity" CACHE STRING "TDE Settings Directory" )
set( KRB5_FILE "/etc/krb5.conf" CACHE STRING "Kerberos config file" )
set( SYSTEM_CA_STORE_CERT_LOCATION "/usr/local/share/ca-certificates/" CACHE STRING "Location of ca-certificates" )
set( SYSTEM_CA_STORE_REGENERATE_COMMAND "update-ca-certificates" CACHE STRING "Command to update ca-certificates" )
set( CRON_UPDATE_PRIMARY_REALM_CERTIFICATES_OPENLDAP_RELOAD_COMMAND "/etc/init.d/slapd force-reload" CACHE STRING "Cron command to update openLDAP" )
@ -69,7 +70,7 @@ include( ConfigureChecks.cmake )
###### global compiler settings
add_definitions( -DHAVE_CONFIG_H )
add_definitions( -DHAVE_CONFIG_H ${ENABLE_PERMISSIVE_FLAG} )
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${TQT_CXX_FLAGS}" )
set( CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--no-undefined" )

@ -26,9 +26,104 @@ if( WITH_GCC_VISIBILITY )
endif( WITH_GCC_VISIBILITY )
##### get the system's default path for libraries
tde_save_and_set( CMAKE_INSTALL_PREFIX "/usr" )
include( GNUInstallDirs OPTIONAL )
if( CMAKE_INSTALL_LIBDIR )
set( SYSTEM_LIBDIR "${CMAKE_INSTALL_LIBDIR}" )
else( )
set( SYSTEM_LIBDIR "lib${LIB_SUFFIX}" )
endif( )
tde_restore( CMAKE_INSTALL_PREFIX )
##### check for ldap
find_library( HAVE_LIBLDAP ldap )
if( NOT HAVE_LIBLDAP )
tde_message_fatal( "ldap is required, but was not found on your system" )
endif( NOT HAVE_LIBLDAP )
##### check for krb5
pkg_search_module( KRB5 heimdal-krb5 krb5 )
if( NOT KRB5_FOUND)
if( NOT DEFINED KRB5_CONFIG_EXECUTABLE )
find_program( KRB5_CONFIG_EXECUTABLE NAMES krb5-config.heimdal krb5-config )
if( NOT KRB5_CONFIG_EXECUTABLE )
tde_message_fatal( "krb5 library is required but not found on your system" )
endif( )
endif( )
execute_process(
COMMAND ${KRB5_CONFIG_EXECUTABLE} --libs
OUTPUT_VARIABLE KRB5_LIBRARIES
ERROR_VARIABLE KRB5_LIBRARIES
OUTPUT_STRIP_TRAILING_WHITESPACE
ERROR_STRIP_TRAILING_WHITESPACE
)
execute_process(
COMMAND ${KRB5_CONFIG_EXECUTABLE} --cflags
OUTPUT_VARIABLE KRB5_INCLUDE_DIRS
ERROR_VARIABLE KRB5_INCLUDE_DIRS
OUTPUT_STRIP_TRAILING_WHITESPACE
ERROR_STRIP_TRAILING_WHITESPACE
)
if( NOT "${KRB5_LIBRARIES}" STREQUAL "" )
set( KRB5_FOUND 1 )
endif( )
endif( )
find_path( HEIMDAL_INCLUDEDIR
NAMES krb5_asn1.h
HINTS ${KRB5_INCLUDE_DIRS} ${KRB5_INCLUDEDIR} /usr/include
PATH_SUFFIXES "heimdal"
)
if( NOT "${HEIMDAL_INCLUDEDIR}" STREQUAL "${KRB5_INCLUDEDIR}" )
# fix Heimdal include dirs
set( KRB5_INCLUDE_DIRS "${HEIMDAL_INCLUDEDIR}" )
endif( )
find_path( HEIMDAL_LIBDIR
NAMES libhdb.so
HINTS
${KRB5_LIBRARY_DIRS} ${KRB5_LIBDIR}
/usr/${SYSTEM_LIBDIR} /usr/local/${SYSTEM_LIBDIR}
PATH_SUFFIXES "heimdal"
)
if( NOT "${HEIMDAL_LIBDIR}" STREQUAL "${KRB5_LIBDIR}" )
# fix Heimdal library dirs
set( KRB5_LIBRARY_DIRS "${HEIMDAL_LIBDIR}" )
endif( )
if( "${HEIMDAL_INCLUDEDIR}" STREQUAL "HEIMDAL_INCLUDEDIR-NOTFOUND" OR
"${HEIMDAL_LIBDIR}" STREQUAL "HEIMDAL_LIBDIR-NOTFOUND" )
tde_message_fatal( "Heimdal Kerberos is required, but was not found on our system" )
endif( )
# check compiler permissive flag
check_cxx_compiler_flag( -fpermissive HAVE_PERMISSIVE_SUPPORT )
if( HAVE_PERMISSIVE_SUPPORT )
set( ENABLE_PERMISSIVE_FLAG "-fpermissive" )
endif( )
##### check for tdehwlib
tde_save_and_set( CMAKE_REQUIRED_INCLUDES "${TDE_INCLUDE_DIR}" )
check_cxx_source_compiles( "
#include <tdemacros.h>
#ifndef __TDE_HAVE_TDEHWLIB
#error tdecore is not build with tdehwlib
#endif
int main() { return 0; } "
HAVE_TDEHWLIB
)
tde_restore( CMAKE_REQUIRED_INCLUDES )
if( NOT HAVE_TDEHWLIB )
tde_message_fatal( "tdehwlib is required, but not built in tdecore" )
endif( NOT HAVE_TDEHWLIB )
set( TDEHW_LIBRARIES "tdehw-shared" )

@ -1,7 +1,7 @@
#define VERSION "@VERSION@"
// Defined if you have fvisibility and fvisibility-inlines-hidden support.
#cmakedefine __KDE_HAVE_GCC_VISIBILITY 1
#cmakedefine __TDE_HAVE_GCC_VISIBILITY 1
/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most
significant byte first (like Motorola and SPARC, unlike Intel). */
@ -13,5 +13,11 @@
/* Define Kerberos config file */
#cmakedefine KRB5_FILE "@KRB5_FILE@"
/* Define Location of ca-certificates */
#cmakedefine SYSTEM_CA_STORE_CERT_LOCATION "@SYSTEM_CA_STORE_CERT_LOCATION@"
/* Define Command to update ca-certificats */
#cmakedefine SYSTEM_CA_STORE_REGENERATE_COMMAND "@SYSTEM_CA_STORE_REGENERATE_COMMAND@"
/* Define Cron command to update openLDAP certificats */
#cmakedefine CRON_UPDATE_PRIMARY_REALM_CERTIFICATES_OPENLDAP_RELOAD_COMMAND "@CRON_UPDATE_PRIMARY_REALM_CERTIFICATES_OPENLDAP_RELOAD_COMMAND@"

@ -11,6 +11,7 @@ include_directories(
link_directories(
${TQT_LIBRARY_DIRS}
${TDE_LIB_DIR}
${KRB5_LIBRARY_DIRS}
)
@ -27,8 +28,9 @@ tde_add_library( tdeldap SHARED AUTOMOC
tdeui-shared
tdecore-shared
tdeio-shared
${TDEHW_LIBRARIES}
tdesu
lber
krb5 kadm5clnt kadm5srv hdb lber
ldap
VERSION 1.0.0

@ -23,13 +23,13 @@
#include <tqmap.h>
#include <tdeapplication.h>
#include <ksimpleconfig.h>
#include <tdesimpleconfig.h>
#include <tdelocale.h>
#include <kdebug.h>
#include <kstandarddirs.h>
#include <tdestandarddirs.h>
#include <kiconloader.h>
#include <dcopclient.h>
#include <kprocess.h>
#include <tdeprocess.h>
#include <kcombobox.h>
#include "ldaplogindlg.h"

@ -30,7 +30,7 @@ class TQStringList;
*/
class LDAPLogin : public LDAPLoginDlg {
Q_OBJECT
TQ_OBJECT
public:
LDAPLogin(TQWidget *parent=0, const char *name=0);
~LDAPLogin();

@ -32,8 +32,8 @@
#include "ldaplogindlg.h"
#include "ldappasswddlg.h"
LDAPPasswordDialog::LDAPPasswordDialog(TQWidget* parent, const char* name, bool allowGSSAPI)
: KDialogBase(parent, name, true, i18n("LDAP Authentication"), (allowGSSAPI)?Ok|Cancel|User1:Ok|Cancel, Ok, true, i18n("Authenticate with SASL/GSSAPI"))
LDAPPasswordDialog::LDAPPasswordDialog(TQWidget* parent, const char* name, bool allowGSSAPI, bool allowSmartCard)
: KDialogBase(parent, name, true, i18n("LDAP Authentication"), Ok|Cancel|((allowGSSAPI)?User1:0)|((allowSmartCard)?User2:0), Ok, true, i18n("Authenticate with SASL/GSSAPI"), i18n("Authenticate with cryptographic card"))
{
m_base = new LDAPLogin(this);
@ -42,11 +42,19 @@ LDAPPasswordDialog::LDAPPasswordDialog(TQWidget* parent, const char* name, bool
void LDAPPasswordDialog::slotOk() {
use_gssapi = false;
use_smartcard = false;
accept();
}
void LDAPPasswordDialog::slotUser1() {
use_gssapi = true;
use_smartcard = false;
accept();
}
void LDAPPasswordDialog::slotUser2() {
use_gssapi = false;
use_smartcard = true;
accept();
}

@ -26,20 +26,22 @@
class LDAPLogin;
class KDE_EXPORT LDAPPasswordDialog : public KDialogBase
class TDE_EXPORT LDAPPasswordDialog : public KDialogBase
{
Q_OBJECT
TQ_OBJECT
public:
LDAPPasswordDialog(TQWidget* parent = 0, const char* name = 0, bool allowGSSAPI = true);
LDAPPasswordDialog(TQWidget* parent = 0, const char* name = 0, bool allowGSSAPI = true, bool allowSmartCard = false);
public slots:
void slotOk();
void slotUser1();
void slotUser2();
public:
LDAPLogin *m_base;
bool use_gssapi;
bool use_smartcard;
};
#endif

File diff suppressed because it is too large Load Diff

@ -1,5 +1,5 @@
/***************************************************************************
* Copyright (C) 2012-2013 by Timothy Pearson *
* Copyright (C) 2012-2015 by Timothy Pearson *
* kb9vqf@pearsoncomputing.net *
* *
* This program is free software; you can redistribute it and/or modify *
@ -21,16 +21,19 @@
#ifndef _LIBTDELDAP_H_
#define _LIBTDELDAP_H_
#include <stdint.h>
#include <unistd.h>
#include <sys/stat.h>
#include <ldap.h>
#include <kadm5/admin.h>
#include <tqobject.h>
#include <tqstring.h>
#include <tqdatetime.h>
#include <tqvaluelist.h>
#include <tqfile.h>
#include <ksimpleconfig.h>
#include <tdesimpleconfig.h>
// FIXME
// Connect this to CMake/Automake
@ -47,6 +50,8 @@
#define KERBEROS_PKI_PEM_FILE KERBEROS_PKI_ANCHORDIR "tdeca.pem"
#define KERBEROS_PKI_PEMKEY_FILE KERBEROS_PKI_ANCHORDIR "tdeca.key.pem"
#define KERBEROS_PKI_CRL_FILE KERBEROS_PKI_ANCHORDIR "tdecrl.pem"
#define KERBEROS_PKI_CRLDB_FILE KERBEROS_PKI_ANCHORDIR "tdecrl.db"
#define KERBEROS_PKI_KDC_FILE KERBEROS_PKI_PUBLICDIR "@@@KDCSERVER@@@.pki.crt"
#define KERBEROS_PKI_KDCKEY_FILE KERBEROS_PKI_PRIVATEDIR "@@@KDCSERVER@@@.pki.key"
#define KERBEROS_PKI_KDCREQ_FILE KERBEROS_PKI_PRIVATEDIR "@@@KDCSERVER@@@.pki.req"
@ -54,14 +59,23 @@
#define LDAP_CERT_FILE KERBEROS_PKI_PUBLICDIR "@@@ADMINSERVER@@@.ldap.crt"
#define LDAP_CERTKEY_FILE KERBEROS_PKI_PRIVATEDIR "@@@ADMINSERVER@@@.ldap.key"
#define LDAP_CERTREQ_FILE KERBEROS_PKI_PRIVATEDIR "@@@ADMINSERVER@@@.ldap.req"
#define LDAP_CERTREVOC_FILE KERBEROS_PKI_PUBLICDIR "@@@ADMINSERVER@@@.ldap.crl"
#define OPENSSL_EXTENSIONS_FILE TDE_CERTIFICATE_DIR "pki_extensions"
#define OPENSSL_EXTENSIONS_FILE TDE_CERTIFICATE_DIR "openssl.cfg"
#define DEFAULT_IGNORED_USERS_LIST "avahi,avahi-autoipd,backup,bin,colord,daemon,games,gnats,haldaemon,hplip,irc,klog,landscape,libuuid,list,lp,mail,man,messagebus,news,ntp,polkituser,postfix,proxy,pulse,root,rtkit,saned,sshd,statd,sync,sys,syslog,timidity,usbmux,uucp,www-data"
#define CRON_UPDATE_PRIMARY_REALM_CERTIFICATES_FILE "/etc/cron.daily/tde-upd-pri-rlm-certs"
#define CRON_UPDATE_PRIMARY_REALM_CERTIFICATES_COMMAND TDE_BINDIR "/primaryrccertupdater"
// 1 year
#define KERBEROS_PKI_PEMKEY_EXPIRY_DAYS 365
// 1 month
#define KERBEROS_PKI_CRL_EXPIRY_DAYS 30
#define KERBEROS_PKI_KRB_EXPIRY_DAYS 30
#define KERBEROS_PKI_LDAP_EXPIRY_DAYS 30
// Values from hdb.asn1
enum LDAPKRB5Flags {
KRB5_INITIAL = 0x00000001,
@ -141,7 +155,20 @@ inline KRB5TicketFlags operator&(KRB5TicketFlags a, KRB5TicketFlags b)
typedef TQValueList<uid_t> UserList;
typedef TQValueList<gid_t> GroupList;
class KDE_EXPORT LDAPCredentials
namespace PKICertificateStatus {
enum PKICertificateStatusEnum {
Invalid = 0,
Valid = 1,
Revoked = 2
};
}
typedef TQValueList<TQByteArray> TQByteArrayList;
typedef TQPair<uint32_t, TQByteArray> PKICertificateEntry;
typedef TQValueList<PKICertificateEntry> PKICertificateEntryList;
class TDE_EXPORT LDAPCredentials
{
public:
LDAPCredentials();
@ -149,15 +176,16 @@ class KDE_EXPORT LDAPCredentials
public:
TQString username;
TQCString password;
TQString password;
TQString realm;
bool use_tls;
bool use_gssapi;
bool use_smartcard;
TQString service;
};
// PRIVATE
class KDE_EXPORT LDAPRealmConfig
class TDE_EXPORT LDAPRealmConfig
{
public:
TQString name;
@ -173,11 +201,16 @@ class KDE_EXPORT LDAPRealmConfig
bool pkinit_require_krbtgt_otherName;
bool win2k_pkinit;
bool win2k_pkinit_require_binding;
TQString certificate_revocation_list_url;
};
// PRIVATE
class KDE_EXPORT LDAPCertConfig
class TDE_EXPORT LDAPCertConfig
{
public:
LDAPCertConfig();
~LDAPCertConfig();
public:
bool generate_certs;
TQString provided_kerberos_pem;
@ -187,6 +220,11 @@ class KDE_EXPORT LDAPCertConfig
TQString provided_ldap_crt;
TQString provided_ldap_key;
int caExpiryDays;
int caCrlExpiryDays;
int kerberosExpiryDays;
int ldapExpiryDays;
TQString countryName;
TQString stateOrProvinceName;
TQString localityName;
@ -197,13 +235,15 @@ class KDE_EXPORT LDAPCertConfig
};
// PRIVATE
class KDE_EXPORT LDAPPamConfig
class TDE_EXPORT LDAPPamConfig
{
public:
LDAPPamConfig();
~LDAPPamConfig();
public:
bool enable_pkcs11_login;
int pkcs11_login_card_slot;
bool enable_cached_credentials;
bool autocreate_user_directories_enable;
mode_t autocreate_user_directories_umask;
@ -211,7 +251,7 @@ class KDE_EXPORT LDAPPamConfig
};
// PRIVATE
class KDE_EXPORT LDAPClientRealmConfig
class TDE_EXPORT LDAPClientRealmConfig
{
public:
bool enable_bonding;
@ -234,7 +274,7 @@ class KDE_EXPORT LDAPClientRealmConfig
typedef TQMap<TQString, LDAPRealmConfig> LDAPRealmConfigList;
class KDE_EXPORT LDAPUserInfo
class TDE_EXPORT LDAPUserInfo
{
public:
LDAPUserInfo();
@ -252,7 +292,7 @@ class KDE_EXPORT LDAPUserInfo
gid_t primary_gid;
bool tde_builtin_account;
LDAPKRB5Flags status; // Default active user is 586 [KRB5_ACTIVE_DEFAULT] and locked out user is 7586 [KRB5_DISABLED_ACCOUNT]
TQCString new_password;
TQString new_password;
TQDateTime account_created;
TQDateTime account_modified;
TQDateTime password_last_changed;
@ -312,9 +352,12 @@ class KDE_EXPORT LDAPUserInfo
TQString businessCategory;
TQString carLicense;
TQString notes;
// PKI
PKICertificateEntryList pkiCertificates;
};
class KDE_EXPORT LDAPGroupInfo
class TDE_EXPORT LDAPGroupInfo
{
public:
LDAPGroupInfo();
@ -331,7 +374,7 @@ class KDE_EXPORT LDAPGroupInfo
TQStringList userlist;
};
class KDE_EXPORT LDAPMachineInfo
class TDE_EXPORT LDAPMachineInfo
{
public:
LDAPMachineInfo();
@ -348,7 +391,7 @@ class KDE_EXPORT LDAPMachineInfo
LDAPKRB5Flags status; // Default is 126 [KRB5_MACHINE_ACCOUNT_DEFAULT]
};
class KDE_EXPORT LDAPServiceInfo
class TDE_EXPORT LDAPServiceInfo
{
public:
LDAPServiceInfo();
@ -366,7 +409,7 @@ class KDE_EXPORT LDAPServiceInfo
LDAPKRB5Flags status; // Default is 126 [KRB5_SERVICE_PRINCIPAL_DEFAULT]
};
class KDE_EXPORT LDAPTDEBuiltinsInfo
class TDE_EXPORT LDAPTDEBuiltinsInfo
{
public:
LDAPTDEBuiltinsInfo();
@ -380,7 +423,7 @@ class KDE_EXPORT LDAPTDEBuiltinsInfo
TQString builtinStandardUserGroup;
};
class KDE_EXPORT LDAPMasterReplicationMapping
class TDE_EXPORT LDAPMasterReplicationMapping
{
public:
LDAPMasterReplicationMapping();
@ -393,7 +436,7 @@ class KDE_EXPORT LDAPMasterReplicationMapping
typedef TQValueList<LDAPMasterReplicationMapping> LDAPMasterReplicationMap;
class KDE_EXPORT LDAPMasterReplicationInfo
class TDE_EXPORT LDAPMasterReplicationInfo
{
public:
LDAPMasterReplicationInfo();
@ -407,14 +450,14 @@ class KDE_EXPORT LDAPMasterReplicationInfo
int timeout;
int syncMethod;
TQString syncDN;
TQCString syncPassword;
TQString syncPassword;
TQString certificateFile;
TQString caCertificateFile;
bool ignore_ssl_failure;
bool replicate_olcGlobal;
};
class KDE_EXPORT KerberosTicketInfo
class TDE_EXPORT KerberosTicketInfo
{
public:
KerberosTicketInfo();
@ -445,8 +488,8 @@ typedef TQValueList<KerberosTicketInfo> KerberosTicketInfoList;
class PtyProcess;
class KDE_EXPORT LDAPManager : public TQObject {
Q_OBJECT
class TDE_EXPORT LDAPManager : public TQObject {
TQ_OBJECT
public:
LDAPManager(TQString realm, TQString host, TQObject *parent=0, const char *name=0);
@ -479,37 +522,54 @@ class KDE_EXPORT LDAPManager : public TQObject {
int deleteServiceInfo(LDAPServiceInfo service, TQString *errstr=0);
int exportKeytabForPrincipal(TQString principal, TQString fileName, TQString *errstr=0);
int deleteKeytabEntriesForPrincipal(TQString principal, TQString fileName, TQString *errstr=0);
LDAPCredentials currentLDAPCredentials();
LDAPCredentials currentLDAPCredentials(bool inferGSSAPIData=false);
int moveKerberosEntries(TQString newSuffix, TQString* errstr=0);
int writeCertificateFileIntoDirectory(TQByteArray cert, TQString attr, TQString* errstr=0);
int writePKICertificateFilesIntoDirectory(LDAPUserInfo user, TQString attr, TQString* errstr=0);
TQString getRealmCAMaster(TQString* errstr=0);
int setRealmCAMaster(TQString masterFQDN, TQString* errstr=0);
int getLdapCertificateStoreAttribute(TQString attribute, TQString* value, TQString* errstr=0);
int setLdapCertificateStoreAttribute(TQString attribute, TQString value, TQString* errstr=0);
LDAPTDEBuiltinsInfo getTDEBuiltinMappings(TQString *errstr=0);
LDAPMasterReplicationInfo getLDAPMasterReplicationSettings(TQString *errstr=0);
int setLDAPMasterReplicationSettings(LDAPMasterReplicationInfo replicationinfo, TQString *errstr=0);
int writeSudoersConfFile(TQString *errstr=0);
int getTDECertificate(TQString certificateName, TQFile *fileHandle, TQString *errstr=0);
int getTDECertificate(TQString certificateName, TQString fileName, TQString *errstr=0);
int getTDECertificate(TQString certificateName, TQByteArray *certificate, TQString *errstr=0);
int setPasswordForUser(LDAPUserInfo user, TQString *errstr);
static int writePrimaryRealmCertificateUpdateCronFile(TQString *errstr=0);
static int installCACertificateInHostCAStore(TQString *errstr=0);
static int retrieveAndInstallCaCrl(LDAPManager* manager=0, TQString *errstr=0);
static TQString getMachineFQDN();
static int writeTDERealmList(LDAPRealmConfigList realms, KSimpleConfig* config, TQString *errstr=0);
static LDAPRealmConfigList readTDERealmList(KSimpleConfig* config, bool disableAllBonds=false);
static int writeTDERealmList(LDAPRealmConfigList realms, TDESimpleConfig* config, TQString *errstr=0);
static LDAPRealmConfigList fetchAndReadTDERealmList(TQString *defaultRealm=0);
static LDAPRealmConfigList readTDERealmList(TDESimpleConfig* config, bool disableAllBonds=false);
static TQDateTime getCertificateExpiration(TQString certfile);
static TQDateTime getCertificateExpiration(TQByteArray certfileContents);
static int generatePublicKerberosCACertificate(LDAPCertConfig certinfo);
static int generatePublicKerberosCACertificate(LDAPCertConfig certinfo, LDAPRealmConfig realmcfg);
static int generatePublicKerberosCertificate(LDAPCertConfig certinfo, LDAPRealmConfig realmcfg);
static int generatePublicLDAPCertificate(LDAPCertConfig certinfo, LDAPRealmConfig realmcfg, uid_t ldap_uid, gid_t ldap_gid);
static int generateClientCertificatePair(int expirydays, LDAPUserInfo user, LDAPRealmConfig realmcfg, TQString signingPrivateKeyFile, TQString privateKeyFile, TQString publicCertFile, int clientKeyBitLength=2048, TQString autoLoginPIN=TQString::null, TQString *errstr=0);
static int generateClientCertificatePrivateKey(TQString privateKeyFile, int clientKeyBitLength=2048, TQString *errstr=0);
static int generateClientCertificatePublicCertificate(int expirydays, LDAPUserInfo user, LDAPRealmConfig realmcfg, TQString signingPrivateKeyFile, TQString privateKeyFile, TQString publicCertFile, TQString autoLoginPIN=TQString::null, TQString *errstr=0);
int generatePKICRL(int expirydays, LDAPRealmConfig realmcfg, TQString crlFile, TQString signingPrivateKeyFile, TQString revocationDatabaseFile, TQString *errstr=0);
static TQString ldapdnForRealm(TQString realm);
static TQString openssldcForRealm(TQString realm);
static TQString cnFromDn(TQString dn);
static KerberosTicketInfoList getKerberosTicketList(TQString cache=TQString::null, TQString *cacheFileName=0);
static int getKerberosPassword(LDAPCredentials &creds, TQString prompt, bool requestServicePrincipal=false, TQWidget* parent=0);
static int getKerberosPassword(LDAPCredentials &creds, TQString prompt, bool requestServicePrincipal=false, bool allowSmartCard=false, TQWidget* parent=0);
static int obtainKerberosTicket(LDAPCredentials creds, TQString principal, TQString *errstr=0);
static int obtainKerberosServiceTicket(TQString principal, TQString *errstr=0);
static int destroyKerberosTicket(TQString principal, TQString *errstr=0);
@ -517,18 +577,28 @@ class KDE_EXPORT LDAPManager : public TQObject {
static TQString detailedKAdminErrorMessage(TQString initialMessage);
static TQString readFullLineFromPtyProcess(PtyProcess* proc);
static LDAPClientRealmConfig loadClientRealmConfig(KSimpleConfig* config, bool useDefaults=false);
static int saveClientRealmConfig(LDAPClientRealmConfig clientRealmConfig, KSimpleConfig* config, TQString *errstr=0);
static LDAPClientRealmConfig loadClientRealmConfig(TDESimpleConfig* config, bool useDefaults=false);
static int saveClientRealmConfig(LDAPClientRealmConfig clientRealmConfig, TDESimpleConfig* config, TQString *errstr=0);
static int writeClientKrb5ConfFile(LDAPClientRealmConfig clientRealmConfig, LDAPRealmConfigList realmList, TQString *errstr=0);
static int writeLDAPConfFile(LDAPRealmConfig realmcfg, LDAPMachineRole machineRole, TQString *errstr=0);
static int writeNSSwitchFile(TQString *errstr=0);
static int writeOpenSSLConfigurationFile(LDAPRealmConfig realmcfg, TQString *errstr=0);
static int writeOpenSSLConfigurationFile(LDAPRealmConfig realmcfg, LDAPUserInfo user, TQString opensslConfigFile, TQString caRootKeyFile=TQString::null, TQString caRootCertFile=TQString::null, TQString caRootDatabaseFile=TQString::null, TQString autoLoginPIN=TQString::null, TQString *errstr=0);
static int writeClientCronFiles(TQString *errstr=0);
static int rehashClientPKCSCertificates(TQString *errstr=0);
static int writePAMFiles(LDAPPamConfig pamConfig, TQString *errstr=0);
static bool pkcsLoginEnabled();
static int bondRealm(TQString adminUserName, const char * adminPassword, TQString adminRealm, TQString *errstr=0);
static int unbondRealm(LDAPRealmConfig realmcfg, TQString adminUserName, const char * adminPassword, TQString adminRealm, TQString *errstr=0);
static int bondRealm(const TQString &adminUserName, const TQString &adminPassword,
const TQString &adminRealm, TQString *errstr=0);
static int unbondRealm(LDAPRealmConfig realmcfg, const TQString &adminUserName,
const TQString &adminPassword, const TQString &adminRealm, TQString *errstr=0);
private:
int bindKAdmin(LDAPCredentials *administrativeCredentials=NULL, TQString *errstr=0);
int unbindKAdmin(TQString *errstr=0);
int kAdminAddNewPrincipal(TQString principalName, TQString newPassword, TQString *errstr=0);
int kAdminDeletePrincipal(TQString principalName, TQString *errstr=0);
LDAPUserInfo parseLDAPUserRecord(LDAPMessage* entry);
LDAPGroupInfo parseLDAPGroupRecord(LDAPMessage* entry);
LDAPMachineInfo parseLDAPMachineRecord(LDAPMessage* entry);
@ -537,6 +607,7 @@ class KDE_EXPORT LDAPManager : public TQObject {
LDAPMasterReplicationInfo parseLDAPMasterReplicationRecord(LDAPMasterReplicationInfo replicationinfo, LDAPMessage* entry);
TQString parseLDAPSyncProvOverlayConfigRecord(LDAPMessage* entry);
bool parseLDAPTDEStringAttribute(LDAPMessage* entry, TQString attribute, TQString& retval);
static TQString getOpenSSLVersion();
private:
TQString m_realm;
@ -545,6 +616,12 @@ class KDE_EXPORT LDAPManager : public TQObject {
TQString m_basedc;
LDAPCredentials* m_creds;
LDAP *m_ldap;
// kadmin interface
krb5_context m_krb5admContext;
void* m_krb5admHandle;
char* m_krb5admKeytabFilename;
char* m_krb5admRealmName;
};
#endif // _LIBTDELDAP_H_

Loading…
Cancel
Save