VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/src/Common/SecurityToken.cpp
diff options
context:
space:
mode:
authorMounir IDRASSI <mounir.idrassi@idrix.fr>2024-06-12 12:30:04 +0200
committerMounir IDRASSI <mounir.idrassi@idrix.fr>2024-06-12 12:30:04 +0200
commit455a4f2176a5cfbe325e1e40cea20dd3e466b64c (patch)
tree7a84d0f768ee375ea9f648bbbdeac7a4906f13fb /src/Common/SecurityToken.cpp
parentbf9f3ec4f0a987ae1591ab5466f6eee599203c85 (diff)
downloadVeraCrypt-455a4f2176a5cfbe325e1e40cea20dd3e466b64c.tar.gz
VeraCrypt-455a4f2176a5cfbe325e1e40cea20dd3e466b64c.zip
Avoid conflict with C++17 features std::byte by using uint8 type instead of byte
Diffstat (limited to 'src/Common/SecurityToken.cpp')
-rw-r--r--src/Common/SecurityToken.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/Common/SecurityToken.cpp b/src/Common/SecurityToken.cpp
index ad8ed33e..2a8222e6 100644
--- a/src/Common/SecurityToken.cpp
+++ b/src/Common/SecurityToken.cpp
@@ -123,7 +123,7 @@ namespace VeraCrypt
Sessions.erase(Sessions.find(slotId));
}
- void SecurityToken::CreateKeyfile(CK_SLOT_ID slotId, vector <byte>& keyfileData, const string& name)
+ void SecurityToken::CreateKeyfile(CK_SLOT_ID slotId, vector <uint8>& keyfileData, const string& name)
{
if (name.empty())
throw ParameterIncorrect(SRC_POS);
@@ -167,10 +167,10 @@ namespace VeraCrypt
throw Pkcs11Exception(status);
// Some tokens report success even if the new object was truncated to fit in the available memory
- vector <byte> objectData;
+ vector <uint8> objectData;
GetObjectAttribute(slotId, keyfileHandle, CKA_VALUE, objectData);
- finally_do_arg(vector <byte> *, &objectData, { if (!finally_arg->empty()) burn(&finally_arg->front(), finally_arg->size()); });
+ finally_do_arg(vector <uint8> *, &objectData, { if (!finally_arg->empty()) burn(&finally_arg->front(), finally_arg->size()); });
if (objectData.size() != keyfileData.size())
{
@@ -227,13 +227,13 @@ namespace VeraCrypt
keyfile.Token->SlotId = slotId;
keyfile.Token = shared_ptr<SecurityTokenInfo>(new SecurityTokenInfo(token));
- vector <byte> privateAttrib;
+ vector <uint8> privateAttrib;
GetObjectAttribute(slotId, dataHandle, CKA_PRIVATE, privateAttrib);
if (privateAttrib.size() == sizeof(CK_BBOOL) && *(CK_BBOOL*)&privateAttrib.front() != CK_TRUE)
continue;
- vector <byte> label;
+ vector <uint8> label;
GetObjectAttribute(slotId, dataHandle, CKA_LABEL, label);
label.push_back(0);
@@ -320,7 +320,7 @@ namespace VeraCrypt
return token;
}
- void SecurityTokenKeyfile::GetKeyfileData(vector <byte>& keyfileData) const
+ void SecurityTokenKeyfile::GetKeyfileData(vector <uint8>& keyfileData) const
{
SecurityToken::LoginUserIfRequired(Token->SlotId);
SecurityToken::GetObjectAttribute(Token->SlotId, Handle, CKA_VALUE, keyfileData);
@@ -361,7 +361,7 @@ namespace VeraCrypt
return objects;
}
- void SecurityToken::GetObjectAttribute(CK_SLOT_ID slotId, CK_OBJECT_HANDLE tokenObject, CK_ATTRIBUTE_TYPE attributeType, vector <byte>& attributeValue)
+ void SecurityToken::GetObjectAttribute(CK_SLOT_ID slotId, CK_OBJECT_HANDLE tokenObject, CK_ATTRIBUTE_TYPE attributeType, vector <uint8>& attributeValue)
{
attributeValue.clear();
@@ -379,7 +379,7 @@ namespace VeraCrypt
if (attribute.ulValueLen == 0)
return;
- attributeValue = vector <byte>(attribute.ulValueLen);
+ attributeValue = vector <uint8>(attribute.ulValueLen);
attribute.pValue = &attributeValue.front();
status = Pkcs11Functions->C_GetAttributeValue(Sessions[slotId].Handle, tokenObject, &attribute, 1);