VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/src/Common/ResponseAPDU.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/ResponseAPDU.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/ResponseAPDU.cpp')
-rw-r--r--src/Common/ResponseAPDU.cpp32
1 files changed, 16 insertions, 16 deletions
diff --git a/src/Common/ResponseAPDU.cpp b/src/Common/ResponseAPDU.cpp
index 8a7f069c..3fe3b6de 100644
--- a/src/Common/ResponseAPDU.cpp
+++ b/src/Common/ResponseAPDU.cpp
@@ -5,7 +5,7 @@ using namespace std;
namespace VeraCrypt
{
- uint16 BytesToUInt16(const vector<byte>& buff)
+ uint16 BytesToUInt16(const vector<uint8>& buff)
{
uint16 value = 0;
for (uint16 i = 0; i < buff.size(); i++)
@@ -17,7 +17,7 @@ namespace VeraCrypt
return value;
}
- void AppendData (vector<byte>& buffer, const byte* pbData, size_t cbData)
+ void AppendData (vector<uint8>& buffer, const uint8* pbData, size_t cbData)
{
size_t orgSize = buffer.size ();
buffer.resize (orgSize + cbData);
@@ -36,7 +36,7 @@ namespace VeraCrypt
{
}
- ResponseAPDU::ResponseAPDU(const vector<byte>& data, uint16 SW)
+ ResponseAPDU::ResponseAPDU(const vector<uint8>& data, uint16 SW)
{
m_data = data;
m_SW = SW;
@@ -47,19 +47,19 @@ namespace VeraCrypt
return (uint32)m_data.size();
}
- const vector<byte> ResponseAPDU::getData()
+ const vector<uint8> ResponseAPDU::getData()
{
return m_data;
}
- byte ResponseAPDU::getSW1()
+ uint8 ResponseAPDU::getSW1()
{
- return (byte)((0xFF00 & m_SW) >> 8);
+ return (uint8)((0xFF00 & m_SW) >> 8);
}
- byte ResponseAPDU::getSW2()
+ uint8 ResponseAPDU::getSW2()
{
- return (byte)(0x00FF & m_SW);
+ return (uint8)(0x00FF & m_SW);
}
uint16 ResponseAPDU::getSW()
@@ -67,23 +67,23 @@ namespace VeraCrypt
return m_SW;
}
- const vector<byte> ResponseAPDU::getBytes()
+ const vector<uint8> ResponseAPDU::getBytes()
{
- vector<byte> apdu;
+ vector<uint8> apdu;
AppendData(apdu, m_data.data(), m_data.size());
- apdu.push_back((byte)getSW1());
- apdu.push_back((byte)getSW2());
+ apdu.push_back((uint8)getSW1());
+ apdu.push_back((uint8)getSW2());
return apdu;
}
- void ResponseAPDU::appendData(const vector<byte>& data)
+ void ResponseAPDU::appendData(const vector<uint8>& data)
{
appendData(data.data(), data.size());
}
- void ResponseAPDU::appendData(const byte* data, size_t dataLen)
+ void ResponseAPDU::appendData(const uint8* data, size_t dataLen)
{
AppendData(m_data, data, dataLen);
}
@@ -93,12 +93,12 @@ namespace VeraCrypt
m_SW = SW;
}
- void ResponseAPDU::setBytes(const vector<byte>& bytes)
+ void ResponseAPDU::setBytes(const vector<uint8>& bytes)
{
clear();
if (bytes.size() >= 2)
{
- vector<byte> SWBytes;
+ vector<uint8> SWBytes;
m_data.resize(bytes.size() - 2);
SWBytes.resize(2);