Skip to content

Commit

Permalink
Verify file w/o identity, support additional chipsets
Browse files Browse the repository at this point in the history
There is no mention of version in the project. Add VERSION file under
revision control to track it.

Add support for Actalis and Bit4id cards to middleware. Move ATR
handling logic to dedicated unit.

Signature info is missing id-aa-signingCertificateV2 attribute. Add it.

Verifying a file in CIEID requires selecting an associated identity.
Use a separate flow instead.

Remove build dependencies and static library as in macOS and Windows
repositories.
  • Loading branch information
adab4d committed May 13, 2022
1 parent 9e8229d commit 0b7c570
Show file tree
Hide file tree
Showing 371 changed files with 1,172 additions and 124,542 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@ Release/
build/
dist/
cie-pkcs11/dependencies/*.a
packages/**/*.jar
packages/**/*.deb
packages/**/*.rpm
*.gz
*.so
libcie_sign_sdk.a
4 changes: 2 additions & 2 deletions .settings/language.settings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<provider copy-of="extension" id="org.eclipse.cdt.ui.UserLanguageSettingsProvider"/>
<provider-reference id="org.eclipse.cdt.core.ReferencedProjectsLanguageSettingsProvider" ref="shared-provider"/>
<provider-reference id="org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider" ref="shared-provider"/>
<provider class="org.eclipse.cdt.managedbuilder.language.settings.providers.GCCBuiltinSpecsDetector" console="false" env-hash="-103356951004407181" id="org.eclipse.cdt.managedbuilder.core.GCCBuiltinSpecsDetector" keep-relative-paths="false" name="CDT GCC Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true">
<provider class="org.eclipse.cdt.managedbuilder.language.settings.providers.GCCBuiltinSpecsDetector" console="false" env-hash="1631232521965029824" id="org.eclipse.cdt.managedbuilder.core.GCCBuiltinSpecsDetector" keep-relative-paths="false" name="CDT GCC Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true">
<language-scope id="org.eclipse.cdt.core.gcc"/>
<language-scope id="org.eclipse.cdt.core.g++"/>
</provider>
Expand All @@ -16,7 +16,7 @@
<provider copy-of="extension" id="org.eclipse.cdt.ui.UserLanguageSettingsProvider"/>
<provider-reference id="org.eclipse.cdt.core.ReferencedProjectsLanguageSettingsProvider" ref="shared-provider"/>
<provider-reference id="org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider" ref="shared-provider"/>
<provider class="org.eclipse.cdt.managedbuilder.language.settings.providers.GCCBuiltinSpecsDetector" console="false" env-hash="-103356951004407181" id="org.eclipse.cdt.managedbuilder.core.GCCBuiltinSpecsDetector" keep-relative-paths="false" name="CDT GCC Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true">
<provider class="org.eclipse.cdt.managedbuilder.language.settings.providers.GCCBuiltinSpecsDetector" console="false" env-hash="1631232521965029824" id="org.eclipse.cdt.managedbuilder.core.GCCBuiltinSpecsDetector" keep-relative-paths="false" name="CDT GCC Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true">
<language-scope id="org.eclipse.cdt.core.gcc"/>
<language-scope id="org.eclipse.cdt.core.g++"/>
</provider>
Expand Down
11 changes: 11 additions & 0 deletions CIEID/.project
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,15 @@
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
<filteredResources>
<filter>
<id>1650481512020</id>
<name></name>
<type>30</type>
<matcher>
<id>org.eclipse.core.resources.regexFilterMatcher</id>
<arguments>node_modules|.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__</arguments>
</matcher>
</filter>
</filteredResources>
</projectDescription>
1,647 changes: 536 additions & 1,111 deletions CIEID/src/it/ipzs/cieid/MainFrame.java

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions TestCIE/.settings/language.settings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<provider copy-of="extension" id="org.eclipse.cdt.ui.UserLanguageSettingsProvider"/>
<provider-reference id="org.eclipse.cdt.core.ReferencedProjectsLanguageSettingsProvider" ref="shared-provider"/>
<provider-reference id="org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider" ref="shared-provider"/>
<provider class="org.eclipse.cdt.managedbuilder.language.settings.providers.GCCBuiltinSpecsDetector" console="false" env-hash="1715968884447880600" id="org.eclipse.cdt.managedbuilder.core.GCCBuiltinSpecsDetector" keep-relative-paths="false" name="CDT GCC Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true">
<provider class="org.eclipse.cdt.managedbuilder.language.settings.providers.GCCBuiltinSpecsDetector" console="false" env-hash="1631232521965029824" id="org.eclipse.cdt.managedbuilder.core.GCCBuiltinSpecsDetector" keep-relative-paths="false" name="CDT GCC Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true">
<language-scope id="org.eclipse.cdt.core.gcc"/>
<language-scope id="org.eclipse.cdt.core.g++"/>
</provider>
Expand All @@ -16,7 +16,7 @@
<provider copy-of="extension" id="org.eclipse.cdt.ui.UserLanguageSettingsProvider"/>
<provider-reference id="org.eclipse.cdt.core.ReferencedProjectsLanguageSettingsProvider" ref="shared-provider"/>
<provider-reference id="org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider" ref="shared-provider"/>
<provider class="org.eclipse.cdt.managedbuilder.language.settings.providers.GCCBuiltinSpecsDetector" console="false" env-hash="1715968884447880600" id="org.eclipse.cdt.managedbuilder.core.GCCBuiltinSpecsDetector" keep-relative-paths="false" name="CDT GCC Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true">
<provider class="org.eclipse.cdt.managedbuilder.language.settings.providers.GCCBuiltinSpecsDetector" console="false" env-hash="1631232521965029824" id="org.eclipse.cdt.managedbuilder.core.GCCBuiltinSpecsDetector" keep-relative-paths="false" name="CDT GCC Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true">
<language-scope id="org.eclipse.cdt.core.gcc"/>
<language-scope id="org.eclipse.cdt.core.g++"/>
</provider>
Expand Down
13 changes: 13 additions & 0 deletions TestCIE/.settings/org.eclipse.cdt.managedbuilder.core.prefs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
eclipse.preferences.version=1
environment/buildEnvironmentInclude/cdt.managedbuild.config.gnu.exe.debug.1271518045/CPATH/delimiter=\:
environment/buildEnvironmentInclude/cdt.managedbuild.config.gnu.exe.debug.1271518045/CPATH/operation=remove
environment/buildEnvironmentInclude/cdt.managedbuild.config.gnu.exe.debug.1271518045/CPLUS_INCLUDE_PATH/delimiter=\:
environment/buildEnvironmentInclude/cdt.managedbuild.config.gnu.exe.debug.1271518045/CPLUS_INCLUDE_PATH/operation=remove
environment/buildEnvironmentInclude/cdt.managedbuild.config.gnu.exe.debug.1271518045/C_INCLUDE_PATH/delimiter=\:
environment/buildEnvironmentInclude/cdt.managedbuild.config.gnu.exe.debug.1271518045/C_INCLUDE_PATH/operation=remove
environment/buildEnvironmentInclude/cdt.managedbuild.config.gnu.exe.debug.1271518045/append=true
environment/buildEnvironmentInclude/cdt.managedbuild.config.gnu.exe.debug.1271518045/appendContributed=true
environment/buildEnvironmentLibrary/cdt.managedbuild.config.gnu.exe.debug.1271518045/LIBRARY_PATH/delimiter=\:
environment/buildEnvironmentLibrary/cdt.managedbuild.config.gnu.exe.debug.1271518045/LIBRARY_PATH/operation=remove
environment/buildEnvironmentLibrary/cdt.managedbuild.config.gnu.exe.debug.1271518045/append=true
environment/buildEnvironmentLibrary/cdt.managedbuild.config.gnu.exe.debug.1271518045/appendContributed=true
1 change: 1 addition & 0 deletions VERSION
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1.4.3-2
52 changes: 52 additions & 0 deletions cie-pkcs11/CSP/ATR.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
#include "ATR.h"
#include "../LOGGER/Logger.h"
#include <algorithm>

