diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6ef975bd7..2eb8b38f1 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -55,7 +55,7 @@ jobs: container: ${{ matrix.container }} strategy: matrix: - container: ['ubuntu:20.04', 'ubuntu:22.04', 'ubuntu:23.04'] + container: ['ubuntu:20.04', 'ubuntu:22.04', 'ubuntu:23.04', 'ubuntu:23.10'] env: DEBIAN_FRONTEND: noninteractive DEBFULLNAME: github-actions @@ -110,7 +110,9 @@ 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 flatbuffers-devel flatbuffers-compiler zlib-devel + run: | + dnf install -y --setopt=install_weak_deps=False \ + 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@v4 with: diff --git a/client/DigiDoc.cpp b/client/DigiDoc.cpp index 1088d27d7..4cb4f683f 100644 --- a/client/DigiDoc.cpp +++ b/client/DigiDoc.cpp @@ -453,6 +453,13 @@ bool DigiDoc::isAsicS() const }); } +bool DigiDoc::isCades() const +{ + return std::any_of(m_signatures.cbegin(), m_signatures.cend(), [](const DigiDocSignature &s) { + return s.profile().contains(QLatin1String("CADES"), Qt::CaseInsensitive); + }); +} + bool DigiDoc::isPDF() const { return b && b->mediaType() == "application/pdf"; @@ -461,7 +468,7 @@ bool DigiDoc::isModified() const { return modified; } bool DigiDoc::isSupported() const { - return b && b->mediaType() == "application/vnd.etsi.asic-e+zip"; + return b && b->mediaType() == "application/vnd.etsi.asic-e+zip" && !isCades(); } QString DigiDoc::mediaType() const diff --git a/client/DigiDoc.h b/client/DigiDoc.h index e9c72b8ad..fa4ba4ab3 100644 --- a/client/DigiDoc.h +++ b/client/DigiDoc.h @@ -127,6 +127,7 @@ class DigiDoc: public QObject DocumentModel *documentModel() const; QString fileName() const; bool isAsicS() const; + bool isCades() const; bool isPDF() const; bool isModified() const; bool isSupported() const; diff --git a/client/common_enums.h b/client/common_enums.h index cf4078d3c..b37184c2f 100644 --- a/client/common_enums.h +++ b/client/common_enums.h @@ -95,6 +95,7 @@ enum WarningType { UnknownSignatureWarning, UnknownTimestampWarning, UnsupportedAsicSWarning, + UnsupportedAsicCadesWarning, UnsupportedDDocWarning, EmptyFileWarning, }; diff --git a/client/translations/en.ts b/client/translations/en.ts index 1d47d11fe..0e1b430dd 100644 --- a/client/translations/en.ts +++ b/client/translations/en.ts @@ -3288,6 +3288,10 @@ Additional licenses and components This ASiC-S container contains XAdES signature. You are not allowed to add or remove signatures to this container. This ASiC-S container contains XAdES signature. You are not allowed to add or remove signatures to this container. + + This container contains CAdES signature. You are not allowed to add or remove signatures to this container. + This container contains CAdES signature. You are not allowed to add or remove signatures to this container. + WarningRibbon diff --git a/client/translations/et.ts b/client/translations/et.ts index 19bf1ad9d..a45cfbf1b 100644 --- a/client/translations/et.ts +++ b/client/translations/et.ts @@ -3286,7 +3286,11 @@ Täiendavad litsentsid ja komponendid This ASiC-S container contains XAdES signature. You are not allowed to add or remove signatures to this container. - Tegemist on XAdES allkirja sisalduva ASiC-S ümbrikuga. Sellele ümbrikule ei saa allkirja lisada ega eemaldada. + Tegemist on XAdES allkirja sisaldava ASiC-S ümbrikuga. Sellele ümbrikule ei saa allkirja lisada ega eemaldada. + + + This container contains CAdES signature. You are not allowed to add or remove signatures to this container. + Tegemist on CAdES allkirja sisaldava ümbrikuga. Sellele ümbrikule ei saa allkirja lisada ega eemaldada. diff --git a/client/translations/ru.ts b/client/translations/ru.ts index 40d8200d0..621801b4d 100644 --- a/client/translations/ru.ts +++ b/client/translations/ru.ts @@ -3293,6 +3293,10 @@ Additional licenses and components This ASiC-S container contains XAdES signature. You are not allowed to add or remove signatures to this container. Речь идет о конверте ASiC-S, содержащемся в подписи XAdES. К данному контейнеру нельзя добавить или удалить из него подпись. + + This container contains CAdES signature. You are not allowed to add or remove signatures to this container. + Этот контейнер содержит подпись CAdES. К данному контейнеру нельзя добавить или удалить из него подпись. + WarningRibbon diff --git a/client/widgets/ContainerPage.cpp b/client/widgets/ContainerPage.cpp index 272c0aed9..dba8bc5a1 100644 --- a/client/widgets/ContainerPage.cpp +++ b/client/widgets/ContainerPage.cpp @@ -334,6 +334,8 @@ void ContainerPage::transition(DigiDoc* container) emit warning(UnsupportedDDocWarning); if(container->isAsicS()) emit warning(UnsupportedAsicSWarning); + if(container->isCades()) + emit warning(UnsupportedAsicCadesWarning); hasEmptyFile = false; for (auto i = 0; i < container->documentModel()->rowCount(); i++) diff --git a/client/widgets/WarningItem.cpp b/client/widgets/WarningItem.cpp index d59abce8e..d5656a212 100644 --- a/client/widgets/WarningItem.cpp +++ b/client/widgets/WarningItem.cpp @@ -141,8 +141,16 @@ void WarningItem::lookupWarning() warnText.details = tr("More information"); warnText.page = ria::qdigidoc4::SignDetails; break; + case ria::qdigidoc4::UnsupportedAsicCadesWarning: + warnText.text = tr("This container contains CAdES signature. " + "You are not allowed to add or remove signatures to this container."); + warnText.url = tr("https://www.id.ee/en/article/digidoc-container-format-life-cycle-2/"); + warnText.details = tr("More information"); + warnText.page = ria::qdigidoc4::SignDetails; + break; case ria::qdigidoc4::UnsupportedDDocWarning: - warnText.text = tr("The current file is a DigiDoc container that is not supported officially any longer. You are not allowed to add or remove signatures to this container."); + warnText.text = tr("The current file is a DigiDoc container that is not supported officially any longer. " + "You are not allowed to add or remove signatures to this container."); warnText.url = tr("https://www.id.ee/en/article/digidoc-container-format-life-cycle-2/"); warnText.details = tr("More information"); warnText.page = ria::qdigidoc4::SignDetails;