added version info, refs #4

master
Marc Wäckerlin 14 years ago
parent 83b451a156
commit 8101619fdc
  1. 2
      configure.in
  2. 1
      doc/examples/cryptoki-demo.cxx
  3. 16
      doc/examples/makefile.am
  4. 1
      doc/examples/openssl-ssl-demo.cxx
  5. 1
      doc/examples/openssl-tcp-demo.cxx
  6. 1
      doc/examples/pcsc-demo.cxx
  7. 2
      install-64-and-32-bit-linux.sh
  8. 4
      src/cryptoki.hxx
  9. 5
      src/makefile.am
  10. 5
      src/openssl.hxx
  11. 5
      src/pcsc.hxx
  12. 16
      src/version.cxx

@ -47,6 +47,8 @@ AC_SUBST_FILE(README)
CHANGE_LOG=ChangeLog
AC_SUBST_FILE(CHANGE_LOG)
AM_CPPFLAGS="-DPACKAGEVERSION='\"${VERSION}\"' -DPACKAGENAME='\"${PACKAGENAME}\"'"
# Get rid of that stupid -O2 -g opions!
CXXFLAGS="${CXXFLAGS:-}"

@ -14,6 +14,7 @@ int main(int argc, char const*const*const argv) try {
// print(v);
cryptoki::Init init(argc==2?argv[1]:"onepin-opensc-pkcs11.so");
cryptoki::Info inf(init.info());
std::cout<<"Library-Version: "<<pcsc::version()<<std::endl;
std::cout<<"##################### INFO #####################"<<std::endl
<<"cryptokiVersion: \""<<(int)inf.cryptokiVersion.major
<<'.'<<(int)inf.cryptokiVersion.minor<<'"'<<std::endl

@ -11,10 +11,12 @@ AM_CPPFLAGS += -I/usr/include/PCSC
endif
pcsc_demo_SOURCES = pcsc-demo.cxx
pcsc_demo_LDFLAGS = -L${top_builddir}/src
pcsc_demo_LDADD = -lcryptoki++
if MINGW32
pcsc_demo_LDADD = /opt/local/i586-mingw32msvc/lib/winscard.a
pcsc_demo_LDADD += /opt/local/i586-mingw32msvc/lib/winscard.a
else
pcsc_demo_LDADD = -lpcsclite -lpthread
pcsc_demo_LDADD += -lpcsclite -ldl -lpthread
endif
cryptoki_demo_SOURCES = cryptoki-demo.cxx
@ -28,18 +30,20 @@ endif
openssl_tcp_demo_SOURCES = openssl-tcp-demo.cxx
openssl_tcp_demo_LDFLAGS = -L${top_builddir}/src
openssl_tcp_demo_LDADD = -lcryptoki++
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
openssl_tcp_demo_LDADD = -ldl -lpthread -lssl
openssl_tcp_demo_LDADD += -ldl -lpthread -lssl
endif
openssl_ssl_demo_SOURCES = openssl-ssl-demo.cxx
openssl_ssl_demo_LDFLAGS = -L${top_builddir}/src
openssl_ssl_demo_LDADD = -lcryptoki++
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
openssl_ssl_demo_LDADD = -ldl -lpthread -lssl
openssl_ssl_demo_LDADD += -ldl -lpthread -lssl
endif
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 port(argc>2?argv[2]:"443");
std::string path(argc>3?argv[3]:"/");
std::cout<<"Library-Version: "<<pcsc::version()<<std::endl;
std::cout<<"Connect to: "<<host<<':'<<port<<std::endl;
openssl::SSL ssl
(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;
std::string host(argc>1?argv[1]:"swisssign.com");
std::string port(argc>2?argv[2]:"80");
std::cout<<"Library-Version: "<<pcsc::version()<<std::endl;
std::cout<<"Connect to: "<<host<<':'<<port<<std::endl;
openssl::TCP ssl(host+':'+port);
ssl<<"GET / HTTP/1.1\x0D\x0AHost: "<<host

@ -5,6 +5,7 @@
int main(int, char const*const*const argv) try {
pcsc::Connection c;
pcsc::Connection::Strings reader(c.scan());
std::cout<<"Library-Version: "<<pcsc::version()<<std::endl;
std::cout<<"Suche PCSC-Reader ..."<<std::endl;
if (!reader.size()) std::cout<<"Keine gefunden."<<std::endl;
for (pcsc::Connection::Strings::const_iterator it(reader.begin());

@ -1,5 +1,5 @@
./bootstrap.sh && \
LDFLAGS="-L/usr/lib32 -m32" \
LDFLAGS="-L/usr/lib32 -L/usr/local/lib32 -m32" \
CXXFLAGS="-m32" \
CPPFLAGS="-DCRYPTOKI_LOG\(X\)='std::clog<<X<<"'"@"'"<<__PRETTY_FUNCTION__<<std::endl'" \
./configure \

@ -79,6 +79,10 @@
#endif
#endif
namespace pcsc {
std::string version();
}
//! @see gcryptoki
namespace cryptoki {

@ -17,8 +17,11 @@ EXTRA_DIST = $(pkgconfig_DATA).in $(shell ls -1 *.doc)
lib_LTLIBRARIES = libcryptoki++.la
libcryptoki___la_SOURCES = cryptoki.cxx cryptoki.hxx
libcryptoki___la_SOURCES = cryptoki.cxx cryptoki.hxx version.cxx
libcryptoki___la_LIBADD = -lssl
if !MINGW32
libcryptoki___la_LIBADD += -lpcsclite
endif
clean-local:
-rm -r ${QMAKE_TARGET}.app

@ -23,6 +23,10 @@
#include <cstdio>
#include <cassert>
namespace pcsc {
std::string version();
}
#ifndef OPENSSL_LOG
#include <iostream>
#if __GNUC__ >= 2
@ -51,7 +55,6 @@
//! @see gopenssl
namespace openssl {
//============================================================================
//! @addtogroup opensslexceptions
//@{

@ -41,6 +41,7 @@
#define MAX_ATR_SIZE 33
#endif
namespace pcsc {
#ifdef UNICODE
inline std::wstring strconv(std::string s) {
return std::wstring(s.begin(), s.end());
@ -76,6 +77,10 @@
#include <map>
#include <memory>
namespace pcsc {
std::string version();
}
#include <sstream>
#include <iomanip>

@ -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);
}
Loading…
Cancel
Save