using namespace CieIDLogger;

cie_atr atr_list[] = {
{CIE_Type::CIE_NXP, "NXP", { 0x80, 0x31, 0x80, 0x65, 0x49, 0x54, 0x4E, 0x58, 0x50, 0x12, 0x0F, 0xFF, 0x82, 0x90, 0xF0 }},
{CIE_Type::CIE_Gemalto, "Gemalto", { 0x80, 0x31, 0x80, 0x65, 0xB0, 0x85, 0x04, 0x00, 0x11 }},
{CIE_Type::CIE_Gemalto, "Gemalto2", {0x80, 0x31, 0x80, 0x65, 0xB0, 0x85, 0x03, 0x00, 0xEF }},
{CIE_Type::CIE_STM,"STM", {0x80, 0x66, 0x47, 0x50, 0x00, 0xB8, 0x00, 0x7F }},
{CIE_Type::CIE_STM2,"STM2", { 0x80, 0x80, 0x01, 0x01 }},
{CIE_Type::CIE_STM3,"STM3", {0x80, 0x01, 0x80, 0x66, 0x47, 0x50, 0x00, 0xB8, 0x00, 0x94, 0x82, 0x90, 0x00, 0xC5 }},
{CIE_Type::CIE_ACTALIS,"Actalis", {0x80, 0x01, 0x80, 0x31, 0x80, 0x65, 0x49, 0x54, 0x4a, 0x34, 0x41, 0x12, 0x0f, 0xff, 0x82, 0x90, 0x00, 0x88 }},
{CIE_Type::CIE_BIT4ID, "Bit4Id", {0x80, 0x01, 0x80, 0x31, 0x80, 0x65, 0x49, 0x54, 0x4a, 0x34, 0x42, 0x12, 0x0f, 0xff, 0x82, 0x90, 0x00, 0x8b }}
};


