Skip to content

Commit e08c566

Browse files
authored
CDoc 2.0 (#1077)
CDOC-1 Signed-off-by: Raul Metsma <[email protected]>
1 parent 6908762 commit e08c566

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+3522
-1423
lines changed

.github/workflows/build.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
env:
2929
HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK: YES
3030
run: |
31-
brew install ninja
31+
brew install ninja flatbuffers
3232
HASH=($(shasum prepare_osx_build_environment.sh))
3333
curl -O -L -s https://installer.id.ee/media/github/opensc_0.22.0.pkg
3434
curl -O -L -s https://installer.id.ee/media/github/${HASH}.zip
@@ -63,10 +63,10 @@ jobs:
6363
steps:
6464
- name: Install dependencies
6565
if: matrix.container == 'ubuntu:20.04'
66-
run: apt update -qq && apt install --no-install-recommends -y git lsb-release fakeroot build-essential devscripts debhelper cdbs pkg-config cmake libldap2-dev gettext libpcsclite-dev libssl-dev libqt5svg5-dev qttools5-dev-tools qttools5-dev lintian
66+
run: apt update -qq && apt install --no-install-recommends -y git lsb-release fakeroot build-essential devscripts debhelper cdbs pkg-config cmake libldap2-dev gettext libpcsclite-dev libssl-dev libqt5svg5-dev qttools5-dev-tools qttools5-dev lintian libflatbuffers-dev zlib1g-dev
6767
- name: Install dependencies
6868
if: matrix.container != 'ubuntu:20.04'
69-
run: apt update -qq && apt install --no-install-recommends -y git lsb-release fakeroot build-essential devscripts debhelper cdbs pkg-config cmake libldap2-dev gettext libpcsclite-dev libssl-dev libgl-dev libqt6svg6-dev qt6-tools-dev qt6-tools-dev-tools qt6-l10n-tools libqt6core5compat6-dev lintian
69+
run: apt update -qq && apt install --no-install-recommends -y git lsb-release fakeroot build-essential devscripts debhelper cdbs pkg-config cmake libldap2-dev gettext libpcsclite-dev libssl-dev libgl-dev libqt6svg6-dev qt6-tools-dev qt6-tools-dev-tools qt6-l10n-tools libqt6core5compat6-dev lintian libflatbuffers-dev zlib1g-dev
7070
- name: Checkout
7171
uses: actions/checkout@v3
7272
with:
@@ -110,7 +110,7 @@ jobs:
110110
MAKEFLAGS: -j3
111111
steps:
112112
- name: Install Deps
113-
run: dnf install -y git gcc-c++ cmake rpm-build gettext openssl-devel openldap-devel pcsc-lite-devel qt6-qtsvg-devel qt6-qttools-devel qt6-qt5compat-devel
113+
run: dnf install -y git gcc-c++ cmake rpm-build gettext openssl-devel openldap-devel pcsc-lite-devel qt6-qtsvg-devel qt6-qttools-devel qt6-qt5compat-devel flatbuffers-devel flatbuffers-compiler zlib-devel
114114
- name: Checkout
115115
uses: actions/checkout@v3
116116
with:
@@ -169,7 +169,7 @@ jobs:
169169
- name: Prepare vcpkg
170170
uses: lukka/run-vcpkg@v7
171171
with:
172-
vcpkgArguments: openssl
172+
vcpkgArguments: openssl zlib flatbuffers
173173
vcpkgGitCommitId: 9b9c2758ece1d8ac0de90589730bb5ccf45c0874
174174
vcpkgTriplet: x64-windows
175175
- name: Install Qt
@@ -257,7 +257,7 @@ jobs:
257257
with:
258258
submodules: recursive
259259
- name: Install dependencies
260-
run: sudo apt update -qq && sudo apt install --no-install-recommends -y cmake libldap2-dev gettext libpcsclite-dev libminizip-dev libxml-security-c-dev libgl-dev libqt6svg6-dev qt6-tools-dev qt6-tools-dev-tools qt6-l10n-tools libqt6core5compat6-dev
260+
run: sudo apt update -qq && sudo apt install --no-install-recommends -y cmake libldap2-dev gettext libpcsclite-dev libminizip-dev libxml-security-c-dev libgl-dev libqt6svg6-dev qt6-tools-dev qt6-tools-dev-tools qt6-l10n-tools libqt6core5compat6-dev libflatbuffers-dev zlib1g-dev
261261
- name: Download artifact
262262
uses: dawidd6/action-download-artifact@v2
263263
with:

CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,13 @@ find_package(LibDigiDocpp 3.15.0 REQUIRED)
1313
find_package( LDAP REQUIRED )
1414
find_package(QT NAMES Qt6 Qt5 COMPONENTS Core REQUIRED)
1515
find_package(Qt${QT_VERSION_MAJOR} 5.12.0 REQUIRED COMPONENTS Core Widgets Network PrintSupport Svg LinguistTools)
16+
find_package(FlatBuffers CONFIG REQUIRED NAMES FlatBuffers Flatbuffers)
17+
find_package(ZLIB REQUIRED)
1618

1719
set_env( TSL_URL "https://ec.europa.eu/tools/lotl/eu-lotl.xml" CACHE STRING "TSL trust list primary URL" )
1820
set_env( TSL_INCLUDE "EE" CACHE STRING "TSL list include in binary" )
21+
set_env(CDOC2_GET_URL "https://cdoc2-keyserver-get" CACHE STRING "CDoc 2.0 Key Server get URL")
22+
set_env(CDOC2_POST_URL "https://cdoc2-keyserver-post" CACHE STRING "CDoc 2.0 Key Server post URL")
1923
set_env( MOBILEID_URL "https://dd-mid.ria.ee/mid-api" CACHE STRING "URL for Mobile-ID" )
2024
set_env( SMARTID_URL "https://dd-sid.ria.ee/v1" CACHE STRING "URL for Smart-ID" )
2125
set(CMAKE_INTERPROCEDURAL_OPTIMIZATION YES)

client/Application.cpp

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -224,12 +224,6 @@ class DigidocConf final: public digidoc::XmlConfCurrent
224224
{
225225
if(Settings::TSA_URL == Application::confValue(Settings::TSA_URL.KEY).toString())
226226
Settings::TSA_URL.clear(); // Cleanup user conf if it is default url
227-
QList<QSslCertificate> list;
228-
for(const auto &cert: Application::confValue(QLatin1String("CERT-BUNDLE")).toArray())
229-
list.append(QSslCertificate(fromBase64(cert), QSsl::Der));
230-
QSslConfiguration ssl = QSslConfiguration::defaultConfiguration();
231-
ssl.setCaCertificates(list);
232-
QSslConfiguration::setDefaultConfiguration(ssl);
233227
}
234228
#endif
235229

@@ -798,14 +792,14 @@ void Application::parseArgs( const QString &msg )
798792

799793
void Application::parseArgs(QStringList args)
800794
{
801-
bool crypto = args.contains(QLatin1String("-crypto"));
802-
bool sign = args.contains(QLatin1String("-sign"));
803-
bool newWindow = args.contains(QLatin1String("-newWindow"));
804-
args.removeAll(QStringLiteral("-sign"));
805-
args.removeAll(QStringLiteral("-crypto"));
806-
args.removeAll(QStringLiteral("-newWindow"));
807-
QString suffix = args.size() == 1 ? QFileInfo(args.value(0)).suffix() : QString();
808-
showClient(args, crypto || (suffix.compare(QLatin1String("cdoc"), Qt::CaseInsensitive) == 0), sign, newWindow);
795+
bool crypto = args.removeAll(QStringLiteral("-crypto")) > 0;
796+
bool sign = args.removeAll(QStringLiteral("-sign")) > 0;
797+
bool newWindow = args.removeAll(QStringLiteral("-newWindow")) > 0;
798+
if(QString suffix = args.value(0);
799+
suffix.endsWith(QLatin1String(".cdoc"), Qt::CaseInsensitive) ||
800+
suffix.endsWith(QLatin1String(".cdoc2"), Qt::CaseInsensitive))
801+
crypto = true;
802+
showClient(args, crypto, sign, newWindow);
809803
}
810804

811805
uint Application::readTSLVersion(const QString &path)

0 commit comments

Comments
 (0)