Skip to content

Commit 36a19ca

Browse files
committed
Add support of Luxembourg cards
WE2-1032 Signed-off-by: Mart Somermaa <[email protected]> Co-authored-by: RCDevs Security <yumisign>
1 parent d844976 commit 36a19ca

File tree

3 files changed

+106
-0
lines changed

3 files changed

+106
-0
lines changed

include/electronic-id/electronic-id.hpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@ class ElectronicID
5050
HrvEID,
5151
BelEID,
5252
CzeEID,
53+
LuxtrustV2,
54+
LuxEID,
5355
#ifdef _WIN32
5456
MsCryptoApiEID,
5557
#endif

src/electronic-id.cpp

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,78 @@ const std::vector<MaskedATREntry> MASKED_ATRS = {
139139
{{0x3b, 0x98, 0x13, 0x40, 0x0a, 0xa5, 0x03, 0x01, 0x01, 0x01, 0xad, 0x13, 0x11},
140140
{0xff, 0xff, 0x00, 0xff, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00},
141141
constructor<ElectronicID::Type::BelEID>},
142+
// LuxtrustV2
143+
{{0x3B, 0x7D, 0x00, 0x00, 0x00, 0x80, 0x31, 0x80, 0x65, 0xB0, 0x00, 0x00, 0x00, 0x00, 0x83,
144+
0x00, 0x90, 0x00},
145+
{0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0xFF,
146+
0x00, 0xFF, 0xFF},
147+
constructor<ElectronicID::Type::LuxtrustV2>},
148+
// LuxEID
149+
{{0x3B, 0x7F, 0x00, 0x00, 0x00, 0x80, 0x31, 0x80, 0x65, 0xB0,
150+
0x00, 0x03, 0x00, 0x00, 0x12, 0x0F, 0xFF, 0x82, 0x90, 0x00},
151+
{0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
152+
0x00, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF},
153+
constructor<ElectronicID::Type::LuxEID>},
154+
// LuxEID
155+
{{0x3B, 0xFF, 0x00, 0x00, 0x00, 0x81, 0x31, 0x00, 0x43, 0x80, 0x31, 0x80, 0x65,
156+
0xB0, 0x00, 0x03, 0x00, 0x00, 0x12, 0x0F, 0xFF, 0x82, 0x90, 0x00, 0x00},
157+
{0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
158+
0xFF, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00},
159+
constructor<ElectronicID::Type::LuxEID>},
160+
// LuxEID
161+
{{0x3B, 0x8F, 0x00, 0x01, 0x80, 0x31, 0x80, 0x65, 0xB0, 0x00,
162+
0x03, 0x00, 0x00, 0x12, 0x0F, 0xFF, 0x82, 0x90, 0x00, 0x00},
163+
{0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00,
164+
0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00},
165+
constructor<ElectronicID::Type::LuxEID>},
166+
// LuxEID
167+
{{0x3B, 0x88, 0x00, 0x01, 0xE1, 0xF3, 0x5E, 0x11, 0x00, 0x87, 0x95, 0x00, 0x00},
168+
{0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0xFF, 0x00},
169+
constructor<ElectronicID::Type::LuxEID>},
170+
// LuxEID
171+
{{0x3b, 0x7f, 0x00, 0x00, 0x00, 0x80, 0x31, 0x80, 0x65, 0xb0,
172+
0x00, 0x04, 0x00, 0x00, 0x12, 0x0f, 0xff, 0x82, 0x90, 0x00},
173+
{0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
174+
0x00, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF},
175+
constructor<ElectronicID::Type::LuxEID>},
176+
// LuxEID
177+
{{0x3b, 0xff, 0x00, 0x00, 0x00, 0x81, 0x31, 0x00, 0x43, 0x80, 0x31, 0x80, 0x65,
178+
0xb0, 0x00, 0x04, 0x00, 0x00, 0x12, 0x0f, 0xff, 0x82, 0x90, 0x00, 0x00},
179+
{0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
180+
0xFF, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00},
181+
constructor<ElectronicID::Type::LuxEID>},
182+
// LuxEID
183+
{{0x3B, 0x8F, 0x80, 0x01, 0x80, 0x31, 0x80, 0x65, 0xB0, 0x00,
184+
0x04, 0x00, 0x00, 0x12, 0x0F, 0xFF, 0x82, 0x90, 0x00, 0x00},
185+
{0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00,
186+
0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00},
187+
constructor<ElectronicID::Type::LuxEID>},
188+
// LuxEID
189+
{{0x3b, 0x88, 0x80, 0x01, 0x00, 0x88, 0x3c, 0x1f, 0x77, 0x81, 0x95, 0x00, 0xc1},
190+
{0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF},
191+
constructor<ElectronicID::Type::LuxEID>},
192+
// LuxEID
193+
{{0x3b, 0x7f, 0x00, 0x00, 0x00, 0x80, 0x31, 0x80, 0x65, 0xb0,
194+
0x00, 0x05, 0x00, 0x00, 0x12, 0x0f, 0xff, 0x82, 0x90, 0x00},
195+
{0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
196+
0x00, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF},
197+
constructor<ElectronicID::Type::LuxEID>},
198+
// LuxEID
199+
{{0x3b, 0xff, 0x00, 0x00, 0x00, 0x81, 0x31, 0x00, 0x43, 0x80, 0x31, 0x80, 0x65,
200+
0xb0, 0x00, 0x05, 0x00, 0x00, 0x12, 0x0f, 0xff, 0x82, 0x90, 0x00, 0x00},
201+
{0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
202+
0xFF, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00},
203+
constructor<ElectronicID::Type::LuxEID>},
204+
// LuxEID
205+
{{0x3B, 0x8F, 0x80, 0x01, 0x80, 0x31, 0x80, 0x65, 0xB0, 0x00,
206+
0x05, 0x00, 0x00, 0x12, 0x0F, 0xFF, 0x82, 0x90, 0x00, 0x00},
207+
{0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00,
208+
0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00},
209+
constructor<ElectronicID::Type::LuxEID>},
210+
// LuxEID
211+
{{0x3b, 0x88, 0x80, 0x01, 0xe1, 0xf3, 0x5e, 0x11, 0x77, 0xa1, 0x97, 0x00, 0x15},
212+
{0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF},
213+
constructor<ElectronicID::Type::LuxEID>},
142214
};
143215

