some minor changes; refs #8
This commit is contained in:
38
README.txt
38
README.txt
@@ -1,11 +1,6 @@
|
||||
Ein globales Makefile existiert bislang noch nicht; die einzelnen
|
||||
Komponenten werden müssen separat gebaut werden.
|
||||
|
||||
actlibrary
|
||||
Beinhaltet Unterverzeichnisse für die "actlibrary" und die dazugehörigen
|
||||
Include-Dateien der einzelnen Architekturen
|
||||
Enthält APDUs.
|
||||
|
||||
openssl-act-engine
|
||||
OpenSSL-Engine auf Basis der actlibrary zur Benutzung von
|
||||
Smartcard-basierten Schlüsseln von OpenSSL aus
|
||||
@@ -14,22 +9,12 @@ openssl-act-engine
|
||||
- benötigt Pfad zur actlibrary der Zielarchitektur (ACTLIB_ROOT)
|
||||
- erstellt libengine_act.so
|
||||
|
||||
swisssign-openssl-pkcs11-engine
|
||||
OpenSSL-PKCS11-Engine. Referenzcode für das Grundgerüst der
|
||||
OpenSSL-actlibrary-Engine, nicht im eigentlichen SwissSurfer benötigt.
|
||||
|
||||
Qt
|
||||
Beinhaltet das Qt-Quellcode-Archiv.
|
||||
|
||||
Qt/patch
|
||||
Beinhaltet die Patches zum Qt-Quellcode. Anwenden mit
|
||||
cd /pfad/zu/ausgepackten/qt-Quellen ; patch -p1 </pfad/zu/patch
|
||||
und nachfolgenden Compilieren
|
||||
|
||||
swisssurfer
|
||||
Der SwissSurfer selbst.
|
||||
- Erstellen mit "./bootstrap.sh"
|
||||
- Benutzt automake/autoconf/GCC Toolchain
|
||||
-> benötigt Ubuntu-Pakete:
|
||||
libxext-dev, libx11-dev
|
||||
|
||||
Test_Qt_Frontend
|
||||
Minimales Test-Frontend, was die engine_act.dll (die
|
||||
@@ -40,6 +25,25 @@ Test_Qt_Frontend
|
||||
- Wird mit dem "Qt Creator" auf Basis der gepatchten Qt-Library gebaut
|
||||
- Windows-spezifische Implementation, benötigt engine_act.dll in
|
||||
C:\Windows\System32 (Pfad in smartcardauth.cpp eincodiert)
|
||||
QMAKESPEC=../qt/qt-everywhere-opensource-src-4.6.3/mkspecs/linux-g++-64 ../qt/qt-everywhere-opensource-src-4.6.3/bin/qmake QtSslTest.pro
|
||||
|
||||
|
||||
actlibrary
|
||||
Beinhaltet Unterverzeichnisse für die "actlibrary" und die dazugehörigen
|
||||
Include-Dateien der einzelnen Architekturen
|
||||
Enthält APDUs.
|
||||
|
||||
swisssign-openssl-pkcs11-engine
|
||||
OpenSSL-PKCS11-Engine. Referenzcode für das Grundgerüst der
|
||||
OpenSSL-actlibrary-Engine, nicht im eigentlichen SwissSurfer benötigt.
|
||||
|
||||
Qt
|
||||
Beinhaltet das Qt-Quellcode-Archiv.
|
||||
|
||||
swisssurfer
|
||||
Der SwissSurfer selbst.
|
||||
- Erstellen mit "./bootstrap.sh"
|
||||
- Benutzt automake/autoconf/GCC Toolchain
|
||||
|
||||
Sample_executables
|
||||
Beinhaltet z.Zt. vorcompiliertes Beispiel der engine_act.dll
|
||||
|
@@ -4,7 +4,9 @@
|
||||
TEMPLATE = app
|
||||
TARGET =
|
||||
DEPENDPATH += .
|
||||
INCLUDEPATH += ../openssl-act-engine .
|
||||
INCLUDEPATH += ../openssl-act-engine ../openssl-act-engine/src . ../qt/qt-everywhere-opensource-src-4.6.3/include ../qt/qt-everywhere-opensource-src-4.6.3/include/Qt
|
||||
|
||||
CONFIG += debug
|
||||
|
||||
# Input
|
||||
SOURCES += qtssltest.cpp \
|
||||
|
@@ -145,7 +145,7 @@ bool SmartCardAuth::hookInitSslContext(SSL_CTX *ctx)
|
||||
#ifdef USE_CERTIFICATE_FILE
|
||||
// Load a specific intermediate certificate from a file
|
||||
//! @todo PEM-File
|
||||
BIO* cert_file= q_BIO_new_file("D:\\QtSmartCardAuth_TMI\\QtSslTest\\swsign_interm.pem", "r");
|
||||
BIO* cert_file= q_BIO_new_file("swsign_interm.pem", "r");
|
||||
X509* interm=q_PEM_read_bio_X509(cert_file,NULL,NULL, NULL);
|
||||
q_BIO_free(cert_file);
|
||||
|
||||
|
@@ -5,6 +5,16 @@
|
||||
#include <openssl/rsa.h>
|
||||
#include <openssl/engine.h>
|
||||
|
||||
#define CHECK(X) \
|
||||
if (!(res=X)) { \
|
||||
printf("ERROR: %s", #X); \
|
||||
for (unsigned int err(0); err=ERR_get_error();) { \
|
||||
fprintf(stderr,"%s\n", ERR_error_string(err, NULL)); \
|
||||
} \
|
||||
return -1; \
|
||||
}
|
||||
|
||||
|
||||
int main(int argc, char* argv[])
|
||||
{
|
||||
ENGINE* e = NULL;
|
||||
@@ -12,22 +22,27 @@ int main(int argc, char* argv[])
|
||||
|
||||
ENGINE_load_dynamic();
|
||||
e = ENGINE_by_id("dynamic");
|
||||
|
||||
if (!e) {
|
||||
printf("ERROR: No Engine");
|
||||
return -1;
|
||||
}
|
||||
|
||||
int res;
|
||||
int res(-1);
|
||||
|
||||
// Parameters to set for the dynamic loader
|
||||
res = ENGINE_ctrl_cmd_string(e, "SO_PATH", "/home/carsten/engine_securetoken/libengine_securetoken.so", 0);
|
||||
res = ENGINE_ctrl_cmd_string(e, "ID", "securetoken", 0);
|
||||
res = ENGINE_ctrl_cmd_string(e, "LIST_ADD", "1", 0);
|
||||
CHECK(ENGINE_ctrl_cmd_string(e, "SO_PATH", "./libengine_act.so", 0));
|
||||
CHECK(ENGINE_ctrl_cmd_string(e, "ID", "securetoken", 0));
|
||||
CHECK(ENGINE_ctrl_cmd_string(e, "LIST_ADD", "1", 0));
|
||||
|
||||
// Now actually load the SecureToken engine.
|
||||
res = ENGINE_ctrl_cmd_string(e, "LOAD", NULL, 0);
|
||||
CHECK(ENGINE_ctrl_cmd_string(e, "LOAD", NULL, 0));
|
||||
|
||||
// Following control commands go to the SecureToken engine rather than the dynamic loader
|
||||
|
||||
res = ENGINE_init(e);
|
||||
CHECK(ENGINE_init(e));
|
||||
|
||||
res = ENGINE_ctrl_cmd(e, "ENUM_CERTS", 0, &certs_found, NULL, 0);
|
||||
CHECK(ENGINE_ctrl_cmd(e, "ENUM_CERTS", 0, &certs_found, NULL, 0));
|
||||
|
||||
printf("Found %d certificates.\n", certs_found->num_certs);
|
||||
|
||||
@@ -76,7 +91,7 @@ int main(int argc, char* argv[])
|
||||
|
||||
|
||||
|
||||
res = ENGINE_finish(e);
|
||||
CHECK(ENGINE_finish(e));
|
||||
|
||||
ENGINE_cleanup();
|
||||
|
||||
|
Reference in New Issue
Block a user