Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 4 additions & 13 deletions .github/workflows/cmake-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,36 +5,27 @@ on: [push, pull_request]
env:
BUILD_TYPE: RelWithDebInfo
CMAKE_BUILD_PARALLEL_LEVEL: 3
VCPKG_MANIFEST_DIR: .github
VCPKG_INSTALLED_DIR: ${{ github.workspace }}/build/vcpkg_installed

jobs:
build:
runs-on: windows-latest

steps:
- name: Checkout code
uses: actions/checkout@v4
uses: actions/checkout@v5

- name: Cache vcpkg
uses: actions/cache@v4
with:
path: ${{ github.workspace }}/vcpkg_cache
key: vcpkg-${{ hashFiles(format('{0}/vcpkg.json', env.VCPKG_MANIFEST_DIR)) }}
key: vcpkg-${{ hashFiles('vcpkg.json') }}

- name: Prepare vcpkg and libraries
uses: lukka/run-vcpkg@v11
with:
vcpkgJsonGlob: ${{ env.VCPKG_MANIFEST_DIR }}/vcpkg.json
runVcpkgInstall: true
- name: Configure CMake
env:
VCPKG_BINARY_SOURCES: clear;files,${{ github.workspace }}/vcpkg_cache,readwrite

- name: Configure CMake
run: |
cmake -A x64 -S . -B build "-DCMAKE_BUILD_TYPE=${env:BUILD_TYPE}" `
"-DCMAKE_TOOLCHAIN_FILE=${env:VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake" `
"-DVCPKG_MANIFEST_DIR=${{ env.VCPKG_MANIFEST_DIR }}"
"-DCMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake"

- name: Build
run: cmake --build build --config ${env:BUILD_TYPE}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ TEST(byte_vector_stringOperatorTest, appendsHexToNonEmptyString)
byte_vector data = {0x12, 0x34, 0xAB, 0xFF};
std::string prefix = "prefix-";

std::string result = prefix + data;
std::string result = std::move(prefix) + data;

EXPECT_EQ(result, "prefix-1234abff");
}
Expand All @@ -41,7 +41,7 @@ TEST(byte_vector_stringOperatorTest, appendsHexToEmptyString)
byte_vector data = {0x01, 0xA0, 0xFF};
std::string prefix;

std::string result = prefix + data;
std::string result = std::move(prefix) + data;

EXPECT_EQ(result, "01a0ff");
}
Expand All @@ -51,7 +51,7 @@ TEST(byte_vector_stringOperatorTest, handlesEmptyByteVector)
byte_vector data;
std::string prefix = "nothing-changes-";

std::string result = prefix + data;
std::string result = std::move(prefix) + data;

EXPECT_EQ(result, "nothing-changes-");
}
2 changes: 1 addition & 1 deletion src/electronic-ids/pcsc/EIDThales.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ byte_vector EIDThales::getCertificateImpl(const SmartCard::Session& session,
ElectronicID::PinInfo EIDThales::pinRetriesLeft(const SmartCard::Session& session,
byte_type pinReference, bool pinActive) const
{
const auto GET_DATA = smartcard().protocol() == SmartCard::Protocol::T1
const auto& GET_DATA = smartcard().protocol() == SmartCard::Protocol::T1
? CommandApdu {0x00, 0xCB, 0x00, 0xFF, {0xA0, 0x03, 0x83, 0x01, pinReference}, 0x00}
: CommandApdu {0x00, 0xCB, 0x00, 0xFF, {0xA0, 0x03, 0x83, 0x01, pinReference}};
const auto response = session.transmit(GET_DATA);
Expand Down
4 changes: 3 additions & 1 deletion src/electronic-ids/pcsc/LatEIDIDEMIAv2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,9 @@ TLV LatEIDIDEMIAV2::readEF_File(const SmartCard::Session& session, byte_vector f
if (auto it = cache.find(file); it != cache.end()) {
return TLV(it->second);
}
return TLV(cache[std::move(file)] = readFile(session, CommandApdu::selectEF(0x02, file)));
auto value = readFile(session, CommandApdu::selectEF(0x02, file));
auto it = cache.try_emplace(std::move(file), std::move(value)).first;
return TLV(it->second);
}

TLV LatEIDIDEMIAV2::readDCODInfo(const SmartCard::Session& session, byte_type type,
Expand Down
File renamed without changes.
Loading