1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
|
From: Thomas Habets <thomas@habets.se>
Date: Thu, 16 May 2019 00:12:53 +0100
Subject: Answer CKA_LABEL attribute request with dummy value
A bug in RedHat's patched OpenSSH is preventing empty string, so
providing a one-letter dummy label is the workaround.
Fixes #48
---
src/session.cc | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/src/session.cc b/src/session.cc
index 655673d..a8a1dec 100644
--- a/src/session.cc
+++ b/src/session.cc
@@ -243,6 +243,19 @@ Session::GetAttributeValue(CK_OBJECT_HANDLE hObject,
pTemplate[i].ulValueLen = 0;
break;
+ case CKA_LABEL:
+ config_.debug_log(" Attribute %d: Label (unsupported)", i);
+ if (pTemplate[i].pValue) {
+ *static_cast<char*>(pTemplate[i].pValue) = 'x';
+ }
+ pTemplate[i].ulValueLen = 1;
+ break;
+
+ case 0x202: // CKA_ALWAYS_AUTHENTICATE:
+ config_.debug_log(" Attribute %d: Always authenticate (unsupported)", i);
+ pTemplate[i].ulValueLen = 0;
+ break;
+
default:
config_.debug_log(" Attribute %d: Unknown (%d)", i, pTemplate[i].type);
pTemplate[i].ulValueLen = 0;
|