template <typename T>
bool IsSubset(std::vector<T> A, std::vector<T> B)
{
if (A.size() < B.size())
return false;

sort(A.begin(), A.end());
sort(B.begin(), B.end());
return includes(A.begin(), A.end(), B.begin(), B.end());
}

string get_manufacturer(vector<uint8_t> atr) {

for (cie_atr el : atr_list) {
if (IsSubset(atr, el.atr)) {
LOG_INFO("ReadCIEType - CIE %s detected", el.type.c_str());
return el.type;
}
}

return "";
}

CIE_Type get_type(vector<uint8_t> atr) {


for (cie_atr el : atr_list) {
if (IsSubset(atr, el.atr)) {
return el.cie_type;
}
}

return CIE_Type::CIE_Unknown;
}
33 changes: 33 additions & 0 deletions cie-pkcs11/CSP/ATR.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#ifndef _CIE_ATR_H_
#define _CIE_ATR_H_

#include <iostream>
#include <string>
#include <vector>
#include <stdint.h>

using namespace std;

enum CIE_Type {
CIE_Unknown,
CIE_Gemalto,
CIE_STM,
CIE_STM2,
CIE_STM3,
CIE_NXP,
CIE_ACTALIS,
CIE_BIT4ID
};

typedef struct _cie_atr {
CIE_Type cie_type;
string type;
vector<uint8_t> atr;
}cie_atr;


string get_manufacturer(vector<uint8_t> atr);
CIE_Type get_type(vector<uint8_t> atr);

#endif // _CIE_ATR_H_

Loading

0 comments on commit 0b7c570

Please sign in to comment.