Skip to content
Merged
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
18 changes: 6 additions & 12 deletions .github/workflows/cmake-linux-fedora.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,14 @@ name: CMake (Fedora Linux)

on: [push, pull_request]

env:
BUILD_TYPE: RelWithDebInfo

jobs:
build:
runs-on: ubuntu-latest
continue-on-error: ${{ matrix.experimental }}
continue-on-error: ${{ matrix.container == 'fedora:rawhide' }}
strategy:
matrix:
container: ['fedora:latest']
experimental: [false]
include:
- container: 'fedora:rawhide'
experimental: true
container: ['fedora:latest', 'fedora:rawhide']
build_type: [Release, RelWithDebInfo]

container:
image: ${{ matrix.container }}
Expand All @@ -27,10 +21,10 @@ jobs:
- uses: actions/checkout@v4

- name: Configure CMake
run: cmake -DCMAKE_BUILD_TYPE=$BUILD_TYPE -S . -B build
run: cmake -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -S . -B build

- name: Build
run: cmake --build build --config $BUILD_TYPE -j $(nproc)
run: cmake --build build --config ${{ matrix.build_type }} -j $(nproc)

- name: Test
run: ctest -V -C $BUILD_TYPE --test-dir build
run: ctest -V -C ${{ matrix.build_type }} --test-dir build
7 changes: 3 additions & 4 deletions include/electronic-id/electronic-id.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class ElectronicID
using byte_type = pcsc_cpp::byte_type;
using Signature = std::pair<byte_vector, SignatureAlgorithm>;

enum Type {
enum Type : uint8_t {
EstEID,
FinEID,
LatEID,
Expand Down Expand Up @@ -125,7 +125,6 @@ class CardInfo

const pcsc_cpp::Reader& reader() const { return _reader; }
const ElectronicID& eid() const { return *_eid; }
const ElectronicID::ptr eidPtr() const { return _eid; }

private:
pcsc_cpp::Reader _reader;
Expand Down Expand Up @@ -216,7 +215,7 @@ class MsCryptoApiError : public Error
class AutoSelectFailed : public Error
{
public:
enum class Reason {
enum class Reason : uint8_t {
SERVICE_NOT_RUNNING,
NO_READERS,
SINGLE_READER_NO_CARD,
Expand All @@ -241,7 +240,7 @@ class VerifyPinFailed : public Error
template <typename T>
using observer_ptr = T*;

enum class Status {
enum class Status : uint8_t {
RETRY_ALLOWED,
INVALID_PIN_LENGTH,
PIN_ENTRY_TIMEOUT,
Expand Down
2 changes: 0 additions & 2 deletions lib/libpcsc-cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,8 @@ add_library(${PROJECT_NAME}
include/${PROJECT_NAME}/${PROJECT_NAME}.hpp
include/${PROJECT_NAME}/${PROJECT_NAME}-utils.hpp
include/${PROJECT_NAME}/comp_winscard.hpp
include/flag-set-cpp/flag_set.hpp
include/magic_enum/magic_enum.hpp
src/Context.hpp
src/Reader.cpp
src/SCardCall.hpp
src/SmartCard.cpp
src/listReaders.cpp
Expand Down
175 changes: 0 additions & 175 deletions lib/libpcsc-cpp/include/flag-set-cpp/flag_set.hpp

This file was deleted.

35 changes: 5 additions & 30 deletions lib/libpcsc-cpp/include/pcsc-cpp/pcsc-cpp.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@

#pragma once

#include "flag-set-cpp/flag_set.hpp"

#include <cstdint>
#include <limits>
#include <memory>
#include <stdexcept>
#include <string>
#include <vector>

// The rule of five (C++ Core guidelines C.21).
Expand Down Expand Up @@ -254,39 +254,14 @@ class SmartCard
};

/** Reader provides card reader information, status and gives access to the smart card in it. */
class Reader
struct Reader
{
public:
enum class Status {
UNAWARE,
IGNORE,
CHANGED,
UNKNOWN,
UNAVAILABLE,
EMPTY,
PRESENT,
ATRMATCH,
EXCLUSIVE,
INUSE,
MUTE,
UNPOWERED,
_
};

Reader(ContextPtr context, string_t name, byte_vector cardAtr, flag_set<Status> status);

SmartCard::ptr connectToCard() const { return std::make_unique<SmartCard>(ctx, name, cardAtr); }

bool isCardInserted() const { return status[Status::PRESENT]; }

std::string statusString() const;

const ContextPtr ctx;
const string_t name;
const byte_vector cardAtr;
const flag_set<Status> status;

private:
ContextPtr ctx;
const bool isCardPresent;
};

/**
Expand Down
54 changes: 0 additions & 54 deletions lib/libpcsc-cpp/src/Reader.cpp

This file was deleted.

Loading
Loading