aboutsummaryrefslogtreecommitdiffstats
path: root/src/core/function/gpg/GpgSmartCardManager.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/function/gpg/GpgSmartCardManager.cpp')
-rw-r--r--src/core/function/gpg/GpgSmartCardManager.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/core/function/gpg/GpgSmartCardManager.cpp b/src/core/function/gpg/GpgSmartCardManager.cpp
index 422f0b20..cc7f8ab3 100644
--- a/src/core/function/gpg/GpgSmartCardManager.cpp
+++ b/src/core/function/gpg/GpgSmartCardManager.cpp
@@ -29,6 +29,7 @@
#include "GpgSmartCardManager.h"
#include "core/function/gpg/GpgAutomatonHandler.h"
+#include "core/utils/CommonUtils.h"
namespace GpgFrontend {
@@ -81,6 +82,17 @@ auto GpgSmartCardManager::Fetch(const QString& serial_number) -> bool {
.DoCardInteract(serial_number, next_state_handler, action_handler);
}
+auto GpgSmartCardManager::IsSCDVersionSupported() -> bool {
+ auto [r, s] = assuan_.SendDataCommand(GpgComponentType::kGPG_AGENT,
+ "SCD GETINFO version");
+ if (s.isEmpty()) {
+ LOG_D() << "invalid response of SCD GETINFO version: " << s;
+ return false;
+ }
+
+ return GFCompareSoftwareVersion(s.front(), "2.3.0") > 0;
+}
+
auto GpgSmartCardManager::GetSerialNumbers() -> QStringList {
auto [r, s] = assuan_.SendStatusCommand(GpgComponentType::kGPG_AGENT,
"SCD SERIALNO --all");