Finished the auth token client port to Linux and made some minor

makefile system maintenance.
This commit is contained in:
Juan Carlos Luciani
2006-10-05 21:25:00 +00:00
parent 8db0e78d31
commit c076f68b37
20 changed files with 149 additions and 55 deletions

View File

@@ -41,7 +41,7 @@ InitializeLibrary(void);
//
// Debug tracing level
//
int DebugLevel = 3;
int DebugLevel = 0;
//
// Operating parameter

View File

@@ -23,8 +23,10 @@
if DEBUG
TARGET_CFG = Debug
CFLAGS += -v -w
DEFINES = -DDBG
else
TARGET_CFG = Release
DEFINES = -DNDEBUG
endif
SUBDIRS =
@@ -59,11 +61,12 @@ CFILES = ../authmech.c \
CSFILES_CSC :=
INCLUDES = -I. -I.. -I../../include
RESOURCES =
DEFINES = -fno-strict-aliasing
if LIB64
DEFINES += -D_LIB64
endif
CFLAGS += $(INCLUDES) $(DEFINES)
CFLAGS += -Wno-format-extra-args -fno-strict-aliasing $(INCLUDES) $(DEFINES)
LIBS = -lpthread -ldl -lexpat -lcurl -lidn -lssl -lcrypto -lz -lmicasa
LDFLAGS = -Bsymbolic -shared -Wl,-soname=$(MODULE_NAME).$(MODULE_EXT) -L$(ROOT)/lib/$(TARGET_CFG)

View File

