This commit is contained in:
parent
445472e185
commit
5cd7a46f09
116
.cproject
116
.cproject
|
@ -55,25 +55,8 @@
|
|||
<storageModule moduleId="refreshScope"/>
|
||||
<storageModule moduleId="org.eclipse.cdt.make.core.buildtargets">
|
||||
<buildTargets>
|
||||
<target name="ACTK" path="ACTK1_0" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
|
||||
<buildCommand>make</buildCommand>
|
||||
<buildArguments/>
|
||||
<buildTarget>ACTK</buildTarget>
|
||||
<stopOnError>true</stopOnError>
|
||||
<useDefaultCommand>true</useDefaultCommand>
|
||||
<runAllBuilders>true</runAllBuilders>
|
||||
</target>
|
||||
<target name="clean" path="ACTK1_0" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
|
||||
<buildCommand>make</buildCommand>
|
||||
<buildArguments/>
|
||||
<buildTarget>clean</buildTarget>
|
||||
<stopOnError>true</stopOnError>
|
||||
<useDefaultCommand>true</useDefaultCommand>
|
||||
<runAllBuilders>true</runAllBuilders>
|
||||
</target>
|
||||
<target name="clean" path="ACTK1_3_2" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
|
||||
<buildCommand>make</buildCommand>
|
||||
<buildArguments/>
|
||||
<buildTarget>clean</buildTarget>
|
||||
<stopOnError>true</stopOnError>
|
||||
<useDefaultCommand>true</useDefaultCommand>
|
||||
|
@ -81,7 +64,6 @@
|
|||
</target>
|
||||
<target name="all" path="ACTK1_3_2" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
|
||||
<buildCommand>make</buildCommand>
|
||||
<buildArguments/>
|
||||
<buildTarget>all</buildTarget>
|
||||
<stopOnError>true</stopOnError>
|
||||
<useDefaultCommand>true</useDefaultCommand>
|
||||
|
@ -89,14 +71,61 @@
|
|||
</target>
|
||||
<target name="tests" path="ACTK1_3_2" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
|
||||
<buildCommand>make</buildCommand>
|
||||
<buildArguments/>
|
||||
<buildTarget>tests</buildTarget>
|
||||
<stopOnError>true</stopOnError>
|
||||
<useDefaultCommand>true</useDefaultCommand>
|
||||
<runAllBuilders>true</runAllBuilders>
|
||||
</target>
|
||||
<target name="libACTK1_0.so" path="ACTK1_0" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
|
||||
<buildCommand>make</buildCommand>
|
||||
<buildArguments/>
|
||||
<buildTarget>libACTK1_0.so</buildTarget>
|
||||
<stopOnError>true</stopOnError>
|
||||
<useDefaultCommand>true</useDefaultCommand>
|
||||
<runAllBuilders>true</runAllBuilders>
|
||||
</target>
|
||||
<target name="clean" path="ACTK1_0" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
|
||||
<buildCommand>make</buildCommand>
|
||||
<buildTarget>clean</buildTarget>
|
||||
<stopOnError>true</stopOnError>
|
||||
<useDefaultCommand>true</useDefaultCommand>
|
||||
<runAllBuilders>true</runAllBuilders>
|
||||
</target>
|
||||
<target name="tests" path="ACTK1_0" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
|
||||
<buildCommand>make</buildCommand>
|
||||
<buildArguments/>
|
||||
<buildTarget>tests</buildTarget>
|
||||
<stopOnError>true</stopOnError>
|
||||
<useDefaultCommand>true</useDefaultCommand>
|
||||
<runAllBuilders>true</runAllBuilders>
|
||||
</target>
|
||||
<target name="dirs" path="ACTK1_0" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
|
||||
<buildCommand>make</buildCommand>
|
||||
<buildArguments/>
|
||||
<buildTarget>dirs</buildTarget>
|
||||
<stopOnError>true</stopOnError>
|
||||
<useDefaultCommand>true</useDefaultCommand>
|
||||
<runAllBuilders>true</runAllBuilders>
|
||||
</target>
|
||||
<target name="dclean" path="ACTK1_0" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
|
||||
<buildCommand>make</buildCommand>
|
||||
<buildArguments/>
|
||||
<buildTarget>dclean</buildTarget>
|
||||
<stopOnError>true</stopOnError>
|
||||
<useDefaultCommand>true</useDefaultCommand>
|
||||
<runAllBuilders>true</runAllBuilders>
|
||||
</target>
|
||||
<target name="all" path="ACTK1_0" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
|
||||
<buildCommand>make</buildCommand>
|
||||
<buildArguments/>
|
||||
<buildTarget>all</buildTarget>
|
||||
<stopOnError>true</stopOnError>
|
||||
<useDefaultCommand>true</useDefaultCommand>
|
||||
<runAllBuilders>true</runAllBuilders>
|
||||
</target>
|
||||
<target name="clean" path="APIG" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
|
||||
<buildCommand>make</buildCommand>
|
||||
<buildArguments/>
|
||||
<buildTarget>clean</buildTarget>
|
||||
<stopOnError>true</stopOnError>
|
||||
<useDefaultCommand>true</useDefaultCommand>
|
||||
|
@ -104,36 +133,13 @@
|
|||
</target>
|
||||
<target name="cliever" path="APIG" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
|
||||
<buildCommand>make</buildCommand>
|
||||
<buildArguments/>
|
||||
<buildTarget>cliever</buildTarget>
|
||||
<stopOnError>true</stopOnError>
|
||||
<useDefaultCommand>true</useDefaultCommand>
|
||||
<runAllBuilders>true</runAllBuilders>
|
||||
</target>
|
||||
<target name="AusRegEPPTK.so" path="AusRegEPPTK" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
|
||||
<buildCommand>make</buildCommand>
|
||||
<buildTarget>all</buildTarget>
|
||||
<stopOnError>true</stopOnError>
|
||||
<useDefaultCommand>true</useDefaultCommand>
|
||||
<runAllBuilders>true</runAllBuilders>
|
||||
</target>
|
||||
<target name="tests" path="AusRegEPPTK" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
|
||||
<buildCommand>make</buildCommand>
|
||||
<buildTarget>tests</buildTarget>
|
||||
<stopOnError>true</stopOnError>
|
||||
<useDefaultCommand>true</useDefaultCommand>
|
||||
<runAllBuilders>true</runAllBuilders>
|
||||
</target>
|
||||
<target name="clean" path="AusRegEPPTK" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
|
||||
<buildCommand>make</buildCommand>
|
||||
<buildTarget>clean</buildTarget>
|
||||
<stopOnError>true</stopOnError>
|
||||
<useDefaultCommand>true</useDefaultCommand>
|
||||
<runAllBuilders>true</runAllBuilders>
|
||||
</target>
|
||||
<target name="cliever" path="AusRegCliever" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
|
||||
<buildCommand>make</buildCommand>
|
||||
<buildArguments/>
|
||||
<buildTarget>cliever</buildTarget>
|
||||
<stopOnError>true</stopOnError>
|
||||
<useDefaultCommand>true</useDefaultCommand>
|
||||
|
@ -141,6 +147,7 @@
|
|||
</target>
|
||||
<target name="clean" path="AusRegCliever" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
|
||||
<buildCommand>make</buildCommand>
|
||||
<buildArguments/>
|
||||
<buildTarget>clean</buildTarget>
|
||||
<stopOnError>true</stopOnError>
|
||||
<useDefaultCommand>true</useDefaultCommand>
|
||||
|
@ -148,11 +155,36 @@
|
|||
</target>
|
||||
<target name="distclean" path="AusRegCliever" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
|
||||
<buildCommand>make</buildCommand>
|
||||
<buildArguments/>
|
||||
<buildTarget>distclean</buildTarget>
|
||||
<stopOnError>true</stopOnError>
|
||||
<useDefaultCommand>true</useDefaultCommand>
|
||||
<runAllBuilders>true</runAllBuilders>
|
||||
</target>
|
||||
<target name="AusRegEPPTK.so" path="AusRegEPPTK" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
|
||||
<buildCommand>make</buildCommand>
|
||||
<buildArguments/>
|
||||
<buildTarget>all</buildTarget>
|
||||
<stopOnError>true</stopOnError>
|
||||
<useDefaultCommand>true</useDefaultCommand>
|
||||
<runAllBuilders>true</runAllBuilders>
|
||||
</target>
|
||||
<target name="tests" path="AusRegEPPTK" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
|
||||
<buildCommand>make</buildCommand>
|
||||
<buildArguments/>
|
||||
<buildTarget>tests</buildTarget>
|
||||
<stopOnError>true</stopOnError>
|
||||
<useDefaultCommand>true</useDefaultCommand>
|
||||
<runAllBuilders>true</runAllBuilders>
|
||||
</target>
|
||||
<target name="clean" path="AusRegEPPTK" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
|
||||
<buildCommand>make</buildCommand>
|
||||
<buildArguments/>
|
||||
<buildTarget>clean</buildTarget>
|
||||
<stopOnError>true</stopOnError>
|
||||
<useDefaultCommand>true</useDefaultCommand>
|
||||
<runAllBuilders>true</runAllBuilders>
|
||||
</target>
|
||||
</buildTargets>
|
||||
</storageModule>
|
||||
</cproject>
|
||||
|
|
|
@ -1,25 +1,31 @@
|
|||
##################################################
|
||||
# Makefile for building lib and main test routine#
|
||||
##################################################
|
||||
# operating system
|
||||
LOCATION=authoring
|
||||
|
||||
SYSTEM = $(shell uname -s)
|
||||
|
||||
CXX = g++
|
||||
CC = gcc
|
||||
|
||||
#SHARED_CXXFLAGS += -O2
|
||||
SHARED_CXXFLAGS += -g
|
||||
#PRODORDEV += -O2
|
||||
PRODORDEV += -ggdb3
|
||||
|
||||
CXXFLAGS = $(SHARED_CXXFLAGS) -Wall -Wpointer-arith -Wcast-qual -D_REENTRANT -fPIC
|
||||
CXXFLAGS = $(PRODORDEV) -Wall -Wpointer-arith -Wcast-qual -D_REENTRANT -fPIC
|
||||
CPPFLAGS = -fPIC -D_GNU_SOURCE
|
||||
CXXFLAGS += -D_GNU_SOURCE -O0
|
||||
|
||||
#XERCES_HOME = /usr/local/xerces-c-src_2_7_0
|
||||
#XERCES_LIB_DIR = ${XERCES_HOME}/lib
|
||||
#XERCES_LIB = xerces-c2_7_0
|
||||
|
||||
#XALAN_HOME = /usr/local/xalan-c_1_10_0
|
||||
#XALAN_LIB_DIR = $(XALAN_HOME)/lib
|
||||
ifeq ($(LOCATION),authoring)
|
||||
XALAN_LIB_DIR = /usr/lib/x86_64-linux-gnu/
|
||||
endif
|
||||
ifeq ($(LOCATION),production)
|
||||
XALAN_LIB_DIR = /usr/lib/
|
||||
endif
|
||||
XALAN_LIB = xalan-c
|
||||
XALAN_INC_DIR = /usr/include/xalanc
|
||||
XERCES_LIB_DIR = /usr/lib/
|
||||
XERCES_LIB = xerces-c
|
||||
XERCES_INC_DIR = /usr/include/xercesc/
|
||||
|
||||
include xml-deps.mk
|
||||
|
||||
|
@ -48,7 +54,7 @@ test_execs = $(subst .o,,$(test_objs))
|
|||
calc_deps = \
|
||||
$(CC) -MT '$(build_obj_dir)/$(basename $(notdir $@)).o $@' -MF $@ -MM $(CPPFLAGS) $(INCLUDE_DIR) $<
|
||||
|
||||
all: dirs $(objs) $(BUILD_LIB_DIR)/libACTK1_3_2.so
|
||||
all: dirs $(objs) $(BUILD_LIB_DIR)/libACTK1_0.so
|
||||
|
||||
%.d: %.c
|
||||
$(calc_deps)
|
||||
|
@ -78,8 +84,8 @@ $(BUILD_OBJ_DIR)/%.o: %.c
|
|||
$(CC) $(CPPFLAGS) -c -o $@ $(INCLUDE_DIR) $<
|
||||
|
||||
|
||||
LDFLAGS_TESTS = -L$(BUILD_LIB_DIR) -lACTK1_3_2 \
|
||||
-L$(XALAN_LIB_DIR) -lxalan-c -lxalanMsg\
|
||||
LDFLAGS_TESTS = -L$(BUILD_LIB_DIR) -lACTK1_0 \
|
||||
-L$(XALAN_LIB_DIR) -lxalan-c -lxalanMsg -licuuc -licudata \
|
||||
-L$(XERCES_LIB_DIR) -lxerces-c \
|
||||
-lssl \
|
||||
-lrt
|
||||
|
@ -90,7 +96,7 @@ $(BUILD_OBJ_DIR)/%: $(BUILD_OBJ_DIR)/%.o
|
|||
.PHONY: doc clean dclean
|
||||
####### Build rules
|
||||
|
||||
#libACTK1_3_2.a: $(OBJECTS)
|
||||
#libAusreg_EPP_toolkit.a: $(OBJECTS)
|
||||
# $(LIB_ARCHIVER) $(LIB_FLAGS) $(BUILD_LIB_DIR)/$@ $^
|
||||
|
||||
|
||||
|
@ -103,15 +109,15 @@ dirs:
|
|||
-mkdir -p $(BUILD_LIB_DIR)
|
||||
-mkdir -p $(BUILD_OBJ_DIR)
|
||||
|
||||
libACTK1_3_2.so:
|
||||
$(BUILD_LIB_DIR)/libACTK1_3_2.so: $(objs)
|
||||
$(CXX) $(LDFLAGS) $(SHARED_CXXFLAGS) -shared $^ -o $@
|
||||
libACTK1_0.so:
|
||||
$(BUILD_LIB_DIR)/libACTK1_0.so: $(objs)
|
||||
$(CXX) $(LDFLAGS) $(PRODORDEV) -shared $^ -o $@
|
||||
|
||||
doc:
|
||||
doxygen etc/Doxyfile
|
||||
|
||||
clean:
|
||||
$(RM) $(objs) $(BUILD_LIB_DIR)/libACTK1_3_2.so *~
|
||||
$(RM) $(objs) $(BUILD_LIB_DIR)/libACTK1_0.so *~
|
||||
$(RM) -r $(BUILD_OBJ_DIR)
|
||||
$(RM) -r $(BUILD_LIB_DIR)
|
||||
|
||||
|
|
|
@ -3,6 +3,6 @@
|
|||
|
||||
#include <string>
|
||||
|
||||
void init(const std::string& system_props_file);
|
||||
void init(const std::string &system_props_file);
|
||||
|
||||
#endif
|
||||
|
|
|
@ -8,14 +8,6 @@
|
|||
#include <unistd.h>
|
||||
#include <sys/socket.h>
|
||||
|
||||
#if (PRODUCTION==1)
|
||||
#define sslCast
|
||||
#define sslUncast
|
||||
#else
|
||||
#define sslCast const
|
||||
#define sslUncast (SSL_CTX *)
|
||||
#endif
|
||||
|
||||
using namespace std;
|
||||
|
||||
namespace {
|
||||
|
@ -41,36 +33,36 @@ TLSContext::TLSContext(const string& private_key_file,
|
|||
SSL_load_error_strings();
|
||||
SSL_library_init();
|
||||
|
||||
sslCast SSL_METHOD *meth = TLSv1_client_method();
|
||||
SSL_METHOD *meth = TLSv1_client_method();
|
||||
if (meth == NULL)
|
||||
throw SSLException("Error initialising SSL method");
|
||||
|
||||
// SSL Context
|
||||
sslCast SSL_CTX *local_ctx = SSL_CTX_new(meth);
|
||||
SSL_CTX *local_ctx = SSL_CTX_new(meth);
|
||||
if (local_ctx == NULL)
|
||||
{
|
||||
throw SSLException ("Error initialising SSL context");
|
||||
}
|
||||
|
||||
// SSL Ciphers
|
||||
int i = SSL_CTX_set_cipher_list( sslUncast local_ctx, "TLSv1");
|
||||
int i = SSL_CTX_set_cipher_list( local_ctx, "TLSv1");
|
||||
if (i == -1)
|
||||
{
|
||||
SSL_CTX_free( sslUncast local_ctx);
|
||||
SSL_CTX_free( local_ctx);
|
||||
throw SSLException(
|
||||
"There was a problem initialising the SSL cipher list");
|
||||
}
|
||||
|
||||
SSL_CTX_set_default_passwd_cb_userdata( sslUncast local_ctx,
|
||||
SSL_CTX_set_default_passwd_cb_userdata( local_ctx,
|
||||
static_cast<void*>(const_cast<char*>(password.c_str())));
|
||||
SSL_CTX_set_default_passwd_cb( sslUncast local_ctx, getPassword);
|
||||
SSL_CTX_set_default_passwd_cb( local_ctx, getPassword);
|
||||
|
||||
i = SSL_CTX_use_PrivateKey_file( sslUncast local_ctx,
|
||||
i = SSL_CTX_use_PrivateKey_file( local_ctx,
|
||||
private_key_file.c_str(),
|
||||
SSL_FILETYPE_PEM);
|
||||
if (i == -1)
|
||||
{
|
||||
SSL_CTX_free( sslUncast local_ctx);
|
||||
SSL_CTX_free( local_ctx);
|
||||
throw SSLException(
|
||||
"There was a problem initialising SSL the private key '"
|
||||
+ private_key_file + "'");
|
||||
|
@ -78,23 +70,23 @@ TLSContext::TLSContext(const string& private_key_file,
|
|||
|
||||
// Load the public certificate for our key.
|
||||
// Replace with
|
||||
i = SSL_CTX_use_certificate_chain_file( sslUncast local_ctx, cert_file.c_str());
|
||||
i = SSL_CTX_use_certificate_chain_file( local_ctx, cert_file.c_str());
|
||||
if (i == -1)
|
||||
{
|
||||
SSL_CTX_free( sslUncast local_ctx);
|
||||
SSL_CTX_free( local_ctx);
|
||||
throw SSLException("Error loading cert_file '" + cert_file + "'");
|
||||
}
|
||||
|
||||
// Load the CA certificate(s)
|
||||
i = SSL_CTX_load_verify_locations ( sslUncast local_ctx, ca_file.c_str(), NULL);
|
||||
i = SSL_CTX_load_verify_locations ( local_ctx, ca_file.c_str(), NULL);
|
||||
|
||||
if (i == -1)
|
||||
{
|
||||
SSL_CTX_free( sslUncast local_ctx);
|
||||
SSL_CTX_free( local_ctx);
|
||||
throw EPPException ("Could not load CA file '" + ca_file +"'");
|
||||
}
|
||||
|
||||
ctx = sslUncast local_ctx;
|
||||
ctx = local_ctx;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -40,7 +40,7 @@ TLSSocket::TLSSocket(SSL_CTX* ctx, int sock, const string& host,
|
|||
|
||||
if ((ret = SSL_get_verify_result(ssl)) != X509_V_OK)
|
||||
{
|
||||
SSLException e("Certificate verify failed", ssl, ret);
|
||||
SSLException e("Certificate Verify failed", ssl, ret);
|
||||
SSL_shutdown(ssl);
|
||||
throw e;
|
||||
}
|
||||
|
|
|
@ -40,7 +40,7 @@ TLSSocket::TLSSocket(SSL_CTX* ctx, int sock, const string& host,
|
|||
|
||||
if ((ret = SSL_get_verify_result(ssl)) != X509_V_OK)
|
||||
{
|
||||
SSLException e("Certificate verify failed", ssl, ret);
|
||||
SSLException e("Certificate Verify failed", ssl, ret);
|
||||
SSL_shutdown(ssl);
|
||||
throw e;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue