mirror of
https://github.com/QuasarApp/qca.git
synced 2025-05-11 10:19:33 +00:00
QString::sprintf -> QString::asprintf
This commit is contained in:
parent
0816a04f42
commit
4ad7e911d9
@ -44,7 +44,7 @@ set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules" )
|
|||||||
# Do not automatically link Qt executables to qtmain target on Windows.
|
# Do not automatically link Qt executables to qtmain target on Windows.
|
||||||
# QCA exucatables use console mode only. Not need to link against qtmain.lib.
|
# QCA exucatables use console mode only. Not need to link against qtmain.lib.
|
||||||
set(Qt5_NO_LINK_QTMAIN ON)
|
set(Qt5_NO_LINK_QTMAIN ON)
|
||||||
find_package(Qt5 REQUIRED Core)
|
find_package(Qt5 5.5 REQUIRED Core)
|
||||||
set(CMAKE_AUTOMOC ON)
|
set(CMAKE_AUTOMOC ON)
|
||||||
|
|
||||||
include(QcaMacro)
|
include(QcaMacro)
|
||||||
|
@ -585,7 +585,7 @@ public:
|
|||||||
bool ret = false;
|
bool ret = false;
|
||||||
|
|
||||||
QCA_logTextMessage (
|
QCA_logTextMessage (
|
||||||
QString ().sprintf (
|
QString::asprintf (
|
||||||
"pkcs11RSAContext::decrypt - decrypt in.size()=%d, alg=%d",
|
"pkcs11RSAContext::decrypt - decrypt in.size()=%d, alg=%d",
|
||||||
in.size (),
|
in.size (),
|
||||||
(int)alg
|
(int)alg
|
||||||
@ -672,7 +672,7 @@ public:
|
|||||||
|
|
||||||
if (s_keyStoreList != NULL) {
|
if (s_keyStoreList != NULL) {
|
||||||
s_keyStoreList->_emit_diagnosticText (
|
s_keyStoreList->_emit_diagnosticText (
|
||||||
QString ().sprintf (
|
QString::asprintf (
|
||||||
"PKCS#11: Cannot decrypt: %lu-'%s'.\n",
|
"PKCS#11: Cannot decrypt: %lu-'%s'.\n",
|
||||||
e.rv (),
|
e.rv (),
|
||||||
myPrintable (e.message ())
|
myPrintable (e.message ())
|
||||||
@ -682,7 +682,7 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
QCA_logTextMessage (
|
QCA_logTextMessage (
|
||||||
QString ().sprintf (
|
QString::asprintf (
|
||||||
"pkcs11RSAContext::decrypt - decrypt out->size()=%d",
|
"pkcs11RSAContext::decrypt - decrypt out->size()=%d",
|
||||||
out->size ()
|
out->size ()
|
||||||
),
|
),
|
||||||
@ -718,7 +718,7 @@ public:
|
|||||||
case EMSA3_RIPEMD160:
|
case EMSA3_RIPEMD160:
|
||||||
default:
|
default:
|
||||||
QCA_logTextMessage (
|
QCA_logTextMessage (
|
||||||
QString().sprintf (
|
QString::asprintf (
|
||||||
"PKCS#11: Invalid hash algorithm %d",
|
"PKCS#11: Invalid hash algorithm %d",
|
||||||
_sign_data.alg
|
_sign_data.alg
|
||||||
),
|
),
|
||||||
@ -850,7 +850,7 @@ public:
|
|||||||
|
|
||||||
if (s_keyStoreList != NULL) {
|
if (s_keyStoreList != NULL) {
|
||||||
s_keyStoreList->_emit_diagnosticText (
|
s_keyStoreList->_emit_diagnosticText (
|
||||||
QString ().sprintf (
|
QString::asprintf (
|
||||||
"PKCS#11: Cannot sign: %lu-'%s'.\n",
|
"PKCS#11: Cannot sign: %lu-'%s'.\n",
|
||||||
e.rv (),
|
e.rv (),
|
||||||
myPrintable (e.message ())
|
myPrintable (e.message ())
|
||||||
@ -862,7 +862,7 @@ public:
|
|||||||
_clearSign ();
|
_clearSign ();
|
||||||
|
|
||||||
QCA_logTextMessage (
|
QCA_logTextMessage (
|
||||||
QString ().sprintf (
|
QString::asprintf (
|
||||||
"pkcs11RSAContext::endSign - return result.size ()=%d",
|
"pkcs11RSAContext::endSign - return result.size ()=%d",
|
||||||
result.size ()
|
result.size ()
|
||||||
),
|
),
|
||||||
@ -962,7 +962,7 @@ public:
|
|||||||
) == CKR_OK;
|
) == CKR_OK;
|
||||||
|
|
||||||
QCA_logTextMessage (
|
QCA_logTextMessage (
|
||||||
QString ().sprintf (
|
QString::asprintf (
|
||||||
"pkcs11RSAContext::_ensureTokenAvailable - return ret=%d",
|
"pkcs11RSAContext::_ensureTokenAvailable - return ret=%d",
|
||||||
ret ? 1 : 0
|
ret ? 1 : 0
|
||||||
),
|
),
|
||||||
@ -988,7 +988,7 @@ public:
|
|||||||
) == CKR_OK;
|
) == CKR_OK;
|
||||||
|
|
||||||
QCA_logTextMessage (
|
QCA_logTextMessage (
|
||||||
QString ().sprintf (
|
QString::asprintf (
|
||||||
"pkcs11RSAContext::_ensureTokenAccess - return ret=%d",
|
"pkcs11RSAContext::_ensureTokenAccess - return ret=%d",
|
||||||
ret ? 1 : 0
|
ret ? 1 : 0
|
||||||
),
|
),
|
||||||
@ -1431,7 +1431,7 @@ pkcs11h_engine_crypto_t pkcs11QCACrypto::crypto = {
|
|||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
pkcs11KeyStoreListContext::pkcs11KeyStoreListContext (Provider *p) : KeyStoreListContext(p) {
|
pkcs11KeyStoreListContext::pkcs11KeyStoreListContext (Provider *p) : KeyStoreListContext(p) {
|
||||||
QCA_logTextMessage (
|
QCA_logTextMessage (
|
||||||
QString ().sprintf (
|
QString::asprintf (
|
||||||
"pkcs11KeyStoreListContext::pkcs11KeyStoreListContext - entry Provider=%p",
|
"pkcs11KeyStoreListContext::pkcs11KeyStoreListContext - entry Provider=%p",
|
||||||
(void *)p
|
(void *)p
|
||||||
),
|
),
|
||||||
@ -1489,7 +1489,7 @@ pkcs11KeyStoreListContext::start () {
|
|||||||
void
|
void
|
||||||
pkcs11KeyStoreListContext::setUpdatesEnabled (bool enabled) {
|
pkcs11KeyStoreListContext::setUpdatesEnabled (bool enabled) {
|
||||||
QCA_logTextMessage (
|
QCA_logTextMessage (
|
||||||
QString ().sprintf (
|
QString::asprintf (
|
||||||
"pkcs11KeyStoreListContext::setUpdatesEnabled - entry enabled=%d",
|
"pkcs11KeyStoreListContext::setUpdatesEnabled - entry enabled=%d",
|
||||||
enabled ? 1 : 0
|
enabled ? 1 : 0
|
||||||
),
|
),
|
||||||
@ -1507,7 +1507,7 @@ pkcs11KeyStoreListContext::setUpdatesEnabled (bool enabled) {
|
|||||||
}
|
}
|
||||||
catch (const pkcs11Exception &e) {
|
catch (const pkcs11Exception &e) {
|
||||||
s_keyStoreList->_emit_diagnosticText (
|
s_keyStoreList->_emit_diagnosticText (
|
||||||
QString ().sprintf (
|
QString::asprintf (
|
||||||
"PKCS#11: Start event failed %lu-'%s'.\n",
|
"PKCS#11: Start event failed %lu-'%s'.\n",
|
||||||
e.rv (),
|
e.rv (),
|
||||||
myPrintable (e.message ())
|
myPrintable (e.message ())
|
||||||
@ -1527,7 +1527,7 @@ pkcs11KeyStoreListContext::entry (
|
|||||||
const QString &entryId
|
const QString &entryId
|
||||||
) {
|
) {
|
||||||
QCA_logTextMessage (
|
QCA_logTextMessage (
|
||||||
QString ().sprintf (
|
QString::asprintf (
|
||||||
"pkcs11KeyStoreListContext::entry - entry/return id=%d entryId='%s'",
|
"pkcs11KeyStoreListContext::entry - entry/return id=%d entryId='%s'",
|
||||||
id,
|
id,
|
||||||
myPrintable (entryId)
|
myPrintable (entryId)
|
||||||
@ -1548,7 +1548,7 @@ pkcs11KeyStoreListContext::entryPassive (
|
|||||||
pkcs11h_certificate_id_t certificate_id = NULL;
|
pkcs11h_certificate_id_t certificate_id = NULL;
|
||||||
|
|
||||||
QCA_logTextMessage (
|
QCA_logTextMessage (
|
||||||
QString ().sprintf (
|
QString::asprintf (
|
||||||
"pkcs11KeyStoreListContext::entryPassive - entry serialized='%s'",
|
"pkcs11KeyStoreListContext::entryPassive - entry serialized='%s'",
|
||||||
myPrintable (serialized)
|
myPrintable (serialized)
|
||||||
),
|
),
|
||||||
@ -1575,7 +1575,7 @@ pkcs11KeyStoreListContext::entryPassive (
|
|||||||
}
|
}
|
||||||
catch (const pkcs11Exception &e) {
|
catch (const pkcs11Exception &e) {
|
||||||
s_keyStoreList->_emit_diagnosticText (
|
s_keyStoreList->_emit_diagnosticText (
|
||||||
QString ().sprintf (
|
QString::asprintf (
|
||||||
"PKCS#11: Add key store entry %lu-'%s'.\n",
|
"PKCS#11: Add key store entry %lu-'%s'.\n",
|
||||||
e.rv (),
|
e.rv (),
|
||||||
myPrintable (e.message ())
|
myPrintable (e.message ())
|
||||||
@ -1589,7 +1589,7 @@ pkcs11KeyStoreListContext::entryPassive (
|
|||||||
}
|
}
|
||||||
|
|
||||||
QCA_logTextMessage (
|
QCA_logTextMessage (
|
||||||
QString ().sprintf (
|
QString::asprintf (
|
||||||
"pkcs11KeyStoreListContext::entryPassive - return entry=%p",
|
"pkcs11KeyStoreListContext::entryPassive - return entry=%p",
|
||||||
(void *)entry
|
(void *)entry
|
||||||
),
|
),
|
||||||
@ -1605,7 +1605,7 @@ pkcs11KeyStoreListContext::type (int id) const {
|
|||||||
Q_UNUSED(id);
|
Q_UNUSED(id);
|
||||||
|
|
||||||
QCA_logTextMessage (
|
QCA_logTextMessage (
|
||||||
QString ().sprintf (
|
QString::asprintf (
|
||||||
"pkcs11KeyStoreListContext::type - entry/return id=%d",
|
"pkcs11KeyStoreListContext::type - entry/return id=%d",
|
||||||
id
|
id
|
||||||
),
|
),
|
||||||
@ -1620,7 +1620,7 @@ pkcs11KeyStoreListContext::storeId (int id) const {
|
|||||||
QString ret;
|
QString ret;
|
||||||
|
|
||||||
QCA_logTextMessage (
|
QCA_logTextMessage (
|
||||||
QString ().sprintf (
|
QString::asprintf (
|
||||||
"pkcs11KeyStoreListContext::storeId - entry id=%d",
|
"pkcs11KeyStoreListContext::storeId - entry id=%d",
|
||||||
id
|
id
|
||||||
),
|
),
|
||||||
@ -1632,7 +1632,7 @@ pkcs11KeyStoreListContext::storeId (int id) const {
|
|||||||
}
|
}
|
||||||
|
|
||||||
QCA_logTextMessage (
|
QCA_logTextMessage (
|
||||||
QString ().sprintf (
|
QString::asprintf (
|
||||||
"pkcs11KeyStoreListContext::storeId - return ret=%s",
|
"pkcs11KeyStoreListContext::storeId - return ret=%s",
|
||||||
myPrintable (ret)
|
myPrintable (ret)
|
||||||
),
|
),
|
||||||
@ -1647,7 +1647,7 @@ pkcs11KeyStoreListContext::name (int id) const {
|
|||||||
QString ret;
|
QString ret;
|
||||||
|
|
||||||
QCA_logTextMessage (
|
QCA_logTextMessage (
|
||||||
QString ().sprintf (
|
QString::asprintf (
|
||||||
"pkcs11KeyStoreListContext::name - entry id=%d",
|
"pkcs11KeyStoreListContext::name - entry id=%d",
|
||||||
id
|
id
|
||||||
),
|
),
|
||||||
@ -1659,7 +1659,7 @@ pkcs11KeyStoreListContext::name (int id) const {
|
|||||||
}
|
}
|
||||||
|
|
||||||
QCA_logTextMessage (
|
QCA_logTextMessage (
|
||||||
QString ().sprintf (
|
QString::asprintf (
|
||||||
"pkcs11KeyStoreListContext::name - return ret=%s",
|
"pkcs11KeyStoreListContext::name - return ret=%s",
|
||||||
myPrintable (ret)
|
myPrintable (ret)
|
||||||
),
|
),
|
||||||
@ -1675,7 +1675,7 @@ pkcs11KeyStoreListContext::entryTypes (int id) const {
|
|||||||
Q_UNUSED(id);
|
Q_UNUSED(id);
|
||||||
|
|
||||||
QCA_logTextMessage (
|
QCA_logTextMessage (
|
||||||
QString ().sprintf (
|
QString::asprintf (
|
||||||
"pkcs11KeyStoreListContext::entryTypes - entry/return id=%d",
|
"pkcs11KeyStoreListContext::entryTypes - entry/return id=%d",
|
||||||
id
|
id
|
||||||
),
|
),
|
||||||
@ -1748,7 +1748,7 @@ pkcs11KeyStoreListContext::keyStores () {
|
|||||||
}
|
}
|
||||||
catch (const pkcs11Exception &e) {
|
catch (const pkcs11Exception &e) {
|
||||||
s_keyStoreList->_emit_diagnosticText (
|
s_keyStoreList->_emit_diagnosticText (
|
||||||
QString ().sprintf (
|
QString::asprintf (
|
||||||
"PKCS#11: Cannot get key stores: %lu-'%s'.\n",
|
"PKCS#11: Cannot get key stores: %lu-'%s'.\n",
|
||||||
e.rv (),
|
e.rv (),
|
||||||
myPrintable (e.message ())
|
myPrintable (e.message ())
|
||||||
@ -1761,7 +1761,7 @@ pkcs11KeyStoreListContext::keyStores () {
|
|||||||
}
|
}
|
||||||
|
|
||||||
QCA_logTextMessage (
|
QCA_logTextMessage (
|
||||||
QString ().sprintf (
|
QString::asprintf (
|
||||||
"pkcs11KeyStoreListContext::keyStores - return out.size()=%d",
|
"pkcs11KeyStoreListContext::keyStores - return out.size()=%d",
|
||||||
out.size ()
|
out.size ()
|
||||||
),
|
),
|
||||||
@ -1777,7 +1777,7 @@ pkcs11KeyStoreListContext::entryList (int id) {
|
|||||||
QList<KeyStoreEntryContext*> out;
|
QList<KeyStoreEntryContext*> out;
|
||||||
|
|
||||||
QCA_logTextMessage (
|
QCA_logTextMessage (
|
||||||
QString ().sprintf (
|
QString::asprintf (
|
||||||
"pkcs11KeyStoreListContext::entryList - entry id=%d",
|
"pkcs11KeyStoreListContext::entryList - entry id=%d",
|
||||||
id
|
id
|
||||||
),
|
),
|
||||||
@ -1880,7 +1880,7 @@ pkcs11KeyStoreListContext::entryList (int id) {
|
|||||||
}
|
}
|
||||||
catch (const pkcs11Exception &e) {
|
catch (const pkcs11Exception &e) {
|
||||||
s_keyStoreList->_emit_diagnosticText (
|
s_keyStoreList->_emit_diagnosticText (
|
||||||
QString ().sprintf (
|
QString::asprintf (
|
||||||
"PKCS#11: Add key store entry %lu-'%s'.\n",
|
"PKCS#11: Add key store entry %lu-'%s'.\n",
|
||||||
e.rv (),
|
e.rv (),
|
||||||
myPrintable (e.message ())
|
myPrintable (e.message ())
|
||||||
@ -1909,7 +1909,7 @@ pkcs11KeyStoreListContext::entryList (int id) {
|
|||||||
}
|
}
|
||||||
catch (const pkcs11Exception &e) {
|
catch (const pkcs11Exception &e) {
|
||||||
s_keyStoreList->_emit_diagnosticText (
|
s_keyStoreList->_emit_diagnosticText (
|
||||||
QString ().sprintf (
|
QString::asprintf (
|
||||||
"PKCS#11: Add key store entry %lu-'%s'.\n",
|
"PKCS#11: Add key store entry %lu-'%s'.\n",
|
||||||
e.rv (),
|
e.rv (),
|
||||||
myPrintable (e.message ())
|
myPrintable (e.message ())
|
||||||
@ -1921,7 +1921,7 @@ pkcs11KeyStoreListContext::entryList (int id) {
|
|||||||
}
|
}
|
||||||
catch (const pkcs11Exception &e) {
|
catch (const pkcs11Exception &e) {
|
||||||
s_keyStoreList->_emit_diagnosticText (
|
s_keyStoreList->_emit_diagnosticText (
|
||||||
QString ().sprintf (
|
QString::asprintf (
|
||||||
"PKCS#11: Enumerating store failed %lu-'%s'.\n",
|
"PKCS#11: Enumerating store failed %lu-'%s'.\n",
|
||||||
e.rv (),
|
e.rv (),
|
||||||
myPrintable (e.message ())
|
myPrintable (e.message ())
|
||||||
@ -1934,7 +1934,7 @@ pkcs11KeyStoreListContext::entryList (int id) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
QCA_logTextMessage (
|
QCA_logTextMessage (
|
||||||
QString ().sprintf (
|
QString::asprintf (
|
||||||
"pkcs11KeyStoreListContext::entryList - return out.size()=%d",
|
"pkcs11KeyStoreListContext::entryList - return out.size()=%d",
|
||||||
out.size ()
|
out.size ()
|
||||||
),
|
),
|
||||||
@ -1955,7 +1955,7 @@ pkcs11KeyStoreListContext::_tokenPrompt (
|
|||||||
bool ret = false;
|
bool ret = false;
|
||||||
|
|
||||||
QCA_logTextMessage (
|
QCA_logTextMessage (
|
||||||
QString ().sprintf (
|
QString::asprintf (
|
||||||
"pkcs11KeyStoreListContext::_tokenPrompt - entry user_data=%p, token_id=%p",
|
"pkcs11KeyStoreListContext::_tokenPrompt - entry user_data=%p, token_id=%p",
|
||||||
user_data,
|
user_data,
|
||||||
(void *)token_id
|
(void *)token_id
|
||||||
@ -1988,7 +1988,7 @@ pkcs11KeyStoreListContext::_tokenPrompt (
|
|||||||
}
|
}
|
||||||
|
|
||||||
QCA_logTextMessage (
|
QCA_logTextMessage (
|
||||||
QString ().sprintf (
|
QString::asprintf (
|
||||||
"pkcs11KeyStoreListContext::_tokenPrompt - return ret=%d",
|
"pkcs11KeyStoreListContext::_tokenPrompt - return ret=%d",
|
||||||
ret ? 1 : 0
|
ret ? 1 : 0
|
||||||
),
|
),
|
||||||
@ -2010,7 +2010,7 @@ pkcs11KeyStoreListContext::_pinPrompt (
|
|||||||
bool ret = false;
|
bool ret = false;
|
||||||
|
|
||||||
QCA_logTextMessage (
|
QCA_logTextMessage (
|
||||||
QString ().sprintf (
|
QString::asprintf (
|
||||||
"pkcs11KeyStoreListContext::_pinPrompt - entry user_data=%p, token_id=%p",
|
"pkcs11KeyStoreListContext::_pinPrompt - entry user_data=%p, token_id=%p",
|
||||||
user_data,
|
user_data,
|
||||||
(void *)token_id
|
(void *)token_id
|
||||||
@ -2047,7 +2047,7 @@ pkcs11KeyStoreListContext::_pinPrompt (
|
|||||||
}
|
}
|
||||||
|
|
||||||
QCA_logTextMessage (
|
QCA_logTextMessage (
|
||||||
QString ().sprintf (
|
QString::asprintf (
|
||||||
"pkcs11KeyStoreListContext::_pinPrompt - return ret=%d",
|
"pkcs11KeyStoreListContext::_pinPrompt - return ret=%d",
|
||||||
ret ? 1 : 0
|
ret ? 1 : 0
|
||||||
),
|
),
|
||||||
@ -2062,7 +2062,7 @@ pkcs11KeyStoreListContext::_emit_diagnosticText (
|
|||||||
const QString &t
|
const QString &t
|
||||||
) {
|
) {
|
||||||
QCA_logTextMessage (
|
QCA_logTextMessage (
|
||||||
QString ().sprintf (
|
QString::asprintf (
|
||||||
"pkcs11KeyStoreListContext::_emit_diagnosticText - entry t='%s'",
|
"pkcs11KeyStoreListContext::_emit_diagnosticText - entry t='%s'",
|
||||||
myPrintable (t)
|
myPrintable (t)
|
||||||
),
|
),
|
||||||
@ -2114,7 +2114,7 @@ pkcs11KeyStoreListContext::_registerTokenId (
|
|||||||
const pkcs11h_token_id_t token_id
|
const pkcs11h_token_id_t token_id
|
||||||
) {
|
) {
|
||||||
QCA_logTextMessage (
|
QCA_logTextMessage (
|
||||||
QString ().sprintf (
|
QString::asprintf (
|
||||||
"pkcs11KeyStoreListContext::_registerTokenId - entry token_id=%p",
|
"pkcs11KeyStoreListContext::_registerTokenId - entry token_id=%p",
|
||||||
(void *)token_id
|
(void *)token_id
|
||||||
),
|
),
|
||||||
@ -2153,7 +2153,7 @@ pkcs11KeyStoreListContext::_registerTokenId (
|
|||||||
}
|
}
|
||||||
|
|
||||||
QCA_logTextMessage (
|
QCA_logTextMessage (
|
||||||
QString ().sprintf (
|
QString::asprintf (
|
||||||
"pkcs11KeyStoreListContext::_registerTokenId - return entry=%p",
|
"pkcs11KeyStoreListContext::_registerTokenId - return entry=%p",
|
||||||
(void *)token_id
|
(void *)token_id
|
||||||
),
|
),
|
||||||
@ -2195,7 +2195,7 @@ pkcs11KeyStoreListContext::_keyStoreEntryByCertificateId (
|
|||||||
pkcs11KeyStoreEntryContext *entry = NULL;
|
pkcs11KeyStoreEntryContext *entry = NULL;
|
||||||
|
|
||||||
QCA_logTextMessage (
|
QCA_logTextMessage (
|
||||||
QString ().sprintf (
|
QString::asprintf (
|
||||||
"pkcs11KeyStoreListContext::_keyStoreEntryByCertificateId - entry certificate_id=%p, has_private=%d, chain.size()=%d",
|
"pkcs11KeyStoreListContext::_keyStoreEntryByCertificateId - entry certificate_id=%p, has_private=%d, chain.size()=%d",
|
||||||
(void *)certificate_id,
|
(void *)certificate_id,
|
||||||
has_private ? 1 : 0,
|
has_private ? 1 : 0,
|
||||||
@ -2259,7 +2259,7 @@ pkcs11KeyStoreListContext::_keyStoreEntryByCertificateId (
|
|||||||
}
|
}
|
||||||
|
|
||||||
QCA_logTextMessage (
|
QCA_logTextMessage (
|
||||||
QString ().sprintf (
|
QString::asprintf (
|
||||||
"pkcs11KeyStoreListContext::_keyStoreEntryByCertificateId - return entry=%p",
|
"pkcs11KeyStoreListContext::_keyStoreEntryByCertificateId - return entry=%p",
|
||||||
(void *)entry
|
(void *)entry
|
||||||
),
|
),
|
||||||
@ -2277,7 +2277,7 @@ pkcs11KeyStoreListContext::_tokenId2storeId (
|
|||||||
size_t len;
|
size_t len;
|
||||||
|
|
||||||
QCA_logTextMessage (
|
QCA_logTextMessage (
|
||||||
QString ().sprintf (
|
QString::asprintf (
|
||||||
"pkcs11KeyStoreListContext::_tokenId2storeId - entry token_id=%p",
|
"pkcs11KeyStoreListContext::_tokenId2storeId - entry token_id=%p",
|
||||||
(void *)token_id
|
(void *)token_id
|
||||||
),
|
),
|
||||||
@ -2312,7 +2312,7 @@ pkcs11KeyStoreListContext::_tokenId2storeId (
|
|||||||
storeId = "qca-pkcs11/" + _escapeString (QString::fromUtf8 (buf));
|
storeId = "qca-pkcs11/" + _escapeString (QString::fromUtf8 (buf));
|
||||||
|
|
||||||
QCA_logTextMessage (
|
QCA_logTextMessage (
|
||||||
QString ().sprintf (
|
QString::asprintf (
|
||||||
"pkcs11KeyStoreListContext::_tokenId2storeId - return storeId='%s'",
|
"pkcs11KeyStoreListContext::_tokenId2storeId - return storeId='%s'",
|
||||||
myPrintable (storeId)
|
myPrintable (storeId)
|
||||||
),
|
),
|
||||||
@ -2332,7 +2332,7 @@ pkcs11KeyStoreListContext::_serializeCertificate (
|
|||||||
size_t len;
|
size_t len;
|
||||||
|
|
||||||
QCA_logTextMessage (
|
QCA_logTextMessage (
|
||||||
QString ().sprintf (
|
QString::asprintf (
|
||||||
"pkcs11KeyStoreListContext::_serializeCertificate - entry certificate_id=%p, xx, has_private=%d",
|
"pkcs11KeyStoreListContext::_serializeCertificate - entry certificate_id=%p, xx, has_private=%d",
|
||||||
(void *)certificate_id,
|
(void *)certificate_id,
|
||||||
has_private ? 1 : 0
|
has_private ? 1 : 0
|
||||||
@ -2365,7 +2365,7 @@ pkcs11KeyStoreListContext::_serializeCertificate (
|
|||||||
|
|
||||||
buf.resize ((int)len);
|
buf.resize ((int)len);
|
||||||
|
|
||||||
serialized = QString ().sprintf (
|
serialized = QString::asprintf (
|
||||||
"qca-pkcs11/0/%s/%d/",
|
"qca-pkcs11/0/%s/%d/",
|
||||||
myPrintable(_escapeString (QString::fromUtf8 (buf))),
|
myPrintable(_escapeString (QString::fromUtf8 (buf))),
|
||||||
has_private ? 1 : 0
|
has_private ? 1 : 0
|
||||||
@ -2379,7 +2379,7 @@ pkcs11KeyStoreListContext::_serializeCertificate (
|
|||||||
serialized.append (list.join ("/"));
|
serialized.append (list.join ("/"));
|
||||||
|
|
||||||
QCA_logTextMessage (
|
QCA_logTextMessage (
|
||||||
QString ().sprintf (
|
QString::asprintf (
|
||||||
"pkcs11KeyStoreListContext::_serializeCertificate - return serialized='%s'",
|
"pkcs11KeyStoreListContext::_serializeCertificate - return serialized='%s'",
|
||||||
myPrintable (serialized)
|
myPrintable (serialized)
|
||||||
),
|
),
|
||||||
@ -2400,7 +2400,7 @@ pkcs11KeyStoreListContext::_deserializeCertificate (
|
|||||||
chain.clear ();
|
chain.clear ();
|
||||||
|
|
||||||
QCA_logTextMessage (
|
QCA_logTextMessage (
|
||||||
QString ().sprintf (
|
QString::asprintf (
|
||||||
"pkcs11KeyStoreListContext::_deserializeCertificate - entry from='%s', p_certificate_id=%p, p_has_private=%p",
|
"pkcs11KeyStoreListContext::_deserializeCertificate - entry from='%s', p_certificate_id=%p, p_has_private=%p",
|
||||||
myPrintable (from),
|
myPrintable (from),
|
||||||
(void *)p_certificate_id,
|
(void *)p_certificate_id,
|
||||||
@ -2481,7 +2481,7 @@ pkcs11KeyStoreListContext::_deserializeCertificate (
|
|||||||
}
|
}
|
||||||
|
|
||||||
QCA_logTextMessage (
|
QCA_logTextMessage (
|
||||||
QString ().sprintf (
|
QString::asprintf (
|
||||||
"pkcs11KeyStoreListContext::_deserializeCertificate - return *p_certificate_id=%p, chain.size()=%d",
|
"pkcs11KeyStoreListContext::_deserializeCertificate - return *p_certificate_id=%p, chain.size()=%d",
|
||||||
(void *)*p_certificate_id,
|
(void *)*p_certificate_id,
|
||||||
chain.size ()
|
chain.size ()
|
||||||
@ -2498,7 +2498,7 @@ pkcs11KeyStoreListContext::_escapeString (
|
|||||||
|
|
||||||
foreach (QChar c, from) {
|
foreach (QChar c, from) {
|
||||||
if (c == '/' || c == '\\') {
|
if (c == '/' || c == '\\') {
|
||||||
to += QString ().sprintf ("\\x%04x", c.unicode ());
|
to += QString::asprintf ("\\x%04x", c.unicode ());
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
to += c;
|
to += c;
|
||||||
@ -2624,7 +2624,7 @@ void pkcs11Provider::init () {
|
|||||||
catch (const pkcs11Exception &e) {
|
catch (const pkcs11Exception &e) {
|
||||||
QCA_logTextMessage (e.message (), Logger::Error);
|
QCA_logTextMessage (e.message (), Logger::Error);
|
||||||
appendPluginDiagnosticText (
|
appendPluginDiagnosticText (
|
||||||
QString().sprintf (
|
QString::asprintf (
|
||||||
"An error %s during initialization of qca-pkcs11 plugin\n",
|
"An error %s during initialization of qca-pkcs11 plugin\n",
|
||||||
myPrintable (e.message ())
|
myPrintable (e.message ())
|
||||||
)
|
)
|
||||||
@ -2688,7 +2688,7 @@ pkcs11Provider::createContext (const QString &type) {
|
|||||||
Provider::Context *context = NULL;
|
Provider::Context *context = NULL;
|
||||||
|
|
||||||
QCA_logTextMessage (
|
QCA_logTextMessage (
|
||||||
QString ().sprintf (
|
QString::asprintf (
|
||||||
"pkcs11Provider::createContext - entry type='%s'",
|
"pkcs11Provider::createContext - entry type='%s'",
|
||||||
myPrintable (type)
|
myPrintable (type)
|
||||||
),
|
),
|
||||||
@ -2705,7 +2705,7 @@ pkcs11Provider::createContext (const QString &type) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
QCA_logTextMessage (
|
QCA_logTextMessage (
|
||||||
QString ().sprintf (
|
QString::asprintf (
|
||||||
"pkcs11Provider::createContext - return context=%p",
|
"pkcs11Provider::createContext - return context=%p",
|
||||||
(void *)context
|
(void *)context
|
||||||
),
|
),
|
||||||
@ -2772,14 +2772,14 @@ pkcs11Provider::defaultConfig () const {
|
|||||||
mytemplate["pin_cache"] = PKCS11H_PIN_CACHE_INFINITE;
|
mytemplate["pin_cache"] = PKCS11H_PIN_CACHE_INFINITE;
|
||||||
mytemplate["log_level"] = 0;
|
mytemplate["log_level"] = 0;
|
||||||
for (int i=0;i<_CONFIG_MAX_PROVIDERS;i++) {
|
for (int i=0;i<_CONFIG_MAX_PROVIDERS;i++) {
|
||||||
mytemplate[QString ().sprintf ("provider_%02d_enabled", i)] = false;
|
mytemplate[QString::asprintf ("provider_%02d_enabled", i)] = false;
|
||||||
mytemplate[QString ().sprintf ("provider_%02d_name", i)] = "";
|
mytemplate[QString::asprintf ("provider_%02d_name", i)] = "";
|
||||||
mytemplate[QString ().sprintf ("provider_%02d_library", i)] = "";
|
mytemplate[QString::asprintf ("provider_%02d_library", i)] = "";
|
||||||
mytemplate[QString ().sprintf ("provider_%02d_allow_protected_authentication", i)] = true;
|
mytemplate[QString::asprintf ("provider_%02d_allow_protected_authentication", i)] = true;
|
||||||
mytemplate[QString ().sprintf ("provider_%02d_cert_private", i)] = false;
|
mytemplate[QString::asprintf ("provider_%02d_cert_private", i)] = false;
|
||||||
mytemplate[QString ().sprintf ("provider_%02d_private_mask", i)] = PKCS11H_PRIVATEMODE_MASK_AUTO;
|
mytemplate[QString::asprintf ("provider_%02d_private_mask", i)] = PKCS11H_PRIVATEMODE_MASK_AUTO;
|
||||||
mytemplate[QString ().sprintf ("provider_%02d_slotevent_method", i)] = "auto";
|
mytemplate[QString::asprintf ("provider_%02d_slotevent_method", i)] = "auto";
|
||||||
mytemplate[QString ().sprintf ("provider_%02d_slotevent_timeout", i)] = 0;
|
mytemplate[QString::asprintf ("provider_%02d_slotevent_timeout", i)] = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
return mytemplate;
|
return mytemplate;
|
||||||
@ -2819,10 +2819,10 @@ pkcs11Provider::configChanged (const QVariantMap &config) {
|
|||||||
* Add new providers
|
* Add new providers
|
||||||
*/
|
*/
|
||||||
for (int i=0;i<_CONFIG_MAX_PROVIDERS;i++) {
|
for (int i=0;i<_CONFIG_MAX_PROVIDERS;i++) {
|
||||||
bool enabled = config[QString ().sprintf ("provider_%02d_enabled", i)].toBool ();
|
bool enabled = config[QString::asprintf ("provider_%02d_enabled", i)].toBool ();
|
||||||
QString provider = config[QString ().sprintf ("provider_%02d_library", i)].toString ();
|
QString provider = config[QString::asprintf ("provider_%02d_library", i)].toString ();
|
||||||
QString name = config[QString ().sprintf ("provider_%02d_name", i)].toString ();
|
QString name = config[QString::asprintf ("provider_%02d_name", i)].toString ();
|
||||||
QString qslotevent = config[QString ().sprintf ("provider_%02d_slotevent_method", i)].toString ();
|
QString qslotevent = config[QString::asprintf ("provider_%02d_slotevent_method", i)].toString ();
|
||||||
unsigned slotevent = PKCS11H_SLOTEVENT_METHOD_AUTO;
|
unsigned slotevent = PKCS11H_SLOTEVENT_METHOD_AUTO;
|
||||||
if (qslotevent == "trigger") {
|
if (qslotevent == "trigger") {
|
||||||
slotevent = PKCS11H_SLOTEVENT_METHOD_TRIGGER;
|
slotevent = PKCS11H_SLOTEVENT_METHOD_TRIGGER;
|
||||||
@ -2838,7 +2838,7 @@ pkcs11Provider::configChanged (const QVariantMap &config) {
|
|||||||
if (enabled && !provider.isEmpty()) {
|
if (enabled && !provider.isEmpty()) {
|
||||||
|
|
||||||
QCA_logTextMessage (
|
QCA_logTextMessage (
|
||||||
QString ().sprintf (
|
QString::asprintf (
|
||||||
"Loading PKCS#11 provider '%s' (%s)",
|
"Loading PKCS#11 provider '%s' (%s)",
|
||||||
myPrintable (name),
|
myPrintable (name),
|
||||||
myPrintable (provider)
|
myPrintable (provider)
|
||||||
@ -2851,22 +2851,22 @@ pkcs11Provider::configChanged (const QVariantMap &config) {
|
|||||||
myPrintable (name),
|
myPrintable (name),
|
||||||
myPrintable (provider),
|
myPrintable (provider),
|
||||||
config[
|
config[
|
||||||
QString ().sprintf ("provider_%02d_allow_protected_authentication", i)
|
QString::asprintf ("provider_%02d_allow_protected_authentication", i)
|
||||||
].toBool () != false ? TRUE : FALSE, //krazy:exclude=captruefalse
|
].toBool () != false ? TRUE : FALSE, //krazy:exclude=captruefalse
|
||||||
(unsigned)config[
|
(unsigned)config[
|
||||||
QString ().sprintf ("provider_%02d_private_mask", i)
|
QString::asprintf ("provider_%02d_private_mask", i)
|
||||||
].toInt (),
|
].toInt (),
|
||||||
slotevent,
|
slotevent,
|
||||||
(unsigned)config[
|
(unsigned)config[
|
||||||
QString ().sprintf ("provider_%02d_slotevent_timeout", i)
|
QString::asprintf ("provider_%02d_slotevent_timeout", i)
|
||||||
].toInt (),
|
].toInt (),
|
||||||
config[
|
config[
|
||||||
QString ().sprintf ("provider_%02d_cert_private", i)
|
QString::asprintf ("provider_%02d_cert_private", i)
|
||||||
].toBool () != false ? TRUE : FALSE //krazy:exclude=captruefalse
|
].toBool () != false ? TRUE : FALSE //krazy:exclude=captruefalse
|
||||||
)) != CKR_OK
|
)) != CKR_OK
|
||||||
) {
|
) {
|
||||||
QCA_logTextMessage (
|
QCA_logTextMessage (
|
||||||
QString ().sprintf (
|
QString::asprintf (
|
||||||
"PKCS#11: Cannot log provider '%s'-'%s' %lu-'%s'.\n",
|
"PKCS#11: Cannot log provider '%s'-'%s' %lu-'%s'.\n",
|
||||||
myPrintable (name),
|
myPrintable (name),
|
||||||
myPrintable (provider),
|
myPrintable (provider),
|
||||||
@ -2876,7 +2876,7 @@ pkcs11Provider::configChanged (const QVariantMap &config) {
|
|||||||
Logger::Error
|
Logger::Error
|
||||||
);
|
);
|
||||||
appendPluginDiagnosticText (
|
appendPluginDiagnosticText (
|
||||||
QString ().sprintf (
|
QString::asprintf (
|
||||||
"Cannot load PKCS#11 provider '%s'\n",
|
"Cannot load PKCS#11 provider '%s'\n",
|
||||||
myPrintable (name)
|
myPrintable (name)
|
||||||
)
|
)
|
||||||
|
@ -462,7 +462,7 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
QCA_logTextMessage (
|
QCA_logTextMessage (
|
||||||
QString ().sprintf (
|
QString::asprintf (
|
||||||
"softstorePKeyBase::_ensureAccess - return ret=%d",
|
"softstorePKeyBase::_ensureAccess - return ret=%d",
|
||||||
ret ? 1 : 0
|
ret ? 1 : 0
|
||||||
),
|
),
|
||||||
@ -686,7 +686,7 @@ public:
|
|||||||
|
|
||||||
QString
|
QString
|
||||||
storeId () const override {
|
storeId () const override {
|
||||||
return QString ().sprintf ("%s/%s", "qca-softstore", myPrintable (_entry.name));
|
return QString::asprintf ("%s/%s", "qca-softstore", myPrintable (_entry.name));
|
||||||
}
|
}
|
||||||
|
|
||||||
QString
|
QString
|
||||||
@ -716,7 +716,7 @@ private:
|
|||||||
public:
|
public:
|
||||||
softstoreKeyStoreListContext (Provider *p) : KeyStoreListContext (p) {
|
softstoreKeyStoreListContext (Provider *p) : KeyStoreListContext (p) {
|
||||||
QCA_logTextMessage (
|
QCA_logTextMessage (
|
||||||
QString ().sprintf (
|
QString::asprintf (
|
||||||
"softstoreKeyStoreListContext::softstoreKeyStoreListContext - entry Provider=%p",
|
"softstoreKeyStoreListContext::softstoreKeyStoreListContext - entry Provider=%p",
|
||||||
(void *)p
|
(void *)p
|
||||||
),
|
),
|
||||||
@ -773,7 +773,7 @@ public:
|
|||||||
void
|
void
|
||||||
setUpdatesEnabled (bool enabled) override {
|
setUpdatesEnabled (bool enabled) override {
|
||||||
QCA_logTextMessage (
|
QCA_logTextMessage (
|
||||||
QString ().sprintf (
|
QString::asprintf (
|
||||||
"softstoreKeyStoreListContext::setUpdatesEnabled - entry/return enabled=%d",
|
"softstoreKeyStoreListContext::setUpdatesEnabled - entry/return enabled=%d",
|
||||||
enabled ? 1 : 0
|
enabled ? 1 : 0
|
||||||
),
|
),
|
||||||
@ -787,7 +787,7 @@ public:
|
|||||||
const QString &entryId
|
const QString &entryId
|
||||||
) override {
|
) override {
|
||||||
QCA_logTextMessage (
|
QCA_logTextMessage (
|
||||||
QString ().sprintf (
|
QString::asprintf (
|
||||||
"softstoreKeyStoreListContext::entry - entry/return id=%d entryId='%s'",
|
"softstoreKeyStoreListContext::entry - entry/return id=%d entryId='%s'",
|
||||||
id,
|
id,
|
||||||
myPrintable (entryId)
|
myPrintable (entryId)
|
||||||
@ -807,7 +807,7 @@ public:
|
|||||||
KeyStoreEntryContext *entry = NULL;
|
KeyStoreEntryContext *entry = NULL;
|
||||||
|
|
||||||
QCA_logTextMessage (
|
QCA_logTextMessage (
|
||||||
QString ().sprintf (
|
QString::asprintf (
|
||||||
"softstoreKeyStoreListContext::entryPassive - entry serialized='%s'",
|
"softstoreKeyStoreListContext::entryPassive - entry serialized='%s'",
|
||||||
myPrintable (serialized)
|
myPrintable (serialized)
|
||||||
),
|
),
|
||||||
@ -823,7 +823,7 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
QCA_logTextMessage (
|
QCA_logTextMessage (
|
||||||
QString ().sprintf (
|
QString::asprintf (
|
||||||
"softstoreKeyStoreListContext::entryPassive - return entry=%p",
|
"softstoreKeyStoreListContext::entryPassive - return entry=%p",
|
||||||
(void *)entry
|
(void *)entry
|
||||||
),
|
),
|
||||||
@ -838,7 +838,7 @@ public:
|
|||||||
Q_UNUSED(id);
|
Q_UNUSED(id);
|
||||||
|
|
||||||
QCA_logTextMessage (
|
QCA_logTextMessage (
|
||||||
QString ().sprintf (
|
QString::asprintf (
|
||||||
"softstoreKeyStoreListContext::type - entry/return id=%d",
|
"softstoreKeyStoreListContext::type - entry/return id=%d",
|
||||||
id
|
id
|
||||||
),
|
),
|
||||||
@ -853,7 +853,7 @@ public:
|
|||||||
QString ret;
|
QString ret;
|
||||||
|
|
||||||
QCA_logTextMessage (
|
QCA_logTextMessage (
|
||||||
QString ().sprintf (
|
QString::asprintf (
|
||||||
"softstoreKeyStoreListContext::storeId - entry id=%d",
|
"softstoreKeyStoreListContext::storeId - entry id=%d",
|
||||||
id
|
id
|
||||||
),
|
),
|
||||||
@ -863,7 +863,7 @@ public:
|
|||||||
ret = "qca-softstore";
|
ret = "qca-softstore";
|
||||||
|
|
||||||
QCA_logTextMessage (
|
QCA_logTextMessage (
|
||||||
QString ().sprintf (
|
QString::asprintf (
|
||||||
"softstoreKeyStoreListContext::storeId - return ret=%s",
|
"softstoreKeyStoreListContext::storeId - return ret=%s",
|
||||||
myPrintable (ret)
|
myPrintable (ret)
|
||||||
),
|
),
|
||||||
@ -878,7 +878,7 @@ public:
|
|||||||
QString ret;
|
QString ret;
|
||||||
|
|
||||||
QCA_logTextMessage (
|
QCA_logTextMessage (
|
||||||
QString ().sprintf (
|
QString::asprintf (
|
||||||
"softstoreKeyStoreListContext::name - entry id=%d",
|
"softstoreKeyStoreListContext::name - entry id=%d",
|
||||||
id
|
id
|
||||||
),
|
),
|
||||||
@ -888,7 +888,7 @@ public:
|
|||||||
ret = "User Software Store";
|
ret = "User Software Store";
|
||||||
|
|
||||||
QCA_logTextMessage (
|
QCA_logTextMessage (
|
||||||
QString ().sprintf (
|
QString::asprintf (
|
||||||
"softstoreKeyStoreListContext::name - return ret=%s",
|
"softstoreKeyStoreListContext::name - return ret=%s",
|
||||||
myPrintable (ret)
|
myPrintable (ret)
|
||||||
),
|
),
|
||||||
@ -903,7 +903,7 @@ public:
|
|||||||
Q_UNUSED(id);
|
Q_UNUSED(id);
|
||||||
|
|
||||||
QCA_logTextMessage (
|
QCA_logTextMessage (
|
||||||
QString ().sprintf (
|
QString::asprintf (
|
||||||
"softstoreKeyStoreListContext::entryTypes - entry/return id=%d",
|
"softstoreKeyStoreListContext::entryTypes - entry/return id=%d",
|
||||||
id
|
id
|
||||||
),
|
),
|
||||||
@ -928,7 +928,7 @@ public:
|
|||||||
list += _last_id;
|
list += _last_id;
|
||||||
|
|
||||||
QCA_logTextMessage (
|
QCA_logTextMessage (
|
||||||
QString ().sprintf (
|
QString::asprintf (
|
||||||
"softstoreKeyStoreListContext::keyStores - return out.size()=%d",
|
"softstoreKeyStoreListContext::keyStores - return out.size()=%d",
|
||||||
list.size ()
|
list.size ()
|
||||||
),
|
),
|
||||||
@ -943,7 +943,7 @@ public:
|
|||||||
QList<KeyStoreEntryContext*> list;
|
QList<KeyStoreEntryContext*> list;
|
||||||
|
|
||||||
QCA_logTextMessage (
|
QCA_logTextMessage (
|
||||||
QString ().sprintf (
|
QString::asprintf (
|
||||||
"softstoreKeyStoreListContext::entryList - entry id=%d",
|
"softstoreKeyStoreListContext::entryList - entry id=%d",
|
||||||
id
|
id
|
||||||
),
|
),
|
||||||
@ -955,7 +955,7 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
QCA_logTextMessage (
|
QCA_logTextMessage (
|
||||||
QString ().sprintf (
|
QString::asprintf (
|
||||||
"softstoreKeyStoreListContext::entryList - return out.size()=%d",
|
"softstoreKeyStoreListContext::entryList - return out.size()=%d",
|
||||||
list.size ()
|
list.size ()
|
||||||
),
|
),
|
||||||
@ -970,7 +970,7 @@ public:
|
|||||||
const QString &t
|
const QString &t
|
||||||
) {
|
) {
|
||||||
QCA_logTextMessage (
|
QCA_logTextMessage (
|
||||||
QString ().sprintf (
|
QString::asprintf (
|
||||||
"softstoreKeyStoreListContext::_emit_diagnosticText - entry t='%s'",
|
"softstoreKeyStoreListContext::_emit_diagnosticText - entry t='%s'",
|
||||||
myPrintable (t)
|
myPrintable (t)
|
||||||
),
|
),
|
||||||
@ -1039,23 +1039,23 @@ public:
|
|||||||
_entries.clear ();
|
_entries.clear ();
|
||||||
|
|
||||||
for (int i=0;i<maxEntries;i++) {
|
for (int i=0;i<maxEntries;i++) {
|
||||||
if (config[QString ().sprintf ("entry_%02d_enabled", i)].toBool ()) {
|
if (config[QString::asprintf ("entry_%02d_enabled", i)].toBool ()) {
|
||||||
ConvertResult cresult;
|
ConvertResult cresult;
|
||||||
SoftStoreEntry entry;
|
SoftStoreEntry entry;
|
||||||
PublicType publicType = publicTypeInvalid;
|
PublicType publicType = publicTypeInvalid;
|
||||||
|
|
||||||
entry.name = config[QString ().sprintf ("entry_%02d_name", i)].toString ();
|
entry.name = config[QString::asprintf ("entry_%02d_name", i)].toString ();
|
||||||
QString stringReferenceType = config[QString ().sprintf ("entry_%02d_private_type", i)].toString ();
|
QString stringReferenceType = config[QString::asprintf ("entry_%02d_private_type", i)].toString ();
|
||||||
QString stringPublicType = config[QString ().sprintf ("entry_%02d_public_type", i)].toString ();
|
QString stringPublicType = config[QString::asprintf ("entry_%02d_public_type", i)].toString ();
|
||||||
entry.noPassphrase = config[QString ().sprintf ("entry_%02d_no_passphrase", i)].toBool ();
|
entry.noPassphrase = config[QString::asprintf ("entry_%02d_no_passphrase", i)].toBool ();
|
||||||
entry.unlockTimeout = config[QString ().sprintf ("entry_%02d_unlock_timeout", i)].toInt ();
|
entry.unlockTimeout = config[QString::asprintf ("entry_%02d_unlock_timeout", i)].toInt ();
|
||||||
|
|
||||||
if (publicTypeMap.contains (stringPublicType)) {
|
if (publicTypeMap.contains (stringPublicType)) {
|
||||||
publicType = publicTypeMap[stringPublicType];
|
publicType = publicTypeMap[stringPublicType];
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
_emit_diagnosticText (
|
_emit_diagnosticText (
|
||||||
QString ().sprintf (
|
QString::asprintf (
|
||||||
"Software Store: Bad public key type of '%s' entry.\n",
|
"Software Store: Bad public key type of '%s' entry.\n",
|
||||||
myPrintable (entry.name)
|
myPrintable (entry.name)
|
||||||
)
|
)
|
||||||
@ -1068,7 +1068,7 @@ public:
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
_emit_diagnosticText (
|
_emit_diagnosticText (
|
||||||
QString ().sprintf (
|
QString::asprintf (
|
||||||
"Software Store: Bad private key type of '%s' entry.\n",
|
"Software Store: Bad private key type of '%s' entry.\n",
|
||||||
myPrintable (entry.name)
|
myPrintable (entry.name)
|
||||||
)
|
)
|
||||||
@ -1076,14 +1076,14 @@ public:
|
|||||||
goto cleanup1;
|
goto cleanup1;
|
||||||
}
|
}
|
||||||
|
|
||||||
entry.keyReference = config[QString ().sprintf ("entry_%02d_private", i)].toString ();
|
entry.keyReference = config[QString::asprintf ("entry_%02d_private", i)].toString ();
|
||||||
|
|
||||||
switch (publicType) {
|
switch (publicType) {
|
||||||
case publicTypeInvalid:
|
case publicTypeInvalid:
|
||||||
goto cleanup1;
|
goto cleanup1;
|
||||||
break;
|
break;
|
||||||
case publicTypeX509Chain:
|
case publicTypeX509Chain:
|
||||||
QStringList base64certs = config[QString ().sprintf ("entry_%02d_public", i)].toString ().split ("!");
|
QStringList base64certs = config[QString::asprintf ("entry_%02d_public", i)].toString ().split ("!");
|
||||||
|
|
||||||
foreach (const QString &s, base64certs) {
|
foreach (const QString &s, base64certs) {
|
||||||
entry.chain += Certificate::fromDER (
|
entry.chain += Certificate::fromDER (
|
||||||
@ -1094,7 +1094,7 @@ public:
|
|||||||
|
|
||||||
if (cresult != ConvertGood) {
|
if (cresult != ConvertGood) {
|
||||||
_emit_diagnosticText (
|
_emit_diagnosticText (
|
||||||
QString ().sprintf (
|
QString::asprintf (
|
||||||
"Software Store: Cannot load certificate of '%s' entry.\n",
|
"Software Store: Cannot load certificate of '%s' entry.\n",
|
||||||
myPrintable (entry.name)
|
myPrintable (entry.name)
|
||||||
)
|
)
|
||||||
@ -1127,14 +1127,14 @@ private:
|
|||||||
QString serialized;
|
QString serialized;
|
||||||
|
|
||||||
QCA_logTextMessage (
|
QCA_logTextMessage (
|
||||||
QString ().sprintf (
|
QString::asprintf (
|
||||||
"softstoreKeyStoreListContext::_serializeSoftStoreEntry - entry name=%s",
|
"softstoreKeyStoreListContext::_serializeSoftStoreEntry - entry name=%s",
|
||||||
myPrintable (entry.name)
|
myPrintable (entry.name)
|
||||||
),
|
),
|
||||||
Logger::Debug
|
Logger::Debug
|
||||||
);
|
);
|
||||||
|
|
||||||
serialized = QString ().sprintf (
|
serialized = QString::asprintf (
|
||||||
"qca-softstore/0/%s/%d/%s/%d/%d/x509chain/",
|
"qca-softstore/0/%s/%d/%s/%d/%d/x509chain/",
|
||||||
myPrintable (_escapeString (entry.name)),
|
myPrintable (_escapeString (entry.name)),
|
||||||
entry.keyReferenceType,
|
entry.keyReferenceType,
|
||||||
@ -1151,7 +1151,7 @@ private:
|
|||||||
serialized.append (list.join ("/"));
|
serialized.append (list.join ("/"));
|
||||||
|
|
||||||
QCA_logTextMessage (
|
QCA_logTextMessage (
|
||||||
QString ().sprintf (
|
QString::asprintf (
|
||||||
"softstoreKeyStoreListContext::_serializeSoftStoreEntry - return serialized='%s'",
|
"softstoreKeyStoreListContext::_serializeSoftStoreEntry - return serialized='%s'",
|
||||||
myPrintable (serialized)
|
myPrintable (serialized)
|
||||||
),
|
),
|
||||||
@ -1169,7 +1169,7 @@ private:
|
|||||||
bool ret = false;
|
bool ret = false;
|
||||||
|
|
||||||
QCA_logTextMessage (
|
QCA_logTextMessage (
|
||||||
QString ().sprintf (
|
QString::asprintf (
|
||||||
"softstoreKeyStoreListContext::_deserializeSoftStoreEntry - entry from='%s'",
|
"softstoreKeyStoreListContext::_deserializeSoftStoreEntry - entry from='%s'",
|
||||||
myPrintable (serialized)
|
myPrintable (serialized)
|
||||||
),
|
),
|
||||||
@ -1215,7 +1215,7 @@ private:
|
|||||||
cleanup:
|
cleanup:
|
||||||
|
|
||||||
QCA_logTextMessage (
|
QCA_logTextMessage (
|
||||||
QString ().sprintf (
|
QString::asprintf (
|
||||||
"softstoreKeyStoreListContext::_deserializeSoftStoreEntry - return ret=%d chain.size()=%d",
|
"softstoreKeyStoreListContext::_deserializeSoftStoreEntry - return ret=%d chain.size()=%d",
|
||||||
ret ? 1 : 0,
|
ret ? 1 : 0,
|
||||||
entry.chain.size ()
|
entry.chain.size ()
|
||||||
@ -1233,7 +1233,7 @@ private:
|
|||||||
softstoreKeyStoreEntryContext *entry = NULL;
|
softstoreKeyStoreEntryContext *entry = NULL;
|
||||||
|
|
||||||
QCA_logTextMessage (
|
QCA_logTextMessage (
|
||||||
QString ().sprintf (
|
QString::asprintf (
|
||||||
"softstoreKeyStoreListContext::_keyStoreEntryBySoftStoreEntry - entry name=%s",
|
"softstoreKeyStoreListContext::_keyStoreEntryBySoftStoreEntry - entry name=%s",
|
||||||
myPrintable (sentry.name)
|
myPrintable (sentry.name)
|
||||||
),
|
),
|
||||||
@ -1266,7 +1266,7 @@ private:
|
|||||||
);
|
);
|
||||||
|
|
||||||
QCA_logTextMessage (
|
QCA_logTextMessage (
|
||||||
QString ().sprintf (
|
QString::asprintf (
|
||||||
"softstoreKeyStoreListContext::_keyStoreEntryBySoftStoreEntry - return entry=%p",
|
"softstoreKeyStoreListContext::_keyStoreEntryBySoftStoreEntry - return entry=%p",
|
||||||
(void *)entry
|
(void *)entry
|
||||||
),
|
),
|
||||||
@ -1284,7 +1284,7 @@ private:
|
|||||||
|
|
||||||
foreach (const QChar &c, from) {
|
foreach (const QChar &c, from) {
|
||||||
if (c == '/' || c == '\\') {
|
if (c == '/' || c == '\\') {
|
||||||
to += QString ().sprintf ("\\x%04x", c.unicode ());
|
to += QString::asprintf ("\\x%04x", c.unicode ());
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
to += c;
|
to += c;
|
||||||
@ -1369,7 +1369,7 @@ public:
|
|||||||
Provider::Context *context = NULL;
|
Provider::Context *context = NULL;
|
||||||
|
|
||||||
QCA_logTextMessage (
|
QCA_logTextMessage (
|
||||||
QString ().sprintf (
|
QString::asprintf (
|
||||||
"softstoreProvider::createContext - entry type='%s'",
|
"softstoreProvider::createContext - entry type='%s'",
|
||||||
myPrintable (type)
|
myPrintable (type)
|
||||||
),
|
),
|
||||||
@ -1385,7 +1385,7 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
QCA_logTextMessage (
|
QCA_logTextMessage (
|
||||||
QString ().sprintf (
|
QString::asprintf (
|
||||||
"softstoreProvider::createContext - return context=%p",
|
"softstoreProvider::createContext - return context=%p",
|
||||||
(void *)context
|
(void *)context
|
||||||
),
|
),
|
||||||
@ -1406,14 +1406,14 @@ public:
|
|||||||
|
|
||||||
mytemplate["formtype"] = "http://affinix.com/qca/forms/qca-softstore#1.0";
|
mytemplate["formtype"] = "http://affinix.com/qca/forms/qca-softstore#1.0";
|
||||||
for (int i=0;i<_CONFIG_MAX_ENTRIES;i++) {
|
for (int i=0;i<_CONFIG_MAX_ENTRIES;i++) {
|
||||||
mytemplate[QString ().sprintf ("entry_%02d_enabled", i)] = false;
|
mytemplate[QString::asprintf ("entry_%02d_enabled", i)] = false;
|
||||||
mytemplate[QString ().sprintf ("entry_%02d_name", i)] = "";
|
mytemplate[QString::asprintf ("entry_%02d_name", i)] = "";
|
||||||
mytemplate[QString ().sprintf ("entry_%02d_public_type", i)] = "";
|
mytemplate[QString::asprintf ("entry_%02d_public_type", i)] = "";
|
||||||
mytemplate[QString ().sprintf ("entry_%02d_private_type", i)] = "";
|
mytemplate[QString::asprintf ("entry_%02d_private_type", i)] = "";
|
||||||
mytemplate[QString ().sprintf ("entry_%02d_public", i)] = "";
|
mytemplate[QString::asprintf ("entry_%02d_public", i)] = "";
|
||||||
mytemplate[QString ().sprintf ("entry_%02d_private", i)] = "";
|
mytemplate[QString::asprintf ("entry_%02d_private", i)] = "";
|
||||||
mytemplate[QString ().sprintf ("entry_%02d_unlock_timeout", i)] = -1;
|
mytemplate[QString::asprintf ("entry_%02d_unlock_timeout", i)] = -1;
|
||||||
mytemplate[QString ().sprintf ("entry_%02d_no_passphrase", i)] = false;
|
mytemplate[QString::asprintf ("entry_%02d_no_passphrase", i)] = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
return mytemplate;
|
return mytemplate;
|
||||||
|
@ -1614,7 +1614,7 @@ public:
|
|||||||
public slots:
|
public slots:
|
||||||
void tracker_updated()
|
void tracker_updated()
|
||||||
{
|
{
|
||||||
QCA_logTextMessage(QString().sprintf("keystore: %p: tracker_updated start", q), Logger::Information);
|
QCA_logTextMessage(QString::asprintf("keystore: %p: tracker_updated start", q), Logger::Information);
|
||||||
|
|
||||||
QMutexLocker locker(&m);
|
QMutexLocker locker(&m);
|
||||||
if(!pending)
|
if(!pending)
|
||||||
@ -1629,7 +1629,7 @@ public slots:
|
|||||||
w.wakeOne();
|
w.wakeOne();
|
||||||
}
|
}
|
||||||
|
|
||||||
QCA_logTextMessage(QString().sprintf("keystore: %p: tracker_updated end", q), Logger::Information);
|
QCA_logTextMessage(QString::asprintf("keystore: %p: tracker_updated end", q), Logger::Information);
|
||||||
}
|
}
|
||||||
|
|
||||||
void update()
|
void update()
|
||||||
|
@ -348,7 +348,7 @@ void ProviderManager::scan()
|
|||||||
int ver = i->p->qcaVersion();
|
int ver = i->p->qcaVersion();
|
||||||
if(!validVersion(ver))
|
if(!validVersion(ver))
|
||||||
{
|
{
|
||||||
errstr.sprintf("plugin version 0x%06x is in the future", ver);
|
errstr = QString::asprintf("plugin version 0x%06x is in the future", ver);
|
||||||
logDebug(QString(" %1: (as %2) %3").arg(className, providerName, errstr));
|
logDebug(QString(" %1: (as %2) %3").arg(className, providerName, errstr));
|
||||||
delete i;
|
delete i;
|
||||||
continue;
|
continue;
|
||||||
@ -440,7 +440,7 @@ void ProviderManager::scan()
|
|||||||
int ver = i->p->qcaVersion();
|
int ver = i->p->qcaVersion();
|
||||||
if(!validVersion(ver))
|
if(!validVersion(ver))
|
||||||
{
|
{
|
||||||
errstr.sprintf("plugin version 0x%06x is in the future", ver);
|
errstr = QString::asprintf("plugin version 0x%06x is in the future", ver);
|
||||||
logDebug(QString(" %1: (class: %2, as %3) %4").arg(fileName, className, providerName, errstr));
|
logDebug(QString(" %1: (class: %2, as %3) %4").arg(fileName, className, providerName, errstr));
|
||||||
delete i;
|
delete i;
|
||||||
continue;
|
continue;
|
||||||
@ -475,8 +475,7 @@ bool ProviderManager::add(Provider *p, int priority)
|
|||||||
int ver = p->qcaVersion();
|
int ver = p->qcaVersion();
|
||||||
if(!validVersion(ver))
|
if(!validVersion(ver))
|
||||||
{
|
{
|
||||||
QString errstr;
|
QString errstr = QString::asprintf("plugin version 0x%06x is in the future", ver);
|
||||||
errstr.sprintf("plugin version 0x%06x is in the future", ver);
|
|
||||||
logDebug(QString("Directly adding: %1: %2").arg(providerName, errstr));
|
logDebug(QString("Directly adding: %1: %2").arg(providerName, errstr));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -1531,7 +1531,7 @@ public:
|
|||||||
// provider settings (always write at least 10 providers)
|
// provider settings (always write at least 10 providers)
|
||||||
for(int n = 0; n < 10 || n < providers.count(); ++n)
|
for(int n = 0; n < 10 || n < providers.count(); ++n)
|
||||||
{
|
{
|
||||||
QString prefix = QString().sprintf("provider_%02d_", n);
|
QString prefix = QString::asprintf("provider_%02d_", n);
|
||||||
|
|
||||||
Pkcs11ProviderConfig provider;
|
Pkcs11ProviderConfig provider;
|
||||||
if(n < providers.count())
|
if(n < providers.count())
|
||||||
@ -1561,7 +1561,7 @@ public:
|
|||||||
|
|
||||||
for(int n = 0;; ++n)
|
for(int n = 0;; ++n)
|
||||||
{
|
{
|
||||||
QString prefix = QString().sprintf("provider_%02d_", n);
|
QString prefix = QString::asprintf("provider_%02d_", n);
|
||||||
|
|
||||||
// collect all key/values with this prefix into a
|
// collect all key/values with this prefix into a
|
||||||
// a separate container, leaving out the prefix
|
// a separate container, leaving out the prefix
|
||||||
|
Loading…
x
Reference in New Issue
Block a user