@@ -140,6 +140,7 @@ Local_sem_open(const char *pathname, int oflag, ... )
// modifications from W. Richard Stevens book: UNIX Network
// Programming, Interprocess Communications (Printed in 1999).
//
// L2
//=======================================================================--
{
int i, fd, semflag, semid, save_errno;
@@ -245,6 +246,7 @@ Local_sem_wait(Local_sem_t *sem)
// modifications from W. Richard Stevens book: UNIX Network
// Programming, Interprocess Communications (Printed in 1999).
//
// L2
//=======================================================================--
{
struct sembuf op;
@@ -278,6 +280,7 @@ Local_sem_post(Local_sem_t *sem)
// modifications from W. Richard Stevens book: UNIX Network
// Programming, Interprocess Communications (Printed in 1999).
//
// L2
//=======================================================================--
{
struct sembuf op;
@@ -310,6 +313,7 @@ Local_sem_close(Local_sem_t *sem)
// modifications from W. Richard Stevens book: UNIX Network
// Programming, Interprocess Communications (Printed in 1999).
//
// L2
//=======================================================================--
{
if (sem->sem_magic != SEM_MAGIC) {
@@ -335,7 +339,7 @@ GetTickCount(void)
//
// Notes:
//
// L1
// L2
//=======================================================================--
{
struct tms tm;
@@ -349,7 +353,7 @@ GetTickCount(void)
long ticksPerSecond;
ticksPerSecond = sysconf(_SC_CLK_TCK);
DbgTrace(0, "-GetTickCount- TicksPerSec = %0X\n", ticksPerSecond);
DbgTrace(3, "-GetTickCount- TicksPerSec = %0X\n", ticksPerSecond);
g_milliSecondsPerTicks = 1000 / ticksPerSecond;
}
@@ -376,7 +380,7 @@ CreateUserMutex(
//
// Notes:
//
// L1
// L2
//=======================================================================--
{
CasaStatus retStatus = CasaStatusBuild(CASA_SEVERITY_ERROR,
@@ -385,7 +389,7 @@ CreateUserMutex(
DbgTrace(1, "-CreateUserMutex- Start\n", 0);
// We use Posix Named Semaphores to provide this functionality. The semaphore names are
// We use Named Semaphores to provide this functionality. The semaphore names are
// linked to the user via its uid.
if (sprintf(g_userNamedSemName, "/var/lib/CASA/authtoken/semuser_%d", geteuid()) != -1)
{
@@ -428,7 +432,7 @@ AcquireUserMutex(
//
// Notes:
//
// L1
// L2
//=======================================================================--
{
DbgTrace(2, "-AcquireUserMutex- Start\n", 0);
@@ -460,7 +464,7 @@ ReleaseUserMutex(
//
// Notes:
//
// L1
// L2
//=======================================================================--
{
DbgTrace(2, "-ReleaseUserMutex- Start\n", 0);
@@ -492,7 +496,7 @@ DestroyUserMutex(
//
// Notes:
//
// L1
// L2
//=======================================================================--
{
DbgTrace(2, "-DestroyUserMutex- Start\n", 0);
@@ -620,7 +624,7 @@ NormalizeHostName(
//
// Notes:
//
// L1
// L2
//=======================================================================--
{
char *pNormalizedName = NULL;

View File

@@ -55,7 +55,7 @@ CurlWriteCallback(
//
// Notes:
//
// L0
// L2
//=======================================================================--
{
size_t dataConsumed = numDataItems;
@@ -124,7 +124,7 @@ OpenRpcSession(
//
// Notes:
//
// L0
// L2
//=======================================================================--
{
RpcSession *pSession;
@@ -263,7 +263,7 @@ CloseRpcSession(
//
// Notes:
//
// L1
// L2
//=======================================================================--
{
DbgTrace(1, "-CloseRpcSession- Start\n", 0);
@@ -307,7 +307,7 @@ InternalRpc(
//
// Notes:
//
// L1
// L2
//=======================================================================--
{
CasaStatus retStatus;
@@ -323,7 +323,7 @@ InternalRpc(
*ppResponseData = NULL;
*pResponseDataLen = 0;
// Setup the final URL using the input parameters
// Setup the URL using the input parameters
if (secure)
{
pPartialUrl = pSession->pPartialHttpsUrl;
@@ -505,7 +505,7 @@ InitializeRpc(void)
//
// Notes:
//
// L0
// L2
//=======================================================================--
{
CasaStatus retStatus;

View File

@@ -0,0 +1,12 @@
#######################################################
# #
# CASA Authentication Token System configuration file #
# for module: #
# #
# Krb5Authenticate #
# #
#######################################################
LibraryName /usr/lib64/CASA/authtoken/krb5mech.so

View File

@@ -23,8 +23,10 @@
if DEBUG
TARGET_CFG = Debug
CFLAGS += -v -w
DEFINES = -DDBG
else
TARGET_CFG = Release
DEFINES = -DNDEBUG
endif
SUBDIRS =
@@ -52,18 +54,23 @@ CFILES = get.c \
CSFILES_CSC :=
INCLUDES = -I. -I.. -I../../.. -I$(ROOT)/include
RESOURCES =
DEFINES = -fno-strict-aliasing
DEST_CONF_FILE_NAME = Krb5Authenticate.conf
if LIB64
DEFINES += -D_LIB64
SRC_CONF_FILE_NAME = Krb5Authenticate_lib64.conf
else
SRC_CONF_FILE_NAME = Krb5Authenticate.conf
endif
CFLAGS += $(INCLUDES) $(DEFINES)
CFLAGS += -Wno-format-extra-args -fno-strict-aliasing $(INCLUDES) $(DEFINES)
LIBS = -lpthread -lc -lgssapi
LDFLAGS = -Bsymbolic -shared -Wl,-soname=$(MODULE_NAME).$(MODULE_EXT) -L$(ROOT)/lib/$(TARGET_CFG)
OBJDIR = ./$(TARGET_CFG)/$(LIB)
OBJS = $(addprefix $(OBJDIR)/, $(CFILES:%.c=%.o))
EXTRA_DIST = $(CFILES) *.h Krb5Authenticate.conf
EXTRA_DIST = $(CFILES) *.h Krb5Authenticate.conf Krb5Authenticate_lib64.conf
CUR_DIR := $(shell pwd)
@@ -85,6 +92,7 @@ $(OBJDIR)/$(MODULE_NAME).$(MODULE_EXT): $(OBJDIR) $(OBJS)
@echo [======== Linking $@ ========]
$(LINK) -o $@ $(LDFLAGS) $(OBJS) $(LIBS)
cp -f $(OBJDIR)/$(MODULE_NAME).$(MODULE_EXT) $(LIBDIR)/$(TARGET_CFG)/$(MODULE_NAME).$(MODULE_EXT)
cp -f $(SRC_CONF_FILE_NAME) $(LIBDIR)/$(TARGET_CFG)/$(DEST_CONF_FILE_NAME)
$(OBJDIR):
[ -d $(OBJDIR) ] || mkdir -p $(OBJDIR)

View File

@@ -165,7 +165,7 @@ AuthTokenIf_GetAuthToken(
// Description:
// Get authentication token to authenticate user to specified service.
//
// L0
// L2
//=======================================================================--
{
CasaStatus retStatus;
@@ -241,7 +241,8 @@ AuthTokenIf_GetAuthToken(
char *pEncodedToken;
int encodedTokenLen;
// The security context was initialized, now return it to the caller after base64 encoding it.
// The security context was initialized, now return the token to the
// caller after base64 encoding it.
retStatus = EncodeData(gssSendToken.value,
gssSendToken.length,
&pEncodedToken,

View File

@@ -23,8 +23,10 @@
if DEBUG
TARGET_CFG = Debug
CFLAGS += -v -w
DEFINES = -DDBG
else
TARGET_CFG = Release
DEFINES = -DNDEBUG
endif
SUBDIRS =
@@ -52,18 +54,23 @@ CFILES = ../get.c \
CSFILES_CSC :=
INCLUDES = -I. -I.. -I../../.. -I$(ROOT)/include
RESOURCES =
DEFINES = -fno-strict-aliasing
DEST_CONF_FILE_NAME = PwdAuthenticate.conf
if LIB64
DEFINES += -D_LIB64
SRC_CONF_FILE_NAME = PwdAuthenticate_lib64.conf
else
SRC_CONF_FILE_NAME = PwdAuthenticate.conf
endif
CFLAGS += $(INCLUDES) $(DEFINES)
CFLAGS += -Wno-format-extra-args -fno-strict-aliasing $(INCLUDES) $(DEFINES)
LIBS = -lpthread -lmicasa
LDFLAGS = -Bsymbolic -shared -Wl,-soname=$(MODULE_NAME).$(MODULE_EXT) -L$(ROOT)/lib/$(TARGET_CFG)
OBJDIR = ./$(TARGET_CFG)/$(LIB)
OBJS = $(addprefix $(OBJDIR)/, $(CFILES:%.c=%.o))
EXTRA_DIST = $(CFILES) *.h PwdAuthenticate.conf
EXTRA_DIST = $(CFILES) *.h PwdAuthenticate.conf PwdAuthenticate_lib64.conf
CUR_DIR := $(shell pwd)
@@ -85,6 +92,7 @@ $(OBJDIR)/$(MODULE_NAME).$(MODULE_EXT): $(OBJDIR) $(OBJS)
@echo [======== Linking $@ ========]
$(LINK) -o $@ $(LDFLAGS) $(OBJS) $(LIBS)
cp -f $(OBJDIR)/$(MODULE_NAME).$(MODULE_EXT) $(LIBDIR)/$(TARGET_CFG)/$(MODULE_NAME).$(MODULE_EXT)
cp -f $(SRC_CONF_FILE_NAME) $(LIBDIR)/$(TARGET_CFG)/$(DEST_CONF_FILE_NAME)
$(OBJDIR):
[ -d $(OBJDIR) ] || mkdir -p $(OBJDIR)

View File

@@ -0,0 +1,12 @@
#######################################################
# #
# CASA Authentication Token System configuration file #
# for module: #
# #
# PwdAuthenticate #
# #
#######################################################
LibraryName /usr/lib64/CASA/authtoken/pwmech.so

View File

@@ -33,7 +33,7 @@
//===[ Global variables ]==================================================
// Debug Level
int DebugLevel = 3;
int DebugLevel = 0;
// Tables for Base64 encoding and decoding
static const int8_t g_Base64[] =