144216
std::string byteVectorToHexString(const byte_vector& bytes)

src/electronic-ids/pkcs11/Pkcs11ElectronicID.cpp

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,18 @@ inline fs::path czechPkcs11ModulePath()
118118
#endif
119119
}
120120

121+
inline fs::path luxembourgPkcs11ModulePath()
122+
{
123+
#ifdef _WIN32
124+
return programFilesPath() / L"Gemalto/Classic Client/BIN/gclib.dll";
125+
#elif defined __APPLE__
126+
return "/Library/Frameworks/Pkcs11ClassicClient.framework/Versions/A/Pkcs11ClassicClient/"
127+
"libgclib.dylib";
128+
#else // Linux
129+
return "/usr/lib/pkcs11/libgclib.so";
130+
#endif
131+
}
132+
121133
const std::map<ElectronicID::Type, Pkcs11ElectronicIDModule> SUPPORTED_PKCS11_MODULES {
122134
// EstEID configuration is here only for testing,
123135
// it is not enabled in getElectronicID().
@@ -171,6 +183,26 @@ const std::map<ElectronicID::Type, Pkcs11ElectronicIDModule> SUPPORTED_PKCS11_MO
171183
true,
172184
false,
173185
}},
186+
{ElectronicID::Type::LuxtrustV2,
187+
{
188+
"LuxtrustV2 eID (PKCS#11)"s, // name
189+
ElectronicID::Type::LuxtrustV2, // type
190+
luxembourgPkcs11ModulePath().make_preferred(), // path
191+
192+
3,
193+
true,
194+
false,
195+
}},
196+
{ElectronicID::Type::LuxEID,
197+
{
198+
"Luxembourg eID (PKCS#11)"s, // name
199+
ElectronicID::Type::LuxEID, // type
200+
luxembourgPkcs11ModulePath().make_preferred(), // path
201+
202+
3,
203+
true,
204+
true,
205+
}},
174206
};
175207

176208
const Pkcs11ElectronicIDModule& getModule(ElectronicID::Type eidType)

0 commit comments

Comments
 (0)