Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions client/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,10 @@ add_executable(${PROJECT_NAME} WIN32 MACOSX_BUNDLE
QPCSC.cpp
QPCSC_p.h
QPCSC.h
QPKCS11.cpp
QPKCS11.h
$<IF:$<PLATFORM_ID:Windows>,
QCNG.cpp QCNG.h,
QPKCS11.cpp QPKCS11.h
>
QSigner.cpp
QSigner.h
QSmartCard.cpp
Expand Down Expand Up @@ -194,7 +196,6 @@ if( APPLE )
COMMAND zip -r ${CMAKE_BINARY_DIR}/${PROJECT_NAME}-dbg_${VERSION}$ENV{VER_SUFFIX}.zip ${PROJECT_NAME}.dSYM
)
elseif(WIN32)
target_sources(${PROJECT_NAME} PRIVATE QCNG.cpp QCNG.h)
target_compile_options(${PROJECT_NAME} PRIVATE "/guard:cf")
target_link_options(${PROJECT_NAME} PRIVATE "/guard:cf" $<$<BOOL:${CROSSSIGNCERT}>:/INTEGRITYCHECK>)
target_link_libraries(${PROJECT_NAME} NCrypt Crypt32 Cryptui winscard)
Expand Down
17 changes: 9 additions & 8 deletions client/QCryptoBackend.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,9 @@
#include "TokenData.h"
#ifdef Q_OS_WIN
#include "QCNG.h"
#endif
#else
#include "QPKCS11.h"
#endif
#include "QSigner.h"
#include "QSmartCard.h"

Expand Down Expand Up @@ -88,13 +89,13 @@ QString QCryptoBackend::errorString(Status error)
switch( error )
{
case PinOK: return QString();
case PinCanceled: return QCoreApplication::translate("QCryptoBackend", "PIN entry canceled");
case PinLocked: return QCoreApplication::translate("QCryptoBackend", "PIN locked");
case PinIncorrect: return QCoreApplication::translate("QCryptoBackend", "PIN incorrect");
case InProgress: return QCoreApplication::translate("QCryptoBackend", "Signing/decrypting is already in progress another window.");
case GeneralError: return QCoreApplication::translate("QCryptoBackend", "PKCS11 general error");
case DeviceError: return QCoreApplication::translate("QCryptoBackend", "PKCS11 device error");
default: return QCoreApplication::translate("QCryptoBackend", "Unknown error");
case PinCanceled: return tr("PIN entry canceled");
case PinLocked: return tr("PIN locked");
case PinIncorrect: return tr("PIN incorrect");
case InProgress: return tr("Signing/decrypting is already in progress another window.");
case GeneralError: return tr("PKCS11 general error");
case DeviceError: return tr("PKCS11 device error");
default: return tr("Unknown error");
}
}

Expand Down
2 changes: 2 additions & 0 deletions client/QCryptoBackend.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@

#include "TokenData.h"

#include <QtCore/QCoreApplication>
#include <QtCore/QCryptographicHash>

#include <expected>
Expand All @@ -30,6 +31,7 @@ class QSslKey;

class QCryptoBackend
{
Q_DECLARE_TR_FUNCTIONS(QCryptoBackend);
public:
enum Status : quint8
{
Expand Down
2 changes: 2 additions & 0 deletions client/QPKCS11.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,9 @@ std::shared_ptr<QPKCS11Library> QPKCS11Library::current()
{ "/Library/Frameworks/eToken.framework/Versions/Current/libIDPrimePKCS11.dylib", "3BFF9600008131FE4380318065B0855956FB120FFE82900000" },
{ "/Library/Frameworks/eToken.framework/Versions/Current/libIDPrimePKCS11.dylib", "3BFF9600008131FE4380318065B08505003912017882900040" },
#elif defined(Q_OS_WIN)
#ifdef _DEBUG
{ "opensc-pkcs11.dll", {} },
#endif
#else
{ "opensc-pkcs11.so", {} },
#if defined(Q_OS_LINUX)
Expand Down
Loading