Cleanups for PAM and SIA build process

git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@364 c6295689-39f2-0310-b995-f0e70906c6a9
This commit is contained in:
aet 2002-03-21 17:41:32 +00:00
parent 504b0ae2b9
commit 0cfbcb8fd6
12 changed files with 88 additions and 51 deletions

View File

@ -756,7 +756,6 @@ if test "x$PAM_MSG" = "xyes" ; then
fi
LIBS="$saved_LIBS"
AM_CONDITIONAL(HAVE_PAM, test "x$PAM_MSG" = "xyes")
AM_CONDITIONAL(HAVE_PAM_AND_SSL, test "x$PAM_MSG" = "xyes" -a "x$SSL_MSG" = "xyes")
dnl Check for SIA libs
AC_SUBST(LIBSIA)

View File

@ -2,20 +2,13 @@
libdir = ${prefix}/lib/security
INCLUDES = @CFLAGS_PCSC@ @CFLAGS_OPENSC@ -I../scam -I../scconf -I../scrandom -I../scldap
INCLUDES = -I../scam
if HAVE_LDAP
LDAP_LTLIBS = @LIBSCLDAP@
else
LDAP_LTLIBS =
endif
LDFLAGS = @LDFLAGS@ @LIBDL@ @LIBPAM@ ../scam/libpamscam.la
LDFLAGS = @LDFLAGS@ @LIBDL@ @LIBSCRANDOM@ $(LDAP_LTLIBS) @LIBCRYPTO@ @LIBOPENSC@ @LIBPAM@
SRC = pam_opensc.c pam_support.c pam_support.h
AUTHSRC = ../scam/scam.c ../scam/scam.h ../scam/p15_eid.c ../scam/p15_ldap.c
SRC = $(AUTHSRC) pam_opensc.c pam_support.c pam_support.h
if HAVE_PAM_AND_SSL
if HAVE_PAM
lib_LTLIBRARIES = pam_opensc.la
noinst_PROGRAMS = pam_opensc-test
else

View File

@ -17,9 +17,12 @@ The following options are recognized:
resulting in a delay of about 1 second.
auth_method=X - use authentication method X, the following
methods are currently recognized:
sp, opensc-pkcs15
pkcs15-ldap, pkcs15-eid
auth_method[sp]:
Generic options:
-h Show help
auth_method[opensc-pkcs15-ldap]:
-r <reader> Reader name
LDAP specific options:
-L ldap.conf Configuration file to load
@ -35,5 +38,5 @@ LDAP specific options:
-a attribute(s)
-f filter
auth_method[opensc-pkcs15]:
TODO
auth_method[opensc-pkcs15-eid]:
-r <reader> Reader name

View File

@ -34,6 +34,7 @@
#include <utmp.h>
#endif
#include <sys/types.h>
#include "pam_support.h"
#include "scam.h"
#define PAM_SM_AUTH

View File

@ -1,3 +1,50 @@
# Process this file with automake to create Makefile.in
EXTRA_DIST = scam.c scam.h p15_eid.c p15_ldap.c
INCLUDES = @CFLAGS_PCSC@ @CFLAGS_OPENSC@ -I../scconf -I../scrandom -I../scldap
if HAVE_PAM
PAM = libpamscam.la
else
PAM =
endif
if HAVE_SIA
SIA = libsiascam.la
else
SIA =
endif
lib_LTLIBRARIES = $(PAM) $(SIA)
if HAVE_LDAP
LDAP_LTLIBS = @LIBSCLDAP@
else
LDAP_LTLIBS =
endif
if HAVE_SSL
SSL_LTLIBS = @LIBCRYPTO@
else
SSL_LTLIBS =
endif
# Temporary
if HAVE_SCIDI
SCIDI_LTLIBS = @LIBSSP@
SCIDI_SRC = ../../../scam/sp.c
SCIDI_INC = @CFLAGS_SSP@
else
SCIDI_LTLIBS =
SCIDI_SRC =
SCIDI_INC =
endif
LDFLAGS = @LIBOPENSC@ @LIBSCRANDOM@ $(LDAP_LTLIBS) $(SSL_LTLIBS) $(SCIDI_LTLIBS)
EXTRAINC = $(SCIDI_INC)
SRC = scam.c scam.h p15_eid.c p15_ldap.c $(SCIDI_SRC)
libpamscam_la_SOURCES = $(SRC)
libpamscam_la_LDFLAGS = -module -avoid-version
libpamscam_la_CFLAGS = -I../pam -DPAM_SCAM $(EXTRAINC)
libsiascam_la_SOURCES = $(SRC)
libsiascam_la_LDFLAGS = -module -avoid-version
libsiascam_la_CFLAGS = -I../sia -DSIA_SCAM $(EXTRAINC)

View File

