Skip to content

Commit

Permalink
Use libxml2/xmsec1 for TSL parsing and validation (#604)
Browse files Browse the repository at this point in the history
IB-7947

Signed-off-by: Raul Metsma <raul@metsma.ee>
  • Loading branch information
metsma authored Jul 19, 2024
1 parent 0adcc6b commit bc518d4
Show file tree
Hide file tree
Showing 37 changed files with 1,391 additions and 1,994 deletions.
13 changes: 8 additions & 5 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ permissions:
env:
BUILD_NUMBER: ${{ github.run_number }}
CMAKE_BUILD_PARALLEL_LEVEL: 4
UBUNTU_DEPS: cmake xsdcxx libxml-security-c-dev libxml2-dev zlib1g-dev
UBUNTU_DEPS: cmake xsdcxx libxml-security-c-dev libxml2-dev libxmlsec1-dev zlib1g-dev
jobs:
macos:
name: Build on macOS for ${{ matrix.target }}
Expand Down Expand Up @@ -47,6 +47,9 @@ jobs:
- name: Build libxml2
if: steps.cache.outputs.cache-hit != 'true'
run: ./prepare_osx_build_environment.sh libxml2 ${{ matrix.target }}
- name: Build xmlsec1
if: steps.cache.outputs.cache-hit != 'true'
run: ./prepare_osx_build_environment.sh xmlasec ${{ matrix.target }}
- name: Move to cache
if: steps.cache.outputs.cache-hit != 'true'
run: |
Expand Down Expand Up @@ -86,7 +89,7 @@ jobs:
- name: Install Deps
run: |
dnf install -y --setopt=install_weak_deps=False \
git gcc-c++ cmake rpm-build xml-security-c-devel libxml2-devel zlib-devel doxygen boost-test swig python3-devel java-17-openjdk-devel xsd minizip-devel
git gcc-c++ cmake rpm-build xml-security-c-devel libxml2-devel xmlsec1-openssl-devel libtool-ltdl-devel zlib-devel doxygen boost-test swig python3-devel java-17-openjdk-devel xsd minizip-devel
- name: Install CMake
if: matrix.container == 39
run: |
Expand All @@ -113,14 +116,14 @@ jobs:
container: ubuntu:${{ matrix.container }}
strategy:
matrix:
container: ['20.04', '22.04', '23.10', '24.04']
container: ['20.04', '22.04', '24.04']
env:
DEBIAN_FRONTEND: noninteractive
DEBFULLNAME: github-actions
DEBEMAIL: github-actions@github.com
steps:
- name: Install dependencies
run: apt update -qq && apt install --no-install-recommends -y git lsb-release build-essential devscripts debhelper ${UBUNTU_DEPS} doxygen swig openjdk-11-jdk-headless libpython3-dev python3-setuptools libboost-test-dev lintian
run: apt update -qq && apt install --no-install-recommends -y git lsb-release build-essential devscripts debhelper lintian pkg-config ${UBUNTU_DEPS} doxygen swig openjdk-11-jdk-headless libpython3-dev python3-setuptools libboost-test-dev
- name: Checkout
uses: actions/checkout@v4
with:
Expand Down Expand Up @@ -217,7 +220,7 @@ jobs:
cmake -B build -S .
cmake --build build --target docs
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./build/doc
Expand Down
19 changes: 17 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,12 @@ endif()
if(POLICY CMP0122)
cmake_policy(SET CMP0122 NEW)
endif()
if(POLICY CMP0167)
cmake_policy(SET CMP0167 NEW)
endif()
project(libdigidocpp VERSION 3.18.0)
set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/modules)
list(APPEND CMAKE_PREFIX_PATH ${CMAKE_INSTALL_PREFIX})

include(VersionInfo)
include(GNUInstallDirs)
Expand Down Expand Up @@ -52,9 +56,20 @@ find_package(XmlSecurityC REQUIRED)
find_package(XSD 4.0 REQUIRED)
find_package(ZLIB REQUIRED)
find_package(MiniZip 1 QUIET)
if(UNIX AND NOT APPLE)
add_library(xmlsec INTERFACE)
if(UNIX)
find_package(PkgConfig)
pkg_check_modules(MINIZIP minizip IMPORTED_TARGET)
pkg_check_modules(XMLSEC1_OPENSSL xmlsec1-openssl REQUIRED IMPORTED_TARGET)
target_link_libraries(xmlsec INTERFACE PkgConfig::XMLSEC1_OPENSSL)
if(NOT APPLE)
pkg_check_modules(MINIZIP minizip IMPORTED_TARGET)
endif()
else()
find_package(unofficial-xmlsec REQUIRED)
target_link_libraries(xmlsec INTERFACE
unofficial::xmlsec::xmlsec1
unofficial::xmlsec::xmlsec1-openssl
)
endif()
find_package(SWIG)
if(SWIG_FOUND)
Expand Down
2 changes: 2 additions & 0 deletions debian/control
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,12 @@ Priority: optional
Maintainer: RIA <info@ria.ee>
Build-Depends:
debhelper-compat (= 12),
pkg-config,
cmake,
libxml-security-c-dev,
xsdcxx (>= 4.0) | xsd (>= 4.0),
libxml2-dev,
libxmlsec1-dev,
doxygen,
swig,
java11-sdk-headless,
Expand Down
43 changes: 0 additions & 43 deletions etc/schema/ts_119612v020101_additionaltypes_xsd.xsd

This file was deleted.

43 changes: 0 additions & 43 deletions etc/schema/ts_119612v020101_additionaltypes_xsd.xsd.orig

This file was deleted.

92 changes: 0 additions & 92 deletions etc/schema/ts_119612v020101_sie_xsd.xsd

This file was deleted.

Loading

0 comments on commit bc518d4

Please sign in to comment.