summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'Swiften/TLS/CAPICertificate.cpp')
-rw-r--r--Swiften/TLS/CAPICertificate.cpp26
1 files changed, 13 insertions, 13 deletions
diff --git a/Swiften/TLS/CAPICertificate.cpp b/Swiften/TLS/CAPICertificate.cpp
index f10ad47..526b535 100644
--- a/Swiften/TLS/CAPICertificate.cpp
+++ b/Swiften/TLS/CAPICertificate.cpp
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright (c) 2012-2016 Isode Limited. 2 * Copyright (c) 2012-2019 Isode Limited.
3 * All rights reserved. 3 * All rights reserved.
4 * See the COPYING file for more information. 4 * See the COPYING file for more information.
5 */ 5 */
@@ -22,7 +22,7 @@
22#define DEBUG_SCARD_STATUS(function, status) \ 22#define DEBUG_SCARD_STATUS(function, status) \
23{ \ 23{ \
24 std::shared_ptr<boost::system::error_code> errorCode = std::make_shared<boost::system::error_code>(status, boost::system::system_category()); \ 24 std::shared_ptr<boost::system::error_code> errorCode = std::make_shared<boost::system::error_code>(status, boost::system::system_category()); \
25 SWIFT_LOG(debug) << std::hex << function << ": status: 0x" << status << ": " << errorCode->message() << std::endl; \ 25 SWIFT_LOG(debug) << std::hex << function << ": status: 0x" << status << ": " << errorCode->message(); \
26} 26}
27 27
28namespace Swift { 28namespace Swift {
@@ -44,7 +44,7 @@ CAPICertificate::CAPICertificate(const std::string& capiUri, TimerFactory* timer
44} 44}
45 45
46CAPICertificate::~CAPICertificate() { 46CAPICertificate::~CAPICertificate() {
47 SWIFT_LOG(debug) << "Destroying the CAPICertificate" << std::endl; 47 SWIFT_LOG(debug) << "Destroying the CAPICertificate";
48 if (smartCardTimer_) { 48 if (smartCardTimer_) {
49 smartCardTimer_->stop(); 49 smartCardTimer_->stop();
50 smartCardTimer_->onTick.disconnect(boost::bind(&CAPICertificate::handleSmartCardTimerTick, this)); 50 smartCardTimer_->onTick.disconnect(boost::bind(&CAPICertificate::handleSmartCardTimerTick, this));
@@ -53,7 +53,7 @@ CAPICertificate::~CAPICertificate() {
53 53
54 if (certStoreHandle_) { 54 if (certStoreHandle_) {
55 if (CertCloseStore(certStoreHandle_, 0) == FALSE) { 55 if (CertCloseStore(certStoreHandle_, 0) == FALSE) {
56 SWIFT_LOG(debug) << "Failed to close the certificate store handle" << std::endl; 56 SWIFT_LOG(debug) << "Failed to close the certificate store handle";
57 } 57 }
58 } 58 }
59 59
@@ -161,7 +161,7 @@ void CAPICertificate::setUri(const std::string& capiUri) {
161 CERT_KEY_PROV_INFO_PROP_ID, 161 CERT_KEY_PROV_INFO_PROP_ID,
162 NULL, 162 NULL,
163 &len)) { 163 &len)) {
164 SWIFT_LOG(error) << "Error while retrieving context properties" << std::endl; 164 SWIFT_LOG(error) << "Error while retrieving context properties";
165 return; 165 return;
166 } 166 }
167 167
@@ -287,25 +287,25 @@ bool CAPICertificate::checkIfSmartCardPresent() {
287 287
288 switch (dwState) { 288 switch (dwState) {
289 case SCARD_ABSENT: 289 case SCARD_ABSENT:
290 SWIFT_LOG(debug) << "Card absent." << std::endl; 290 SWIFT_LOG(debug) << "Card absent.";
291 break; 291 break;
292 case SCARD_PRESENT: 292 case SCARD_PRESENT:
293 SWIFT_LOG(debug) << "Card present." << std::endl; 293 SWIFT_LOG(debug) << "Card present.";
294 break; 294 break;
295 case SCARD_SWALLOWED: 295 case SCARD_SWALLOWED:
296 SWIFT_LOG(debug) << "Card swallowed." << std::endl; 296 SWIFT_LOG(debug) << "Card swallowed.";
297 break; 297 break;
298 case SCARD_POWERED: 298 case SCARD_POWERED:
299 SWIFT_LOG(debug) << "Card has power." << std::endl; 299 SWIFT_LOG(debug) << "Card has power.";
300 break; 300 break;
301 case SCARD_NEGOTIABLE: 301 case SCARD_NEGOTIABLE:
302 SWIFT_LOG(debug) << "Card reset and waiting PTS negotiation." << std::endl; 302 SWIFT_LOG(debug) << "Card reset and waiting PTS negotiation.";
303 break; 303 break;
304 case SCARD_SPECIFIC: 304 case SCARD_SPECIFIC:
305 SWIFT_LOG(debug) << "Card has specific communication protocols set." << std::endl; 305 SWIFT_LOG(debug) << "Card has specific communication protocols set.";
306 break; 306 break;
307 default: 307 default:
308 SWIFT_LOG(debug) << "Unknown or unexpected card state." << std::endl; 308 SWIFT_LOG(debug) << "Unknown or unexpected card state.";
309 break; 309 break;
310 } 310 }
311 311
@@ -332,7 +332,7 @@ bool CAPICertificate::checkIfSmartCardPresent() {
332void CAPICertificate::handleSmartCardTimerTick() { 332void CAPICertificate::handleSmartCardTimerTick() {
333 bool poll = checkIfSmartCardPresent(); 333 bool poll = checkIfSmartCardPresent();
334 if (lastPollingResult_ && !poll) { 334 if (lastPollingResult_ && !poll) {
335 SWIFT_LOG(debug) << "CAPI Certificate detected that the certificate card was removed" << std::endl; 335 SWIFT_LOG(debug) << "CAPI Certificate detected that the certificate card was removed";
336 onCertificateCardRemoved(); 336 onCertificateCardRemoved();
337 } 337 }
338 lastPollingResult_ = poll; 338 lastPollingResult_ = poll;