@ -36,10 +36,10 @@
#include <openssl/pem.h>
#include "scam.h"
#if defined(HAVE_PAM)
#if defined(PAM_SCAM)
static pam_handle_t *p15_eid_pamh = NULL;
static unsigned int *p15_eid_ctrl = NULL;
#elif defined(HAVE_OSF_SIA)
#elif defined(SIA_SCAM)
static sia_collect_func_t *p15_eid_collect = NULL;
static SIAENTITY *p15_eid_entity = NULL;
#endif
@ -71,10 +71,10 @@ const char *p15_eid_usage(void)
void p15_eid_handles(void *ctx1, void *ctx2, void *ctx3)
{
#if defined(HAVE_PAM)
#if defined(PAM_SCAM)
p15_eid_pamh = (pam_handle_t *) ctx1;
p15_eid_ctrl = (unsigned int *) ctx2;
#elif defined(HAVE_OSF_SIA)
#elif defined(SIA_SCAM)
p15_eid_collect = (sia_collect_func_t *) ctx1;
p15_eid_entity = (SIAENTITY *) ctx2;
#endif
@ -89,10 +89,10 @@ void p15_eid_printmsg(char *str,...)
memset(buf, 0, 128);
vsnprintf(buf, 128, str, ap);
va_end(ap);
#if defined(HAVE_PAM)
#if defined(PAM_SCAM)
if (p15_eid_pamh && p15_eid_ctrl)
opensc_pam_msg(p15_eid_pamh, *p15_eid_ctrl, PAM_TEXT_INFO, buf);
#elif defined(HAVE_OSF_SIA)
#elif defined(SIA_SCAM)
#endif
}
@ -105,10 +105,10 @@ void p15_eid_logmsg(char *str,...)
memset(buf, 0, 1024);
vsnprintf(buf, 1024, str, ap);
va_end(ap);
#if defined(HAVE_PAM)
#if defined(PAM_SCAM)
if (p15_eid_pamh)
opensc_pam_log(LOG_NOTICE, p15_eid_pamh, buf);
#elif defined(HAVE_OSF_SIA)
#elif defined(SIA_SCAM)
opensc_sia_log(buf);
#endif
}

View File

@ -37,10 +37,10 @@
#include <openssl/rsa.h>
#include "scam.h"
#if defined(HAVE_PAM)
#if defined(PAM_SCAM)
static pam_handle_t *p15_ldap_pamh = NULL;
static unsigned int *p15_ldap_ctrl = NULL;
#elif defined(HAVE_OSF_SIA)
#elif defined(SIA_SCAM)
static sia_collect_func_t *p15_ldap_collect = NULL;
static SIAENTITY *p15_ldap_entity = NULL;
#endif
@ -72,10 +72,10 @@ const char *p15_ldap_usage(void)
void p15_ldap_handles(void *ctx1, void *ctx2, void *ctx3)
{
#if defined(HAVE_PAM)
#if defined(PAM_SCAM)
p15_ldap_pamh = (pam_handle_t *) ctx1;
p15_ldap_ctrl = (unsigned int *) ctx2;
#elif defined(HAVE_OSF_SIA)
#elif defined(SIA_SCAM)
p15_ldap_collect = (sia_collect_func_t *) ctx1;
p15_ldap_entity = (SIAENTITY *) ctx2;
#endif
@ -90,10 +90,10 @@ void p15_ldap_printmsg(char *str,...)
memset(buf, 0, 128);
vsnprintf(buf, 128, str, ap);
va_end(ap);
#if defined(HAVE_PAM)
#if defined(PAM_SCAM)
if (p15_ldap_pamh && p15_ldap_ctrl)
opensc_pam_msg(p15_ldap_pamh, *p15_ldap_ctrl, PAM_TEXT_INFO, buf);
#elif defined(HAVE_OSF_SIA)
#elif defined(SIA_SCAM)
#endif
}
@ -106,10 +106,10 @@ void p15_ldap_logmsg(char *str,...)
memset(buf, 0, 1024);
vsnprintf(buf, 1024, str, ap);
va_end(ap);
#if defined(HAVE_PAM)
#if defined(PAM_SCAM)
if (p15_ldap_pamh)
opensc_pam_log(LOG_NOTICE, p15_ldap_pamh, buf);
#elif defined(HAVE_OSF_SIA)
#elif defined(SIA_SCAM)
opensc_sia_log(buf);
#endif
}

View File

@ -19,7 +19,7 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifdef HAVE_CONFIH_H
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include <stdio.h>

View File

@ -26,13 +26,13 @@
extern "C" {
#endif
#ifdef HAVE_CONFIH_H
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#if defined(HAVE_PAM)
#include "pam_support.h"
#elif defined(HAVE_OSF_SIA)
#include "sia_support.h"
#if defined(PAM_SCAM)
#include <pam_support.h>
#elif defined(SIA_SCAM)
#include <sia_support.h>
#endif
#define SCAM_FAILED 1

View File

@ -2,18 +2,11 @@
libdir = ${prefix}/lib/security
INCLUDES = @CFLAGS_PCSC@ @CFLAGS_OPENSC@ -I../scam -I../scconf -I../scrandom -I../scldap
INCLUDES = -I../scam
if HAVE_LDAP
LDAP_LTLIBS = @LIBSCLDAP@
else
LDAP_LTLIBS =
endif
LDFLAGS = @LDFLAGS@ @LIBDL@ ../scam/libsiascam.la
LDFLAGS = @LDFLAGS@ @LIBDL@ @LIBSCRANDOM@ $(LDAP_LTLIBS) @LIBOPENSC@
AUTHSRC = ../scam/scam.c ../scam/scam.h ../scam/p15_eid.c ../scam/p15_ldap.c
SRC = $(AUTHSRC) sia_opensc.c sia_support.c sia_support.h
SRC = sia_opensc.c sia_support.c sia_support.h
if HAVE_SIA
lib_LTLIBRARIES = libsia_opensc.la
@ -23,7 +16,7 @@ lib_LTLIBRARIES =
noinst_PROGRAMS =
endif
libsia_opensc_la_SOURCES = $(SRC) $(INC)
libsia_opensc_la_SOURCES = $(SRC)
libsia_opensc_la_LDFLAGS = -module -avoid-version
test_sia_SOURCES = test-sia.c

View File

@ -26,6 +26,7 @@
#include <stdarg.h>
#include <pwd.h>
#include <sys/types.h>
#include "sia_support.h"
#include "scam.h"
static int scam_method = 0;

View File

@ -26,7 +26,7 @@
#include <stdarg.h>
#include <pwd.h>
#include <sys/types.h>
#include "scam.h"
#include "sia_support.h"
/* opensc_sia_log logs to the standard sialog. */
void opensc_sia_log(char *format,...)