Skip to content

Commit

Permalink
CDoc 2.0 (open-eid#1077)
Browse files Browse the repository at this point in the history
CDOC-1

Signed-off-by: Raul Metsma <[email protected]>
  • Loading branch information
metsma authored Jul 14, 2023
1 parent 6908762 commit e08c566
Show file tree
Hide file tree
Showing 60 changed files with 3,522 additions and 1,423 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
env:
HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK: YES
run: |
brew install ninja
brew install ninja flatbuffers
HASH=($(shasum prepare_osx_build_environment.sh))
curl -O -L -s https://installer.id.ee/media/github/opensc_0.22.0.pkg
curl -O -L -s https://installer.id.ee/media/github/${HASH}.zip
Expand Down Expand Up @@ -63,10 +63,10 @@ jobs:
steps:
- name: Install dependencies
if: matrix.container == 'ubuntu:20.04'
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
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
- name: Install dependencies
if: matrix.container != 'ubuntu:20.04'
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
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
- name: Checkout
uses: actions/checkout@v3
with:
Expand Down Expand Up @@ -110,7 +110,7 @@ jobs:
MAKEFLAGS: -j3
steps:
- name: Install Deps
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
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
- name: Checkout
uses: actions/checkout@v3
with:
Expand Down Expand Up @@ -169,7 +169,7 @@ jobs:
- name: Prepare vcpkg
uses: lukka/run-vcpkg@v7
with:
vcpkgArguments: openssl
vcpkgArguments: openssl zlib flatbuffers
vcpkgGitCommitId: 9b9c2758ece1d8ac0de90589730bb5ccf45c0874
vcpkgTriplet: x64-windows
- name: Install Qt
Expand Down Expand Up @@ -257,7 +257,7 @@ jobs:
with:
submodules: recursive
- name: Install dependencies
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
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
- name: Download artifact
uses: dawidd6/action-download-artifact@v2
with:
Expand Down
4 changes: 4 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,13 @@ find_package(LibDigiDocpp 3.15.0 REQUIRED)
find_package( LDAP REQUIRED )
find_package(QT NAMES Qt6 Qt5 COMPONENTS Core REQUIRED)
find_package(Qt${QT_VERSION_MAJOR} 5.12.0 REQUIRED COMPONENTS Core Widgets Network PrintSupport Svg LinguistTools)
find_package(FlatBuffers CONFIG REQUIRED NAMES FlatBuffers Flatbuffers)
find_package(ZLIB REQUIRED)

set_env( TSL_URL "https://ec.europa.eu/tools/lotl/eu-lotl.xml" CACHE STRING "TSL trust list primary URL" )
set_env( TSL_INCLUDE "EE" CACHE STRING "TSL list include in binary" )
set_env(CDOC2_GET_URL "https://cdoc2-keyserver-get" CACHE STRING "CDoc 2.0 Key Server get URL")
set_env(CDOC2_POST_URL "https://cdoc2-keyserver-post" CACHE STRING "CDoc 2.0 Key Server post URL")
set_env( MOBILEID_URL "https://dd-mid.ria.ee/mid-api" CACHE STRING "URL for Mobile-ID" )
set_env( SMARTID_URL "https://dd-sid.ria.ee/v1" CACHE STRING "URL for Smart-ID" )
set(CMAKE_INTERPROCEDURAL_OPTIMIZATION YES)
Expand Down
22 changes: 8 additions & 14 deletions client/Application.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -224,12 +224,6 @@ class DigidocConf final: public digidoc::XmlConfCurrent
{
if(Settings::TSA_URL == Application::confValue(Settings::TSA_URL.KEY).toString())
Settings::TSA_URL.clear(); // Cleanup user conf if it is default url
QList<QSslCertificate> list;
for(const auto &cert: Application::confValue(QLatin1String("CERT-BUNDLE")).toArray())
list.append(QSslCertificate(fromBase64(cert), QSsl::Der));
QSslConfiguration ssl = QSslConfiguration::defaultConfiguration();
ssl.setCaCertificates(list);
QSslConfiguration::setDefaultConfiguration(ssl);
}
#endif

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

void Application::parseArgs(QStringList args)
{
bool crypto = args.contains(QLatin1String("-crypto"));
bool sign = args.contains(QLatin1String("-sign"));
bool newWindow = args.contains(QLatin1String("-newWindow"));
args.removeAll(QStringLiteral("-sign"));
args.removeAll(QStringLiteral("-crypto"));
args.removeAll(QStringLiteral("-newWindow"));
QString suffix = args.size() == 1 ? QFileInfo(args.value(0)).suffix() : QString();
showClient(args, crypto || (suffix.compare(QLatin1String("cdoc"), Qt::CaseInsensitive) == 0), sign, newWindow);
bool crypto = args.removeAll(QStringLiteral("-crypto")) > 0;
bool sign = args.removeAll(QStringLiteral("-sign")) > 0;
bool newWindow = args.removeAll(QStringLiteral("-newWindow")) > 0;
if(QString suffix = args.value(0);
suffix.endsWith(QLatin1String(".cdoc"), Qt::CaseInsensitive) ||
suffix.endsWith(QLatin1String(".cdoc2"), Qt::CaseInsensitive))
crypto = true;
showClient(args, crypto, sign, newWindow);
}

uint Application::readTSLVersion(const QString &path)
Expand Down
Loading

0 comments on commit e08c566

Please sign in to comment.