Constify tokenInfo() and findUniqueID()

No functional change
This commit is contained in:
Christian Hohnstaedt 2024-02-28 21:04:52 +01:00
parent affc2dca6b
commit 46e82e254e
2 changed files with 9 additions and 9 deletions

View File

@ -389,7 +389,7 @@ void pkcs11::initToken(const slotid &slot, unsigned char *pin, int pinlen,
pk11error(slot, "C_InitToken", rv);
}
tkInfo pkcs11::tokenInfo(const slotid &slot)
tkInfo pkcs11::tokenInfo(const slotid &slot) const
{
tkInfo ti;
CK_RV rv = tokenInfo(slot, &ti);
@ -400,7 +400,7 @@ tkInfo pkcs11::tokenInfo(const slotid &slot)
return ti;
}
CK_RV pkcs11::tokenInfo(const slotid &slot, tkInfo *tkinfo)
CK_RV pkcs11::tokenInfo(const slotid &slot, tkInfo *tkinfo) const
{
CK_TOKEN_INFO token_info;
CK_RV rv;
@ -452,7 +452,7 @@ int pkcs11::deleteObjects(QList<CK_OBJECT_HANDLE> objects)
}
#define ID_LEN 8
pk11_attr_data pkcs11::findUniqueID(unsigned long oclass)
pk11_attr_data pkcs11::findUniqueID(unsigned long oclass) const
{
pk11_attr_data id(CKA_ID);
pk11_attr_ulong class_att(CKA_CLASS, oclass);
@ -576,7 +576,7 @@ pk11_attr_data pkcs11::generateKey(QString name, unsigned long mech,
return new_id;
}
QList<CK_OBJECT_HANDLE> pkcs11::objectList(pk11_attlist &atts)
QList<CK_OBJECT_HANDLE> pkcs11::objectList(pk11_attlist &atts) const
{
CK_RV rv;
CK_OBJECT_HANDLE objects[256];

View File

@ -115,9 +115,9 @@ class pkcs11
pkcs11();
~pkcs11();
CK_RV tokenInfo(const slotid &slot, tkInfo *tkinfo);
tkInfo tokenInfo(const slotid &slot);
tkInfo tokenInfo()
CK_RV tokenInfo(const slotid &slot, tkInfo *tkinfo) const;
tkInfo tokenInfo(const slotid &slot) const;
tkInfo tokenInfo() const
{
return tokenInfo(p11slot);
}
@ -145,7 +145,7 @@ class pkcs11
CK_OBJECT_HANDLE object);
void storeAttribute(pk11_attribute &attribute,
CK_OBJECT_HANDLE object);
QList<CK_OBJECT_HANDLE> objectList(pk11_attlist &atts);
QList<CK_OBJECT_HANDLE> objectList(pk11_attlist &atts) const;
QString tokenLogin(QString name, bool so, bool force=false);
void getRandom();
void logout();
@ -155,7 +155,7 @@ class pkcs11
void setPin(unsigned char *oldPin, unsigned long oldPinLen,
unsigned char *pin, unsigned long pinLen);
CK_OBJECT_HANDLE createObject(pk11_attlist &attrs);
pk11_attr_data findUniqueID(unsigned long oclass);
pk11_attr_data findUniqueID(unsigned long oclass) const;
pk11_attr_data generateKey(QString name,
unsigned long ec_rsa_mech, unsigned long bits, int nid);
int deleteObjects(QList<CK_OBJECT_HANDLE> objects);