diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 31d46dc..789bf3b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -155,15 +155,6 @@ jobs: with: path: ${{ github.workspace }}/vcpkg_cache key: vcpkg-${{ matrix.image }}-${{ matrix.platform }}-${{ hashFiles('vcpkg.json') }} - - name: Prepare vcpkg - uses: lukka/run-vcpkg@v11 - with: - vcpkgJsonGlob: ./vcpkg.json - runVcpkgInstall: true - runVcpkgFormatString: "[`install`, `--recurse`, `--clean-after-build`, `--x-install-root`, `$[env.VCPKG_INSTALLED_DIR]`, `--triplet`, `$[env.VCPKG_DEFAULT_TRIPLET]`, `--x-feature`, `tests`]" - env: - VCPKG_BINARY_SOURCES: clear;files,${{ github.workspace }}/vcpkg_cache,readwrite - VCPKG_INSTALLED_DIR: ${{ github.workspace }}/build/vcpkg_installed - name: Install dependencies run: winget install --silent --accept-source-agreements --accept-package-agreements swig doxygen - uses: actions/setup-java@v4 @@ -171,10 +162,12 @@ jobs: distribution: 'temurin' java-version: '17' - name: Build + env: + VCPKG_BINARY_SOURCES: clear;files,${{ github.workspace }}/vcpkg_cache,readwrite run: | $swig = (Get-Item "$env:LOCALAPPDATA\Microsoft\WinGet\Links\swig.exe").Target cmake -A ${{ matrix.platform }} -S . -B build -DCMAKE_BUILD_TYPE=RelWithDebInfo ` - "-DCMAKE_TOOLCHAIN_FILE=${{ env.VCPKG_ROOT }}/scripts/buildsystems/vcpkg.cmake" ` + "-DCMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake" ` "-DSWIG_EXECUTABLE=$swig" ` -DVCPKG_TARGET_TRIPLET=${{ env.VCPKG_DEFAULT_TRIPLET }} ` ${{ matrix.platform == 'x64' && '-DVCPKG_MANIFEST_FEATURES=tests' || '' }} ` diff --git a/cdoc/CDoc2Writer.cpp b/cdoc/CDoc2Writer.cpp index f75c850..5458987 100644 --- a/cdoc/CDoc2Writer.cpp +++ b/cdoc/CDoc2Writer.cpp @@ -105,7 +105,7 @@ createRSACapsule(flatbuffers::FlatBufferBuilder& builder, const libcdoc::Recipie return cdoc20::header::CreateRecipientRecord(builder, cdoc20::header::Capsule::recipients_RSAPublicKeyCapsule, capsule.Union(), - builder.CreateString(rcpt.getLabel({{"x-expiry-time", rcpt.expiry_ts == 0 ? std::string() : std::to_string(rcpt.expiry_ts)}})), + builder.CreateString(rcpt.getLabel({{"server_exp", rcpt.expiry_ts == 0 ? std::string() : std::to_string(rcpt.expiry_ts)}})), builder.CreateVector(xor_key), cdoc20::header::FMKEncryptionMethod::XOR); } @@ -123,7 +123,7 @@ createRSAServerCapsule(flatbuffers::FlatBufferBuilder& builder, const libcdoc::R return cdoc20::header::CreateRecipientRecord(builder, cdoc20::header::Capsule::recipients_KeyServerCapsule, capsule.Union(), - builder.CreateString(rcpt.getLabel({{"x-expiry-time", std::to_string(expiry_time)}})), + builder.CreateString(rcpt.getLabel({{"server_exp", std::to_string(expiry_time)}})), builder.CreateVector(xor_key), cdoc20::header::FMKEncryptionMethod::XOR); } @@ -138,7 +138,7 @@ createECCCapsule(flatbuffers::FlatBufferBuilder& builder, const libcdoc::Recipie return cdoc20::header::CreateRecipientRecord(builder, cdoc20::header::Capsule::recipients_ECCPublicKeyCapsule, capsule.Union(), - builder.CreateString(rcpt.getLabel({{"x-expiry-time", rcpt.expiry_ts == 0 ? std::string() : std::to_string(rcpt.expiry_ts)}})), + builder.CreateString(rcpt.getLabel({{"server_exp", rcpt.expiry_ts == 0 ? std::string() : std::to_string(rcpt.expiry_ts)}})), builder.CreateVector(xor_key), cdoc20::header::FMKEncryptionMethod::XOR); } @@ -157,7 +157,7 @@ createECCServerCapsule(flatbuffers::FlatBufferBuilder& builder, const libcdoc::R return cdoc20::header::CreateRecipientRecord(builder, cdoc20::header::Capsule::recipients_KeyServerCapsule, capsule.Union(), - builder.CreateString(rcpt.getLabel({{"x-expiry-time", std::to_string(expiry_time)}})), + builder.CreateString(rcpt.getLabel({{"server_exp", std::to_string(expiry_time)}})), builder.CreateVector(xor_key), cdoc20::header::FMKEncryptionMethod::XOR); } diff --git a/cdoc/Recipient.cpp b/cdoc/Recipient.cpp index fe604f5..5d9b4d0 100644 --- a/cdoc/Recipient.cpp +++ b/cdoc/Recipient.cpp @@ -142,8 +142,13 @@ Recipient::isTheSameRecipient(const std::vector& public_key) const static Recipient::EIDType getEIDType(const std::vector& policies) { - for (const auto& policy : policies) + for (const auto& pol : policies) { + std::string_view policy = pol; + if (policy.starts_with("2.999.")) { // Zetes TEST OID prefix + policy = policy.substr(6); + } + if (policy.starts_with("1.3.6.1.4.1.51361.1.1.3") || policy.starts_with("1.3.6.1.4.1.51361.1.2.3")) { return Recipient::EIDType::DigiID;