added version info, refs #4
This commit is contained in:
@@ -47,6 +47,8 @@ AC_SUBST_FILE(README)
|
|||||||
CHANGE_LOG=ChangeLog
|
CHANGE_LOG=ChangeLog
|
||||||
AC_SUBST_FILE(CHANGE_LOG)
|
AC_SUBST_FILE(CHANGE_LOG)
|
||||||
|
|
||||||
|
AM_CPPFLAGS="-DPACKAGEVERSION='\"${VERSION}\"' -DPACKAGENAME='\"${PACKAGENAME}\"'"
|
||||||
|
|
||||||
# Get rid of that stupid -O2 -g opions!
|
# Get rid of that stupid -O2 -g opions!
|
||||||
CXXFLAGS="${CXXFLAGS:-}"
|
CXXFLAGS="${CXXFLAGS:-}"
|
||||||
|
|
||||||
|
@@ -14,6 +14,7 @@ int main(int argc, char const*const*const argv) try {
|
|||||||
// print(v);
|
// print(v);
|
||||||
cryptoki::Init init(argc==2?argv[1]:"onepin-opensc-pkcs11.so");
|
cryptoki::Init init(argc==2?argv[1]:"onepin-opensc-pkcs11.so");
|
||||||
cryptoki::Info inf(init.info());
|
cryptoki::Info inf(init.info());
|
||||||
|
std::cout<<"Library-Version: "<<pcsc::version()<<std::endl;
|
||||||
std::cout<<"##################### INFO #####################"<<std::endl
|
std::cout<<"##################### INFO #####################"<<std::endl
|
||||||
<<"cryptokiVersion: \""<<(int)inf.cryptokiVersion.major
|
<<"cryptokiVersion: \""<<(int)inf.cryptokiVersion.major
|
||||||
<<'.'<<(int)inf.cryptokiVersion.minor<<'"'<<std::endl
|
<<'.'<<(int)inf.cryptokiVersion.minor<<'"'<<std::endl
|
||||||
|
@@ -11,10 +11,12 @@ AM_CPPFLAGS += -I/usr/include/PCSC
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
pcsc_demo_SOURCES = pcsc-demo.cxx
|
pcsc_demo_SOURCES = pcsc-demo.cxx
|
||||||
|
pcsc_demo_LDFLAGS = -L${top_builddir}/src
|
||||||
|
pcsc_demo_LDADD = -lcryptoki++
|
||||||
if MINGW32
|
if MINGW32
|
||||||
pcsc_demo_LDADD = /opt/local/i586-mingw32msvc/lib/winscard.a
|
pcsc_demo_LDADD += /opt/local/i586-mingw32msvc/lib/winscard.a
|
||||||
else
|
else
|
||||||
pcsc_demo_LDADD = -lpcsclite -lpthread
|
pcsc_demo_LDADD += -lpcsclite -ldl -lpthread
|
||||||
endif
|
endif
|
||||||
|
|
||||||
cryptoki_demo_SOURCES = cryptoki-demo.cxx
|
cryptoki_demo_SOURCES = cryptoki-demo.cxx
|
||||||
@@ -28,18 +30,20 @@ endif
|
|||||||
|
|
||||||
openssl_tcp_demo_SOURCES = openssl-tcp-demo.cxx
|
openssl_tcp_demo_SOURCES = openssl-tcp-demo.cxx
|
||||||
openssl_tcp_demo_LDFLAGS = -L${top_builddir}/src
|
openssl_tcp_demo_LDFLAGS = -L${top_builddir}/src
|
||||||
|
openssl_tcp_demo_LDADD = -lcryptoki++
|
||||||
if MINGW32
|
if MINGW32
|
||||||
openssl_tcp_demo_LDADD = /opt/local/i586-mingw32msvc/lib/ssleay32.a /opt/local/i586-mingw32msvc/lib/libeay32.a
|
openssl_tcp_demo_LDADD += /opt/local/i586-mingw32msvc/lib/ssleay32.a /opt/local/i586-mingw32msvc/lib/libeay32.a
|
||||||
else
|
else
|
||||||
openssl_tcp_demo_LDADD = -ldl -lpthread -lssl
|
openssl_tcp_demo_LDADD += -ldl -lpthread -lssl
|
||||||
endif
|
endif
|
||||||
|
|
||||||
openssl_ssl_demo_SOURCES = openssl-ssl-demo.cxx
|
openssl_ssl_demo_SOURCES = openssl-ssl-demo.cxx
|
||||||
openssl_ssl_demo_LDFLAGS = -L${top_builddir}/src
|
openssl_ssl_demo_LDFLAGS = -L${top_builddir}/src
|
||||||
|
openssl_ssl_demo_LDADD = -lcryptoki++
|
||||||
if MINGW32
|
if MINGW32
|
||||||
openssl_ssl_demo_LDADD = /opt/local/i586-mingw32msvc/lib/ssleay32.a /opt/local/i586-mingw32msvc/lib/libeay32.a
|
openssl_ssl_demo_LDADD += /opt/local/i586-mingw32msvc/lib/ssleay32.a /opt/local/i586-mingw32msvc/lib/libeay32.a
|
||||||
else
|
else
|
||||||
openssl_ssl_demo_LDADD = -ldl -lpthread -lssl
|
openssl_ssl_demo_LDADD += -ldl -lpthread -lssl
|
||||||
endif
|
endif
|
||||||
|
|
||||||
MAINTAINERCLEANFILES = makefile.in
|
MAINTAINERCLEANFILES = makefile.in
|
||||||
|
@@ -14,6 +14,7 @@ int main(int argc, char** argv) try {
|
|||||||
std::string host(argc>1?argv[1]:"dev.swisssign.com");
|
std::string host(argc>1?argv[1]:"dev.swisssign.com");
|
||||||
std::string port(argc>2?argv[2]:"443");
|
std::string port(argc>2?argv[2]:"443");
|
||||||
std::string path(argc>3?argv[3]:"/");
|
std::string path(argc>3?argv[3]:"/");
|
||||||
|
std::cout<<"Library-Version: "<<pcsc::version()<<std::endl;
|
||||||
std::cout<<"Connect to: "<<host<<':'<<port<<std::endl;
|
std::cout<<"Connect to: "<<host<<':'<<port<<std::endl;
|
||||||
openssl::SSL ssl
|
openssl::SSL ssl
|
||||||
(openssl::TrustStore("/usr/lib/ssl/certs/SwissSign_Gold_CA_-_G2.pem"));
|
(openssl::TrustStore("/usr/lib/ssl/certs/SwissSign_Gold_CA_-_G2.pem"));
|
||||||
|
@@ -13,6 +13,7 @@ int main(int argc, char** argv) try {
|
|||||||
openssl::Init init;
|
openssl::Init init;
|
||||||
std::string host(argc>1?argv[1]:"swisssign.com");
|
std::string host(argc>1?argv[1]:"swisssign.com");
|
||||||
std::string port(argc>2?argv[2]:"80");
|
std::string port(argc>2?argv[2]:"80");
|
||||||
|
std::cout<<"Library-Version: "<<pcsc::version()<<std::endl;
|
||||||
std::cout<<"Connect to: "<<host<<':'<<port<<std::endl;
|
std::cout<<"Connect to: "<<host<<':'<<port<<std::endl;
|
||||||
openssl::TCP ssl(host+':'+port);
|
openssl::TCP ssl(host+':'+port);
|
||||||
ssl<<"GET / HTTP/1.1\x0D\x0AHost: "<<host
|
ssl<<"GET / HTTP/1.1\x0D\x0AHost: "<<host
|
||||||
|
@@ -5,6 +5,7 @@
|
|||||||
int main(int, char const*const*const argv) try {
|
int main(int, char const*const*const argv) try {
|
||||||
pcsc::Connection c;
|
pcsc::Connection c;
|
||||||
pcsc::Connection::Strings reader(c.scan());
|
pcsc::Connection::Strings reader(c.scan());
|
||||||
|
std::cout<<"Library-Version: "<<pcsc::version()<<std::endl;
|
||||||
std::cout<<"Suche PCSC-Reader ..."<<std::endl;
|
std::cout<<"Suche PCSC-Reader ..."<<std::endl;
|
||||||
if (!reader.size()) std::cout<<"Keine gefunden."<<std::endl;
|
if (!reader.size()) std::cout<<"Keine gefunden."<<std::endl;
|
||||||
for (pcsc::Connection::Strings::const_iterator it(reader.begin());
|
for (pcsc::Connection::Strings::const_iterator it(reader.begin());
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
./bootstrap.sh && \
|
./bootstrap.sh && \
|
||||||
LDFLAGS="-L/usr/lib32 -m32" \
|
LDFLAGS="-L/usr/lib32 -L/usr/local/lib32 -m32" \
|
||||||
CXXFLAGS="-m32" \
|
CXXFLAGS="-m32" \
|
||||||
CPPFLAGS="-DCRYPTOKI_LOG\(X\)='std::clog<<X<<"'"@"'"<<__PRETTY_FUNCTION__<<std::endl'" \
|
CPPFLAGS="-DCRYPTOKI_LOG\(X\)='std::clog<<X<<"'"@"'"<<__PRETTY_FUNCTION__<<std::endl'" \
|
||||||
./configure \
|
./configure \
|
||||||
|
@@ -79,6 +79,10 @@
|
|||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
namespace pcsc {
|
||||||
|
std::string version();
|
||||||
|
}
|
||||||
|
|
||||||
//! @see gcryptoki
|
//! @see gcryptoki
|
||||||
namespace cryptoki {
|
namespace cryptoki {
|
||||||
|
|
||||||
|
@@ -17,8 +17,11 @@ EXTRA_DIST = $(pkgconfig_DATA).in $(shell ls -1 *.doc)
|
|||||||
|
|
||||||
lib_LTLIBRARIES = libcryptoki++.la
|
lib_LTLIBRARIES = libcryptoki++.la
|
||||||
|
|
||||||
libcryptoki___la_SOURCES = cryptoki.cxx cryptoki.hxx
|
libcryptoki___la_SOURCES = cryptoki.cxx cryptoki.hxx version.cxx
|
||||||
libcryptoki___la_LIBADD = -lssl
|
libcryptoki___la_LIBADD = -lssl
|
||||||
|
if !MINGW32
|
||||||
|
libcryptoki___la_LIBADD += -lpcsclite
|
||||||
|
endif
|
||||||
|
|
||||||
clean-local:
|
clean-local:
|
||||||
-rm -r ${QMAKE_TARGET}.app
|
-rm -r ${QMAKE_TARGET}.app
|
||||||
|
@@ -23,6 +23,10 @@
|
|||||||
#include <cstdio>
|
#include <cstdio>
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
|
|
||||||
|
namespace pcsc {
|
||||||
|
std::string version();
|
||||||
|
}
|
||||||
|
|
||||||
#ifndef OPENSSL_LOG
|
#ifndef OPENSSL_LOG
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#if __GNUC__ >= 2
|
#if __GNUC__ >= 2
|
||||||
@@ -51,7 +55,6 @@
|
|||||||
//! @see gopenssl
|
//! @see gopenssl
|
||||||
namespace openssl {
|
namespace openssl {
|
||||||
|
|
||||||
|
|
||||||
//============================================================================
|
//============================================================================
|
||||||
//! @addtogroup opensslexceptions
|
//! @addtogroup opensslexceptions
|
||||||
//@{
|
//@{
|
||||||
|
@@ -41,6 +41,7 @@
|
|||||||
#define MAX_ATR_SIZE 33
|
#define MAX_ATR_SIZE 33
|
||||||
#endif
|
#endif
|
||||||
namespace pcsc {
|
namespace pcsc {
|
||||||
|
|
||||||
#ifdef UNICODE
|
#ifdef UNICODE
|
||||||
inline std::wstring strconv(std::string s) {
|
inline std::wstring strconv(std::string s) {
|
||||||
return std::wstring(s.begin(), s.end());
|
return std::wstring(s.begin(), s.end());
|
||||||
@@ -76,6 +77,10 @@
|
|||||||
#include <map>
|
#include <map>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
|
|
||||||
|
namespace pcsc {
|
||||||
|
std::string version();
|
||||||
|
}
|
||||||
|
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
#include <iomanip>
|
#include <iomanip>
|
||||||
|
|
||||||
|
16
src/version.cxx
Normal file
16
src/version.cxx
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
/*! @file
|
||||||
|
|
||||||
|
@id $Id$
|
||||||
|
*/
|
||||||
|
// 1 2 3 4 5 6 7 8
|
||||||
|
// 45678901234567890123456789012345678901234567890123456789012345678901234567890
|
||||||
|
|
||||||
|
#include <string>
|
||||||
|
|
||||||
|
namespace pcsc {
|
||||||
|
std::string version() {
|
||||||
|
return PACKAGENAME "-" PACKAGEVERSION;
|
||||||
|
}
|
||||||
|
const std::string IDENT("$Id: " PACKAGENAME "-" PACKAGEVERSION " $");
|
||||||
|
const std::string WHAT("#(@)" PACKAGENAME "-" PACKAGEVERSION);
|
||||||
|
}
|
Reference in New Issue
Block a user