diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6ef975bd7..8782b9332 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -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 dd32f8bc0..06e096d9f 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. + + The current file is a ASiC container with CAdES signatures that is not supported currently. You are not allowed to add or remove signatures to this container. + The current file is a ASiC container with CAdES signatures that is not supported currently. 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 4f1fa585c..99ffb7a19 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. + + + The current file is a ASiC container with CAdES signatures that is not supported currently. 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 6646ad3d3..a22126cfb 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. К данному контейнеру нельзя добавить или удалить из него подпись. + + The current file is a ASiC container with CAdES signatures that is not supported currently. You are not allowed to add or remove signatures to this container. + Этот контейнер содержит подпись КАДЕС. К данному контейнеру нельзя добавить или удалить из него подпись. + 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..b62d28266 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("The current file is a ASiC container with CAdES signatures that is not supported currently. " + "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;