mirror of
https://github.com/QuasarApp/qca.git
synced 2025-05-12 10:49:32 +00:00
whitespace fixes.
svn path=/trunk/kdesupport/qca/; revision=609816
This commit is contained in:
parent
f9e5a75d8f
commit
00449cc829
@ -112,12 +112,12 @@ public:
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void update(const QSecureArray &a)
|
void update(const QSecureArray &a)
|
||||||
{
|
{
|
||||||
PK11_DigestOp(m_context, (const unsigned char*)a.data(), a.size());
|
PK11_DigestOp(m_context, (const unsigned char*)a.data(), a.size());
|
||||||
}
|
}
|
||||||
|
|
||||||
QSecureArray final()
|
QSecureArray final()
|
||||||
{
|
{
|
||||||
unsigned int len = 0;
|
unsigned int len = 0;
|
||||||
@ -126,13 +126,13 @@ public:
|
|||||||
a.resize(len);
|
a.resize(len);
|
||||||
return a;
|
return a;
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
PK11SlotInfo *m_slot;
|
PK11SlotInfo *m_slot;
|
||||||
int m_status;
|
int m_status;
|
||||||
PK11Context *m_context;
|
PK11Context *m_context;
|
||||||
SECOidTag m_hashAlgo;
|
SECOidTag m_hashAlgo;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
//-----------------------------------------------------------
|
//-----------------------------------------------------------
|
||||||
@ -215,14 +215,14 @@ public:
|
|||||||
{
|
{
|
||||||
return anyKeyLength();
|
return anyKeyLength();
|
||||||
}
|
}
|
||||||
|
|
||||||
void setup(const QCA::SymmetricKey &key)
|
void setup(const QCA::SymmetricKey &key)
|
||||||
{
|
{
|
||||||
/* turn the raw key into a SECItem */
|
/* turn the raw key into a SECItem */
|
||||||
SECItem keyItem;
|
SECItem keyItem;
|
||||||
keyItem.data = (unsigned char*) key.data();
|
keyItem.data = (unsigned char*) key.data();
|
||||||
keyItem.len = key.size();
|
keyItem.len = key.size();
|
||||||
|
|
||||||
m_nssKey = PK11_ImportSymKey(m_slot, m_macAlgo, PK11_OriginUnwrap, CKA_SIGN, &keyItem, NULL);
|
m_nssKey = PK11_ImportSymKey(m_slot, m_macAlgo, PK11_OriginUnwrap, CKA_SIGN, &keyItem, NULL);
|
||||||
|
|
||||||
SECItem noParams;
|
SECItem noParams;
|
||||||
@ -246,7 +246,7 @@ public:
|
|||||||
{
|
{
|
||||||
PK11_DigestOp(m_context, (const unsigned char*)a.data(), a.size());
|
PK11_DigestOp(m_context, (const unsigned char*)a.data(), a.size());
|
||||||
}
|
}
|
||||||
|
|
||||||
void final( QSecureArray *out)
|
void final( QSecureArray *out)
|
||||||
{
|
{
|
||||||
// NSS doesn't appear to be able to tell us how big the digest will
|
// NSS doesn't appear to be able to tell us how big the digest will
|
||||||
@ -257,14 +257,14 @@ public:
|
|||||||
PK11_DigestFinal(m_context, (unsigned char*)out->data(), &len, out->size());
|
PK11_DigestFinal(m_context, (unsigned char*)out->data(), &len, out->size());
|
||||||
out->resize(len); // and fix it up later
|
out->resize(len); // and fix it up later
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
PK11SlotInfo *m_slot;
|
PK11SlotInfo *m_slot;
|
||||||
int m_status;
|
int m_status;
|
||||||
PK11Context *m_context;
|
PK11Context *m_context;
|
||||||
CK_MECHANISM_TYPE m_macAlgo;
|
CK_MECHANISM_TYPE m_macAlgo;
|
||||||
PK11SymKey* m_nssKey;
|
PK11SymKey* m_nssKey;
|
||||||
};
|
};
|
||||||
|
|
||||||
//-----------------------------------------------------------
|
//-----------------------------------------------------------
|
||||||
class nssCipherContext : public QCA::CipherContext
|
class nssCipherContext : public QCA::CipherContext
|
||||||
@ -318,7 +318,7 @@ public:
|
|||||||
SECItem keyItem;
|
SECItem keyItem;
|
||||||
keyItem.data = (unsigned char*) key.data();
|
keyItem.data = (unsigned char*) key.data();
|
||||||
keyItem.len = key.size();
|
keyItem.len = key.size();
|
||||||
|
|
||||||
if (QCA::Encode == dir) {
|
if (QCA::Encode == dir) {
|
||||||
m_nssKey = PK11_ImportSymKey(m_slot, m_cipherMechanism,
|
m_nssKey = PK11_ImportSymKey(m_slot, m_cipherMechanism,
|
||||||
PK11_OriginUnwrap, CKA_ENCRYPT,
|
PK11_OriginUnwrap, CKA_ENCRYPT,
|
||||||
@ -405,7 +405,7 @@ class nssProvider : public QCA::Provider
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
void init()
|
void init()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
~nssProvider()
|
~nssProvider()
|
||||||
@ -421,7 +421,7 @@ public:
|
|||||||
{
|
{
|
||||||
return "qca-nss";
|
return "qca-nss";
|
||||||
}
|
}
|
||||||
|
|
||||||
QStringList features() const
|
QStringList features() const
|
||||||
{
|
{
|
||||||
QStringList list;
|
QStringList list;
|
||||||
@ -450,7 +450,7 @@ public:
|
|||||||
|
|
||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
Context *createContext(const QString &type)
|
Context *createContext(const QString &type)
|
||||||
{
|
{
|
||||||
if ( type == "md2" )
|
if ( type == "md2" )
|
||||||
|
Loading…
x
Reference in New Issue
Block a user