removed version, refs #101; implemented new temporaryfile handler and improved save, refs #51; partial changes for refs #79 and solved #104
This commit is contained in:
@@ -153,8 +153,11 @@ class SmartCardAuth: public QObject {
|
||||
|
||||
void login(bool force=true) {
|
||||
qDebug()<<__PRETTY_FUNCTION__;
|
||||
QMutexLocker lock(&_mutex);
|
||||
while (!_mutex.tryLock()) QCoreApplication::processEvents();
|
||||
FreeLock freelock(_mutex);
|
||||
OPENSSL_LOG("got lock");
|
||||
if (!_e || (!force && *_e)) return; // no smartcard or already logged in
|
||||
OPENSSL_LOG("start login to smartcard");
|
||||
try {
|
||||
QList<CertInfo> authcerts;
|
||||
QList<CertInfo> allcerts;
|
||||
@@ -286,6 +289,17 @@ class SmartCardAuth: public QObject {
|
||||
cryptoki::SlotList::iterator slot;
|
||||
cryptoki::Attribute id;
|
||||
};
|
||||
|
||||
class FreeLock {
|
||||
public:
|
||||
FreeLock(QMutex& m): _mutex(m) {
|
||||
}
|
||||
~FreeLock() {
|
||||
_mutex.unlock();
|
||||
}
|
||||
private:
|
||||
QMutex& _mutex;
|
||||
};
|
||||
|
||||
private:
|
||||
|
||||
|
Reference in New Issue
Block a user