Skip to content
This repository has been archived by the owner on Feb 12, 2024. It is now read-only.

Commit

Permalink
Merge pull request #4 from calypsonet/win-fix
Browse files Browse the repository at this point in the history
Fix: fixed runtime issue on Windows
  • Loading branch information
AlexandreMunsch committed Jun 5, 2023
2 parents be5a569 + 5669b13 commit e9a4bbc
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 7 deletions.
3 changes: 2 additions & 1 deletion src/main/transaction/CardSecuritySetting.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ using namespace calypsonet::terminal::reader;
*
* @since 1.0.0
*/
class CardSecuritySetting : virtual public CommonSecuritySetting<CardSecuritySetting> {
class CardSecuritySetting : virtual public CommonSecuritySetting {
public:
/**
* Defines the SAM and the reader through which it is accessible to be used to handle the
Expand Down Expand Up @@ -190,6 +190,7 @@ class CardSecuritySetting : virtual public CommonSecuritySetting<CardSecuritySet
*/
virtual CardSecuritySetting& setPinModificationCipheringKey(const uint8_t kif,
const uint8_t kvc) = 0;

};

}
Expand Down
14 changes: 10 additions & 4 deletions src/main/transaction/CommonSecuritySetting.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,13 @@ using namespace calypsonet::terminal::reader;
* @param <S> The type of the lowest level child object.
* @since 1.2.0
*/
template <typename S>
class CommonSecuritySetting {
public:
/**
*
*/
virtual ~CommonSecuritySetting() = default;

/**
* Defines the control SAM and the reader through which it is accessible to be used to handle
* the relevant cryptographic operations.
Expand All @@ -50,8 +54,9 @@ class CommonSecuritySetting {
* CalypsoSam is equal to CalypsoSam::ProductType::UNKNOWN.
* @since 1.2.0
*/
virtual S& setControlSamResource(const std::shared_ptr<CardReader> samReader,
const std::shared_ptr<CalypsoSam> calypsoSam) = 0;
virtual CommonSecuritySetting& setControlSamResource(
const std::shared_ptr<CardReader> samReader,
const std::shared_ptr<CalypsoSam> calypsoSam) = 0;

/**
* Sets the service to be used to dynamically check if a SAM is revoked or not.
Expand All @@ -61,7 +66,8 @@ class CommonSecuritySetting {
* @throws IllegalArgumentException If the provided service is null.
* @since 1.2.0
*/
virtual S& setSamRevocationService(const std::shared_ptr<SamRevocationServiceSpi> service) = 0;
virtual CommonSecuritySetting& setSamRevocationService(
const std::shared_ptr<SamRevocationServiceSpi> service) = 0;
};

}
Expand Down
2 changes: 1 addition & 1 deletion src/main/transaction/CommonTransactionManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ class CommonTransactionManager {
* @return Null if the transaction does not use security settings.
* @since 1.2.0
*/
virtual const std::shared_ptr<S> getSecuritySetting() const = 0;
virtual const std::shared_ptr<CommonSecuritySetting> getSecuritySetting() const = 0;

/**
* Returns the audit data of the transaction containing all APDU exchanges with the card and the
Expand Down
2 changes: 1 addition & 1 deletion src/main/transaction/SamSecuritySetting.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ namespace transaction {
*
* @since 1.2.0
*/
class SamSecuritySetting : virtual public CommonSecuritySetting<SamSecuritySetting> {
class SamSecuritySetting : virtual public CommonSecuritySetting {
public:
/**
*
Expand Down

0 comments on commit e9a4bbc

Please sign in to comment.