summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Shadura <andrewsh@debian.org>2018-04-25 15:38:01 +0200
committerAndrew Shadura <andrewsh@debian.org>2018-04-25 15:38:01 +0200
commit3259ab99df8d8746a46ca7469635751f604e42fc (patch)
tree29219f0e5c8ae9a2e099781167592fe8bfa0b5a0
parent61c1a106bd81794f48e4cd85bae129f9270279e8 (diff)
New upstream version 3.10.4+ds1
-rw-r--r--.gitignore10
-rw-r--r--.gitmodules6
-rw-r--r--.travis.yml91
-rw-r--r--CMakeLists.txt32
-rw-r--r--RELEASE-NOTES.md (renamed from RELEASE-NOTES.txt)360
-rw-r--r--cmake/modules/FindLibDigiDoc.cmake2
-rw-r--r--cmake/modules/FindLibDigiDocpp.cmake2
-rw-r--r--cmake/modules/FindPoDoFo.cmake28
-rw-r--r--cmake/modules/FindXSD.cmake7
-rw-r--r--cmake/modules/FindXercesC.cmake6
-rw-r--r--cmake/modules/FindXmlSecurityC.cmake10
-rw-r--r--cmake/modules/ID.icobin0 -> 7358 bytes
-rw-r--r--cmake/modules/MacOSXBundleInfo.plist.in2
-rw-r--r--cmake/modules/VersionInfo.cmake84
-rw-r--r--cmake/modules/WelcomeDlg2.wxs42
-rw-r--r--cmake/modules/WixUI_Minimal2.wxs64
-rw-r--r--cmake/modules/banner.bmpbin0 -> 85896 bytes
-rw-r--r--cmake/modules/dlgbmp.bmpbin0 -> 461816 bytes
-rw-r--r--config.h.cmake2
-rw-r--r--debian/changelog6
-rw-r--r--debian/control70
-rw-r--r--debian/copyright37
-rw-r--r--debian/patches/01-manpage.patch32
-rw-r--r--debian/patches/02-no-rpath.patch12
-rw-r--r--debian/patches/series2
-rwxr-xr-xdebian/rules25
-rw-r--r--debian/watch3
-rw-r--r--etc/certs/ESTEID-SK 2015.crt37
-rw-r--r--etc/certs/TEST ESTEID-SK 2015.crt37
-rw-r--r--etc/digidoc.conf.cmake34
-rw-r--r--libdigidoc/CMakeLists.txt60
-rw-r--r--libdigidoc/DigiDocCert.c73
-rw-r--r--libdigidoc/DigiDocConfig.c3
-rw-r--r--libdigidoc/DigiDocConvert.c52
-rw-r--r--libdigidoc/DigiDocDefs.h2
-rw-r--r--libdigidoc/DigiDocDfExtract.c31
-rw-r--r--libdigidoc/DigiDocEnc.c54
-rw-r--r--libdigidoc/DigiDocEncSAXParser.c44
-rw-r--r--libdigidoc/DigiDocGen.c58
-rw-r--r--libdigidoc/DigiDocLib.c35
-rw-r--r--libdigidoc/DigiDocOCSP.c279
-rw-r--r--libdigidoc/DigiDocObj.c150
-rw-r--r--libdigidoc/DigiDocSAXParser.c32
-rw-r--r--libdigidoc/DigiDocVerify.c99
-rw-r--r--libdigidoc/cdigidoc.rc16
-rw-r--r--libdigidoc/libdigidoc.rc16
-rw-r--r--libxml2-2.9.2-patches.zipbin7018 -> 0 bytes
-rw-r--r--prepare_win_build_environment.ps19
-rw-r--r--vc2008/cdigidoc.vcproj207
-rw-r--r--vc2008/libdigidoc.ncbbin27675648 -> 0 bytes
-rw-r--r--vc2008/libdigidoc.sln37
-rw-r--r--vc2008/libdigidoc.suobin53248 -> 0 bytes
-rw-r--r--vc2008/libdigidoc.vcproj406
-rw-r--r--vc2008/libdigidoc_vs.sln37
-rw-r--r--vc2010/DigiDocLib.vcxproj206
-rw-r--r--vc2010/digidoc.vcxproj146
-rw-r--r--vc2010/libdigidoc.sln61
57 files changed, 1246 insertions, 1910 deletions
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..f1590b7
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,10 @@
+*.suo
+*.ncb
+*.pch
+*.pdb
+CMakeCache.txt
+CMakeFiles
+CMakeScripts
+Makefile
+cmake_install.cmake
+install_manifest.txt
diff --git a/.gitmodules b/.gitmodules
new file mode 100644
index 0000000..83f5d10
--- /dev/null
+++ b/.gitmodules
@@ -0,0 +1,6 @@
+[submodule "etc/certs"]
+ path = etc/certs
+ url = ../certs
+[submodule "cmake"]
+ path = cmake
+ url = ../cmake
diff --git a/.travis.yml b/.travis.yml
index 528953b..4a47595 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,31 +1,68 @@
+language: c++
+matrix:
+ include:
+ - os: linux
+ env: TARGET=ubuntu:16.04
+ sudo: false
+ - os: linux
+ env: TARGET=ubuntu:18.04
+ sudo: false
+ - os: linux
+ env: TARGET=i386/ubuntu:16.04
+ sudo: false
+ - os: osx
+ env: TARGET=osx
+sudo: required
+dist: trusty
+osx_image: xcode9.2
+services:
+- docker
+cache: ccache
+env:
+ global:
+ - BUILD_NUMBER=${TRAVIS_BUILD_NUMBER}
before_install: if [ "${TRAVIS_OS_NAME}" = "osx" ]; then
brew update;
- else
- sudo apt-get update -qq;
- sudo apt-get install -y cmake libxml2-dev libssl-dev;
+ brew install openssl;
fi
-script:
-- mkdir build
-- cd build
-- cmake ..
-- make
-
-os:
- - linux
- - osx
-
-env:
- global:
- # The next declaration is the encrypted COVERITY_SCAN_TOKEN, created
- # via the "travis encrypt" command using the project repo's public key
- - secure: "AhDg868E2SgZbGhsFyDQd19IVCZcQ2a7shdojRTxIxF10TGhAleFEtm4EAoXjjgCPcGY52o1aVaEMea/GRnLR6oLQ592igxNHjTlTGKcDp5w28xVq9m7d4JVrvUeYvKoi+szS4Ah8zhraGdssMaq8LtZzLbaoEXCaMCDRlXPGro="
+script: case ${TARGET} in
+ *osx*)
+ mkdir build && cd build && cmake -DOPENSSL_ROOT_DIR=/usr/local/opt/openssl ..;
+ make all pkgbuild;
+ cd ..;
+ ;;
+ *)
+ docker run -e BUILD_NUMBER=${BUILD_NUMBER} -e COVERITY_SCAN_TOKEN=${COVERITY_SCAN_TOKEN} -e TRAVIS_BRANCH=${TRAVIS_BRANCH} -e TARGET=${TARGET} -v $(pwd):$(pwd) -t "${TARGET}" /bin/bash -c "cd $(pwd);"'
+ apt-get update -qq;
+ apt-get install -y dh-make devscripts dpkg-dev cdbs cmake libxml2-dev libssl-dev git curl wget ruby;
+ export VERSION=$(grep project CMakeLists.txt | egrep -o "([0-9]{1,}\.)+[0-9]{1,}").${BUILD_NUMBER};
+ export DEBFULLNAME="Travis";
+ export DEBEMAIL="travis-ci@travis";
+ dh_make --createorig --addmissing --defaultless -y -p libdigidoc_${VERSION};
+ dch --distribution $(lsb_release -cs) -v ${VERSION} "Release ${VERSION}.";
+ dpkg-buildpackage -rfakeroot -us -uc;
+ if [ "${TARGET}" = "ubuntu:16.04" ]; then
+ export COVERITY_SCAN_PROJECT_NAME="open-eid/libdigidoc";
+ export COVERITY_SCAN_NOTIFICATION_EMAIL="raul@metsma.ee";
+ export COVERITY_SCAN_BRANCH_PATTERN=coverity_scan;
+ export COVERITY_SCAN_BUILD_COMMAND_PREPEND="mkdir coverity && cd coverity && cmake ..";
+ export COVERITY_SCAN_BUILD_COMMAND=make;
+ wget -O - https://scan.coverity.com/scripts/travisci_build_coverity_scan.sh | bash;
+ fi;
+ git clean -dxf';
+ ;;
+ esac
-addons:
- coverity_scan:
- project:
- name: "open-eid/libdigidoc"
- description: "Build submitted via Travis CI"
- notification_email: raul@metsma.ee
- build_command_prepend: "mkdir coverity; cd coverity; cmake .."
- build_command: make
- branch_pattern: coverity_scan
+before_deploy:
+- export VERSION=${TRAVIS_TAG:1}
+- cd ..
+- mv libdigidoc libdigidoc-${VERSION}
+- tar czf libdigidoc-${VERSION}.tar.gz --exclude-vcs libdigidoc-${VERSION}
+deploy:
+ provider: releases
+ api_key: ${GITHUB_ACCESS_TOKEN}
+ file: libdigidoc-${VERSION}.tar.gz
+ skip_cleanup: true
+ on:
+ tags: true
+ condition: "$TRAVIS_OS_NAME = linux"
diff --git a/CMakeLists.txt b/CMakeLists.txt
index c55cd36..b4be89a 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,14 +1,15 @@
-cmake_minimum_required( VERSION 2.8 )
-project( libdigidoc )
+cmake_minimum_required(VERSION 3.0)
+project(libdigidoc VERSION 3.10.4)
set( CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/modules" )
-set( CMAKE_FIND_ROOT_PATH ${CMAKE_OSX_SYSROOT} )
-set( INSTALL_DOC false CACHE BOOL "Install documentation" )
+set( BUILD_TOOLS YES CACHE BOOL "Build digidoc-tool" )
+set( BUILD_TYPE SHARED CACHE STRING "Build library as SHARED/STATIC" )
+set( SIGNCERT "" CACHE STRING "Common name of certificate to used sign binaries, empty skip signing" )
+set( INSTCERT "" CACHE STRING "Common name of certificate to used sign packages, empty skip signing" )
if( APPLE )
set( FRAMEWORK YES CACHE BOOL "Build library as Mac OS X Framework" )
endif()
-include( CheckIncludeFiles )
include( VersionInfo )
include( GNUInstallDirs )
@@ -25,17 +26,15 @@ find_package( PKCS11 )
find_package( ZLIB REQUIRED )
find_package( Iconv )
-if( INSTALL_DOC )
- if( DOXYGEN_FOUND )
- configure_file( ${CMAKE_SOURCE_DIR}/etc/Doxyfile.in Doxyfile @ONLY )
- add_custom_target( docs ALL
- ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile
- WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
- COMMENT "Generating API documentation with Doxygen" VERBATIM
- )
- install( DIRECTORY ${CMAKE_BINARY_DIR}/doc/ DESTINATION ${CMAKE_INSTALL_DATADIR}/doc/libdigidoc )
- endif()
- install( DIRECTORY doc/ DESTINATION ${CMAKE_INSTALL_DATADIR}/doc/libdigidoc PATTERN ".svn" EXCLUDE )
+if( DOXYGEN_FOUND )
+ configure_file( ${CMAKE_SOURCE_DIR}/etc/Doxyfile.in Doxyfile @ONLY )
+ add_custom_target( docs ALL
+ ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile
+ WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
+ COMMENT "Generating API documentation with Doxygen" VERBATIM
+ )
+ install( DIRECTORY ${CMAKE_BINARY_DIR}/doc/ DESTINATION ${CMAKE_INSTALL_DOCDIR}/libdigidoc )
+ install( DIRECTORY doc/ DESTINATION ${CMAKE_INSTALL_DOCDIR}/libdigidoc )
endif()
configure_file( config.h.cmake config.h )
@@ -52,4 +51,3 @@ if( ICONV_FOUND )
endif()
add_subdirectory( libdigidoc )
-
diff --git a/RELEASE-NOTES.txt b/RELEASE-NOTES.md
index 3ca40ce..d8a2b6b 100644
--- a/RELEASE-NOTES.txt
+++ b/RELEASE-NOTES.md
@@ -1,168 +1,196 @@
-DigiDoc C library 3.10 release notes
------------------------------------
-Changes compared to ver 3.9.1
-
-- Changed validation process of OCSP response so that the responder’s certificate reference is taken from the response instead of the signature’s XML.
-- Improved DDOC document validation. It is now checked that the issuance time of the OCSP response would be in the validity period of the signer's certificate.
-- Changed the validation of DDOC documents so that multiple data files with the same name would be allowed in the container.
-- Improved utility program's output during DDOC document validation. If the signer's certificate is from live CA chain but OCSP confirmation has been issued from test OCSP responder then warning 172 "Signer from LIVE CA-chain but OCSP from TEST CA-chain!" is returned.
-- Removed duplicate configuration file entry CA_CERT_6 to fix KLASS3-SK 2010 (KLASS3-SK 2010 EECCRCA.crt) certificate's configuration settings.
-- Removed Finnish CA certificates from digidoc.ini default configuration file. It is recommended to use BDOC format and relevant software instead.
+DigiDoc C library [3.10.4](https://github.com/open-eid/libdigidocpp/releases/tag/v3.10.4) release notes
+-----------------------------------
+- OpenSSL 1.1 support
+
+[Full Changelog](https://github.com/open-eid/libdigidocpp/compare/v3.10.3...v3.10.4)
+
+DigiDoc C library [3.10.3](https://github.com/open-eid/libdigidocpp/releases/tag/v3.10.3) release notes
+-----------------------------------
+- Minor changes to allow build openssl 1.0 under OSX
+
+[Full Changelog](https://github.com/open-eid/libdigidocpp/compare/v3.10.2...v3.10.3)
+
+DigiDoc C library [3.10.2](https://github.com/open-eid/libdigidocpp/releases/tag/v3.10.2) release notes
+-----------------------------------
+- Added ESTEID-SK 2015 certificate
+- Fixed OSX crash
+
+[Full Changelog](https://github.com/open-eid/libdigidocpp/compare/v3.10.1...v3.10.2)
+
+DigiDoc C library 3.10.1 release notes
+-----------------------------------
+Changes compared to ver 3.10
+
+- Fixed ddoc format and version checking. The unfixed library can crash when reading a ddoc file with unknown format and/or version value. Sertifitseerimiskeskus and RIA thank Aivar Liimets for his contribution.
+- Fixed validation of DDOC 1.0-1.2 documents that were created with older version of DigiDoc3 Client (with only DDOC 1.0 format support) on Ubuntu and OSX due to incompatibility with OpenSSL base library openssl_1.0.1f. (IB-3997)
+
+
+
+DigiDoc C library 3.10 release notes
+-----------------------------------
+Changes compared to ver 3.9.1
+
+- Changed validation process of OCSP response so that the responder’s certificate reference is taken from the response instead of the signature’s XML.
+- Improved DDOC document validation. It is now checked that the issuance time of the OCSP response would be in the validity period of the signer's certificate.
+- Changed the validation of DDOC documents so that multiple data files with the same name would be allowed in the container.
+- Improved utility program's output during DDOC document validation. If the signer's certificate is from live CA chain but OCSP confirmation has been issued from test OCSP responder then warning 172 "Signer from LIVE CA-chain but OCSP from TEST CA-chain!" is returned.
+- Removed duplicate configuration file entry CA_CERT_6 to fix KLASS3-SK 2010 (KLASS3-SK 2010 EECCRCA.crt) certificate's configuration settings.
+- Removed Finnish CA certificates from digidoc.ini default configuration file. It is recommended to use BDOC format and relevant software instead.
- Development of the software can now be monitored in GitHub environment: https://github.com/open-eid/libdigidoc
-
-Known issues:
+
+Known issues:
- Validation of documents in DDOC 1.0 format fails on Ubuntu LTS upgrade 14.4.1 and newer due to incompatibility in OpenSSL base library openssl_1.0.1f-1ubuntu2.8. The problem does not occur on Ubuntu 14.4 with openssl_1.0.1f-1ubuntu2.7, OSX and Windows platforms.
-
-
-
-DigiDoc C library 3.9.1 release notes
------------------------------------
-Changes compared to ver 3.9
-
-- DDOC security fixes:
- - Improved XML structure validation for DDOC files. This is a highly relevant security fix having an effect on the validation of DDOC files. The unfixed library can mistakenly give positive results on validation of invalid DDOC files with incorrect XML elements' ordering.
-
-
-
-DigiDoc C library 3.9 release notes
------------------------------------
-Changes compared to ver 3.8
-
-- Improved checking of signer certificate's CA chain length during signature creation and validation. Previously it was not possible to create signature if there was only one CA certificate in the certificate chain.
-- Improved DDOC files' validation, added check that the signer certificate's data would match the X509SerialNumber and X509IssuerName elements' contents.
-- Improved DDOC files validation, added check for Transforms elements which are not supported in DDOC files.
-- Changed signature adding and removal restrictions in case of erroneous files (incl. files that are valid with warnings). No restrictions are made to adding or removing signatures, except of in case of files that are in old format (DIGIDOC-XML 1.0, 1.1, 1.2).
-- Fixed error of handling quotation marks in ClaimedRole and SignatureProductionPlace elements during signature creation and validation. Quotation marks are not replaced during canonicalization according to Canonical XML Version 1.0. Note that as a result, the files that contain quotation marks in the respective elements and have been created with v3.9 might not be compatible with v3.8 of the library.
-- Fixed handling of special characters <, >, & and carriage return in X509IssuerName and ResponderID elements. The characters are now replaced during canonicalization according to Canonical XML Version 1.0. Note that as a result, the files that contain these special characters in the respective elements and have been created with v3.9 might not be compatible with v3.8 of the library.
-- Fixed error which occurred when parsing DDOC document's data file name that contains '&' special character. Previously, the character was erroneously displayed in escaped form.
-- Fixed error that occurred during signature creation when Windows redirected directories were used. Occasionally, writing the ddoc file to redirected directory did not succeed due to synchronization problems.
-- Fixed error that caused the library to exit unexpectedly when trying to parse a DDOC file that contained a large number of validation errors.
-- Changed compression functionality during CDOC encryption process to deprecated, by default the data is never compressed. Removed DENC_COMPRESS_MODE configuration file parameter.
-- Updated cdigidoc.exe utility program's commands "-encrypt-sk", "-encrypt-file" and "-encrypt" so that "MimeType", "OriginalMimeType" and "orig_file" encryption properties are set according to CDOC 1.0 specification.
-- Changed ddsGetStatus() function in DigiDocService.h source file to deprecated status, use ddsGetStatusWithFile() instead. The ddsGetStatusWithFile() function enables to determine the DDOC file name to which the signature value is added.
-- Added command "-mid-test" to cdigidoc-exe utility program, to be used for testing purposes only. The command enables to test the whole Mobile-ID signing process, including creating new DDOC container, adding data file, creating signature, validating the created signature and extracting data files.
-- Fixed cdigidoc utility program's "-libraryerrors" parameter functionality. When the parameter is set then only the errors that are returned by the library are now displayed as "LIBRARY-ERROR".
-- Used coverity.com static analysis tool to find source code defects and vulnerabilities.
-
-
-
-DigiDoc C library 3.8 release notes
------------------------------------
-Changes compared to ver 3.7.2
-
-- Started using coverity.com static analysis tool to find source code defects and vulnerabilities. Fixed resource leak and NULL pointer problems that were discovered.
-- Fixed createDataFileInMemory() method, added fixed SHA-1 digest type value when creating new data file.
-- Added support for new KLASS3-SK 2010 CA certificate.
-- Improved the validation of signer's certificate path, added check if all of the chain's certificates validity period includes the signature creation time (producedAt field's value in OCSP response).
-- Improved error handling in case of missing CA certificates and certificates in wrong format, error code 36 is returned in this case. Only PEM format is supported for CA certificates.
-- Added support for extracting data files from container so that the data is kept only in internal memory buffers. Added command –extract-mem to cdigidoc.c utility program.
-- Added validation support for DDOC signatures that are created with Finnish live and test certificates. The certificate files have to be installed with separate packages. The live certificates package contains Finnish root CA certificate (http://fineid.fi/default.aspx?id=596) and certificates which are included in the Finnish national Trust Service List (TSL) (https://www.viestintavirasto.fi/attachments/TSL-Ficora.xml). Finnish test certificates (http://fineid.fi/default.aspx?id=597) are included in the overall test certificates package.
-- Fixed error handling in case of NULL values in DDOC file’s format and version variables. Acknowledgements. Sertifitseerimiskeskus and RIA thank Aivar Liimets for his contribution.
-- Added possibility get all validation error codes that were found during DDOC file’s parsing and validation process instead of only one error code returned by the validation function verifySignatureAndNotary(). Added error code 173, which is returned in case of multiple errors. Library user must check the list of multiple errors by using new API functions getLastErrorsIdx(), getErrorsInfo() (in source file DigiDocError.c).
-- Added warnings system to the library. In case of minor technical errors in the signed DigiDoc file, validation result VALID WITH WARNINGS is used, meaning that the file is legally valid but further alterations (adding/removing signatures) are restricted. It is recommended for the programmers to implement the usage validation status VALID WITH WARNINGS as described in documentation. The warnings system is implemented in cdigidoc.c utility program (identically to DigiDoc3 Client desktop applicaton), warning situations include:
- - DDOC file's <DataFile> element's xmlns attribute is missing (error code 169)
- - The DigiDoc file format is older than officially accepted, i.e. the file is DDOC 1.0, 1.1, 1.2 (error code 171).
- - DDOC file's <X509IssuerName> or <X509SerialNumber> element's xmlns attribute is missing (error code 170).
- - The signature has been created with a test certificate (error code 172).
-- Changed the priorities of DigiDoc file's validation result statuses.
-- Added error codes 168 (ERR_DF_NAME), 169 (ERR_DF_WRONG_DIG), 170 (ERR_ISSUER_XMLNS), 171 (ERR_OLD_VERSION), 172 (ERR_TEST_SIGNATURE), 173 (ERR_UNKNOWN_ERROR).
-- Fixed nonce asn.1 prefix verification if nonce has no prefix but first 2 bytes match required prefix value.
-- Added validation check of signer’s roles. Maximum 2 <ClaimedRole> elements are supported by the library in a DDOC file.
-- Added check for duplicate <DataFile> element’s fileName attribute. Multiple data files with the same file name in a single container are not supported.
-- Improved <DataFile> element's Id attribute validation. Added support for <DataFile> element’s Id attribute value DO (capital O, not zero).
-- Improved error handling of invalid DDOC files with a missing <DataFile> element. Error 44 ERR_BAD_DATAFILE_COUNT is produced in case of such files.
-- Fixed CDOC file’s <EncryptionProperty Name="DocumentFormat"> element’s value, ENCDOC-XML 1.0 is used instead of ENCDOC-XML 1.1.
-- Fixed –validate command’s output in cdigidoc.c utility program to show validation result correctly in case if one signature among multiple signatures is erroneous.
-- Removed -list command line parameter from cdigidoc.c utility program, changed -verify command so that it replaces the –list command (validates the file and also prints out the data file list).
-- Fixed error handling in cdigidoc.c utility program if input DDOC file name contained also “.cdoc” in the file’s name.
-- It is not allowed to add or remove signatures from DigiDoc files with missing <DataFile> element’s xmlns attribute.
-- Removed configuration file parameter CHECK_SIGNATURE_VALUE_ASN1. Signature values with erroneous ASN.1 prefix values are regarded as not valid.
-- Changed function verifiedByWrongDataFileHash() to deprecated.
-
-- DDOC/CDOC security fixes:
-- Added check that <DigestValue> and <ClaimedRole> elements that are verified are within signed content. This is a highly relevant security fix. Without this fix malicious ddoc files with data not signed by original signer but added by third parties later could have been verified to be valid.
-- Fixed validation of OCSP response, added check that the OCSP response corresponds to the signer’s certificate. This is a highly relevant security fix. Without this fix specially generated ddoc file with changed OCSP response could have been verified to be valid.
-- Changed process of searching for CA certificates. The certificates are searched from the secure Program Files directory that is specified with CA_CERT_PATH configuration file parameter, not from the working directory. This is a highly relevant security fix. Without this fix, CA certificate files that may have been added to the working directory with malicious intent would be used by the library.
-- Fixed the opening of DDOC container with a faulty <DigestValue> tag. This is a highly relevant security fix that has an effect on the validation of DDOC files. Acknowledgements. Sertifitseerimiskeskus and RIA thank Aivar Liimets for his contribution.
-
-
-
-DigiDoc C library 3.7.2 release notes
---------------------------------------
-Changes compared to ver 3.7.1.992
-
-- DDOC/CDOC security fixes:
- - Fixed the opening of DDOC container with a faulty DataFile name tag. This is a highly relevant security fix having an effect on the verification of DDOC files. The unfixed library can result in overwrite arbitrary files on the system with the privileges of the victim.
-
-
-
-DigiDoc C library 3.7.1 release notes
------------------------------------
-Changes compared to ver 3.7.0.910
-
-- Changed the handling of DigiDoc container which has no xmlns attribute in the <DataFile> element.
-
-
-
-DigiDoc C library 3.7 release notes
------------------------------------
-Changes compared to ver 3.6.0.26
-
-- Added the support of slot choice option for CDOC decryption with utility
-- Fixed the search of the signer’s certificate issuer for DDOC verification
-- Fixed the OCSP hash check error handling for DDOC verification: error messages are correct when there are several errors associated with a container
-- Fixed the error handling of the DDOC verification function verifySignatureInfoCERT
-- Added the decrypted transport key option for testing CDOC decryption with utility
-- Fixed padding control for CDOC
-- Fixed padding handling of CDOC PKCS#7: now PKCS#7 padding is managed by the openssl
-- Fixed the DDOC signing function ddocLocateSlotWithSignatureCert: the use of the digital stamp has improved
-- Fixed the OCSP response handling for DDOC signing
-- Fixed CDOC packaging according xml-enc standard
-- Fixed the handling of the initial CDOC file name: the directory path is not added to the CDOC container
-- Fixed the handling of special characters in the CDOC decryption
-- Added Mac OSX keychain support for OCSP server access certificates in DDOC signing
-- Fixed the error handling of DDOC verification in case of the lack of issuer certificates
-- Fixed the DDOC verification function readAuthorityKeyIdentifier
-- Added the function signDocumentWithSlotAndSigner to the signing of DDOC to allow signature over CAPI/CNG
-- Added the support of signing DDOC files in the memory: no temporary files are saved
-- Added the support of encryption and decryption of CDOC in the memory: no temporary files are saved
-- Fixed the logic of the xmlns mirroring in the XML root element in the DDOC signing and verification
-- Added the PKCS12 support for DDOC signing
-- Fixed the EVP_DecodeUpdate CDOC decryption function: buffer size improvement
-- Fixed the notarizeSignatureWithIp and finalizeAndVerifyNotary2 functions for DDOC signing and verification: the setting is supported if the ocsp responder certificate has been issued from another chain than the signer’s certificate
-- Fixed the hash description handling of the ASN.1 signature value for DDOC signing and verification: 13-byte and 15-byte values are supported
-- Added BOM (Byte order mark) support on DDOC verification
-- Fixed error handling of the missing OCSP responder certificate for DDOC verification
-- Removed support for DDOC format version 1.0, 1.1, 1.2 for DDOC signing. Only DDOC verification and exctracting files from container are supported. Creating container, signing and removing signature are not supported
-
-
-- DDOC/CDOC security fixes:
- - Added the check of the ASN.1 structure of the nonce field for DDOC signing and verification. This is a highly relevant security fix having an effect on the verification of DDOC files. The unfixed library can mistakenly give positive results on verificaton invalid DDOC container with wrong ASN.1 structure on the nonce field.
- - Added the check of the ASN.1 structure of the signature value for DDOC signing and verification. This is a highly relevant security fix having an effect on the verification of DDOC files. The unfixed library can mistakenly give positive results on verificaton invalid DDOC container with wrong ASN.1 structure on the signature value.
- - Added the check of the nonce field of the signature for DDOC signing and verification. This is a highly relevant security fix having an effect on the verification of DDOC files. The unfixed library can mistakenly give positive results on verificaton invalid DDOC container with the wrong nonce field value on the signature.
- - Removed the EMBEDDED type DDOC file support for verification. This is a highly relevant security fix having an effect on the verification of DDOC files. The unfixed library can mistakenly give positive results on verificaton invalid EMBEDDED type DDOC container.
- - Fixed the signature verification of a DDOC with a faulty DataFile tag. This is a highly relevant security fix having an effect on the verification of DDOC files. The unfixed library can result in the crashing of the application or unauthorized code execution in opening of a DDOC file created with malicious intent.
-
-
-
-
-
-DigiDoc C library 3.6 release notes
------------------------------------
-Changes compared to ver 2.6.0.18
-
-- Changes according ETSI Plug test results
-- Changes according Cross library (jdigidoc & libdigidoc & libdigidocpp) test results (DDOC, CDOC)
-- Removed DETACHED, HASHCODE, DDOC 1.4, BDOC support
-- CDOC padding improvements
-- Updated documentation in doc folder SK-CDD-PRG-GUIDE
-- Support for software based private keys
-- Versioning switched to same schema (3.5, 3.6 ...) as other middleware components
-- Added Mobiil-ID signing support for cdigidoc utility
-- API change in functions dencOrigContent_findByIndex, dencMetaInfo_GetLibVersion, dencMetaInfo_GetFormatVersion
-- DDOC/CDOC security updates:
- - Fix for decrypting or content viewing of CDOC files with broken orig_file tag. This is a significant security fix which affects CDOC decrypting. A library without this security fix can cause application crashes or allow running malicious code upon opening a deliberately created CDOC file.
- - Fix for decrypting or content viewing of CDOC files with broken EncryptionProperty tag. This is a significant security fix which affects CDOC decrypting. A library without this security fix can cause application crashes or allow running malicious code upon opening a deliberately created CDOC file
- - DigiDocService intermediate resultate file (DDOC file hashcode) verification fix. This is a significant security fix which affects verification of DDOC files. A library without this security fix can mistakenly give positive results on verificaton of invalid DDOC hashcode container.
- - Detached DDOC file verification fix. This is a significant security fix which affects verification of DDOC files. A library without this security fix can mistakenly give positive results on verificaton of invalid DDOC container.
- - Added key usage check in certificate on verification of a signature. This is a significant security fix which affects verification of DDOC files. A library without this security fix can mistakenly give positive results on verificaton of a signature created with incorrect certificate.
+
+
+
+DigiDoc C library 3.9.1 release notes
+-----------------------------------
+Changes compared to ver 3.9
+
+- DDOC security fixes:
+ - Improved XML structure validation for DDOC files. This is a highly relevant security fix having an effect on the validation of DDOC files. The unfixed library can mistakenly give positive results on validation of invalid DDOC files with incorrect XML elements' ordering.
+
+
+
+DigiDoc C library 3.9 release notes
+-----------------------------------
+Changes compared to ver 3.8
+
+- Improved checking of signer certificate's CA chain length during signature creation and validation. Previously it was not possible to create signature if there was only one CA certificate in the certificate chain.
+- Improved DDOC files' validation, added check that the signer certificate's data would match the X509SerialNumber and X509IssuerName elements' contents.
+- Improved DDOC files validation, added check for Transforms elements which are not supported in DDOC files.
+- Changed signature adding and removal restrictions in case of erroneous files (incl. files that are valid with warnings). No restrictions are made to adding or removing signatures, except of in case of files that are in old format (DIGIDOC-XML 1.0, 1.1, 1.2).
+- Fixed error of handling quotation marks in ClaimedRole and SignatureProductionPlace elements during signature creation and validation. Quotation marks are not replaced during canonicalization according to Canonical XML Version 1.0. Note that as a result, the files that contain quotation marks in the respective elements and have been created with v3.9 might not be compatible with v3.8 of the library.
+- Fixed handling of special characters <, >, & and carriage return in X509IssuerName and ResponderID elements. The characters are now replaced during canonicalization according to Canonical XML Version 1.0. Note that as a result, the files that contain these special characters in the respective elements and have been created with v3.9 might not be compatible with v3.8 of the library.
+- Fixed error which occurred when parsing DDOC document's data file name that contains '&' special character. Previously, the character was erroneously displayed in escaped form.
+- Fixed error that occurred during signature creation when Windows redirected directories were used. Occasionally, writing the ddoc file to redirected directory did not succeed due to synchronization problems.
+- Fixed error that caused the library to exit unexpectedly when trying to parse a DDOC file that contained a large number of validation errors.
+- Changed compression functionality during CDOC encryption process to deprecated, by default the data is never compressed. Removed DENC_COMPRESS_MODE configuration file parameter.
+- Updated cdigidoc.exe utility program's commands "-encrypt-sk", "-encrypt-file" and "-encrypt" so that "MimeType", "OriginalMimeType" and "orig_file" encryption properties are set according to CDOC 1.0 specification.
+- Changed ddsGetStatus() function in DigiDocService.h source file to deprecated status, use ddsGetStatusWithFile() instead. The ddsGetStatusWithFile() function enables to determine the DDOC file name to which the signature value is added.
+- Added command "-mid-test" to cdigidoc-exe utility program, to be used for testing purposes only. The command enables to test the whole Mobile-ID signing process, including creating new DDOC container, adding data file, creating signature, validating the created signature and extracting data files.
+- Fixed cdigidoc utility program's "-libraryerrors" parameter functionality. When the parameter is set then only the errors that are returned by the library are now displayed as "LIBRARY-ERROR".
+- Used coverity.com static analysis tool to find source code defects and vulnerabilities.
+
+
+
+DigiDoc C library 3.8 release notes
+-----------------------------------
+Changes compared to ver 3.7.2
+
+- Started using coverity.com static analysis tool to find source code defects and vulnerabilities. Fixed resource leak and NULL pointer problems that were discovered.
+- Fixed createDataFileInMemory() method, added fixed SHA-1 digest type value when creating new data file.
+- Added support for new KLASS3-SK 2010 CA certificate.
+- Improved the validation of signer's certificate path, added check if all of the chain's certificates validity period includes the signature creation time (producedAt field's value in OCSP response).
+- Improved error handling in case of missing CA certificates and certificates in wrong format, error code 36 is returned in this case. Only PEM format is supported for CA certificates.
+- Added support for extracting data files from container so that the data is kept only in internal memory buffers. Added command –extract-mem to cdigidoc.c utility program.
+- Added validation support for DDOC signatures that are created with Finnish live and test certificates. The certificate files have to be installed with separate packages. The live certificates package contains Finnish root CA certificate (http://fineid.fi/default.aspx?id=596) and certificates which are included in the Finnish national Trust Service List (TSL) (https://www.viestintavirasto.fi/attachments/TSL-Ficora.xml). Finnish test certificates (http://fineid.fi/default.aspx?id=597) are included in the overall test certificates package.
+- Fixed error handling in case of NULL values in DDOC file’s format and version variables. Acknowledgements. Sertifitseerimiskeskus and RIA thank Aivar Liimets for his contribution.
+- Added possibility get all validation error codes that were found during DDOC file’s parsing and validation process instead of only one error code returned by the validation function verifySignatureAndNotary(). Added error code 173, which is returned in case of multiple errors. Library user must check the list of multiple errors by using new API functions getLastErrorsIdx(), getErrorsInfo() (in source file DigiDocError.c).
+- Added warnings system to the library. In case of minor technical errors in the signed DigiDoc file, validation result VALID WITH WARNINGS is used, meaning that the file is legally valid but further alterations (adding/removing signatures) are restricted. It is recommended for the programmers to implement the usage validation status VALID WITH WARNINGS as described in documentation. The warnings system is implemented in cdigidoc.c utility program (identically to DigiDoc3 Client desktop applicaton), warning situations include:
+ - DDOC file's <DataFile> element's xmlns attribute is missing (error code 169)
+ - The DigiDoc file format is older than officially accepted, i.e. the file is DDOC 1.0, 1.1, 1.2 (error code 171).
+ - DDOC file's <X509IssuerName> or <X509SerialNumber> element's xmlns attribute is missing (error code 170).
+ - The signature has been created with a test certificate (error code 172).
+- Changed the priorities of DigiDoc file's validation result statuses.
+- Added error codes 168 (ERR_DF_NAME), 169 (ERR_DF_WRONG_DIG), 170 (ERR_ISSUER_XMLNS), 171 (ERR_OLD_VERSION), 172 (ERR_TEST_SIGNATURE), 173 (ERR_UNKNOWN_ERROR).
+- Fixed nonce asn.1 prefix verification if nonce has no prefix but first 2 bytes match required prefix value.
+- Added validation check of signer’s roles. Maximum 2 <ClaimedRole> elements are supported by the library in a DDOC file.
+- Added check for duplicate <DataFile> element’s fileName attribute. Multiple data files with the same file name in a single container are not supported.
+- Improved <DataFile> element's Id attribute validation. Added support for <DataFile> element’s Id attribute value DO (capital O, not zero).
+- Improved error handling of invalid DDOC files with a missing <DataFile> element. Error 44 ERR_BAD_DATAFILE_COUNT is produced in case of such files.
+- Fixed CDOC file’s <EncryptionProperty Name="DocumentFormat"> element’s value, ENCDOC-XML 1.0 is used instead of ENCDOC-XML 1.1.
+- Fixed –validate command’s output in cdigidoc.c utility program to show validation result correctly in case if one signature among multiple signatures is erroneous.
+- Removed -list command line parameter from cdigidoc.c utility program, changed -verify command so that it replaces the –list command (validates the file and also prints out the data file list).
+- Fixed error handling in cdigidoc.c utility program if input DDOC file name contained also “.cdoc” in the file’s name.
+- It is not allowed to add or remove signatures from DigiDoc files with missing <DataFile> element’s xmlns attribute.
+- Removed configuration file parameter CHECK_SIGNATURE_VALUE_ASN1. Signature values with erroneous ASN.1 prefix values are regarded as not valid.
+- Changed function verifiedByWrongDataFileHash() to deprecated.
+
+- DDOC/CDOC security fixes:
+- Added check that <DigestValue> and <ClaimedRole> elements that are verified are within signed content. This is a highly relevant security fix. Without this fix malicious ddoc files with data not signed by original signer but added by third parties later could have been verified to be valid.
+- Fixed validation of OCSP response, added check that the OCSP response corresponds to the signer’s certificate. This is a highly relevant security fix. Without this fix specially generated ddoc file with changed OCSP response could have been verified to be valid.
+- Changed process of searching for CA certificates. The certificates are searched from the secure Program Files directory that is specified with CA_CERT_PATH configuration file parameter, not from the working directory. This is a highly relevant security fix. Without this fix, CA certificate files that may have been added to the working directory with malicious intent would be used by the library.
+- Fixed the opening of DDOC container with a faulty <DigestValue> tag. This is a highly relevant security fix that has an effect on the validation of DDOC files. Acknowledgements. Sertifitseerimiskeskus and RIA thank Aivar Liimets for his contribution.
+
+
+
+DigiDoc C library 3.7.2 release notes
+--------------------------------------
+Changes compared to ver 3.7.1.992
+
+- DDOC/CDOC security fixes:
+ - Fixed the opening of DDOC container with a faulty DataFile name tag. This is a highly relevant security fix having an effect on the verification of DDOC files. The unfixed library can result in overwrite arbitrary files on the system with the privileges of the victim.
+
+
+
+DigiDoc C library 3.7.1 release notes
+-----------------------------------
+Changes compared to ver 3.7.0.910
+
+- Changed the handling of DigiDoc container which has no xmlns attribute in the <DataFile> element.
+
+
+
+DigiDoc C library 3.7 release notes
+-----------------------------------
+Changes compared to ver 3.6.0.26
+
+- Added the support of slot choice option for CDOC decryption with utility
+- Fixed the search of the signer’s certificate issuer for DDOC verification
+- Fixed the OCSP hash check error handling for DDOC verification: error messages are correct when there are several errors associated with a container
+- Fixed the error handling of the DDOC verification function verifySignatureInfoCERT
+- Added the decrypted transport key option for testing CDOC decryption with utility
+- Fixed padding control for CDOC
+- Fixed padding handling of CDOC PKCS#7: now PKCS#7 padding is managed by the openssl
+- Fixed the DDOC signing function ddocLocateSlotWithSignatureCert: the use of the digital stamp has improved
+- Fixed the OCSP response handling for DDOC signing
+- Fixed CDOC packaging according xml-enc standard
+- Fixed the handling of the initial CDOC file name: the directory path is not added to the CDOC container
+- Fixed the handling of special characters in the CDOC decryption
+- Added Mac OSX keychain support for OCSP server access certificates in DDOC signing
+- Fixed the error handling of DDOC verification in case of the lack of issuer certificates
+- Fixed the DDOC verification function readAuthorityKeyIdentifier
+- Added the function signDocumentWithSlotAndSigner to the signing of DDOC to allow signature over CAPI/CNG
+- Added the support of signing DDOC files in the memory: no temporary files are saved
+- Added the support of encryption and decryption of CDOC in the memory: no temporary files are saved
+- Fixed the logic of the xmlns mirroring in the XML root element in the DDOC signing and verification
+- Added the PKCS12 support for DDOC signing
+- Fixed the EVP_DecodeUpdate CDOC decryption function: buffer size improvement
+- Fixed the notarizeSignatureWithIp and finalizeAndVerifyNotary2 functions for DDOC signing and verification: the setting is supported if the ocsp responder certificate has been issued from another chain than the signer’s certificate
+- Fixed the hash description handling of the ASN.1 signature value for DDOC signing and verification: 13-byte and 15-byte values are supported
+- Added BOM (Byte order mark) support on DDOC verification
+- Fixed error handling of the missing OCSP responder certificate for DDOC verification
+- Removed support for DDOC format version 1.0, 1.1, 1.2 for DDOC signing. Only DDOC verification and exctracting files from container are supported. Creating container, signing and removing signature are not supported
+
+
+- DDOC/CDOC security fixes:
+ - Added the check of the ASN.1 structure of the nonce field for DDOC signing and verification. This is a highly relevant security fix having an effect on the verification of DDOC files. The unfixed library can mistakenly give positive results on verificaton invalid DDOC container with wrong ASN.1 structure on the nonce field.
+ - Added the check of the ASN.1 structure of the signature value for DDOC signing and verification. This is a highly relevant security fix having an effect on the verification of DDOC files. The unfixed library can mistakenly give positive results on verificaton invalid DDOC container with wrong ASN.1 structure on the signature value.
+ - Added the check of the nonce field of the signature for DDOC signing and verification. This is a highly relevant security fix having an effect on the verification of DDOC files. The unfixed library can mistakenly give positive results on verificaton invalid DDOC container with the wrong nonce field value on the signature.
+ - Removed the EMBEDDED type DDOC file support for verification. This is a highly relevant security fix having an effect on the verification of DDOC files. The unfixed library can mistakenly give positive results on verificaton invalid EMBEDDED type DDOC container.
+ - Fixed the signature verification of a DDOC with a faulty DataFile tag. This is a highly relevant security fix having an effect on the verification of DDOC files. The unfixed library can result in the crashing of the application or unauthorized code execution in opening of a DDOC file created with malicious intent.
+
+
+
+
+
+DigiDoc C library 3.6 release notes
+-----------------------------------
+Changes compared to ver 2.6.0.18
+
+- Changes according ETSI Plug test results
+- Changes according Cross library (jdigidoc & libdigidoc & libdigidocpp) test results (DDOC, CDOC)
+- Removed DETACHED, HASHCODE, DDOC 1.4, BDOC support
+- CDOC padding improvements
+- Updated documentation in doc folder SK-CDD-PRG-GUIDE
+- Support for software based private keys
+- Versioning switched to same schema (3.5, 3.6 ...) as other middleware components
+- Added Mobiil-ID signing support for cdigidoc utility
+- API change in functions dencOrigContent_findByIndex, dencMetaInfo_GetLibVersion, dencMetaInfo_GetFormatVersion
+- DDOC/CDOC security updates:
+ - Fix for decrypting or content viewing of CDOC files with broken orig_file tag. This is a significant security fix which affects CDOC decrypting. A library without this security fix can cause application crashes or allow running malicious code upon opening a deliberately created CDOC file.
+ - Fix for decrypting or content viewing of CDOC files with broken EncryptionProperty tag. This is a significant security fix which affects CDOC decrypting. A library without this security fix can cause application crashes or allow running malicious code upon opening a deliberately created CDOC file
+ - DigiDocService intermediate resultate file (DDOC file hashcode) verification fix. This is a significant security fix which affects verification of DDOC files. A library without this security fix can mistakenly give positive results on verificaton of invalid DDOC hashcode container.
+ - Detached DDOC file verification fix. This is a significant security fix which affects verification of DDOC files. A library without this security fix can mistakenly give positive results on verificaton of invalid DDOC container.
+ - Added key usage check in certificate on verification of a signature. This is a significant security fix which affects verification of DDOC files. A library without this security fix can mistakenly give positive results on verificaton of a signature created with incorrect certificate.
diff --git a/cmake/modules/FindLibDigiDoc.cmake b/cmake/modules/FindLibDigiDoc.cmake
index 47ccf00..6956117 100644
--- a/cmake/modules/FindLibDigiDoc.cmake
+++ b/cmake/modules/FindLibDigiDoc.cmake
@@ -11,7 +11,7 @@ IF (LIBDIGIDOC_INCLUDE_DIR)
SET(LIBDIGIDOC_FIND_QUIETLY TRUE)
ENDIF (LIBDIGIDOC_INCLUDE_DIR)
-FIND_PATH(LIBDIGIDOC_INCLUDE_DIR libdigidoc/DigiDocDefs.h PATH_SUFFIXES include)
+FIND_PATH(LIBDIGIDOC_INCLUDE_DIR libdigidoc/DigiDocDefs.h)
FIND_LIBRARY(LIBDIGIDOC_LIBRARY NAMES digidoc)
# handle the QUIETLY and REQUIRED arguments and set LIBDIGIDOC_FOUND to TRUE if
diff --git a/cmake/modules/FindLibDigiDocpp.cmake b/cmake/modules/FindLibDigiDocpp.cmake
index 8ec6371..3382efc 100644
--- a/cmake/modules/FindLibDigiDocpp.cmake
+++ b/cmake/modules/FindLibDigiDocpp.cmake
@@ -11,7 +11,7 @@ IF (LIBDIGIDOCPP_INCLUDE_DIR)
SET(LIBDIGIDOCPP_FIND_QUIETLY TRUE)
ENDIF (LIBDIGIDOCPP_INCLUDE_DIR)
-FIND_PATH(LIBDIGIDOCPP_INCLUDE_DIR digidocpp/Container.h PATH_SUFFIXES include)
+FIND_PATH(LIBDIGIDOCPP_INCLUDE_DIR digidocpp/Container.h)
FIND_LIBRARY(LIBDIGIDOCPP_LIBRARY NAMES digidocpp)
# handle the QUIETLY and REQUIRED arguments and set LIBDIGIDOCPP_FOUND to TRUE if
diff --git a/cmake/modules/FindPoDoFo.cmake b/cmake/modules/FindPoDoFo.cmake
new file mode 100644
index 0000000..bc1a629
--- /dev/null
+++ b/cmake/modules/FindPoDoFo.cmake
@@ -0,0 +1,28 @@
+# - Find PoDoFo
+# Find the native PoDoFo includes and library
+#
+# PODOFO_INCLUDE_DIR - where to find winscard.h, wintypes.h, etc.
+# PODOFO_LIBRARIES - List of libraries when using PoDoFo.
+# PODOFO_FOUND - True if PoDoFo found.
+
+
+IF (PODOFO_INCLUDE_DIR)
+ # Already in cache, be silent
+ SET(PODOFO_FIND_QUIETLY TRUE)
+ENDIF (PODOFO_INCLUDE_DIR)
+
+FIND_PATH(PODOFO_INCLUDE_DIR podofo/podofo.h)
+FIND_LIBRARY(PODOFO_LIBRARY NAMES podofo)
+
+# handle the QUIETLY and REQUIRED arguments and set PODOFO_FOUND to TRUE if
+# all listed variables are TRUE
+INCLUDE(FindPackageHandleStandardArgs)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(PODOFO DEFAULT_MSG PODOFO_LIBRARY PODOFO_INCLUDE_DIR)
+
+IF(PODOFO_FOUND)
+ SET( PODOFO_LIBRARIES ${PODOFO_LIBRARY} )
+ELSE(PODOFO_FOUND)
+ SET( PODOFO_LIBRARIES )
+ENDIF(PODOFO_FOUND)
+
+MARK_AS_ADVANCED(PODOFO_LIBRARY PODOFO_INCLUDE_DIR)
diff --git a/cmake/modules/FindXSD.cmake b/cmake/modules/FindXSD.cmake
index 2e168f1..a96dc8c 100644
--- a/cmake/modules/FindXSD.cmake
+++ b/cmake/modules/FindXSD.cmake
@@ -11,10 +11,8 @@ IF (XSD_INCLUDE_DIR)
SET(XSD_FIND_QUIETLY TRUE)
ENDIF (XSD_INCLUDE_DIR)
-FIND_PATH(XSD_INCLUDE_DIR xsd/cxx/parser/elements.hxx HINTS /Library/EstonianIDCard/include)
-
-SET(XSD_NAMES xsdcxx xsdgen xsd)
-FIND_PROGRAM(XSD_EXECUTABLE NAMES ${XSD_NAMES} HINTS /Library/EstonianIDCard/bin)
+FIND_PATH(XSD_INCLUDE_DIR xsd/cxx/parser/elements.hxx)
+FIND_PROGRAM(XSD_EXECUTABLE NAMES xsdcxx xsdgen xsd)
if(XSD_EXECUTABLE)
execute_process (COMMAND ${XSD_EXECUTABLE} "--version" OUTPUT_VARIABLE EXEC_OUT)
string(REGEX REPLACE ".*compiler ([0-9]+)\\.([0-9]+)\\.([0-9]+).*" "\\1" XSD_VERSION_MAJOR ${EXEC_OUT})
@@ -43,6 +41,7 @@ macro( XSD_SCHEMA SOURCES HEADERS OUTPUT INPUT )
--type-naming ucc
--function-naming lcc
--generate-serialization
+ --suppress-assignment
--std c++11
--output-dir ${OUTPUT}
${ARGN}
diff --git a/cmake/modules/FindXercesC.cmake b/cmake/modules/FindXercesC.cmake
index 2d5c1cf..6f31742 100644
--- a/cmake/modules/FindXercesC.cmake
+++ b/cmake/modules/FindXercesC.cmake
@@ -11,10 +11,8 @@ IF (XERCESC_INCLUDE_DIR)
SET(XERCESC_FIND_QUIETLY TRUE)
ENDIF (XERCESC_INCLUDE_DIR)
-FIND_PATH(XERCESC_INCLUDE_DIR xercesc/dom/DOM.hpp HINTS /Library/EstonianIDCard/include)
-
-SET(XERCESC_NAMES xerces-c xerces-c_3 xerces-c_2)
-FIND_LIBRARY(XERCESC_LIBRARY NAMES ${XERCESC_NAMES} HINTS /Library/EstonianIDCard/lib)
+FIND_PATH(XERCESC_INCLUDE_DIR xercesc/dom/DOM.hpp)
+FIND_LIBRARY(XERCESC_LIBRARY NAMES xerces-c xerces-c_3)
# Handle the QUIETLY and REQUIRED arguments and set XERCESC_FOUND to
# TRUE if all listed variables are TRUE.
diff --git a/cmake/modules/FindXmlSecurityC.cmake b/cmake/modules/FindXmlSecurityC.cmake
index 9912c81..9336ef1 100644
--- a/cmake/modules/FindXmlSecurityC.cmake
+++ b/cmake/modules/FindXmlSecurityC.cmake
@@ -11,12 +11,12 @@ IF (XMLSECURITYC_INCLUDE_DIR)
SET(XMLSECURITYC_FIND_QUIETLY TRUE)
ENDIF (XMLSECURITYC_INCLUDE_DIR)
-#FIND_PATH(XALANC_INCLUDE_DIR xalanc/XalanTransformer/XalanTransformer.hpp HINTS /Library/EstonianIDCard/include)
-FIND_PATH(XMLSECURITYC_INCLUDE_DIR xsec/utils/XSECPlatformUtils.hpp HINTS /Library/EstonianIDCard/include)
+FIND_PATH(XALANC_INCLUDE_DIR xalanc/XalanTransformer/XalanTransformer.hpp)
+FIND_PATH(XMLSECURITYC_INCLUDE_DIR xsec/utils/XSECPlatformUtils.hpp)
-#FIND_LIBRARY(XALANC_LIBRARY NAMES xalan-c xalan-C_1 HINTS /Library/EstonianIDCard/lib)
-#FIND_LIBRARY(XALANMSG_LIBRARY NAMES xalanMsg XalanMessages_1 HINTS /Library/EstonianIDCard/lib)
-FIND_LIBRARY(XMLSECURITYC_LIBRARY NAMES xml-security-c xsec_1 HINTS /Library/EstonianIDCard/lib)
+FIND_LIBRARY(XALANC_LIBRARY NAMES xalan-c xalan-C_1)
+FIND_LIBRARY(XALANMSG_LIBRARY NAMES xalanMsg XalanMessages_1)
+FIND_LIBRARY(XMLSECURITYC_LIBRARY NAMES xml-security-c xsec_1)
# Handle the QUIETLY and REQUIRED arguments and set XMLSECURITYC_FOUND to
# TRUE if all listed variables are TRUE.
diff --git a/cmake/modules/ID.ico b/cmake/modules/ID.ico
new file mode 100644
index 0000000..0654fe1
--- /dev/null
+++ b/cmake/modules/ID.ico
Binary files differ
diff --git a/cmake/modules/MacOSXBundleInfo.plist.in b/cmake/modules/MacOSXBundleInfo.plist.in
index e7f2177..b47814f 100644
--- a/cmake/modules/MacOSXBundleInfo.plist.in
+++ b/cmake/modules/MacOSXBundleInfo.plist.in
@@ -31,6 +31,6 @@
<key>LSApplicationCategoryType</key>
<string>public.app-category.utilities</string>
<key>LSMinimumSystemVersion</key>
- <string>10.7</string>
+ <string>${CMAKE_OSX_DEPLOYMENT_TARGET}</string>
</dict>
</plist>
diff --git a/cmake/modules/VersionInfo.cmake b/cmake/modules/VersionInfo.cmake
index 2955ce1..53024c3 100644
--- a/cmake/modules/VersionInfo.cmake
+++ b/cmake/modules/VersionInfo.cmake
@@ -1,39 +1,38 @@
-set( MAJOR_VER 3 )
-set( MINOR_VER 10 )
-set( RELEASE_VER 1 )
-set( BUILD_VER 1208 )
if( $ENV{BUILD_NUMBER} )
- set( BUILD_VER 1208 )
-endif()
-
-if( WIN32 )
- execute_process( COMMAND "cmd.exe" "/C date /T" OUTPUT_VARIABLE BUILD_DATE )
- string( REGEX REPLACE ".*([0-3][0-9]).([0-1][0-9]).([0-9][0-9][0-9][0-9]).*" "\\1.\\2.\\3" BUILD_DATE ${BUILD_DATE} )
-elseif( UNIX )
- execute_process( COMMAND "date" "+%d.%m.%Y" OUTPUT_VARIABLE BUILD_DATE OUTPUT_STRIP_TRAILING_WHITESPACE )
+ set( BUILD_VER $ENV{BUILD_NUMBER} )
+elseif(PROJECT_VERSION_TWEAK)
+ set( BUILD_VER ${PROJECT_VERSION_TWEAK} )
else()
- message( SEND_ERROR "date not implemented")
- set( BUILD_DATE "00.00.0000" )
+ set( BUILD_VER 0 )
+endif()
+if(NOT BUILD_DATE)
+ string(TIMESTAMP BUILD_DATE "%d.%m.%Y")
endif()
-set( VERSION ${MAJOR_VER}.${MINOR_VER}.${RELEASE_VER}.${BUILD_VER} )
+set( VERSION ${PROJECT_VERSION}.${BUILD_VER} )
add_definitions(
- -DMAJOR_VER=${MAJOR_VER}
- -DMINOR_VER=${MINOR_VER}
- -DRELEASE_VER=${RELEASE_VER}
+ -DMAJOR_VER=${PROJECT_VERSION_MAJOR}
+ -DMINOR_VER=${PROJECT_VERSION_MINOR}
+ -DRELEASE_VER=${PROJECT_VERSION_PATCH}
-DBUILD_VER=${BUILD_VER}
-DVER_SUFFIX=\"$ENV{VER_SUFFIX}\"
-DBUILD_DATE=\"${BUILD_DATE}\"
- -DDOMAINURL=\"ria.ee\"
- -DORG=\"RIA\"
)
-set( MACOSX_BUNDLE_COPYRIGHT "(C) 2010-2015 Estonian Information System Authority" )
-set( MACOSX_BUNDLE_SHORT_VERSION_STRING ${MAJOR_VER}.${MINOR_VER}.${RELEASE_VER} )
+set( MACOSX_BUNDLE_COPYRIGHT "(C) 2010-2018 Estonian Information System Authority" )
+set( MACOSX_BUNDLE_SHORT_VERSION_STRING ${PROJECT_VERSION} )
set( MACOSX_BUNDLE_BUNDLE_VERSION ${BUILD_VER} )
set( MACOSX_BUNDLE_ICON_FILE Icon.icns )
-set( MACOSX_FRAMEWORK_SHORT_VERSION_STRING ${MAJOR_VER}.${MINOR_VER}.${RELEASE_VER} )
+set( MACOSX_FRAMEWORK_SHORT_VERSION_STRING ${PROJECT_VERSION} )
set( MACOSX_FRAMEWORK_BUNDLE_VERSION ${BUILD_VER} )
+if( APPLE AND NOT IOS AND NOT CMAKE_OSX_DEPLOYMENT_TARGET )
+ execute_process(COMMAND xcodebuild -version -sdk macosx SDKVersion
+ OUTPUT_VARIABLE CMAKE_OSX_DEPLOYMENT_TARGET OUTPUT_STRIP_TRAILING_WHITESPACE)
+endif()
+if( APPLE AND NOT CMAKE_OSX_SYSROOT )
+ execute_process(COMMAND xcodebuild -version -sdk macosx Path
+ OUTPUT_VARIABLE CMAKE_OSX_SYSROOT OUTPUT_STRIP_TRAILING_WHITESPACE)
+endif()
macro( SET_APP_NAME OUTPUT NAME )
set( ${OUTPUT} "${NAME}" )
@@ -55,28 +54,38 @@ endmacro()
macro( add_manifest TARGET )
if( WIN32 )
add_custom_command(TARGET ${TARGET} POST_BUILD
- COMMAND mt -manifest "${CMAKE_MODULE_PATH}/win81.exe.manifest" -outputresource:"$<TARGET_FILE:${TARGET}>")
+ COMMAND mt -nologo -manifest "${CMAKE_MODULE_PATH}/win81.exe.manifest" -outputresource:"$<TARGET_FILE:${TARGET}>")
endif()
endmacro()
-macro( SET_EX NAME VAR DEF )
- if( "${VAR}" STREQUAL "" )
- set( ${NAME} ${DEF} ${ARGN} )
+macro( SET_ENV NAME DEF )
+ if( DEFINED ENV{${NAME}} )
+ set( ${NAME} $ENV{${NAME}} ${ARGN} )
else()
- set( ${NAME} ${VAR} ${ARGN} )
+ set( ${NAME} ${DEF} ${ARGN} )
endif()
endmacro()
-if(CMAKE_COMPILER_IS_GNUCC OR __COMPILER_GNU)
- if(NOT DEFINED ENABLE_VISIBILITY)
- set(CMAKE_C_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=hidden")
+
+if(NOT DEFINED ENABLE_VISIBILITY)
+ if(POLICY CMP0063)
+ cmake_policy(GET CMP0063 VISIBILITY_POLICY)
+ endif()
+ if(VISIBILITY_POLICY STREQUAL NEW)
+ set(CMAKE_C_VISIBILITY_PRESET hidden)
+ set(CMAKE_CXX_VISIBILITY_PRESET hidden)
+ set(CMAKE_VISIBILITY_INLINES_HIDDEN YES)
+ elseif(CMAKE_COMPILER_IS_GNUCC OR __COMPILER_GNU)
+ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fvisibility=hidden")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=hidden -fvisibility-inlines-hidden")
- #set( CMAKE_C_VISIBILITY_PRESET hidden )
- #set( CMAKE_CXX_VISIBILITY_PRESET hidden )
- #set( CMAKE_VISIBILITY_INLINES_HIDDEN 1 )
endif()
+endif()
- if(NOT DISABLE_CXX11)
+if(NOT DISABLE_CXX11)
+ if(CMAKE_VERSION VERSION_GREATER 3.1.0)
+ set(CMAKE_CXX_STANDARD 11)
+ set(CMAKE_CXX_STANDARD_REQUIRED YES)
+ elseif(CMAKE_COMPILER_IS_GNUCC OR __COMPILER_GNU)
include(CheckCXXCompilerFlag)
CHECK_CXX_COMPILER_FLAG(-std=c++11 C11)
CHECK_CXX_COMPILER_FLAG(-std=c++0x C0X)
@@ -87,9 +96,4 @@ if(CMAKE_COMPILER_IS_GNUCC OR __COMPILER_GNU)
endif()
set(CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LANGUAGE_STANDARD "c++0x")
endif()
- if(APPLE)
- set(CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LIBRARY "libc++")
- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++")
- set(CMAKE_OSX_DEPLOYMENT_TARGET "10.7")
- endif()
endif()
diff --git a/cmake/modules/WelcomeDlg2.wxs b/cmake/modules/WelcomeDlg2.wxs
new file mode 100644
index 0000000..98f0b51
--- /dev/null
+++ b/cmake/modules/WelcomeDlg2.wxs
@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. -->
+
+
+<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
+ <Fragment>
+ <UI>
+ <Dialog Id="WelcomeDlg2" Width="370" Height="270" Title="!(loc.WelcomeDlg_Title)">
+ <Control Id="Bitmap" Type="Bitmap" X="0" Y="0" Width="370" Height="234" TabSkip="no" Text="!(loc.WelcomeDlgBitmap)" />
+ <Control Id="Title" Type="Text" X="135" Y="20" Width="220" Height="60" Transparent="yes" NoPrefix="yes" Text="!(loc.WelcomeDlgTitle)" />
+ <Control Id="Description" Type="Text" X="135" Y="80" Width="220" Height="60" Transparent="yes" NoPrefix="yes" Text="!(loc.WelcomeDlgDescription)" />
+ <Control Id="BottomLine" Type="Line" X="0" Y="234" Width="370" Height="0" />
+ <Control Id="Back" Type="PushButton" X="156" Y="243" Width="56" Height="17" Disabled="yes" Text="!(loc.WixUIBack)" />
+ <Control Id="Install" Type="PushButton" ElevationShield="yes" X="212" Y="243" Width="80" Height="17" Default="yes" Text="!(loc.WelcomeEulaDlgInstall)" Hidden="yes">
+ <Publish Event="SpawnWaitDialog" Value="WaitForCostingDlg">!(wix.WixUICostingPopupOptOut) OR CostingComplete = 1</Publish>
+ <Publish Event="EndDialog" Value="Return"><![CDATA[OutOfDiskSpace <> 1]]></Publish>
+ <Publish Event="SpawnDialog" Value="OutOfRbDiskDlg">OutOfDiskSpace = 1 AND OutOfNoRbDiskSpace = 0 AND (PROMPTROLLBACKCOST="P" OR NOT PROMPTROLLBACKCOST)</Publish>
+ <Publish Event="EndDialog" Value="Return">OutOfDiskSpace = 1 AND OutOfNoRbDiskSpace = 0 AND PROMPTROLLBACKCOST="D"</Publish>
+ <Publish Event="EnableRollback" Value="False">OutOfDiskSpace = 1 AND OutOfNoRbDiskSpace = 0 AND PROMPTROLLBACKCOST="D"</Publish>
+ <Publish Event="SpawnDialog" Value="OutOfDiskDlg">(OutOfDiskSpace = 1 AND OutOfNoRbDiskSpace = 1) OR (OutOfDiskSpace = 1 AND PROMPTROLLBACKCOST="F")</Publish>
+ <Condition Action="show">ALLUSERS</Condition>
+ </Control>
+ <Control Id="InstallNoShield" Type="PushButton" ElevationShield="no" X="212" Y="243" Width="80" Height="17" Default="yes" Text="!(loc.WelcomeEulaDlgInstall)" Hidden="yes">
+ <Publish Event="SpawnWaitDialog" Value="WaitForCostingDlg">!(wix.WixUICostingPopupOptOut) OR CostingComplete = 1</Publish>
+ <Publish Event="EndDialog" Value="Return"><![CDATA[OutOfDiskSpace <> 1]]></Publish>
+ <Publish Event="SpawnDialog" Value="OutOfRbDiskDlg">OutOfDiskSpace = 1 AND OutOfNoRbDiskSpace = 0 AND (PROMPTROLLBACKCOST="P" OR NOT PROMPTROLLBACKCOST)</Publish>
+ <Publish Event="EndDialog" Value="Return">OutOfDiskSpace = 1 AND OutOfNoRbDiskSpace = 0 AND PROMPTROLLBACKCOST="D"</Publish>
+ <Publish Event="EnableRollback" Value="False">OutOfDiskSpace = 1 AND OutOfNoRbDiskSpace = 0 AND PROMPTROLLBACKCOST="D"</Publish>
+ <Publish Event="SpawnDialog" Value="OutOfDiskDlg">(OutOfDiskSpace = 1 AND OutOfNoRbDiskSpace = 1) OR (OutOfDiskSpace = 1 AND PROMPTROLLBACKCOST="F")</Publish>
+ <Condition Action="show">NOT ALLUSERS</Condition>
+ </Control>
+ <Control Id="Cancel" Type="PushButton" X="304" Y="243" Width="56" Height="17" Cancel="yes" Text="!(loc.WixUICancel)">
+ <Publish Event="SpawnDialog" Value="CancelDlg">1</Publish>
+ </Control>
+ </Dialog>
+ </UI>
+
+ <InstallUISequence>
+ <Show Dialog="WelcomeDlg2" Before="ProgressDlg" Overridable="yes">NOT Installed</Show>
+ </InstallUISequence>
+ </Fragment>
+</Wix>
diff --git a/cmake/modules/WixUI_Minimal2.wxs b/cmake/modules/WixUI_Minimal2.wxs
new file mode 100644
index 0000000..5bae0ae
--- /dev/null
+++ b/cmake/modules/WixUI_Minimal2.wxs
@@ -0,0 +1,64 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. -->
+
+
+
+<!--
+First-time install dialog sequence:
+ - WixUI_WelcomeDlg2
+
+Maintenance dialog sequence:
+ WixUI_MaintenanceWelcomeDlg
+ - WixUI_MaintenanceTypeDlg
+ - WixUI_VerifyReadyDlg
+
+Patch dialog sequence:
+ - WixUI_WelcomeDlg
+ - WixUI_VerifyReadyDlg
+-->
+
+<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
+ <Fragment>
+ <UI Id="WixUI_Minimal2">
+ <TextStyle Id="WixUI_Font_Normal" FaceName="Tahoma" Size="8" />
+ <TextStyle Id="WixUI_Font_Bigger" FaceName="Tahoma" Size="12" />
+ <TextStyle Id="WixUI_Font_Title" FaceName="Tahoma" Size="9" Bold="yes" />
+
+ <Property Id="DefaultUIFont" Value="WixUI_Font_Normal" />
+ <Property Id="WixUI_Mode" Value="Minimal" />
+
+ <DialogRef Id="ErrorDlg" />
+ <DialogRef Id="FatalError" />
+ <DialogRef Id="FilesInUse" />
+ <DialogRef Id="MsiRMFilesInUse" />
+ <DialogRef Id="PrepareDlg" />
+ <DialogRef Id="ProgressDlg" />
+ <DialogRef Id="ResumeDlg" />
+ <DialogRef Id="UserExit" />
+ <DialogRef Id="WelcomeDlg" />
+ <DialogRef Id="WelcomeDlg2" />
+
+ <Publish Dialog="ExitDialog" Control="Finish" Event="EndDialog" Value="Return" Order="999">1</Publish>
+
+ <Publish Dialog="VerifyReadyDlg" Control="Back" Event="NewDialog" Value="MaintenanceTypeDlg">1</Publish>
+
+ <Publish Dialog="MaintenanceWelcomeDlg" Control="Next" Event="NewDialog" Value="MaintenanceTypeDlg">1</Publish>
+
+ <Publish Dialog="MaintenanceTypeDlg" Control="RepairButton" Event="NewDialog" Value="VerifyReadyDlg">1</Publish>
+ <Publish Dialog="MaintenanceTypeDlg" Control="RemoveButton" Event="NewDialog" Value="VerifyReadyDlg">1</Publish>
+ <Publish Dialog="MaintenanceTypeDlg" Control="Back" Event="NewDialog" Value="MaintenanceWelcomeDlg">1</Publish>
+
+ <Publish Dialog="WelcomeDlg" Control="Next" Event="NewDialog" Value="VerifyReadyDlg">Installed AND PATCH</Publish>
+ <Publish Dialog="VerifyReadyDlg" Control="Back" Event="NewDialog" Value="WelcomeDlg" Order="2">Installed AND PATCH</Publish>
+
+ <InstallUISequence>
+ <Show Dialog="WelcomeDlg" Before="WelcomeDlg2">Installed AND PATCH</Show>
+ <Show Dialog="WelcomeDlg2" Before="ProgressDlg">NOT Installed</Show>
+ </InstallUISequence>
+
+ <Property Id="ARPNOMODIFY" Value="1" />
+ </UI>
+
+ <UIRef Id="WixUI_Common" />
+ </Fragment>
+</Wix>
diff --git a/cmake/modules/banner.bmp b/cmake/modules/banner.bmp
new file mode 100644
index 0000000..b74514a
--- /dev/null
+++ b/cmake/modules/banner.bmp
Binary files differ
diff --git a/cmake/modules/dlgbmp.bmp b/cmake/modules/dlgbmp.bmp
new file mode 100644
index 0000000..28bc092
--- /dev/null
+++ b/cmake/modules/dlgbmp.bmp
Binary files differ
diff --git a/config.h.cmake b/config.h.cmake
index e8318f9..f92c711 100644
--- a/config.h.cmake
+++ b/config.h.cmake
@@ -4,4 +4,4 @@
/* Version number of package */
#define VERSION "@VERSION@"
#define DIGIDOC_VERSION "@VERSION@"
-#define VERSION_COMMA @MAJOR_VER@,@MINOR_VER@,@RELEASE_VER@,@BUILD_VER@
+#define VERSION_COMMA @PROJECT_VERSION_MAJOR@,@PROJECT_VERSION_MINOR@,@PROJECT_VERSION_PATCH@,@BUILD_VER@
diff --git a/debian/changelog b/debian/changelog
index 8c8aeb2..6468cf9 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,5 +1,5 @@
-libdigidoc (3.10.1.1208-1) unstable; urgency=medium
+libdigidoc (3.10.0) stable; urgency=low
- * Initial upload (Closes: #658300).
+ * Initial release
- -- Andrew Shadura <andrewsh@debian.org> Sun, 01 Nov 2015 19:41:28 +0100
+ -- RIA <info@ria.ee> Tue, 15 Nov 2014 15:42:56 +0300
diff --git a/debian/control b/debian/control
index a5bff60..f7465d3 100644
--- a/debian/control
+++ b/debian/control
@@ -1,14 +1,13 @@
Source: libdigidoc
Section: libs
Priority: extra
-Maintainer: Andrew Shadura <andrewsh@debian.org>
+Maintainer: RIA <info@ria.ee>
Build-Depends:
- debhelper (>= 9),
+ cdbs,
cmake,
libssl-dev,
- libxml2-dev,
- zlib1g-dev
-Standards-Version: 3.9.6
+ libxml2-dev
+Standards-Version: 3.9.8
Homepage: https://github.com/open-eid/libdigidoc
Package: libdigidoc-common
@@ -22,15 +21,8 @@ Breaks:
Replaces:
libdigidoc2 (<< ${binary:Version})
Description: DigiDoc digital signature library common files
- DigiDoc is an XML file format for documents with digital signatures in use by
- the Estonian ID card infrastructure. This library allows for creation and
- reading of DigiDoc files.
- .
- This library implements a subset of the XAdES digital signature standard on
- top of Estonian-specific .ddoc container format.
- .
- This package contains common architecture-independent files for the
- applications using the DigiDoc digital signature library.
+ This package contains common files for using applications with the DigiDoc
+ digital signature library.
Package: libdigidoc2
Replaces:
@@ -42,20 +34,15 @@ Multi-Arch: same
Pre-Depends:
${misc:Pre-Depends}
Depends:
- libdigidoc-common (= ${source:Version}),
- opensc,
- pcscd,
+ libdigidoc-common (= ${binary:Version}),
${misc:Depends},
${shlibs:Depends}
+Recommends:
+ opensc
Description: DigiDoc digital signature library
DigiDoc is an XML file format for documents with digital signatures in use by
the Estonian ID card infrastructure. This library allows for creation and
reading of DigiDoc files.
- .
- This library implements a subset of the XAdES digital signature standard on
- top of Estonian-specific .ddoc container format.
- .
- This package provides the shared libraries.
Package: libdigidoc-tools
Architecture: any
@@ -65,34 +52,20 @@ Depends:
${misc:Depends},
${shlibs:Depends}
Description: DigiDoc digital signature library tools
- DigiDoc is an XML file format for documents with digital signatures in use by
- the Estonian ID card infrastructure. This library allows for creation and
- reading of DigiDoc files.
- .
- This library implements a subset of the XAdES digital signature standard on
- top of Estonian-specific .ddoc container format.
- .
- This package contains tools for manipulating signatures created with the
+ This package contains tools for manipulating signatures command line with the
DigiDoc digital signature library.
Package: libdigidoc-dbg
Architecture: any
Section: debug
-Multi-Arch: same
Depends:
libdigidoc2 (= ${binary:Version}),
libssl1.0.0-dbg,
libxml2-dbg,
${misc:Depends}
-Description: debugging symbols for DigiDoc digital signature library
- DigiDoc is an XML file format for documents with digital signatures in use by
- the Estonian ID card infrastructure. This library allows for creation and
- reading of DigiDoc files.
- .
- This library implements a subset of the XAdES digital signature standard on
- top of Estonian-specific .ddoc container format.
- .
- This package provides the debugging symbols.
+Description: Debugging symbols for libdigidoc2
+ This package contains the debugging symbols for DigiDoc digital signature
+ library.
Package: libdigidoc-dev
Architecture: any
@@ -103,14 +76,8 @@ Depends:
libxml2-dev,
${misc:Depends}
Description: DigiDoc digital signature development files
- DigiDoc is an XML file format for documents with digital signatures in use by
- the Estonian ID card infrastructure. This library allows for creation and
- reading of DigiDoc files.
- .
- This library implements a subset of the XAdES digital signature standard on
- top of Estonian-specific .ddoc container format.
- .
- This package provides the development files.
+ This package contains files necessary for developing applications with the
+ DigiDoc digital signature library.
Package: libdigidoc-doc
Architecture: all
@@ -118,12 +85,5 @@ Section: doc
Depends:
${misc:Depends}
Description: DigiDoc digital signature library documentation
- DigiDoc is an XML file format for documents with digital signatures in use by
- the Estonian ID card infrastructure. This library allows for creation and
- reading of DigiDoc files.
- .
- This library implements a subset of the XAdES digital signature standard on
- top of Estonian-specific .ddoc container format.
- .
This package contains documentation for developing applications with the
DigiDoc digital signature library.
diff --git a/debian/copyright b/debian/copyright
index fc1f191..65669cf 100644
--- a/debian/copyright
+++ b/debian/copyright
@@ -1,28 +1,15 @@
-Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
-Upstream-Name: libdigidoc
-Upstream-Contact: abi@id.ee
-Source: https://github.com/open-eid/libdigidoc
+Copyright 2012 Estonian Information System's Authority
-Files: *
-Copyright: 2012—2015 Estonian Information System's Authority
-License: LGPL-2.1+
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
-Files: debian/*
-Copyright:
- 2012—2015 Estonian Information System's Authority
- 2015 Andrew Shadura <andrewsh@debian.org>
-License: LGPL-2.1+
+This library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+Lesser General Public License for more details.
-License: LGPL-2.1+
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
- .
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
- .
- On Debian systems, the complete text of the GNU Lesser General Public
- License can be found in </usr/share/common-licenses/LGPL-2.1>.
+You should have received a copy of the GNU Lesser General Public
+License with your system, in /usr/share/common-licenses/LGPL-2.1
+If not, see <http://www.gnu.org/licenses/>.
diff --git a/debian/patches/01-manpage.patch b/debian/patches/01-manpage.patch
deleted file mode 100644
index f79a6a6..0000000
--- a/debian/patches/01-manpage.patch
+++ /dev/null
@@ -1,32 +0,0 @@
-From fa90da1834c255ed72e377a96e5c92f8e1a858de Mon Sep 17 00:00:00 2001
-From: Andrew Shadura <andrew@shadura.me>
-Date: Sun, 1 Nov 2015 19:07:15 +0100
-Subject: [PATCH] Fix spelling in the manpage
-
-Signed-off-by: Andrew Shadura <andrew@shadura.me>
----
- libdigidoc/cdigidoc.1.cmake | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
-
-diff --git a/libdigidoc/cdigidoc.1.cmake b/libdigidoc/cdigidoc.1.cmake
-index 20ad67e..effe492 100644
---- a/libdigidoc/cdigidoc.1.cmake
-+++ b/libdigidoc/cdigidoc.1.cmake
-@@ -200,7 +200,7 @@ Decrypts and possibly decompresses the encrypted file just read in and writes to
- Input file (required) specifies the input file’s name.
- Pin (required) represents the recipient’s pin1 (in context of Estonian ID cards).
- pkcs12-file (optional) specifies the PKCS#12 file if decrypting is done with a software token.
--slot deafult is slot 0 containing Estonian ID cards authentication keypair. This parameter can be used to decrypt with a key from the second id card attached to the computer etc.
-+slot default is slot 0 containing Estonian ID cards authentication keypair. This parameter can be used to decrypt with a key from the second id card attached to the computer etc.
- Note: There are also alternative commands for decryption, depending on the encrypted file’s format, size and the certificate type used for decrypting it.
- .RS
- .TP
-@@ -209,7 +209,7 @@ Offers same functionality as -decrypt-sk, should be used for decrypting small fi
- Input file (required) specifies the input file’s name.
- Pin (required) represents the recipient’s pin1 (in contexts of Estonian ID cards).
- pkcs12-file (optional) specifies the PKCS#12 file if decrypting is done with a software token.
--slot deafult is slot 0 containing Estonian ID cards authentication keypair. This parameter can be used to decrypt with a key from the second id card attached to the computer etc.
-+slot default is slot 0 containing Estonian ID cards authentication keypair. This parameter can be used to decrypt with a key from the second id card attached to the computer etc.
- .TP
- .I "-decrypt-file <input-file> <output-file> <pin> [pkcs12-file]"
- Offers same functionality as -decrypt for decrypting documents, should be used for decrypting large files (which do not need to be inside a DigiDoc container). Expects the encrypted data not to be compressed. Note that the command is not currently tested.
diff --git a/debian/patches/02-no-rpath.patch b/debian/patches/02-no-rpath.patch
deleted file mode 100644
index 9e03800..0000000
--- a/debian/patches/02-no-rpath.patch
+++ /dev/null
@@ -1,12 +0,0 @@
-Subject: No rpath, please.
-
---- a/libdigidoc/CMakeLists.txt
-+++ b/libdigidoc/CMakeLists.txt
-@@ -94,7 +94,6 @@
- )
-
- add_executable(cdigidoc cdigidoc.c cdigidoc.rc)
--set_target_properties(cdigidoc PROPERTIES INSTALL_RPATH "@loader_path/../../../..;@loader_path/../..")
- target_link_libraries(cdigidoc digidoc)
-
- install( TARGETS digidoc
diff --git a/debian/patches/series b/debian/patches/series
deleted file mode 100644
index b8d86dd..0000000
--- a/debian/patches/series
+++ /dev/null
@@ -1,2 +0,0 @@
-01-manpage.patch
-02-no-rpath.patch
diff --git a/debian/rules b/debian/rules
index 3104e56..cf11fb5 100755
--- a/debian/rules
+++ b/debian/rules
@@ -1,23 +1,12 @@
#!/usr/bin/make -f
-
-DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
-
+include /usr/share/cdbs/1/rules/debhelper.mk
+include /usr/share/cdbs/1/class/cmake.mk
DEB_CMAKE_EXTRA_FLAGS = \
-DCMAKE_INSTALL_SYSCONFDIR="/etc" \
- -DCMAKE_INSTALL_LIBDIR="lib/$(DEB_HOST_MULTIARCH)" \
- -DINSTALL_DOC=YES
-
-%:
- dh "$@" --buildsystem=cmake
-
-override_dh_auto_configure:
- dh_auto_configure -- $(DEB_CMAKE_EXTRA_FLAGS)
-
-override_dh_strip:
- dh_strip --dbg-package=libdigidoc-dbg
+ -DCMAKE_INSTALL_LIBDIR="lib/$(DEB_HOST_MULTIARCH)"
-override_dh_install:
- dh_install -plibdigidoc-common --exclude=TEST
- dh_install --remaining-packages --list-missing
+DEB_DH_INSTALL_ARGS=--exclude=TEST
-.PHONY: override_dh_auto_configure
+binary-install/libdigidoc-dev::
+# Run dh_install without the default DEB_DH_INSTALL_ARGS to install the TEST*.crt certificates
+ dh_install -plibdigidoc-dev
diff --git a/debian/watch b/debian/watch
deleted file mode 100644
index 2785dc9..0000000
--- a/debian/watch
+++ /dev/null
@@ -1,3 +0,0 @@
-version=3
-
-https://github.com/open-eid/libdigidoc/releases /open-eid/libdigidoc/releases/download/.*/libdigidoc-([\d.]*).tar.gz
diff --git a/etc/certs/ESTEID-SK 2015.crt b/etc/certs/ESTEID-SK 2015.crt
new file mode 100644
index 0000000..8038a89
--- /dev/null
+++ b/etc/certs/ESTEID-SK 2015.crt
@@ -0,0 +1,37 @@
+-----BEGIN CERTIFICATE-----
+MIIGcDCCBVigAwIBAgIQRUgJC4ec7yFWcqzT3mwbWzANBgkqhkiG9w0BAQwFADB1
+MQswCQYDVQQGEwJFRTEiMCAGA1UECgwZQVMgU2VydGlmaXRzZWVyaW1pc2tlc2t1
+czEoMCYGA1UEAwwfRUUgQ2VydGlmaWNhdGlvbiBDZW50cmUgUm9vdCBDQTEYMBYG
+CSqGSIb3DQEJARYJcGtpQHNrLmVlMCAXDTE1MTIxNzEyMzg0M1oYDzIwMzAxMjE3
+MjM1OTU5WjBjMQswCQYDVQQGEwJFRTEiMCAGA1UECgwZQVMgU2VydGlmaXRzZWVy
+aW1pc2tlc2t1czEXMBUGA1UEYQwOTlRSRUUtMTA3NDcwMTMxFzAVBgNVBAMMDkVT
+VEVJRC1TSyAyMDE1MIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEA0oH6
+1NDxbdW9k8nLA1qGaL4B7vydod2Ewp/STBZB3wEtIJCLdkpEsS8pXfFiRqwDVsgG
+Gbu+Q99trlb5LI7yi7rIkRov5NftBdSNPSU5rAhYPQhvZZQgOwRaHa5Ey+BaLJHm
+LqYQS9hQvQsCYyws+xVvNFUpK0pGD64iycqdMuBl/nWq3fLuZppwBh0VFltm4nhr
+/1S0R9TRJpqFUGbGr4OK/DwebQ5PjhdS40gCUNwmC7fPQ4vIH+x+TCk2aG+u3MoA
+z0IrpVWqiwzG/vxreuPPAkgXeFCeYf6fXLsGz4WivsZFbph2pMjELu6sltlBXfAG
+3fGv43t91VXicyzR/eT5dsB+zFsW1sHV+1ONPr+qzgDxCH2cmuqoZNfIIq+buob3
+eA8ee+XpJKJQr+1qGrmhggjvAhc7m6cU4x/QfxwRYhIVNhJf+sKVThkQhbJ9XxuK
+k3c18wymwL1mpDD0PIGJqlssMeiuJ4IzagFbgESGNDUd4icm0hQT8CmQeUm1GbWe
+BYseqPhMQX97QFBLXJLVy2SCyoAz7Bq1qA43++EcibN+yBc1nQs2Zoq8ck9MK0bC
+xDMeUkQUz6VeQGp69ImOQrsw46qTz0mtdQrMSbnkXCuLan5dPm284J9HmaqiYi6j
+6KLcZ2NkUnDQFesBVlMEm+fHa2iR6lnAFYZ06UECAwEAAaOCAgowggIGMB8GA1Ud
+IwQYMBaAFBLyWj7qVhy/zQas8fElyalL1BSZMB0GA1UdDgQWBBSzq4i8mdVipIUq
+CM20HXI7g3JHUTAOBgNVHQ8BAf8EBAMCAQYwdwYDVR0gBHAwbjAIBgYEAI96AQIw
+CQYHBACL7EABAjAwBgkrBgEEAc4fAQEwIzAhBggrBgEFBQcCARYVaHR0cHM6Ly93
+d3cuc2suZWUvQ1BTMAsGCSsGAQQBzh8BAjALBgkrBgEEAc4fAQMwCwYJKwYBBAHO
+HwEEMBIGA1UdEwEB/wQIMAYBAf8CAQAwQQYDVR0eBDowOKE2MASCAiIiMAqHCAAA
+AAAAAAAAMCKHIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMCcGA1Ud
+JQQgMB4GCCsGAQUFBwMJBggrBgEFBQcDAgYIKwYBBQUHAwQwfAYIKwYBBQUHAQEE
+cDBuMCAGCCsGAQUFBzABhhRodHRwOi8vb2NzcC5zay5lZS9DQTBKBggrBgEFBQcw
+AoY+aHR0cDovL3d3dy5zay5lZS9jZXJ0cy9FRV9DZXJ0aWZpY2F0aW9uX0NlbnRy
+ZV9Sb290X0NBLmRlci5jcnQwPQYDVR0fBDYwNDAyoDCgLoYsaHR0cDovL3d3dy5z
+ay5lZS9yZXBvc2l0b3J5L2NybHMvZWVjY3JjYS5jcmwwDQYJKoZIhvcNAQEMBQAD
+ggEBAHRWDGI3P00r2sOnlvLHKk9eE7X93eT+4e5TeaQsOpE5zQRUTtshxN8Bnx2T
+oQ9rgi18q+MwXm2f0mrGakYYG0bix7ZgDQvCMD/kuRYmwLGdfsTXwh8KuL6uSHF+
+U/ZTss6qG7mxCHG9YvebkN5Yj/rYRvZ9/uJ9rieByxw4wo7b19p22PXkAkXP5y3+
+qK/Oet98lqwI97kJhiS2zxFYRk+dXbazmoVHnozYKmsZaSUvoYNNH19tpS7BLdsg
+i9KpbvQLb5ywIMq9ut3+b2Xvzq8yzmHMFtLIJ6Afu1jJpqD82BUAFcvi5vhnP8M7
+b974R18WCOpgNQvXDI+2/8ZINeU=
+-----END CERTIFICATE-----
diff --git a/etc/certs/TEST ESTEID-SK 2015.crt b/etc/certs/TEST ESTEID-SK 2015.crt
new file mode 100644
index 0000000..bd666aa
--- /dev/null
+++ b/etc/certs/TEST ESTEID-SK 2015.crt
@@ -0,0 +1,37 @@
+-----BEGIN CERTIFICATE-----
+MIIGgzCCBWugAwIBAgIQEDb9gCZi4PdWc7IoNVIbsTANBgkqhkiG9w0BAQwFADB9
+MQswCQYDVQQGEwJFRTEiMCAGA1UECgwZQVMgU2VydGlmaXRzZWVyaW1pc2tlc2t1
+czEwMC4GA1UEAwwnVEVTVCBvZiBFRSBDZXJ0aWZpY2F0aW9uIENlbnRyZSBSb290
+IENBMRgwFgYJKoZIhvcNAQkBFglwa2lAc2suZWUwIBcNMTUxMjE4MDcxMzQ0WhgP
+MjAzMDEyMTcyMzU5NTlaMGsxCzAJBgNVBAYTAkVFMSIwIAYDVQQKDBlBUyBTZXJ0
+aWZpdHNlZXJpbWlza2Vza3VzMRcwFQYDVQRhDA5OVFJFRS0xMDc0NzAxMzEfMB0G
+A1UEAwwWVEVTVCBvZiBFU1RFSUQtU0sgMjAxNTCCAiIwDQYJKoZIhvcNAQEBBQAD
+ggIPADCCAgoCggIBAMTeAFvLxmAeaOsRKaf+hlkOhW+CdEilmUIKWs+qCWVq+w8E
+8PA/TohAZdUcO4KFXothmPDmfOCb0ExXcnOPCr2NndavzB39htlyYKYxkOkZi3pL
+z8bZg/HvpBoy8KIg0sYdbhVPYHf6i7fuJjDac4zN1vKdVQXA6Tv5wS/e90/ZyF95
+5vycxdNLticdozm5yCDMNgsEji6QNA1zIi3+C2YmnDXx6VyxhuC2R3q0xNkwtJ4e
+zs1RZGxWokTNPzQc3ilGhEJlVsS8vP624hUHwufQnwrKWpc3+D+plMIO0j3E+hmh
+46gIadDRweFR/dzb+CIBHRaFh0LEBjd/cDFQlBI+E8vpkhqeWp6rp1xwnhCL201M
+3E1E1Mw+51Xqj7WOfY0TzjOmQJy8WJPEwU2m44KxW1SnpeEBVkgb4XYFeQHAllc7
+J7JDv50BoIPpecgaqn1vKR7l//wDsL0MN1tDlBhl3x7TJ/fwMnwB1E3zVZR74TUZ
+h5J49CAcFrfM4RmP/0hcDW8+4wNWMg2Qgst2qmPZmHCI/OJt5yMt0Ud5yPF8AWxV
+ot3TxOBGjMiM8m6WsksFsQxp5WtA0DANGXIIfydTaTV16Mg+KpYVqFKxkvFBmfVp
+6xApMaFl3dY/m56O9JHEqFpBDF+uDQIMjFJxJ4Pt7Mdk40zfL4PSw9Qco2T3AgMB
+AAGjggINMIICCTAfBgNVHSMEGDAWgBS1NAqdpS8QxechDr7EsWVHGwN2/jAdBgNV
+HQ4EFgQUScDyRDll1ZtGOw04YIOx1i0ohqYwDgYDVR0PAQH/BAQDAgEGMGYGA1Ud
+IARfMF0wMQYKKwYBBAHOHwMBATAjMCEGCCsGAQUFBwIBFhVodHRwczovL3d3dy5z
+ay5lZS9DUFMwDAYKKwYBBAHOHwMBAjAMBgorBgEEAc4fAwEDMAwGCisGAQQBzh8D
+AQQwEgYDVR0TAQH/BAgwBgEB/wIBADBBBgNVHR4EOjA4oTYwBIICIiIwCocIAAAA
+AAAAAAAwIocgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwJwYDVR0l
+BCAwHgYIKwYBBQUHAwkGCCsGAQUFBwMCBggrBgEFBQcDBDCBiQYIKwYBBQUHAQEE
+fTB7MCUGCCsGAQUFBzABhhlodHRwOi8vZGVtby5zay5lZS9jYV9vY3NwMFIGCCsG
+AQUFBzAChkZodHRwOi8vd3d3LnNrLmVlL2NlcnRzL1RFU1Rfb2ZfRUVfQ2VydGlm
+aWNhdGlvbl9DZW50cmVfUm9vdF9DQS5kZXIuY3J0MEMGA1UdHwQ8MDowOKA2oDSG
+Mmh0dHBzOi8vd3d3LnNrLmVlL3JlcG9zaXRvcnkvY3Jscy90ZXN0X2VlY2NyY2Eu
+Y3JsMA0GCSqGSIb3DQEBDAUAA4IBAQDBOYTpbbQuoJKAmtDPpAomDd9mKZCarIPx
+AH8UXphSndMqOmIUA4oQMrLcZ6a0rMyCFR8x4NX7abc8T81cvgUAWjfNFn8+bi6+
+DgbjhYY+wZ010MHHdUo2xPajfog8cDWJPkmz+9PAdyjzhb1eYoEnm5D6o4hZQCiR
+yPnOKp7LZcpsVz1IFXsqP7M5WgHk0SqY1vs+Yhu7zWPSNYFIzNNXGoUtfKhhkHiR
+WFX/wdzr3fqeaQ3gs/PyD53YuJXRzFrktgJJoJWnHEYIhEwbai9+OeKr4L4kTkxv
+PKTyjjpLKcjUk0Y0cxg7BuzwevonyBtL72b/FVs6XsXJJqCa3W4T
+-----END CERTIFICATE-----
diff --git a/etc/digidoc.conf.cmake b/etc/digidoc.conf.cmake
index b2076a9..a36d65b 100644
--- a/etc/digidoc.conf.cmake
+++ b/etc/digidoc.conf.cmake
@@ -5,7 +5,7 @@
[ca]
CA_CERT_PATH=@CMAKE_INSTALL_FULL_DATADIR@/libdigidoc
-CA_CERTS=17
+CA_CERTS=18
CA_CERT_1=JUUR-SK.crt
CA_CERT_1_CN=Juur-SK
@@ -30,20 +30,22 @@ CA_CERT_10=ESTEID-SK 2011.crt
CA_CERT_10_CN=ESTEID-SK 2011
CA_CERT_11=EID-SK 2011.crt
CA_CERT_11_CN=EID-SK 2011
+CA_CERT_12=ESTEID-SK 2015.crt
+CA_CERT_12_CN=ESTEID-SK 2015
-CA_CERT_12=TEST Juur-SK.crt
-CA_CERT_12_CN=TEST Juur-SK
-CA_CERT_13=TEST-SK.crt
-CA_CERT_13_CN=TEST-SK
+CA_CERT_13=TEST Juur-SK.crt
+CA_CERT_13_CN=TEST Juur-SK
+CA_CERT_14=TEST-SK.crt
+CA_CERT_14_CN=TEST-SK
-CA_CERT_14=TEST EECCRCA.crt
-CA_CERT_14_CN=TEST of EE Certification Centre Root CA
-CA_CERT_15=TEST ESTEID-SK 2011.crt
-CA_CERT_15_CN=TEST of ESTEID-SK 2011
-CA_CERT_16=TEST EID-SK 2011.crt
-CA_CERT_16_CN=TEST of EID-SK 2011
-CA_CERT_17=TEST KLASS3 2010.crt
-CA_CERT_17_CN=TEST of KLASS3-SK 2010
+CA_CERT_15=TEST EECCRCA.crt
+CA_CERT_15_CN=TEST of EE Certification Centre Root CA
+CA_CERT_16=TEST ESTEID-SK 2011.crt
+CA_CERT_16_CN=TEST of ESTEID-SK 2011
+CA_CERT_17=TEST EID-SK 2011.crt
+CA_CERT_17_CN=TEST of EID-SK 2011
+CA_CERT_18=TEST KLASS3 2010.crt
+CA_CERT_18_CN=TEST of KLASS3-SK 2010
@@ -60,7 +62,7 @@ SIGN_OCSP=0
USE_PROXY=0
DIGIDOC_OCSP_URL=http://ocsp.sk.ee
-DIGIDOC_OCSP_RESPONDER_CERTS=24
+DIGIDOC_OCSP_RESPONDER_CERTS=25
DIGIDOC_OCSP_RESPONDER_CERT_1=TEST-SK OCSP 2005.crt
DIGIDOC_OCSP_RESPONDER_CERT_1_CN=TEST-SK OCSP RESPONDER 2005
@@ -170,3 +172,7 @@ DIGIDOC_OCSP_RESPONDER_CERT_24=SK OCSP 2011.crt
DIGIDOC_OCSP_RESPONDER_CERT_24_CN=SK OCSP RESPONDER 2011
DIGIDOC_OCSP_RESPONDER_CERT_24_CA=VRK CA for Qualified Certificates
DIGIDOC_OCSP_RESPONDER_CERT_24_URL=http://ocsp.sk.ee/_proxy
+
+DIGIDOC_OCSP_RESPONDER_CERT_25=SK OCSP 2011.crt
+DIGIDOC_OCSP_RESPONDER_CERT_25_CN=SK OCSP RESPONDER 2011
+DIGIDOC_OCSP_RESPONDER_CERT_25_CA=ESTEID-SK 2015
diff --git a/libdigidoc/CMakeLists.txt b/libdigidoc/CMakeLists.txt
index eceebfe..87323e4 100644
--- a/libdigidoc/CMakeLists.txt
+++ b/libdigidoc/CMakeLists.txt
@@ -31,21 +31,18 @@ set( PUBLIC_HEADER
)
if( WIN32 )
- add_definitions( -DWITH_SOAPDEFS_H )
+ add_definitions(
+ -DWITH_SOAPDEFS_H
+ -D_CRT_NONSTDC_NO_DEPRECATE
+ -D_CRT_SECURE_NO_DEPRECATE
+ -D_CRT_SECURE_NO_WARNINGS
+ -D_SCL_SECURE_NO_WARNINGS
+ )
list( APPEND libdigidoc_SRCS DigiDocGlobals.c DigiDocCSP.c DigiCrypt.c DlgUnit.c DlgUnitS.c )
set( EXT_LIBRARIES Crypt32 Comctl32 )
endif()
-if( MSVC )
- add_definitions(
- -D_CRT_NONSTDC_NO_DEPRECATE
- -D_CRT_SECURE_NO_DEPRECATE
- -D_CRT_SECURE_NO_WARNINGS
- -D_SCL_SECURE_NO_WARNINGS
- )
-endif()
-
-add_library( digidoc SHARED
+add_library( digidoc ${BUILD_TYPE}
${PUBLIC_HEADER}
${CMAKE_CURRENT_BINARY_DIR}/${DIGIDOC_CONF_NAME}
${libdigidoc_SRCS}
@@ -75,11 +72,11 @@ add_library( digidoc SHARED
)
target_link_libraries( digidoc
- ${CMAKE_DL_LIBS}
- ${LIBXML2_LIBRARIES}
- ${OPENSSL_LIBRARIES}
- ${ZLIB_LIBRARIES}
- ${EXT_LIBRARIES}
+ ${CMAKE_DL_LIBS}
+ ${LIBXML2_LIBRARIES}
+ ${OPENSSL_LIBRARIES}
+ ${ZLIB_LIBRARIES}
+ ${EXT_LIBRARIES}
)
set_target_properties( digidoc PROPERTIES
@@ -93,8 +90,10 @@ set_target_properties( digidoc PROPERTIES
MACOSX_RPATH YES
)
-add_executable(cdigidoc cdigidoc.c cdigidoc.rc)
-target_link_libraries(cdigidoc digidoc)
+if( BUILD_TOOLS )
+ add_executable(cdigidoc cdigidoc.c cdigidoc.rc)
+ target_link_libraries(cdigidoc digidoc)
+endif()
install( TARGETS digidoc
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
@@ -106,7 +105,7 @@ install( TARGETS digidoc
)
if(WIN32)
- install( DIRECTORY ${PROJECT_BINARY_DIR}/libdigidoc/ DESTINATION ${CMAKE_INSTALL_LIBDIR} FILES_MATCHING PATTERN "*.pdb" )
+ install(FILES $<TARGET_PDB_FILE:digidoc> $<TARGET_PDB_FILE:cdigidoc> DESTINATION ${CMAKE_INSTALL_BINDIR} OPTIONAL)
endif()
if( FRAMEWORK )
@@ -119,14 +118,17 @@ if( FRAMEWORK )
add_custom_command( TARGET cdigidoc POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_FILE:cdigidoc> $<TARGET_FILE_DIR:digidoc>/Resources )
add_custom_target( codesign DEPENDS cdigidoc
- COMMAND codesign -f -s \"$$SIGNCERT\" $<TARGET_FILE_DIR:digidoc>/Resources/cdigidoc
- COMMAND codesign -f -s \"$$SIGNCERT\" $<TARGET_FILE_DIR:digidoc>/../..
+ COMMAND codesign -f -s ${SIGNCERT}
+ $<TARGET_FILE_DIR:digidoc>/Resources/cdigidoc
+ $<TARGET_FILE_DIR:digidoc>/../..
COMMAND touch $<TARGET_FILE:cdigidoc>
)
- add_custom_target( pkgbuild DEPENDS codesign
- COMMAND make install DESTDIR=install \; pkgbuild
- --root install
- --sign \"$$INSTCERT\"
+ if(INSTCERT)
+ set(PKGEXTRA --sign ${INSTCERT})
+ endif()
+ add_custom_target( pkgbuild DEPENDS cdigidoc
+ COMMAND make install DESTDIR=install
+ COMMAND pkgbuild --root install ${PKGEXTRA}
${CMAKE_BINARY_DIR}/libdigidoc_${VERSION}$ENV{VER_SUFFIX}.pkg
)
add_custom_target( zipdebug DEPENDS cdigidoc
@@ -135,12 +137,14 @@ if( FRAMEWORK )
COMMAND zip -r ${CMAKE_BINARY_DIR}/libdigidoc-dbg_${VERSION}$ENV{VER_SUFFIX}.zip libdigidoc.dSYM
)
else()
- install( TARGETS cdigidoc DESTINATION ${CMAKE_INSTALL_BINDIR} )
configure_file( libdigidoc.pc.cmake libdigidoc.pc @ONLY )
- configure_file( cdigidoc.1.cmake cdigidoc.1 )
install( FILES ${CMAKE_CURRENT_BINARY_DIR}/libdigidoc.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig )
- install( FILES ${CMAKE_CURRENT_BINARY_DIR}/cdigidoc.1 DESTINATION ${CMAKE_INSTALL_MANDIR}/man1 )
install( FILES ${CERTS} DESTINATION ${CMAKE_INSTALL_FULL_DATADIR}/libdigidoc )
+ if( BUILD_TOOLS )
+ install( TARGETS cdigidoc DESTINATION ${CMAKE_INSTALL_BINDIR} )
+ configure_file( cdigidoc.1.cmake cdigidoc.1 )
+ install( FILES ${CMAKE_CURRENT_BINARY_DIR}/cdigidoc.1 DESTINATION ${CMAKE_INSTALL_MANDIR}/man1 )
+ endif()
endif()
#install( FILES
diff --git a/libdigidoc/DigiDocCert.c b/libdigidoc/DigiDocCert.c
index 3d248bd..6c2eec6 100644
--- a/libdigidoc/DigiDocCert.c
+++ b/libdigidoc/DigiDocCert.c
@@ -1107,16 +1107,17 @@ EXP_OPTION int readCertExtData(X509* pCert, DigiDocMemBuf* pMemBuf, int nExt, in
pos = X509_get_ext_by_NID(pCert, nExt, -1);
if(pos >= 0) {
pExt = X509_get_ext(pCert, pos);
- if(pExt && pExt->value && pExt->value->data) {
+ ASN1_OCTET_STRING *value = X509_EXTENSION_get_data(pExt);
+ if(pExt && value && value->data) {
/* memset(buf1, 0, sizeof(buf1));
l1 = sizeof(buf1);
bin2hex(pExt->value->data, pExt->value->length, buf1, &l1);
ddocDebug(3, "readCertExtData", "Ext: %d len: %d data: %s", nExt, pExt->value->length, buf1);*/
- if(pExt->value->length > 20 && nOff)
+ if(value->length > 20 && nOff)
//ddocMemAssignData(pMemBuf, ((char*)pExt->value->data) + (pExt->value->length - 20), 20);
- ddocMemAssignData(pMemBuf, ((char*)pExt->value->data) + nOff, 20);
+ ddocMemAssignData(pMemBuf, ((char*)value->data) + nOff, 20);
else
- ddocMemAssignData(pMemBuf, ((char*)pExt->value->data), pExt->value->length);
+ ddocMemAssignData(pMemBuf, ((char*)value->data), value->length);
}
}
return err;
@@ -1277,6 +1278,7 @@ int ddocCertGetDN(X509* pCert, DigiDocMemBuf* pMemBuf, int bIssuer)
int err = ERR_OK;
X509_NAME *pName = 0;
X509_NAME_ENTRY *pNe = 0;
+ ASN1_STRING *data = 0;
int i, n, l, t, b = 0;
const char *s;
unsigned char* p;
@@ -1296,11 +1298,12 @@ int ddocCertGetDN(X509* pCert, DigiDocMemBuf* pMemBuf, int bIssuer)
else
pName = X509_get_subject_name(pCert);
RETURN_IF_NULL(pName)
- for(i = 0; (err == ERR_OK) && (i < sk_X509_NAME_ENTRY_num(pName->entries)); i++) {
- pNe = sk_X509_NAME_ENTRY_value(pName->entries, i);
- n = OBJ_obj2nid(pNe->object);
+ for(i = 0; (err == ERR_OK) && (i < X509_NAME_entry_count(pName)); i++) {
+ pNe = X509_NAME_get_entry(pName, i);
+ n = OBJ_obj2nid(X509_NAME_ENTRY_get_object(pNe));
s = OBJ_nid2sn(n);
- t = pNe->value->type;
+ data = X509_NAME_ENTRY_get_data(pNe);
+ t = data->type;
// mostly we find here:
// V_ASN1_PRINTABLESTRING, V_ASN1_TELETEXSTRING or V_ASN1_BMPSTRING
// that we convert to UTF, but V_ASN1_UTF8STRING allready is in UTF8
@@ -1309,10 +1312,10 @@ int ddocCertGetDN(X509* pCert, DigiDocMemBuf* pMemBuf, int bIssuer)
// convert to UTF8 only
p = 0;
if(t == V_ASN1_UTF8STRING) {
- p = pNe->value->data;
- l = pNe->value->length;
+ p = data->data;
+ l = data->length;
} else
- l = ASN1_STRING_to_UTF8(&p, pNe->value);
+ l = ASN1_STRING_to_UTF8(&p, data);
ddocDebug(5, "ddocCertGetDN",
"NameEntry nid: %d type: %d len: %d item: %s value: \'%s\'",
n, t, l, s, (p ? (const char*)p : "NULL"));
@@ -1371,6 +1374,7 @@ EXP_OPTION int ddocCertGetDNFromName(X509_NAME* pName, DigiDocMemBuf* pMemBuf)
{
int err = ERR_OK;
X509_NAME_ENTRY *pNe = 0;
+ ASN1_STRING *data = 0;
int i, n, l, t, b = 0;
const char *s;
unsigned char* p;
@@ -1383,11 +1387,12 @@ EXP_OPTION int ddocCertGetDNFromName(X509_NAME* pName, DigiDocMemBuf* pMemBuf)
pMemBuf->pMem = 0;
pMemBuf->nLen = 0;
- for(i = 0; (err == ERR_OK) && (i < sk_X509_NAME_ENTRY_num(pName->entries)); i++) {
- pNe = sk_X509_NAME_ENTRY_value(pName->entries, i);
- n = OBJ_obj2nid(pNe->object);
+ for(i = 0; (err == ERR_OK) && (i < X509_NAME_entry_count(pName)); i++) {
+ pNe = X509_NAME_get_entry(pName, i);
+ n = OBJ_obj2nid(X509_NAME_ENTRY_get_object(pNe));
s = OBJ_nid2sn(n);
- t = pNe->value->type;
+ data = X509_NAME_ENTRY_get_data(pNe);
+ t = data->type;
// mostly we find here:
// V_ASN1_PRINTABLESTRING, V_ASN1_TELETEXSTRING or V_ASN1_BMPSTRING
// that we convert to UTF, but V_ASN1_UTF8STRING allready is in UTF8
@@ -1396,10 +1401,10 @@ EXP_OPTION int ddocCertGetDNFromName(X509_NAME* pName, DigiDocMemBuf* pMemBuf)
// convert to UTF8 only
p = 0;
if(t == V_ASN1_UTF8STRING) {
- p = pNe->value->data;
- l = pNe->value->length;
+ p = data->data;
+ l = data->length;
} else
- l = ASN1_STRING_to_UTF8(&p, pNe->value);
+ l = ASN1_STRING_to_UTF8(&p, data);
ddocDebug(5, "ddocCertGetDN",
"NameEntry nid: %d type: %d len: %d item: %s value: \'%s\'",
n, t, l, s, (p ? (const char*)p : "NULL"));
@@ -1437,6 +1442,7 @@ int ddocCertGetDNPart(X509* pCert, DigiDocMemBuf* pMemBuf, int nNid, int bIssuer
int err = ERR_OK;
X509_NAME *pName = 0;
X509_NAME_ENTRY *pNe = 0;
+ ASN1_STRING *data;
int i, n, l, t, m, j;
const char *s;
unsigned char* p = 0;
@@ -1455,11 +1461,12 @@ int ddocCertGetDNPart(X509* pCert, DigiDocMemBuf* pMemBuf, int nNid, int bIssuer
pName = X509_get_issuer_name(pCert);
else
pName = X509_get_subject_name(pCert);
- for(i = 0; (err == ERR_OK) && (i < sk_X509_NAME_ENTRY_num(pName->entries)); i++) {
- pNe = sk_X509_NAME_ENTRY_value(pName->entries, i);
- n = OBJ_obj2nid(pNe->object);
+ for(i = 0; (err == ERR_OK) && (i < X509_NAME_entry_count(pName)); i++) {
+ pNe = X509_NAME_get_entry(pName, i);
+ n = OBJ_obj2nid(X509_NAME_ENTRY_get_object(pNe));
s = OBJ_nid2sn(n);
- t = pNe->value->type;
+ data = X509_NAME_ENTRY_get_data(pNe);
+ t = data->type;
// mostly we find here:
// V_ASN1_PRINTABLESTRING, V_ASN1_TELETEXSTRING or V_ASN1_BMPSTRING
// that we convert to UTF, but V_ASN1_UTF8STRING allready is in UTF8
@@ -1467,10 +1474,10 @@ int ddocCertGetDNPart(X509* pCert, DigiDocMemBuf* pMemBuf, int nNid, int bIssuer
if(n == nNid && s != NULL) {
// convert to UTF8 only
if(t == V_ASN1_UTF8STRING) {
- p = pNe->value->data;
- l = pNe->value->length;
+ p = data->data;
+ l = data->length;
} else
- l = ASN1_STRING_to_UTF8(&p, pNe->value);
+ l = ASN1_STRING_to_UTF8(&p, data);
// test for 0x0
m = (p ? strlen(p) : 0);
if(m < l && p) {
@@ -1650,6 +1657,7 @@ int bdocCertGetDN(X509* pCert, DigiDocMemBuf* pMemBuf, int bIssuer)
int err = ERR_OK;
X509_NAME *pName = 0;
X509_NAME_ENTRY *pNe = 0;
+ ASN1_STRING *data = NULL;
int i, n, l, t, b = 0;
const char *s;
unsigned char* p;
@@ -1668,11 +1676,12 @@ int bdocCertGetDN(X509* pCert, DigiDocMemBuf* pMemBuf, int bIssuer)
pName = X509_get_issuer_name(pCert);
else
pName = X509_get_subject_name(pCert);
- for(i = 0; (err == ERR_OK) && (i < sk_X509_NAME_ENTRY_num(pName->entries)); i++) {
- pNe = sk_X509_NAME_ENTRY_value(pName->entries, i);
- n = OBJ_obj2nid(pNe->object);
+ for(i = 0; (err == ERR_OK) && (i < X509_NAME_entry_count(pName)); i++) {
+ pNe = X509_NAME_get_entry(pName, i);
+ data = X509_NAME_ENTRY_get_data(pNe);
+ n = OBJ_obj2nid(X509_NAME_ENTRY_get_object(pNe));
s = OBJ_nid2sn(n);
- t = pNe->value->type;
+ t = data->type;
// mostly we find here:
// V_ASN1_PRINTABLESTRING, V_ASN1_TELETEXSTRING or V_ASN1_BMPSTRING
// that we convert to UTF, but V_ASN1_UTF8STRING allready is in UTF8
@@ -1681,10 +1690,10 @@ int bdocCertGetDN(X509* pCert, DigiDocMemBuf* pMemBuf, int bIssuer)
// convert to UTF8 only
p = 0;
if(t == V_ASN1_UTF8STRING) {
- p = pNe->value->data;
- l = pNe->value->length;
+ p = data->data;
+ l = data->length;
} else
- l = ASN1_STRING_to_UTF8(&p, pNe->value);
+ l = ASN1_STRING_to_UTF8(&p, data);
ddocDebug(5, "ddocCertGetDN",
"NameEntry nid: %d type: %d len: %d item: %s value: \'%s\'",
n, t, l, s, (p ? (const char*)p : "NULL"));
diff --git a/libdigidoc/DigiDocConfig.c b/libdigidoc/DigiDocConfig.c
index 67db4d7..b6c733e 100644
--- a/libdigidoc/DigiDocConfig.c
+++ b/libdigidoc/DigiDocConfig.c
@@ -34,7 +34,9 @@
//AA 04/01/26
#ifdef WIN32
#include <windows.h>
+#if defined(_MSC_VER) && _MSC_VER < 1900
#define snprintf _snprintf
+#endif
#elif defined(__APPLE__)
#include <CoreFoundation/CoreFoundation.h>
#endif
@@ -310,7 +312,6 @@ EXP_OPTION int initConfigStore(const char* szConfigFile)
snprintf(g_szGlobalConfigFile, _MAX_PATH, "%s/%s", g_frameworkResources, DIGIDOC_CONF_NAME);
CFRelease(url);
}
- CFRelease(bundle);
}
CFRelease(identifier);
#endif
diff --git a/libdigidoc/DigiDocConvert.c b/libdigidoc/DigiDocConvert.c
index d81b070..73f6484 100644
--- a/libdigidoc/DigiDocConvert.c
+++ b/libdigidoc/DigiDocConvert.c
@@ -40,7 +40,17 @@
#include <ctype.h>
#include <memory.h>
+#if OPENSSL_VERSION_NUMBER < 0x10010000L
+static EVP_ENCODE_CTX *EVP_ENCODE_CTX_new()
+{
+ return (EVP_ENCODE_CTX*)OPENSSL_malloc(sizeof(EVP_ENCODE_CTX));
+}
+static void EVP_ENCODE_CTX_free(EVP_ENCODE_CTX *ctx)
+{
+ OPENSSL_free(ctx);
+}
+#endif
//==========< general fucntions >============
@@ -836,16 +846,18 @@ int ddocConvertFileName(char* dest, int destlen, const char* src)
//============================================================
EXP_OPTION void encode(const byte* raw, int rawlen, byte* buf, int* buflen)
{
- EVP_ENCODE_CTX ectx;
+ EVP_ENCODE_CTX *ectx;
RETURN_VOID_IF_NULL(raw);
RETURN_VOID_IF_NULL(buf);
RETURN_VOID_IF_NULL(buflen);
memset(buf, 0, *buflen);
- EVP_EncodeInit(&ectx);
- EVP_EncodeUpdate(&ectx, buf, buflen, (byte*)raw, rawlen);
- EVP_EncodeFinal(&ectx, (unsigned char*)strchr((const char*)buf, 0), buflen);
+ ectx = EVP_ENCODE_CTX_new();
+ EVP_EncodeInit(ectx);
+ EVP_EncodeUpdate(ectx, buf, buflen, (byte*)raw, rawlen);
+ EVP_EncodeFinal(ectx, (unsigned char*)strchr((const char*)buf, 0), buflen);
+ EVP_ENCODE_CTX_free(ectx);
*buflen = strlen((const char*)buf);
while(buf[*buflen-1] == '\n' || buf[*buflen-1] == '\r' || buf[*buflen-1] == '-') {
if(buf[*buflen-1] == '-')
@@ -887,7 +899,7 @@ byte* breakToLinesOf64(byte* raw, int rawlen)
//============================================================
EXP_OPTION void decode(const byte* raw, int rawlen, byte* buf, int* buflen)
{
- EVP_ENCODE_CTX ectx;
+ EVP_ENCODE_CTX *ectx;
int l1 = 0;
byte* p;
@@ -897,21 +909,23 @@ EXP_OPTION void decode(const byte* raw, int rawlen, byte* buf, int* buflen)
memset(buf, 0, *buflen);
*buflen = 0;
- EVP_DecodeInit(&ectx);
+ ectx = EVP_ENCODE_CTX_new();
+ EVP_DecodeInit(ectx);
if((!strstr((const char*)raw, "\n") ||
!strstr((const char*)raw, "\r")) &&
strlen((const char*)raw) > 64) {
p = breakToLinesOf64((byte*)raw, rawlen);
l1 = strlen((const char*)p);
- EVP_DecodeUpdate(&ectx, (unsigned char*)buf, &l1,
+ EVP_DecodeUpdate(ectx, (unsigned char*)buf, &l1,
(unsigned char*)p,
strlen((const char*)p));
*buflen += l1;
free(p);
}
else
- EVP_DecodeUpdate(&ectx, buf, buflen, (byte*)raw, rawlen);
- EVP_DecodeFinal(&ectx, buf, &l1);
+ EVP_DecodeUpdate(ectx, buf, buflen, (byte*)raw, rawlen);
+ EVP_DecodeFinal(ectx, buf, &l1);
+ EVP_ENCODE_CTX_free(ectx);
*buflen += l1;
}
@@ -939,7 +953,7 @@ EXP_OPTION int ddocDecodeBase64(DigiDocMemBuf* pMBufSrc, DigiDocMemBuf* pMBufDes
{
int err = ERR_OK, n;
long lPos1 = 0, lPos2 = 0;
- EVP_ENCODE_CTX ectx;
+ EVP_ENCODE_CTX *ectx;
char buf1[70];
RETURN_IF_NULL(pMBufSrc);
RETURN_IF_NULL(pMBufDest);
@@ -949,7 +963,8 @@ EXP_OPTION int ddocDecodeBase64(DigiDocMemBuf* pMBufSrc, DigiDocMemBuf* pMBufDes
// alloc mem for result - it will get smaller so original length must be enough
err = ddocMemSetLength(pMBufDest, pMBufSrc->nLen);
if(err) return err;
- EVP_DecodeInit(&ectx);
+ ectx = EVP_ENCODE_CTX_new();
+ EVP_DecodeInit(ectx);
// decode base64
while(lPos1 < pMBufSrc->nLen) {
// copy next input row
@@ -965,13 +980,14 @@ EXP_OPTION int ddocDecodeBase64(DigiDocMemBuf* pMBufSrc, DigiDocMemBuf* pMBufDes
strncat(buf1, "\n", sizeof(buf1) - strlen(buf1));
// decode this chunk
n = pMBufDest->nLen - lPos2;
- EVP_DecodeUpdate(&ectx, (unsigned char*)((char*)pMBufDest->pMem + lPos2), &n,
+ EVP_DecodeUpdate(ectx, (unsigned char*)((char*)pMBufDest->pMem + lPos2), &n,
(unsigned char*)buf1, strlen((const char*)buf1));
lPos2 += n;
}
memset(buf1, 0, sizeof(buf1));
n = sizeof(buf1);
- EVP_DecodeFinal(&ectx, (unsigned char*)buf1, &n);
+ EVP_DecodeFinal(ectx, (unsigned char*)buf1, &n);
+ EVP_ENCODE_CTX_free(ectx);
lPos2 += n;
pMBufDest->nLen = lPos2;
return err;
@@ -1005,7 +1021,7 @@ EXP_OPTION int ddocDecodeBase64Data(void* data, long len, DigiDocMemBuf* pMBufDe
EXP_OPTION int ddocEncodeBase64(const DigiDocMemBuf* pMBufSrc, DigiDocMemBuf* pMBufDest)
{
int err = ERR_OK, nLen;
- EVP_ENCODE_CTX ectx;
+ EVP_ENCODE_CTX *ectx;
RETURN_IF_NULL(pMBufSrc);
RETURN_IF_NULL(pMBufDest);
@@ -1015,14 +1031,16 @@ EXP_OPTION int ddocEncodeBase64(const DigiDocMemBuf* pMBufSrc, DigiDocMemBuf* pM
// alloc mem for result
err = ddocMemSetLength(pMBufDest, pMBufSrc->nLen * 2 + 10);
if(err) return err;
- EVP_EncodeInit(&ectx);
+ ectx = EVP_ENCODE_CTX_new();
+ EVP_EncodeInit(ectx);
// encode base64
nLen = pMBufDest->nLen;
- EVP_EncodeUpdate(&ectx, (unsigned char*)pMBufDest->pMem, &nLen,
+ EVP_EncodeUpdate(ectx, (unsigned char*)pMBufDest->pMem, &nLen,
(byte*)pMBufSrc->pMem, pMBufSrc->nLen);
pMBufDest->nLen = nLen;
nLen = (pMBufSrc->nLen * 2 + 10) - pMBufDest->nLen;
- EVP_EncodeFinal(&ectx, (unsigned char*)pMBufDest->pMem + pMBufDest->nLen, &nLen);
+ EVP_EncodeFinal(ectx, (unsigned char*)pMBufDest->pMem + pMBufDest->nLen, &nLen);
+ EVP_ENCODE_CTX_free(ectx);
pMBufDest->nLen += nLen; //strlen((const char*)pMBufDest->pMem);
return err;
}
diff --git a/libdigidoc/DigiDocDefs.h b/libdigidoc/DigiDocDefs.h
index 713369c..f691326 100644
--- a/libdigidoc/DigiDocDefs.h
+++ b/libdigidoc/DigiDocDefs.h
@@ -52,7 +52,9 @@
#define FILESEPARATOR "\\"
#include <malloc.h>
#include <direct.h>
+ #if defined(_MSC_VER) && _MSC_VER < 1900
#define snprintf _snprintf
+ #endif
#else
#define FILESEPARATOR "/"
#define DIGI_DOC_LIB
diff --git a/libdigidoc/DigiDocDfExtract.c b/libdigidoc/DigiDocDfExtract.c
index 28345e9..d28725b 100644
--- a/libdigidoc/DigiDocDfExtract.c
+++ b/libdigidoc/DigiDocDfExtract.c
@@ -38,6 +38,18 @@
#include <wchar.h>
#endif
+#if OPENSSL_VERSION_NUMBER < 0x10010000L
+static EVP_ENCODE_CTX *EVP_ENCODE_CTX_new()
+{
+ return (EVP_ENCODE_CTX*)OPENSSL_malloc(sizeof(EVP_ENCODE_CTX));
+}
+
+static void EVP_ENCODE_CTX_free(EVP_ENCODE_CTX *ctx)
+{
+ OPENSSL_free(ctx);
+}
+#endif
+
#define ST_START 0
#define ST_XML 1
#define ST_TAG_NM 2
@@ -71,7 +83,7 @@ EXP_OPTION int ddocExtractDataFile(SignedDoc* pSigDoc, const char* szFileName,
char chars[1050], tag[100], attr[100], con[1030], dec[70], b64line[70];
unsigned char b64 = 0, nNc = 0, bFound = 0;
void *pBuf;
- EVP_ENCODE_CTX ectx;
+ EVP_ENCODE_CTX *ectx;
#ifdef WIN32
wchar_t *convFileName = 0, *convDataFileName = 0; i= 0;
err = utf82unicode((const char*)szFileName, (char**)&convFileName, &i);
@@ -156,7 +168,10 @@ EXP_OPTION int ddocExtractDataFile(SignedDoc* pSigDoc, const char* szFileName,
if(bFound) {
eState = ST_DF_CON;
if(b64)
- EVP_DecodeInit(&ectx);
+ {
+ ectx = EVP_ENCODE_CTX_new();
+ EVP_DecodeInit(ectx);
+ }
} else
eState = ST_CON; // tag endded - content
lc = 0;
@@ -270,7 +285,10 @@ EXP_OPTION int ddocExtractDataFile(SignedDoc* pSigDoc, const char* szFileName,
lc = 0;
con[lc] = 0;
if(b64)
- EVP_DecodeInit(&ectx);
+ {
+ ectx = EVP_ENCODE_CTX_new();
+ EVP_DecodeInit(ectx);
+ }
}
break;
case ST_DF_CON:
@@ -292,7 +310,7 @@ EXP_OPTION int ddocExtractDataFile(SignedDoc* pSigDoc, const char* szFileName,
b64line[lb] = 0;
ld = sizeof(dec);
dec[0] = 0;
- EVP_DecodeUpdate(&ectx, (unsigned char*)dec, &ld, (unsigned char*)b64line, lb);
+ EVP_DecodeUpdate(ectx, (unsigned char*)dec, &ld, (unsigned char*)b64line, lb);
lExtr += ld;
if(ld > 0)
fwrite(dec, 1, ld, fOut);
@@ -349,7 +367,7 @@ EXP_OPTION int ddocExtractDataFile(SignedDoc* pSigDoc, const char* szFileName,
b64line[lb] = 0;
ld = sizeof(dec);
dec[0] = 0;
- EVP_DecodeUpdate(&ectx, (unsigned char*)dec, &ld, (unsigned char*)b64line, lb);
+ EVP_DecodeUpdate(ectx, (unsigned char*)dec, &ld, (unsigned char*)b64line, lb);
lExtr += ld;
if(ld > 0)
fwrite(dec, 1, ld, fOut);
@@ -358,7 +376,8 @@ EXP_OPTION int ddocExtractDataFile(SignedDoc* pSigDoc, const char* szFileName,
}
ld = 0;
dec[ld] = 0;
- EVP_DecodeFinal(&ectx, (unsigned char*)dec, &ld);
+ EVP_DecodeFinal(ectx, (unsigned char*)dec, &ld);
+ EVP_ENCODE_CTX_free(ectx);
lExtr += ld;
if(ld)
fwrite(dec, 1, ld, fOut);
diff --git a/libdigidoc/DigiDocEnc.c b/libdigidoc/DigiDocEnc.c
index 60752aa..ebe26d4 100644
--- a/libdigidoc/DigiDocEnc.c
+++ b/libdigidoc/DigiDocEnc.c
@@ -49,6 +49,17 @@
#define snprintf _snprintf
#endif
+#if OPENSSL_VERSION_NUMBER < 0x10010000L
+static EVP_ENCODE_CTX *EVP_ENCODE_CTX_new()
+{
+ return (EVP_ENCODE_CTX*)OPENSSL_malloc(sizeof(EVP_ENCODE_CTX));
+}
+
+static void EVP_ENCODE_CTX_free(EVP_ENCODE_CTX *ctx)
+{
+ OPENSSL_free(ctx);
+}
+#endif
//======================< DEncEncryptedData >==============================
@@ -894,6 +905,7 @@ int dencEncryptWithCert(X509* pCert, const char* data, int dLen, char* result, i
{
int err = ERR_OK;
EVP_PKEY* pkey;
+ RSA *rsa;
// check parameters
RETURN_IF_NULL_PARAM(pCert)
@@ -905,7 +917,9 @@ int dencEncryptWithCert(X509* pCert, const char* data, int dLen, char* result, i
if(err) return err;
// encrypt data
memset((char*)result, 0, *resLen);
- *resLen = RSA_public_encrypt(dLen, (const unsigned char*)data, (unsigned char*)result, pkey->pkey.rsa, RSA_PKCS1_PADDING);
+ rsa = EVP_PKEY_get1_RSA(pkey);
+ *resLen = RSA_public_encrypt(dLen, (const unsigned char*)data, (unsigned char*)result, rsa, RSA_PKCS1_PADDING);
+ RSA_free(rsa);
// cleanup
EVP_PKEY_free(pkey); // should I ???
@@ -1317,7 +1331,7 @@ EXP_OPTION int dencEncryptedData_findEncryptedKeyByPKCS12(DEncEncryptedData* pEn
int encryptDecrypt(DigiDocMemBuf *pInData, DigiDocMemBuf *pOutData,
DigiDocMemBuf *pKey, int operation, const char* iv)
{
- EVP_CIPHER_CTX ectx;
+ EVP_CIPHER_CTX *ectx;
int err = ERR_OK, len, i, nInLen, nOutLen;
char padBuf[16], *pInMem;
int lOrigLen, lEncLen;
@@ -1364,8 +1378,9 @@ int encryptDecrypt(DigiDocMemBuf *pInData, DigiDocMemBuf *pOutData,
// copy init vector to begin of output data
if(operation == ENCRYPT)
memcpy(pOutData->pMem, iv, 16);
- EVP_CIPHER_CTX_init(&ectx);
- EVP_CipherInit_ex(&ectx, EVP_aes_128_cbc(), NULL, (const unsigned char*)pKey->pMem, (const unsigned char*)iv, operation);
+ ectx = EVP_CIPHER_CTX_new();
+ EVP_CIPHER_CTX_init(ectx);
+ EVP_CipherInit_ex(ectx, EVP_aes_128_cbc(), NULL, (const unsigned char*)pKey->pMem, (const unsigned char*)iv, operation);
//EVP_CIPHER_CTX_set_padding(&ectx, 1);
//checkErrors();
lOrigLen += nInLen;
@@ -1375,14 +1390,14 @@ int encryptDecrypt(DigiDocMemBuf *pInData, DigiDocMemBuf *pOutData,
pOutData->nLen = 16;
else
pOutData->nLen = 0;
- EVP_CipherUpdate(&ectx, (unsigned char*)pOutData->pMem + pOutData->nLen, &i, (const unsigned char*)pInMem, nInLen);
+ EVP_CipherUpdate(ectx, (unsigned char*)pOutData->pMem + pOutData->nLen, &i, (const unsigned char*)pInMem, nInLen);
lEncLen += i;
pOutData->nLen += i;
ddocDebug(3, "encryptDecrypt", "Initial update: %d into: %d -> %d", nInLen, nOutLen, i);
//TODO: in 1.1 don't check len
if(len && operation == ENCRYPT) {
- EVP_CipherUpdate(&ectx, (unsigned char*)pOutData->pMem + pOutData->nLen, &i, (const unsigned char*)padBuf, len);
+ EVP_CipherUpdate(ectx, (unsigned char*)pOutData->pMem + pOutData->nLen, &i, (const unsigned char*)padBuf, len);
ddocDebug(3, "encryptDecrypt", "Padding update: %d -> %d", len, i);
pOutData->nLen += i;
lOrigLen += len;
@@ -1390,12 +1405,12 @@ int encryptDecrypt(DigiDocMemBuf *pInData, DigiDocMemBuf *pOutData,
lEncLen += i;
}
i = nOutLen;
- EVP_CipherFinal_ex(&ectx, (unsigned char*)pOutData->pMem + pOutData->nLen, &i);
+ EVP_CipherFinal_ex(ectx, (unsigned char*)pOutData->pMem + pOutData->nLen, &i);
ddocDebug(3, "encryptDecrypt", "Final update: %d into: %d", i, nOutLen);
pOutData->nLen += i;
lEncLen += i;
ddocDebug(3, "encryptDecrypt", "Total input: %d encrypted: %d", lOrigLen, lEncLen);
- EVP_CIPHER_CTX_cleanup(&ectx);
+ EVP_CIPHER_CTX_free(ectx);
if(operation == DECRYPT) {
// check ANSI X.923 padding
len = (int)(unsigned char)((char*)pOutData->pMem)[pOutData->nLen-1];
@@ -1803,8 +1818,8 @@ EXP_OPTION int dencEncryptFile(DEncEncryptedData* pEncData,
{
int err = ERR_OK, l1, l2, l3, i, nBlock;
long lOrigLen, lEncSize, lWritten;
- EVP_CIPHER_CTX ectx;
- EVP_ENCODE_CTX bctx;
+ EVP_CIPHER_CTX *ectx;
+ EVP_ENCODE_CTX *bctx;
char convInFileName[250], convOutFileName[250];
char buf1[4096], buf2[5120], buf3[6144], buf4[70], *p2;
DigiDocMemBuf mbuf;
@@ -1841,10 +1856,12 @@ EXP_OPTION int dencEncryptFile(DEncEncryptedData* pEncData,
fwrite(mbuf.pMem, 1, mbuf.nLen, hOutFile);
ddocMemBuf_free(&mbuf);
// init encryption
- EVP_CIPHER_CTX_init(&ectx);
+ ectx = EVP_CIPHER_CTX_new();
+ EVP_CIPHER_CTX_init(ectx);
// init encoding
- EVP_EncodeInit(&bctx);
- EVP_CipherInit_ex(&ectx, EVP_aes_128_cbc(), NULL,
+ bctx = EVP_ENCODE_CTX_new();
+ EVP_EncodeInit(bctx);
+ EVP_CipherInit_ex(ectx, EVP_aes_128_cbc(), NULL,
(const unsigned char*)pEncData->mbufTransportKey.pMem,
(const unsigned char*)pEncData->initVector, ENCRYPT);
//EVP_CIPHER_CTX_set_padding(&ectx, 1);
@@ -1876,7 +1893,7 @@ EXP_OPTION int dencEncryptFile(DEncEncryptedData* pEncData,
p2 += 16;
l2 -= 16;
}
- EVP_CipherUpdate(&ectx, (unsigned char*)p2, &l2, (const unsigned char*)buf1, l1);
+ EVP_CipherUpdate(ectx, (unsigned char*)p2, &l2, (const unsigned char*)buf1, l1);
ddocDebug(3, "dencEncryptFile", "Input: %d, block: %d, buf: %d encrypted: %d", l1, nBlock, sizeof(buf2), l2);
lEncSize += l2;
// if it's the final block
@@ -1887,7 +1904,7 @@ EXP_OPTION int dencEncryptFile(DEncEncryptedData* pEncData,
p2 += 16;
l3 -= 16;
}
- EVP_CipherFinal_ex(&ectx, (unsigned char*)p2, &l3);
+ EVP_CipherFinal_ex(ectx, (unsigned char*)p2, &l3);
ddocDebug(3, "dencEncryptFile", "Buf: %d Final encrypted: %d", sizeof(buf2) - l2, l3);
l2 += l3;
lEncSize += l3;
@@ -1898,18 +1915,19 @@ EXP_OPTION int dencEncryptFile(DEncEncryptedData* pEncData,
// encode also the IV vector at the beginning of first block
if(nBlock == 0)
l2 += 16;
- EVP_EncodeUpdate(&bctx, (unsigned char*)buf3, &l3, (byte*)buf2, l2);
+ EVP_EncodeUpdate(bctx, (unsigned char*)buf3, &l3, (byte*)buf2, l2);
lWritten += l3;
fwrite(buf3, 1, l3, hOutFile);
ddocDebug(3, "dencEncryptFile", "In: %d, encrypted: %d, base64: %d", l1, l2, l3);
}
nBlock++;
} while(!err && l1 > 0);
- EVP_CIPHER_CTX_cleanup(&ectx);
+ EVP_CIPHER_CTX_free(ectx);
// write the last portion of line data
l3 = sizeof(buf3);
memset(buf3, 0, l3);
- EVP_EncodeFinal(&bctx, (unsigned char*)buf3, &l3);
+ EVP_EncodeFinal(bctx, (unsigned char*)buf3, &l3);
+ EVP_ENCODE_CTX_free(bctx);
lWritten += l3;
fwrite(buf3, 1, l3, hOutFile);
ddocDebug(4, "dencEncryptFile", "Total input: %d, blocks: %d, encrypted: %d written: %d", lOrigLen, nBlock, lEncSize, lWritten);
diff --git a/libdigidoc/DigiDocEncSAXParser.c b/libdigidoc/DigiDocEncSAXParser.c
index bfd347b..cb38322 100644
--- a/libdigidoc/DigiDocEncSAXParser.c
+++ b/libdigidoc/DigiDocEncSAXParser.c
@@ -51,6 +51,18 @@
#include <libxml/parser.h>
#include <libxml/parserInternals.h> /* only for xmlNewInputFromFile() */
+#if OPENSSL_VERSION_NUMBER < 0x10010000L
+static EVP_ENCODE_CTX *EVP_ENCODE_CTX_new()
+{
+ return (EVP_ENCODE_CTX*)OPENSSL_malloc(sizeof(EVP_ENCODE_CTX));
+}
+
+static void EVP_ENCODE_CTX_free(EVP_ENCODE_CTX *ctx)
+{
+ OPENSSL_free(ctx);
+}
+#endif
+
//===============< SAX handlers >==============================
/*
@@ -235,18 +247,20 @@ int dencSaxHandleEndCipherValue(DEncParse* pctx)
{
int err = ERR_OK, l = 0, i;
char *p = 0;
- EVP_ENCODE_CTX ectx;
+ EVP_ENCODE_CTX *ectx;
if(pctx->mbufContent.pMem && pctx->mbufContent.nLen) {
l = pctx->mbufContent.nLen; // enough since it's shrinking
p = (char*)malloc(l);
RETURN_IF_BAD_ALLOC(p)
//decode((const byte*)pctx->mbufContent.pMem, pctx->mbufContent.nLen, p, &l);
- EVP_DecodeInit(&ectx);
- EVP_DecodeUpdate(&ectx, (unsigned char*)p, &l, (unsigned char*)pctx->mbufContent.pMem, pctx->mbufContent.nLen);
+ ectx = EVP_ENCODE_CTX_new();
+ EVP_DecodeInit(ectx);
+ EVP_DecodeUpdate(ectx, (unsigned char*)p, &l, (unsigned char*)pctx->mbufContent.pMem, pctx->mbufContent.nLen);
ddocDebug(3, "dencSaxHandleEndCipherValue", "Initial decoding: %d -> %d bytes", pctx->mbufContent.nLen, l);
i = pctx->mbufContent.nLen - l;
- EVP_DecodeFinal(&ectx, (unsigned char*)p+l, &i);
+ EVP_DecodeFinal(ectx, (unsigned char*)p+l, &i);
+ EVP_ENCODE_CTX_free(ectx);
l += i;
ddocDebug(3, "dencSaxHandleEndCipherValue", "Final decoding: %d bytes", i);
ddocDebug(3, "dencSaxHandleEndCipherValue", "Decoding: %d bytes of base64 data, got: %d bytes", pctx->mbufContent.nLen, l);
@@ -663,8 +677,8 @@ typedef struct DEncDecryptParse_st {
char* szPin;
int nSlot;
long lB64Len, lBinLen, lDecLen;
- EVP_ENCODE_CTX ectx;
- EVP_CIPHER_CTX dctx;
+ EVP_ENCODE_CTX *ectx;
+ EVP_CIPHER_CTX *dctx;
int nB64SkipMode;
char errmsg[100];
char szCertSerial[100];
@@ -715,8 +729,9 @@ static void dencDecryptStartElementHandler(void *ctx, const xmlChar *name, const
!ddocStackHasParentWithName(&(pctx->dencStack), (xmlChar*)"EncryptedKey", NULL)) {
if(pctx->nB64SkipMode == 0) {
ddocDebug(4, "dencDecryptStartElementHandler", "Decode init");
- EVP_DecodeInit(&(pctx->ectx));
- EVP_CIPHER_CTX_init(&(pctx->dctx));
+ pctx->ectx = EVP_ENCODE_CTX_new();
+ EVP_DecodeInit(pctx->ectx);
+ EVP_CIPHER_CTX_init(pctx->dctx);
pctx->lB64Len = pctx->lBinLen = pctx->lDecLen = 0;
}
pctx->nB64SkipMode++; // increment skip mode
@@ -825,14 +840,16 @@ static void dencDecryptEndElementHandler(void *ctx, const xmlChar *name)
l1 = sizeof(buf1);
memset(buf1, 0, l1);
ddocDebug(4, "dencDecryptEndElementHandler", "Decoding: final into: %d", l1);
- EVP_DecodeFinal(&(pctx->ectx), (unsigned char*)buf1, &l1);
+ EVP_DecodeFinal(pctx->ectx, (unsigned char*)buf1, &l1);
+ EVP_ENCODE_CTX_free(pctx->ectx);
pctx->lBinLen += l1;
ddocDebug(4, "dencDecryptEndElementHandler", "Decoded: final got: %d, total %d -> %d", l1, pctx->lB64Len, pctx->lBinLen);
// decrypt decoded data
l2 = sizeof(buf2);
memset(buf2, 0, l2);
ddocDebug(3, "dencDecryptEndElementHandler", "Decrypting: final into: %d", l2);
- EVP_CipherFinal_ex(&(pctx->dctx), (unsigned char*)buf2, &l2);
+ EVP_CipherFinal_ex(pctx->dctx, (unsigned char*)buf2, &l2);
+ EVP_CIPHER_CTX_free(pctx->dctx);
ddocDebug(4, "dencDecryptEndElementHandler", "Decrypted: final got: %d", l2);
// write to file
if(pctx->hOutFile) {
@@ -902,7 +919,7 @@ static void dencDecryptCharactersHandler(void *ctx, const xmlChar *ch, int len)
}
memset(buf1, 0, l1);
ddocDebug(4, "dencDecryptCharactersHandler", "Decoding: %d into: %d, skip: %d", len, l1, pctx->nB64SkipMode);
- EVP_DecodeUpdate(&(pctx->ectx), (unsigned char*)buf1, &l1, (unsigned char*)ch, len);
+ EVP_DecodeUpdate(pctx->ectx, (unsigned char*)buf1, &l1, (unsigned char*)ch, len);
ddocDebug(4, "dencDecryptCharactersHandler", "Decoded: %d got: %d, skip: %d", len, l1, pctx->nB64SkipMode);
// if this was the first block of decoded base64 data
// then use the first 16 bytes as the IV value
@@ -911,7 +928,8 @@ static void dencDecryptCharactersHandler(void *ctx, const xmlChar *ch, int len)
ddocDebug(4, "dencDecryptCharactersHandler", "Using 16 bytes for IV. Initing cipher");
p1 += 16; // don't decrypt the IV data
l1 -= 16;
- EVP_CipherInit_ex(&(pctx->dctx), EVP_aes_128_cbc(), NULL,
+ pctx->dctx = EVP_CIPHER_CTX_new();
+ EVP_CipherInit_ex(pctx->dctx, EVP_aes_128_cbc(), NULL,
(const unsigned char*)pctx->mbufTransportKey.pMem, (const unsigned char*)buf1, DECRYPT);
}
pctx->lBinLen += l1;
@@ -927,7 +945,7 @@ static void dencDecryptCharactersHandler(void *ctx, const xmlChar *ch, int len)
//if(pctx->nB64SkipMode == 4)
// l1 += 16; // ???
ddocDebug(4, "dencDecryptCharactersHandler", "Decrypting: %d into: %d", l1, l2);
- EVP_CipherUpdate(&(pctx->dctx), (unsigned char*)buf2, &l, (const unsigned char*)p1, l1);
+ EVP_CipherUpdate(pctx->dctx, (unsigned char*)buf2, &l, (const unsigned char*)p1, l1);
ddocDebug(4, "dencDecryptCharactersHandler", "Decrypted: %d got: %d, skip: %d", l1, l, pctx->nB64SkipMode);
if(buf1)
free(buf1);
diff --git a/libdigidoc/DigiDocGen.c b/libdigidoc/DigiDocGen.c
index dc016b1..805b479 100644
--- a/libdigidoc/DigiDocGen.c
+++ b/libdigidoc/DigiDocGen.c
@@ -47,6 +47,25 @@
#include <fcntl.h>
+#if OPENSSL_VERSION_NUMBER < 0x10010000L
+static EVP_ENCODE_CTX *EVP_ENCODE_CTX_new()
+{
+ return (EVP_ENCODE_CTX*)OPENSSL_malloc(sizeof(EVP_ENCODE_CTX));
+}
+
+static void EVP_ENCODE_CTX_free(EVP_ENCODE_CTX *ctx)
+{
+ OPENSSL_free(ctx);
+}
+
+static void RSA_get0_key(const RSA *r, const BIGNUM **n, const BIGNUM **e, const BIGNUM **d)
+{
+ if (n) *n = r->n;
+ if (e) *e = r->e;
+ if (d) *d = r->d;
+}
+#endif
+
//-----------< helper functions >----------------------------
@@ -265,13 +284,13 @@ EXP_OPTION time_t convertStringToTimeT(const SignedDoc* pSigDoc, const char* szT
}
tm1.tm_year -= 1900;
tm1.tm_mon -= 1;
- tm1.tm_isdst = daylight;
+ tm1.tm_isdst = _daylight;
t2 = mktime(&tm1);
if(_daylight != 0) {
if(_timezone < 0)
- dmz = (_timezone / 3600) - daylight;
+ dmz = (_timezone / 3600) - _daylight;
else
- dmz = (_timezone / 3600) + daylight;
+ dmz = (_timezone / 3600) + _daylight;
}
else
dmz = _timezone / 3600;
@@ -1088,6 +1107,8 @@ int addSignatureInfoXML(DigiDocMemBuf *pMBufXML, SignedDoc* pSigDoc, SignatureIn
unsigned char buf2[500], *buf1 = 0;
int len2, len1;
EVP_PKEY* pubKey = NULL;
+ const RSA *rsa = NULL;
+ const BIGNUM *n = NULL, *e = NULL;
SignatureValue *pSigVal;
DigiDocMemBuf mbuf1;
@@ -1127,9 +1148,11 @@ int addSignatureInfoXML(DigiDocMemBuf *pMBufXML, SignedDoc* pSigDoc, SignatureIn
// FIXME
// modulus
//AM 11.02.09
- if(!err && pubKey->type==NID_rsaEncryption) {
+ if(!err && EVP_PKEY_base_id(pubKey)==EVP_PKEY_RSA) {
ddocMemAppendData(pMBufXML,"<KeyValue>\n<RSAKeyValue>\n", -1);
- len1 = BN_bn2bin(pubKey->pkey.rsa->n, buf1);
+ rsa = EVP_PKEY_get1_RSA(pubKey);
+ RSA_get0_key(rsa, &n, &e, NULL);
+ len1 = BN_bn2bin(n, buf1);
// in version 1.1 we output modulus as it is
// starting from 1.2 we convert it to big-endian
/*len2 = sizeof(buf2);
@@ -1148,7 +1171,7 @@ int addSignatureInfoXML(DigiDocMemBuf *pMBufXML, SignedDoc* pSigDoc, SignatureIn
ddocMemAppendData(pMBufXML,"</Modulus>\n", -1);
// exponent
memset(buf1, 0, len1);
- len1 = BN_bn2bin(pubKey->pkey.rsa->e, buf1);
+ len1 = BN_bn2bin(e, buf1);
len2 = sizeof(buf2);
memset(buf2, 0, len2);
encode(buf1, len1, buf2, &len2);
@@ -1156,7 +1179,8 @@ int addSignatureInfoXML(DigiDocMemBuf *pMBufXML, SignedDoc* pSigDoc, SignatureIn
ddocMemAppendData(pMBufXML, (char*)buf2, -1);
ddocMemAppendData(pMBufXML,"</Exponent>\n", -1);
ddocMemAppendData(pMBufXML,"</RSAKeyValue>\n</KeyValue>\n", -1);
- }
+ RSA_free(rsa);
+ }
// cert data
ddocMemAppendData(pMBufXML,"<X509Data><X509Certificate>\n", -1);
}
@@ -1237,7 +1261,7 @@ EXP_OPTION int generateDataFileXML(SignedDoc* pSigDoc, DataFile* pDataFile,
char buf1[2050], buf2[5000], fixedFileName[1024], *p = 0;
char *name, *value, *fName;
FILE *fIn = 0;
- EVP_ENCODE_CTX ectx;
+ EVP_ENCODE_CTX *ectx;
SHA_CTX sctx;
DigiDocMemBuf mbuf1, mbuf2, mbuf3;
#ifdef WIN32
@@ -1385,7 +1409,10 @@ EXP_OPTION int generateDataFileXML(SignedDoc* pSigDoc, DataFile* pDataFile,
#endif
ddocDebug(4, "generateDataFileXML", "Opened FILE01: %s", szDataFile);
if(!strcmp(pSigDoc->szFormat, SK_XML_1_NAME))
- EVP_DecodeInit(&ectx);
+ {
+ ectx = EVP_ENCODE_CTX_new();
+ EVP_DecodeInit(ectx);
+ }
while((len1 = fread(buf1, 1, sizeof(buf1)-2, fIn)) > 0) {
#ifdef WITH_BASE64_HASHING_HACK
if(!strcmp(pDataFile->szContentType, CONTENT_EMBEDDED_BASE64)) {
@@ -1407,7 +1434,7 @@ EXP_OPTION int generateDataFileXML(SignedDoc* pSigDoc, DataFile* pDataFile,
while(*p == ' ' || *p == '\n' || *p == '\r') p++;
ddocDebug(4, "generateDataFileXML", "decode: %s", p);
len2 = sizeof(buf2);
- EVP_DecodeUpdate(&ectx, (unsigned char*)buf2, &len2, (unsigned char*)p, strlen(p));
+ EVP_DecodeUpdate(ectx, (unsigned char*)buf2, &len2, (unsigned char*)p, strlen(p));
ddocDebug(4, "generateDataFileXML", "sha1 update orig: %d: dec: %d", len1, len2);
SHA1_Update(&sctx, (const char*)buf2, len2);
//ddocDebugWriteFile(4, "df-data0.txt", &mbuf3);
@@ -1427,7 +1454,8 @@ EXP_OPTION int generateDataFileXML(SignedDoc* pSigDoc, DataFile* pDataFile,
fIn = 0;
if(!strcmp(pSigDoc->szFormat, SK_XML_1_NAME)) {
len2 = sizeof(buf2);
- EVP_DecodeFinal(&ectx, (unsigned char*)buf2, &len2);
+ EVP_DecodeFinal(ectx, (unsigned char*)buf2, &len2);
+ EVP_ENCODE_CTX_free(ectx);
SHA1_Update(&sctx, (const char*)buf2, len2);
ddocDebug(4, "generateDataFileXML", "sha1 final dec: %d", len1, len2);
len2 = sizeof(buf2);
@@ -1455,10 +1483,11 @@ EXP_OPTION int generateDataFileXML(SignedDoc* pSigDoc, DataFile* pDataFile,
ddocDebug(4, "generateDataFileXML", "Opened FILE2: %s", fixedFileName);
// if encoded
if(!strcmp(pDataFile->szContentType, CONTENT_EMBEDDED_BASE64)) {
- EVP_EncodeInit(&ectx);
+ ectx = EVP_ENCODE_CTX_new();
+ EVP_EncodeInit(ectx);
while((len1 = fread(buf1, 1, sizeof(buf1), fIn)) > 0) {
len2 = sizeof(buf2);
- EVP_EncodeUpdate(&ectx, (unsigned char*)buf2, &len2, (unsigned char*)buf1, len1);
+ EVP_EncodeUpdate(ectx, (unsigned char*)buf2, &len2, (unsigned char*)buf1, len1);
buf2[len2] = 0;
#ifdef WITH_BASE64_HASHING_HACK
ddocCanonicalizePCDATA(buf2);
@@ -1474,7 +1503,8 @@ EXP_OPTION int generateDataFileXML(SignedDoc* pSigDoc, DataFile* pDataFile,
if(hFile)
fwrite(buf2, sizeof(char), len2, hFile);
}
- EVP_EncodeFinal(&ectx, (unsigned char*)buf2, &len2);
+ EVP_EncodeFinal(ectx, (unsigned char*)buf2, &len2);
+ EVP_ENCODE_CTX_free(ectx);
buf2[len2] = 0;
#ifdef WITH_BASE64_HASHING_HACK
ddocCanonicalizePCDATA(buf2);
diff --git a/libdigidoc/DigiDocLib.c b/libdigidoc/DigiDocLib.c
index 4ec82e2..83509d1 100644
--- a/libdigidoc/DigiDocLib.c
+++ b/libdigidoc/DigiDocLib.c
@@ -125,6 +125,21 @@
#include <openssl/pkcs12.h>
#include <openssl/rand.h>
+#if OPENSSL_VERSION_NUMBER < 0x10010000L
+static EVP_MD_CTX *EVP_MD_CTX_new()
+{
+ return (EVP_MD_CTX*)OPENSSL_malloc(sizeof(EVP_MD_CTX));
+}
+
+static void EVP_MD_CTX_free(EVP_MD_CTX *ctx)
+{
+ OPENSSL_free(ctx);
+}
+#else
+# define BIO_R_BAD_HOSTNAME_LOOKUP 102
+# define OCSP_R_SERVER_WRITE_ERROR 116
+#endif
+
long int tzone = -7200; /* default for Estonia, but see initDigiDocLib() */
int daylight = 0; /* default, but see initDigiDocLib() */
@@ -474,7 +489,7 @@ EXP_OPTION int calculateFileSignature(const char* szFileName, int nDigestType,
const char *keyfile, const char* passwd)
{
int err = ERR_OK;
- EVP_MD_CTX ctx;
+ EVP_MD_CTX *ctx;
byte buf[FILE_BUFSIZE];
int i;
FILE *f = NULL;
@@ -491,13 +506,15 @@ EXP_OPTION int calculateFileSignature(const char* szFileName, int nDigestType,
if(*nSigLen >= SIGNATURE_LEN) {
if((err = ReadPrivateKey(&pkey, keyfile, passwd, FILE_FORMAT_PEM)) == ERR_OK) {
if((f = fopen(szFileName,"rb")) != NULL) {
- EVP_SignInit(&ctx, EVP_sha1());
+ ctx = EVP_MD_CTX_new();
+ EVP_SignInit(ctx, EVP_sha1());
for (;;) {
i = fread(buf, sizeof(char), FILE_BUFSIZE, f);
if (i <= 0) break;
- EVP_SignUpdate (&ctx, buf, (unsigned long)i);
+ EVP_SignUpdate (ctx, buf, (unsigned long)i);
}
- err = EVP_SignFinal(&ctx, pSigBuf, (unsigned int*)nSigLen, pkey);
+ err = EVP_SignFinal(ctx, pSigBuf, (unsigned int*)nSigLen, pkey);
+ EVP_MD_CTX_free(ctx);
if(err == ERR_LIB_NONE)
err = ERR_OK;
fclose(f);
@@ -535,7 +552,7 @@ EXP_OPTION int signData(const byte* data, int dlen, byte* pSigBuf, int* nSigLen,
int nDigestType, const char *keyfile, const char* passwd)
{
int err = ERR_OK;
- EVP_MD_CTX ctx;
+ EVP_MD_CTX *ctx;
EVP_PKEY* pkey;
RETURN_IF_NULL_PARAM(data);
@@ -548,9 +565,11 @@ EXP_OPTION int signData(const byte* data, int dlen, byte* pSigBuf, int* nSigLen,
if(nDigestType == DIGEST_SHA1) {
if(*nSigLen >= SIGNATURE_LEN) {
if((err = ReadPrivateKey(&pkey, keyfile, passwd, FILE_FORMAT_PEM)) == ERR_OK) {
- EVP_SignInit(&ctx, EVP_sha1());
- EVP_SignUpdate (&ctx, data, (unsigned long)dlen);
- err = EVP_SignFinal(&ctx, pSigBuf, (unsigned int*)nSigLen, pkey);
+ ctx = EVP_MD_CTX_new();
+ EVP_SignInit(ctx, EVP_sha1());
+ EVP_SignUpdate (ctx, data, (unsigned long)dlen);
+ err = EVP_SignFinal(ctx, pSigBuf, (unsigned int*)nSigLen, pkey);
+ EVP_MD_CTX_free(ctx);
if(err == ERR_LIB_NONE)
err = ERR_OK;
EVP_PKEY_free(pkey);
diff --git a/libdigidoc/DigiDocOCSP.c b/libdigidoc/DigiDocOCSP.c
index 48973e7..5c48aac 100644
--- a/libdigidoc/DigiDocOCSP.c
+++ b/libdigidoc/DigiDocOCSP.c
@@ -59,6 +59,58 @@ static int password_callback(char *buf, int bufsiz, int verify, void *cb_data)
}
#endif
+#if OPENSSL_VERSION_NUMBER < 0x10010000L
+static int OCSP_resp_get0_id(const OCSP_BASICRESP *bs, const ASN1_OCTET_STRING **pid, const X509_NAME **pname)
+{
+ *pid = NULL;
+ *pname = NULL;
+ const OCSP_RESPID *rid = bs->tbsResponseData->responderId;
+ if (rid->type == V_OCSP_RESPID_NAME)
+ *pname = rid->value.byName;
+ else if (rid->type == V_OCSP_RESPID_KEY)
+ *pid = rid->value.byKey;
+ else
+ return 0;
+ return 1;
+}
+
+static const ASN1_GENERALIZEDTIME *OCSP_resp_get0_produced_at(const OCSP_BASICRESP* bs)
+{
+ return bs->tbsResponseData->producedAt;
+}
+
+static const OCSP_CERTID *OCSP_SINGLERESP_get0_id(const OCSP_SINGLERESP *single)
+{
+ return single->certId;
+}
+
+static const ASN1_OCTET_STRING *OCSP_resp_get0_signature(const OCSP_BASICRESP *bs)
+{
+ return bs->signature;
+}
+
+static const STACK_OF(X509_EXTENSION) *X509_get0_extensions(const X509 *x)
+{
+ return x->cert_info->extensions;
+}
+
+static const ASN1_TIME *X509_get0_notBefore(const X509 *x)
+{
+ return x->cert_info->validity->notBefore;
+}
+
+static const ASN1_TIME *X509_get0_notAfter(const X509 *x)
+{
+ return x->cert_info->validity->notAfter;
+}
+#else
+# define BIO_R_BAD_HOSTNAME_LOOKUP 102
+# define OCSP_R_NO_CONTENT 106
+# define OCSP_F_OCSP_SENDREQ_BIO 112
+# define OCSP_R_SERVER_READ_ERROR 113
+# define OCSP_R_SERVER_WRITE_ERROR 116
+#endif
+
//================< OCSP functions> =================================
static int ddocOcspProxyAuthInfo(char *authinfo, const char *user, const char *pass)
@@ -309,20 +361,21 @@ int calcNotaryDigest(SignedDoc* pSigDoc, NotaryInfo* pNotary)
int initializeNotaryInfoWithOCSP(SignedDoc *pSigDoc, NotaryInfo *pNotary,
OCSP_RESPONSE *resp, X509 *notCert, int initDigest)
{
- int n, err = ERR_OK;
+ int n, err = ERR_OK, status = 0;
char buf[500];
OCSP_RESPBYTES *rb = NULL;
OCSP_BASICRESP *br = NULL;
- OCSP_RESPDATA *rd = NULL;
- OCSP_RESPID *rid = NULL;
- // OCSP_CERTSTATUS *cst = NULL;
OCSP_SINGLERESP *single = NULL;
- OCSP_CERTID *cid = NULL;
+ const OCSP_CERTID *cid = NULL;
X509_EXTENSION *nonce;
+ const ASN1_GENERALIZEDTIME *producedAt = NULL;
//AM 26.09.08
DigiDocMemBuf mbuf1;
mbuf1.pMem = 0;
mbuf1.nLen = 0;
+ const ASN1_OCTET_STRING *id = NULL;
+ const X509_NAME *name = NULL;
+ ASN1_OBJECT *hashAlgorithm = NULL;
RETURN_IF_NULL_PARAM(pNotary);
@@ -348,69 +401,66 @@ int initializeNotaryInfoWithOCSP(SignedDoc *pSigDoc, NotaryInfo *pNotary,
default:
SET_LAST_ERROR_RETURN_CODE(ERR_OCSP_UNSUCCESSFUL);
}
- RETURN_IF_NULL_PARAM(resp->responseBytes);
- rb = resp->responseBytes;
- if(OBJ_obj2nid(rb->responseType) != NID_id_pkix_OCSP_basic)
- SET_LAST_ERROR_RETURN_CODE(ERR_OCSP_UNKNOWN_TYPE);
if((br = OCSP_response_get1_basic(resp)) == NULL)
SET_LAST_ERROR_RETURN_CODE(ERR_OCSP_NO_BASIC_RESP);
ddocDebug(4, "initializeNotaryInfoWithOCSP", "test2");
- rd = br->tbsResponseData;
- if(ASN1_INTEGER_get(rd->version) != 0)
- SET_LAST_ERROR_RETURN_CODE(ERR_OCSP_WRONG_VERSION);
- n = sk_OCSP_SINGLERESP_num(rd->responses);
+ n = OCSP_resp_count(br);
if(n != 1)
SET_LAST_ERROR_RETURN_CODE(ERR_OCSP_ONE_RESPONSE);
- single = sk_OCSP_SINGLERESP_value(rd->responses, 0);
+ single = OCSP_resp_get0(br, 0);
RETURN_IF_NULL(single);
- cid = single->certId;
+ cid = OCSP_SINGLERESP_get0_id(single);
RETURN_IF_NULL(cid);
- ddocDebug(4, "initializeNotaryInfoWithOCSP", "CertStatus-type: %d", single->certStatus->type);
+ status = OCSP_single_get0_status(single, NULL, NULL, NULL, NULL);
+ ddocDebug(4, "initializeNotaryInfoWithOCSP", "CertStatus-type: %d", status);
//printf("TYPE: %d\n", single->certStatus->type);
- if(single->certStatus->type != 0) {
- ddocDebug(4, "initializeNotaryInfoWithOCSP", "errcode: %d", handleOCSPCertStatus(single->certStatus->type));
- SET_LAST_ERROR_RETURN_CODE(handleOCSPCertStatus(single->certStatus->type));
+ if(status != 0) {
+ ddocDebug(4, "initializeNotaryInfoWithOCSP", "errcode: %d", handleOCSPCertStatus(status));
+ SET_LAST_ERROR_RETURN_CODE(handleOCSPCertStatus(status));
}
//Removed 31.10.2003
//if(single->singleExtensions)
// SET_LAST_ERROR_RETURN_CODE(ERR_OCSP_NO_SINGLE_EXT);
- if(!rd->responseExtensions ||
- (sk_X509_EXTENSION_num(rd->responseExtensions) != 1) ||
- ((nonce = sk_X509_EXTENSION_value(rd->responseExtensions, 0)) == NULL))
+ if((OCSP_BASICRESP_get_ext_count(br) != 1) ||
+ ((nonce = OCSP_BASICRESP_get_ext(br, 0)) == NULL))
SET_LAST_ERROR_RETURN_CODE(ERR_OCSP_NO_NONCE);
- i2t_ASN1_OBJECT(buf,sizeof(buf),nonce->object);
+ i2t_ASN1_OBJECT(buf,sizeof(buf), X509_EXTENSION_get_object(nonce));
if(strcmp(buf, OCSP_NONCE_NAME))
SET_LAST_ERROR_RETURN_CODE(ERR_OCSP_NO_NONCE);
- rid = rd->responderId;
- if(rid->type == V_OCSP_RESPID_NAME) {
+ OCSP_resp_get0_id(br, &id, &name);
+ if(name) {
pNotary->nRespIdType = RESPID_NAME_TYPE;
- } else if(rid->type == V_OCSP_RESPID_KEY) {
+ } else if(id) {
pNotary->nRespIdType = RESPID_KEY_TYPE;
} else {
SET_LAST_ERROR_RETURN_CODE(ERR_OCSP_WRONG_RESPID);
}
// producedAt
- err = asn1time2str(pSigDoc, rd->producedAt, buf, sizeof(buf));
+ producedAt = OCSP_resp_get0_produced_at(br);
+ err = asn1time2str(pSigDoc, (ASN1_GENERALIZEDTIME*)producedAt, buf, sizeof(buf));
setString(&(pNotary->timeProduced), buf, -1);
n = sizeof(buf);
- if(rid->type == V_OCSP_RESPID_NAME){
+ if(name){
//X509_NAME_oneline(rid->value.byName,buf,n);
- err = ddocCertGetDNFromName(rid->value.byName, &mbuf1);
+ err = ddocCertGetDNFromName((X509_NAME*)name, &mbuf1);
err = ddocNotInfo_SetResponderId(pNotary, (char*)mbuf1.pMem, -1);
ddocMemBuf_free(&mbuf1);
}
- if(rid->type == V_OCSP_RESPID_KEY) {
- err = ddocNotInfo_SetResponderId(pNotary, (const char*)rid->value.byKey->data, rid->value.byKey->length);
+ if(id) {
+ err = ddocNotInfo_SetResponderId(pNotary, (const char*)id->data, id->length);
}
+ OCSP_id_get0_info(NULL, &hashAlgorithm, NULL, NULL, (OCSP_CERTID*)cid);
// digest type
- i2t_ASN1_OBJECT(buf,sizeof(buf),cid->hashAlgorithm->algorithm);
+ i2t_ASN1_OBJECT(buf,sizeof(buf),hashAlgorithm);
//AM 24.11.09 why its needed? added if. 08.12.09 used for gen
if(!pNotary->szDigestType){
setString(&(pNotary->szDigestType), buf, -1);
}
+#if OPENSSL_VERSION_NUMBER < 0x10010000L
// signature algorithm
i2t_ASN1_OBJECT(buf,sizeof(buf),br->signatureAlgorithm->algorithm);
setString(&(pNotary->szSigType), buf, -1);
+#endif
// notary cert
if(notCert && !err)
err = addNotaryInfoCert(pSigDoc, pNotary, notCert);
@@ -427,20 +477,22 @@ int initializeNotaryInfoWithOCSP(SignedDoc *pSigDoc, NotaryInfo *pNotary,
int initializeNotaryInfoWithOCSP2(SignedDoc *pSigDoc, NotaryInfo *pNotary,
OCSP_RESPONSE *resp, X509 *notCert, int initDigest)
{
- int n, err = ERR_OK;
+ int n, err = ERR_OK, status = 0;
char buf[500];
OCSP_RESPBYTES *rb = NULL;
OCSP_BASICRESP *br = NULL;
- OCSP_RESPDATA *rd = NULL;
- OCSP_RESPID *rid = NULL;
// OCSP_CERTSTATUS *cst = NULL;
OCSP_SINGLERESP *single = NULL;
- OCSP_CERTID *cid = NULL;
+ const OCSP_CERTID *cid = NULL;
X509_EXTENSION *nonce;
+ const ASN1_GENERALIZEDTIME *producedAt = NULL;
//AM 26.09.08
DigiDocMemBuf mbuf1;
mbuf1.pMem = 0;
mbuf1.nLen = 0;
+ const ASN1_OCTET_STRING *id = NULL;
+ const X509_NAME *name = NULL;
+ ASN1_OBJECT *hashAlgorithm = NULL;
RETURN_IF_NULL_PARAM(pNotary);
@@ -462,23 +514,17 @@ int initializeNotaryInfoWithOCSP2(SignedDoc *pSigDoc, NotaryInfo *pNotary,
default:
SET_LAST_ERROR_RETURN_CODE(ERR_OCSP_UNSUCCESSFUL);
}
- RETURN_IF_NULL_PARAM(resp->responseBytes);;
- rb = resp->responseBytes;
- if(OBJ_obj2nid(rb->responseType) != NID_id_pkix_OCSP_basic)
- SET_LAST_ERROR_RETURN_CODE(ERR_OCSP_UNKNOWN_TYPE);
if((br = OCSP_response_get1_basic(resp)) == NULL)
SET_LAST_ERROR_RETURN_CODE(ERR_OCSP_NO_BASIC_RESP);
- rd = br->tbsResponseData;
- if(ASN1_INTEGER_get(rd->version) != 0)
- SET_LAST_ERROR_RETURN_CODE(ERR_OCSP_WRONG_VERSION);
- n = sk_OCSP_SINGLERESP_num(rd->responses);
+ n = OCSP_resp_count(br);
if(n != 1)
SET_LAST_ERROR_RETURN_CODE(ERR_OCSP_ONE_RESPONSE);
- single = sk_OCSP_SINGLERESP_value(rd->responses, 0);
+ single = OCSP_resp_get0(br, 0);
RETURN_IF_NULL(single);
- cid = single->certId;
+ cid = OCSP_SINGLERESP_get0_id(single);
RETURN_IF_NULL(cid);
- ddocDebug(4, "initializeNotaryInfoWithOCSP", "CertStatus-type: %d", single->certStatus->type);
+ status = OCSP_single_get0_status(single, NULL, NULL, NULL, NULL);
+ ddocDebug(4, "initializeNotaryInfoWithOCSP", "CertStatus-type: %d", status);
//printf("TYPE: %d\n", single->certStatus->type);
//Am test
/*if(single->certStatus->type != 0) {
@@ -488,40 +534,43 @@ int initializeNotaryInfoWithOCSP2(SignedDoc *pSigDoc, NotaryInfo *pNotary,
//Removed 31.10.2003
//if(single->singleExtensions)
// SET_LAST_ERROR_RETURN_CODE(ERR_OCSP_NO_SINGLE_EXT);
- if(!rd->responseExtensions ||
- (sk_X509_EXTENSION_num(rd->responseExtensions) != 1) ||
- ((nonce = sk_X509_EXTENSION_value(rd->responseExtensions, 0)) == NULL))
+ if((OCSP_BASICRESP_get_ext_count(br) != 1) ||
+ ((nonce = OCSP_BASICRESP_get_ext(br, 0)) == NULL))
SET_LAST_ERROR_RETURN_CODE(ERR_OCSP_NO_NONCE);
- i2t_ASN1_OBJECT(buf,sizeof(buf),nonce->object);
+ i2t_ASN1_OBJECT(buf,sizeof(buf),X509_EXTENSION_get_object(nonce));
if(strcmp(buf, OCSP_NONCE_NAME))
SET_LAST_ERROR_RETURN_CODE(ERR_OCSP_NO_NONCE);
- rid = rd->responderId;
- if(rid->type == V_OCSP_RESPID_NAME) {
+ OCSP_resp_get0_id(br, &id, &name);
+ if(name) {
pNotary->nRespIdType = RESPID_NAME_TYPE;
- } else if(rid->type == V_OCSP_RESPID_KEY) {
+ } else if(id) {
pNotary->nRespIdType = RESPID_KEY_TYPE;
} else {
SET_LAST_ERROR_RETURN_CODE(ERR_OCSP_WRONG_RESPID);
}
// producedAt
- err = asn1time2str(pSigDoc, rd->producedAt, buf, sizeof(buf));
+ producedAt = OCSP_resp_get0_produced_at(br);
+ err = asn1time2str(pSigDoc, (ASN1_GENERALIZEDTIME*)producedAt, buf, sizeof(buf));
setString(&(pNotary->timeProduced), buf, -1);
n = sizeof(buf);
- if(rid->type == V_OCSP_RESPID_NAME){
- err = ddocCertGetDNFromName(rid->value.byName, &mbuf1);
+ if(name){
+ err = ddocCertGetDNFromName((X509_NAME*)name, &mbuf1);
RETURN_IF_NOT(err == ERR_OK, err);
err = ddocNotInfo_SetResponderId(pNotary, (char*)mbuf1.pMem, -1);
ddocMemBuf_free(&mbuf1);
}
- if(rid->type == V_OCSP_RESPID_KEY) {
- err = ddocNotInfo_SetResponderId(pNotary, (const char*)rid->value.byKey->data, rid->value.byKey->length);
+ if(id) {
+ err = ddocNotInfo_SetResponderId(pNotary, (const char*)id->data, id->length);
}
+ OCSP_id_get0_info(NULL, &hashAlgorithm, NULL, NULL, (OCSP_CERTID*)cid);
// digest type
- i2t_ASN1_OBJECT(buf,sizeof(buf),cid->hashAlgorithm->algorithm);
+ i2t_ASN1_OBJECT(buf,sizeof(buf),hashAlgorithm);
setString(&(pNotary->szDigestType), buf, -1);
+#if OPENSSL_VERSION_NUMBER < 0x10010000L
// signature algorithm
i2t_ASN1_OBJECT(buf,sizeof(buf),br->signatureAlgorithm->algorithm);
setString(&(pNotary->szSigType), buf, -1);
+#endif
// notary cert
if(notCert && !err)
err = addNotaryInfoCert(pSigDoc, pNotary, notCert);
@@ -716,6 +765,7 @@ unsigned char *get_authority_key(STACK_OF(X509_EXTENSION) *exts)
int i, found=0;
X509_EXTENSION *ex=0;
ASN1_OBJECT *obj;
+ ASN1_OCTET_STRING *data = NULL;
X509V3_EXT_METHOD *met;
void *st = NULL;
unsigned char *p;
@@ -738,10 +788,11 @@ unsigned char *get_authority_key(STACK_OF(X509_EXTENSION) *exts)
}
met = (X509V3_EXT_METHOD*)X509V3_EXT_get(ex);
- p = ex->value->data;
+ data = X509_EXTENSION_get_data(ex);
+ p = data->data;
#if OPENSSL_VERSION_NUMBER > 0x00908000
// crashes here!
- st = ASN1_item_d2i(NULL, (const unsigned char**)&p, ex->value->length, ASN1_ITEM_ptr(met->it));
+ st = ASN1_item_d2i(NULL, (const unsigned char**)&p, data->length, ASN1_ITEM_ptr(met->it));
#else
st = ASN1_item_d2i(NULL, &p, ex->value->length, ASN1_ITEM_ptr(met->it));
#endif
@@ -799,19 +850,12 @@ OCSP_CERTID* createOCSPCertid(X509 *cert, X509* pCACert)
{
OCSP_CERTID *pId = NULL;
X509_NAME *iname;
- unsigned char *ikey = NULL;
ASN1_INTEGER *sno;
- const EVP_MD *dgst;
- X509_ALGOR *alg;
- unsigned char md[EVP_MAX_MD_SIZE], buf1[100];
- unsigned int len;
- int l1;
DigiDocMemBuf mbuf1, mbuf2;
+ AUTHORITY_KEYID *val = NULL;
mbuf1.pMem = mbuf2.pMem = NULL;
mbuf1.nLen = mbuf2.nLen = 0;
- l1 = (int)sizeof(buf1);
- memset(buf1, 0, l1);
if(cert != NULL) {
ddocCertGetSubjectDN(cert, &mbuf1);
// standard variant would be
@@ -824,48 +868,19 @@ OCSP_CERTID* createOCSPCertid(X509 *cert, X509* pCACert)
} else { // CA unknown
ddocDebug(3, "createOCSPCertid", "Create ocsp id for cert: %s unknown CA", (char*)mbuf1.pMem);
// issuer name hashi arvutamine
- iname = X509_get_issuer_name(cert);
- dgst = EVP_sha1();
- len = sizeof(md);
- if(X509_NAME_digest(iname, dgst, md, &len)) {
- // issuer key hashi lugemine
- //ikey = get_authority_key(cert->cert_info->extensions);
- ikey = get_authority_key_from_cert(cert);
- if(ikey != NULL) {
- // serial numbri lugemine
- sno = X509_get_serialNumber(cert);
- // OCSP certid koostamine
- if((pId = OCSP_CERTID_new()) != NULL) {
- // replace default algorithm ???
- alg = pId->hashAlgorithm;
- if(alg->algorithm != NULL)
- ASN1_OBJECT_free(alg->algorithm);
- alg->algorithm = OBJ_nid2obj(EVP_MD_type(dgst));
- if((alg->parameter = ASN1_TYPE_new()) != NULL) {
- alg->parameter->type = V_ASN1_NULL;
- ASN1_INTEGER_free(pId->serialNumber);
- pId->serialNumber = ASN1_INTEGER_dup(sno);
- if(!ASN1_OCTET_STRING_set(pId->issuerNameHash, md, len) ||
- !ASN1_OCTET_STRING_set(pId->issuerKeyHash, ikey, strlen((const char*)ikey)) ||
- !pId->serialNumber)
- {
- fprintf(stderr, "Unable to fill in CID\n");
- OCSP_CERTID_free(pId);
- pId = NULL;
- }
- } // else - failed to create algorithm
- }
- // cleanup ikey
- free(ikey);
+ val = (AUTHORITY_KEYID*)X509_get_ext_d2i(cert, NID_authority_key_identifier, NULL, NULL );
+ if(!val) {
+ ddocDebug(4, "get_authority_key_from_cert", "Extension not found");
+ return(NULL);
}
- } // else - SHA1 failed
+ sno = X509_get_serialNumber(cert);
+ iname = X509_get_issuer_name(cert);
+ pId = OCSP_cert_id_new(EVP_sha1(), iname, val->keyid, sno);
}
}
ddocMemBuf_free(&mbuf1);
ddocMemBuf_free(&mbuf2);
- if(pId)
- bin2hex((const byte*)pId->issuerKeyHash->data, pId->issuerKeyHash->length, (byte*)buf1, &l1);
- ddocDebug(3, "createOCSPCertid", "Created ocsp id %s issuer-key-hash: %s", (pId ? "OK" : "ERR"), buf1);
+ ddocDebug(3, "createOCSPCertid", "Created ocsp id %s issuer-key-hash", (pId ? "OK" : "ERR"));
return pId;
}
@@ -1310,8 +1325,8 @@ EXP_OPTION int signOCSPRequestPKCS12(OCSP_REQUEST *req, const char* filename, co
time(&tNow);
err = isCertValid(x509, tNow);
#else
- if( X509_cmp_current_time(x509->cert_info->validity->notBefore) >= 0 &&
- X509_cmp_current_time(x509->cert_info->validity->notAfter) <= 0)
+ if( X509_cmp_current_time(X509_get0_notBefore(x509)) >= 0 &&
+ X509_cmp_current_time(X509_get0_notAfter(x509)) <= 0)
err = ERR_CERT_INVALID;
#endif
if (err != ERR_OK)
@@ -1575,8 +1590,6 @@ int verifyOCSPResponse(OCSP_RESPONSE* pResp,
int err = ERR_OK;
RETURN_IF_NULL_PARAM(pResp);
- RETURN_IF_NOT(ASN1_ENUMERATED_get(pResp->responseStatus) == 0, ERR_OCSP_UNSUCCESSFUL);
- RETURN_IF_NOT(OBJ_obj2nid(pResp->responseBytes->responseType) == NID_id_pkix_OCSP_basic, ERR_OCSP_UNKNOWN_TYPE);
RETURN_IF_NOT(caCerts != NULL, ERR_OCSP_RESP_NOT_TRUSTED);
RETURN_IF_NOT(notCert != NULL, ERR_OCSP_CERT_NOTFOUND);
RETURN_IF_NOT((bs = OCSP_response_get1_basic(pResp)) != NULL, ERR_OCSP_NO_BASIC_RESP);
@@ -1607,61 +1620,61 @@ int verifyOCSPResponse(OCSP_RESPONSE* pResp,
int checkNonceAndCertbyOCSP(OCSP_RESPONSE* resp, X509* cert, byte* nonce1, int nonceLen)
{
- int err = ERR_OK, n;
+ int err = ERR_OK, n, status = 0;
char buf[100];
OCSP_BASICRESP *br = NULL;
- OCSP_RESPDATA *rd = NULL;
OCSP_SINGLERESP *single = NULL;
- OCSP_CERTID *cid = NULL;
+ const OCSP_CERTID *cid = NULL;
X509_EXTENSION *nonce;
X509_NAME *iname;
unsigned char *ikey;
+ ASN1_INTEGER *serialNumber = NULL;
+ ASN1_OCTET_STRING *issuerNameHash = NULL, *issuerKeyHash = NULL, *nonceValue = NULL;
RETURN_IF_NULL_PARAM(resp);
RETURN_IF_NULL_PARAM(cert);
if((br = OCSP_response_get1_basic(resp)) == NULL)
SET_LAST_ERROR_RETURN_CODE(ERR_OCSP_NO_BASIC_RESP);
- rd = br->tbsResponseData;
- n = sk_OCSP_SINGLERESP_num(rd->responses);
+ n = OCSP_resp_count(br);
RETURN_IF_NOT(n == 1, ERR_OCSP_ONE_RESPONSE);
- single = sk_OCSP_SINGLERESP_value(rd->responses, 0);
+ single = OCSP_resp_get0(br, 0);
RETURN_IF_NOT(single, ERR_OCSP_ONE_RESPONSE);
- cid = single->certId;
+ cid = OCSP_SINGLERESP_get0_id(single);
RETURN_IF_NULL(cid);
- err = handleOCSPCertStatus(single->certStatus->type);
+ status = OCSP_single_get0_status(single, NULL, NULL, NULL, NULL);
+ err = handleOCSPCertStatus(status);
if(err)
SET_LAST_ERROR_RETURN_CODE(err);
- if(single->singleExtensions)
- SET_LAST_ERROR_RETURN_CODE(ERR_OCSP_NO_SINGLE_EXT);
- if(!rd->responseExtensions ||
- (sk_X509_EXTENSION_num(rd->responseExtensions) != 1) ||
- ((nonce = sk_X509_EXTENSION_value(rd->responseExtensions, 0)) == NULL))
+ if((OCSP_BASICRESP_get_ext_count(br) != 1) ||
+ ((nonce = OCSP_BASICRESP_get_ext(br, 0)) == NULL))
SET_LAST_ERROR_RETURN_CODE(ERR_OCSP_NO_NONCE);
- i2t_ASN1_OBJECT(buf, sizeof(buf), nonce->object);
+ i2t_ASN1_OBJECT(buf, sizeof(buf), X509_EXTENSION_get_object(nonce));
if(strcmp(buf, OCSP_NONCE_NAME))
SET_LAST_ERROR_RETURN_CODE(ERR_OCSP_NO_NONCE);
// check serial number
- if(ASN1_INTEGER_cmp(X509_get_serialNumber(cert), cid->serialNumber) != 0)
+ OCSP_id_get0_info(&issuerNameHash, NULL, &issuerKeyHash, &serialNumber, (OCSP_CERTID*)cid);
+ if(ASN1_INTEGER_cmp(X509_get_serialNumber(cert), serialNumber) != 0)
SET_LAST_ERROR_RETURN_CODE(ERR_WRONG_CERT);
// check issuer name hash
iname = X509_get_issuer_name(cert);
n = sizeof(buf);
X509_NAME_digest(iname, EVP_sha1(), (byte*)buf, (unsigned int*)&n);
- err = compareByteArrays((byte*)buf, (unsigned int)n, cid->issuerNameHash->data, cid->issuerNameHash->length);
+ err = compareByteArrays((byte*)buf, (unsigned int)n, issuerNameHash->data, issuerNameHash->length);
RETURN_IF_NOT(err == ERR_OK, err);
// check issuer key hash
- if((ikey = get_authority_key(cert->cert_info->extensions)) != NULL) {
+ if((ikey = get_authority_key(X509_get0_extensions(cert))) != NULL) {
err = compareByteArrays(ikey, strlen((const char*)ikey),
- cid->issuerKeyHash->data, cid->issuerKeyHash->length);
+ issuerKeyHash->data, issuerKeyHash->length);
// cleanup ikey
free(ikey);
}
// verify nonce value
- if(nonce->value->length == DIGEST_LEN)
- err = compareByteArrays(nonce->value->data, nonce->value->length, nonce1, nonceLen);
+ nonceValue = X509_EXTENSION_get_data(nonce);
+ if(nonceValue->length == DIGEST_LEN)
+ err = compareByteArrays(nonceValue->data, nonceValue->length, nonce1, nonceLen);
else
- err = compareByteArrays(nonce->value->data + 2, nonce->value->length - 2, nonce1, nonceLen);
- ddocDebug(3, "checkNonceAndCertbyOCSP", "nonce1-len: %d nonce2-len: %d err: %d", nonce->value->length, nonceLen, err);
+ err = compareByteArrays(nonceValue->data + 2, nonceValue->length - 2, nonce1, nonceLen);
+ ddocDebug(3, "checkNonceAndCertbyOCSP", "nonce1-len: %d nonce2-len: %d err: %d", nonceValue->length, nonceLen, err);
if (err != ERR_OK) SET_LAST_ERROR(err);
if(br)
OCSP_BASICRESP_free(br);
diff --git a/libdigidoc/DigiDocObj.c b/libdigidoc/DigiDocObj.c
index 4845f3e..6dba29f 100644
--- a/libdigidoc/DigiDocObj.c
+++ b/libdigidoc/DigiDocObj.c
@@ -35,6 +35,47 @@
#include <openssl/evp.h>
#include <openssl/err.h>
+#if OPENSSL_VERSION_NUMBER < 0x10010000L
+static EVP_MD_CTX *EVP_MD_CTX_new()
+{
+ return (EVP_MD_CTX*)OPENSSL_malloc(sizeof(EVP_MD_CTX));
+}
+
+static void EVP_MD_CTX_free(EVP_MD_CTX *ctx)
+{
+ OPENSSL_free(ctx);
+}
+
+static int OCSP_resp_get0_id(const OCSP_BASICRESP *bs, const ASN1_OCTET_STRING **pid, const X509_NAME **pname)
+{
+ *pid = NULL;
+ *pname = NULL;
+ const OCSP_RESPID *rid = bs->tbsResponseData->responderId;
+ if (rid->type == V_OCSP_RESPID_NAME)
+ *pname = rid->value.byName;
+ else if (rid->type == V_OCSP_RESPID_KEY)
+ *pid = rid->value.byKey;
+ else
+ return 0;
+ return 1;
+}
+
+static const ASN1_GENERALIZEDTIME *OCSP_resp_get0_produced_at(const OCSP_BASICRESP* bs)
+{
+ return bs->tbsResponseData->producedAt;
+}
+
+static const OCSP_CERTID *OCSP_SINGLERESP_get0_id(const OCSP_SINGLERESP *single)
+{
+ return single->certId;
+}
+
+static const ASN1_OCTET_STRING *OCSP_resp_get0_signature(const OCSP_BASICRESP *bs)
+{
+ return bs->signature;
+}
+#endif
+
//============================================================
// Sets a string element of a struct to a new value
// dest - element pointer
@@ -3699,28 +3740,26 @@ int ddocGetOcspRespIdTypeAndValue(OCSP_RESPONSE* pResp,
int err = ERR_OK;
OCSP_BASICRESP *br = NULL;
+ const X509_NAME *name = NULL;
+ const ASN1_OCTET_STRING *id = NULL;
RETURN_IF_NULL_PARAM(pResp);
RETURN_IF_NULL_PARAM(pType);
RETURN_IF_NULL_PARAM(pMbufRespId);
if((br = OCSP_response_get1_basic(pResp)) == NULL)
SET_LAST_ERROR_RETURN_CODE(ERR_OCSP_NO_BASIC_RESP);
if(!err && br) {
- switch(br->tbsResponseData->responderId->type) {
- case V_OCSP_RESPID_NAME:
- *pType = RESPID_NAME_TYPE;
- ddocMemSetLength(pMbufRespId, 300);
+ OCSP_resp_get0_id(br, &id, &name);
+ if(name) {
+ *pType = RESPID_NAME_TYPE;
+ ddocMemSetLength(pMbufRespId, 300);
//X509_NAME_oneline(br->tbsResponseData->responderId->value.byName, (char*)pMbufRespId->pMem, pMbufRespId->nLen);
//AM 26.09.08
- err = ddocCertGetDNFromName(br->tbsResponseData->responderId->value.byName, pMbufRespId);
+ err = ddocCertGetDNFromName((X509_NAME*)name, pMbufRespId);
//RETURN_IF_NOT(err == ERR_OK, err);
- break;
- case V_OCSP_RESPID_KEY:
- *pType = RESPID_KEY_TYPE;
- err = ddocMemAssignData(pMbufRespId,
- (const char*)br->tbsResponseData->responderId->value.byKey->data,
- br->tbsResponseData->responderId->value.byKey->length);
- break;
- default:
+ } else if(id) {
+ *pType = RESPID_KEY_TYPE;
+ err = ddocMemAssignData(pMbufRespId, (const char*)id->data, id->length);
+ } else {
SET_LAST_ERROR(ERR_OCSP_WRONG_RESPID);
}
}
@@ -3800,7 +3839,7 @@ int ddocNotInfo_GetBasicResp(const NotaryInfo* pNotary, OCSP_RESPONSE **ppResp,
*ppBasResp = OCSP_response_get1_basic(*ppResp);
if(*ppBasResp) {
if(ppSingle)
- *ppSingle = sk_OCSP_SINGLERESP_value((*ppBasResp)->tbsResponseData->responses, 0);
+ *ppSingle = OCSP_resp_get0(*ppBasResp, 0);
}
else
return ERR_OCSP_NO_BASIC_RESP;
@@ -3818,17 +3857,20 @@ EXP_OPTION const char* ddocNotInfo_GetResponderId_Type(const NotaryInfo* pNotary
int err = ERR_OK;
OCSP_RESPONSE *pResp = 0;
OCSP_BASICRESP *br = NULL;
+ const ASN1_OCTET_STRING *id = NULL;
+ const X509_NAME *name = NULL;
char *p1 = RESPID_NAME_VALUE; // default value is name - usefull in format 1.0 where we had no good OCSP response
RETURN_OBJ_IF_NULL(pNotary, NULL);
err = ddocNotInfo_GetBasicResp(pNotary, &pResp, &br, NULL);
if(!err && br) {
- switch(br->tbsResponseData->responderId->type) {
- case V_OCSP_RESPID_NAME: p1 = RESPID_NAME_VALUE; break;
- case V_OCSP_RESPID_KEY: p1 = RESPID_KEY_VALUE; break;
- default:
+ OCSP_resp_get0_id(br, &id, &name);
+ if(name)
+ p1 = RESPID_NAME_VALUE;
+ else if(id)
+ p1 = RESPID_KEY_VALUE;
+ else
SET_LAST_ERROR(ERR_OCSP_WRONG_RESPID);
- }
}
if(pResp)
OCSP_RESPONSE_free(pResp);
@@ -3850,15 +3892,17 @@ EXP_OPTION int ddocNotInfo_GetThisUpdate(const NotaryInfo* pNotary, DigiDocMemBu
OCSP_RESPONSE *pResp = 0;
OCSP_BASICRESP *br = NULL;
OCSP_SINGLERESP *single = NULL;
+ ASN1_GENERALIZEDTIME *thisUpdate = NULL;
RETURN_IF_NULL_PARAM(pNotary);
RETURN_IF_NULL_PARAM(pMBuf);
err = ddocNotInfo_GetBasicResp(pNotary, &pResp, &br, &single);
if(!err && br && single) {
err = ddocMemSetLength(pMBuf, 50);
- ddocDebug(3, "ddocNotInfo_GetThisUpdate", "This update: %s", single->thisUpdate);
- if(!err && single->thisUpdate)
- err = asn1time2str(NULL, single->thisUpdate, (char*)pMBuf->pMem, pMBuf->nLen);
+ OCSP_single_get0_status(single, NULL, NULL, &thisUpdate, NULL);
+ ddocDebug(3, "ddocNotInfo_GetThisUpdate", "This update: %s", thisUpdate);
+ if(!err && thisUpdate)
+ err = asn1time2str(NULL, thisUpdate, (char*)pMBuf->pMem, pMBuf->nLen);
}
if(pResp)
OCSP_RESPONSE_free(pResp);
@@ -3881,13 +3925,15 @@ int ddocNotInfo_GetThisUpdate_timet(const NotaryInfo* pNotary, time_t* pTime)
OCSP_RESPONSE *pResp = 0;
OCSP_BASICRESP *br = NULL;
OCSP_SINGLERESP *single = NULL;
+ ASN1_GENERALIZEDTIME *thisUpdate = NULL;
RETURN_IF_NULL_PARAM(pNotary);
RETURN_IF_NULL_PARAM(pTime);
err = ddocNotInfo_GetBasicResp(pNotary, &pResp, &br, &single);
if(!err && br && single) {
- if(!err && single->thisUpdate)
- err = asn1time2time_t_local(single->thisUpdate, pTime);
+ OCSP_single_get0_status(single, NULL, NULL, &thisUpdate, NULL);
+ if(!err && thisUpdate)
+ err = asn1time2time_t_local(thisUpdate, pTime);
}
if(pResp)
OCSP_RESPONSE_free(pResp);
@@ -3908,13 +3954,14 @@ int ddocNotInfo_GetProducedAt_timet(const NotaryInfo* pNotary, time_t* pTime)
int err = ERR_OK;
OCSP_RESPONSE *pResp = 0;
OCSP_BASICRESP *br = NULL;
-
+ const ASN1_GENERALIZEDTIME *producedAt = NULL;
RETURN_IF_NULL_PARAM(pNotary);
RETURN_IF_NULL_PARAM(pTime);
err = ddocNotInfo_GetBasicResp(pNotary, &pResp, &br, NULL);
- if(!err && br && br->tbsResponseData && br->tbsResponseData->producedAt) {
- err = asn1time2time_t_local(br->tbsResponseData->producedAt, pTime);
+ producedAt = OCSP_resp_get0_produced_at(br);
+ if(!err && br && producedAt) {
+ err = asn1time2time_t_local((ASN1_GENERALIZEDTIME*)producedAt, pTime);
}
//AM 22.06.08 lets free br too
if(br)
@@ -3954,14 +4001,16 @@ EXP_OPTION int ddocNotInfo_GetNextUpdate(const NotaryInfo* pNotary, DigiDocMemBu
OCSP_RESPONSE *pResp = 0;
OCSP_BASICRESP *br = NULL;
OCSP_SINGLERESP *single = NULL;
+ ASN1_GENERALIZEDTIME *nextUpdate = NULL;
RETURN_IF_NULL_PARAM(pNotary);
RETURN_IF_NULL_PARAM(pMBuf);
err = ddocNotInfo_GetBasicResp(pNotary, &pResp, &br, &single);
if(!err && br && single) {
err = ddocMemSetLength(pMBuf, 50);
- if(!err && single->nextUpdate)
- err = asn1time2str(NULL, single->nextUpdate, (char*)pMBuf->pMem, pMBuf->nLen);
+ OCSP_single_get0_status(single, NULL, NULL, NULL, &nextUpdate);
+ if(!err && nextUpdate)
+ err = asn1time2str(NULL, nextUpdate, (char*)pMBuf->pMem, pMBuf->nLen);
}
if(pResp)
OCSP_RESPONSE_free(pResp);
@@ -3983,13 +4032,17 @@ int ddocNotInfo_GetIssuerNameHash(const NotaryInfo* pNotary, DigiDocMemBuf* pMBu
OCSP_RESPONSE *pResp = 0;
OCSP_BASICRESP *br = NULL;
OCSP_SINGLERESP *single = NULL;
+ ASN1_OCTET_STRING *issuerNameHash = NULL;
+ const OCSP_CERTID *cid = NULL;
RETURN_IF_NULL_PARAM(pNotary);
RETURN_IF_NULL_PARAM(pMBuf);
err = ddocNotInfo_GetBasicResp(pNotary, &pResp, &br, &single);
- if(!err && br && single->certId) {
- err = ddocMemAssignData(pMBuf, (const char*)single->certId->issuerNameHash->data,
- single->certId->issuerNameHash->length);
+ if(!err && br) {
+ cid = OCSP_SINGLERESP_get0_id(OCSP_resp_get0(br, 0));
+ OCSP_id_get0_info(&issuerNameHash, NULL, NULL, NULL, (OCSP_CERTID*)cid);
+ err = ddocMemAssignData(pMBuf, (const char*)issuerNameHash->data,
+ issuerNameHash->length);
}
if(pResp)
OCSP_RESPONSE_free(pResp);
@@ -4011,13 +4064,18 @@ int ddocNotInfo_GetIssuerKeyHash(const NotaryInfo* pNotary, DigiDocMemBuf* pMBuf
OCSP_RESPONSE *pResp = 0;
OCSP_BASICRESP *br = NULL;
OCSP_SINGLERESP *single = NULL;
+ ASN1_OCTET_STRING *issuerKeyHash = NULL;
+ const OCSP_CERTID *cid = NULL;
RETURN_IF_NULL_PARAM(pNotary);
RETURN_IF_NULL_PARAM(pMBuf);
err = ddocNotInfo_GetBasicResp(pNotary, &pResp, &br, &single);
- if(!err && br && single->certId) {
- err = ddocMemAssignData(pMBuf, (const char*)single->certId->issuerKeyHash->data,
- single->certId->issuerKeyHash->length);
+
+ if(!err && br) {
+ cid = OCSP_SINGLERESP_get0_id(OCSP_resp_get0(br, 0));
+ OCSP_id_get0_info(NULL, NULL, &issuerKeyHash, NULL, (OCSP_CERTID*)cid);
+ err = ddocMemAssignData(pMBuf, (const char*)issuerKeyHash->data,
+ issuerKeyHash->length);
}
if(pResp)
OCSP_RESPONSE_free(pResp);
@@ -4040,6 +4098,7 @@ int ddocNotInfo_GetOcspRealDigest(const SignedDoc* pSigDoc, const NotaryInfo* pN
OCSP_BASICRESP *br = NULL;
OCSP_SINGLERESP *single = NULL;
X509_EXTENSION *ext = NULL;
+ ASN1_OCTET_STRING *value = NULL;
byte* p = 0, buf2[DIGEST_LEN256 * 2 + 2];
RETURN_IF_NULL_PARAM(pNotary);
@@ -4051,8 +4110,9 @@ int ddocNotInfo_GetOcspRealDigest(const SignedDoc* pSigDoc, const NotaryInfo* pN
if(nIdx >= 0) {
ext = OCSP_BASICRESP_get_ext(br, nIdx);
if(ext != NULL) {
- int l1 = ASN1_STRING_length(ext->value);
- p = ASN1_STRING_data(ext->value);
+ value = X509_EXTENSION_get_data(ext);
+ int l1 = ASN1_STRING_length(value);
+ p = ASN1_STRING_data(value);
if(l1 > 20 && p[0] == V_ASN1_OCTET_STRING && p[1] == l1-2)
err = ddocMemAssignData(pMBuf, (const char*)p+2, l1-2);
else
@@ -4093,13 +4153,15 @@ int ddocNotInfo_GetOcspSignatureValue(const NotaryInfo* pNotary, DigiDocMemBuf*
int err = ERR_OK;
OCSP_RESPONSE *pResp = 0;
OCSP_BASICRESP *br = NULL;
+ const ASN1_OCTET_STRING *signature = NULL;
RETURN_IF_NULL_PARAM(pNotary);
RETURN_IF_NULL_PARAM(pMBuf);
err = ddocNotInfo_GetBasicResp(pNotary, &pResp, &br, NULL);
if(!err && br) {
- err = ddocMemAssignData(pMBuf, (const char*)br->signature->data,
- br->signature->length);
+ signature = OCSP_resp_get0_signature(br);
+ err = ddocMemAssignData(pMBuf, (const char*)signature->data,
+ signature->length);
}
if(pResp)
OCSP_RESPONSE_free(pResp);
@@ -4328,7 +4390,7 @@ EXP_OPTION int calculateSignatureWithPkcs12(SignedDoc* pSigDoc, SignatureInfo* p
int l2;
EVP_PKEY *pkey = 0;
X509* x509 = 0;
- EVP_MD_CTX ctx;
+ EVP_MD_CTX *ctx;
DigiDocMemBuf mbuf1;
RETURN_IF_NULL_PARAM(pSigInfo);
@@ -4397,9 +4459,11 @@ EXP_OPTION int calculateSignatureWithPkcs12(SignedDoc* pSigDoc, SignatureInfo* p
sigLen = sizeof(signature);
memset(signature, 0, sizeof(signature));
// sign data
- EVP_SignInit(&ctx, EVP_sha1());
- EVP_SignUpdate(&ctx, buf1, (unsigned long)strlen(buf1));
- err = EVP_SignFinal(&ctx, signature, &sigLen, pkey);
+ ctx = EVP_MD_CTX_new();
+ EVP_SignInit(ctx, EVP_sha1());
+ EVP_SignUpdate(ctx, buf1, (unsigned long)strlen(buf1));
+ err = EVP_SignFinal(ctx, signature, &sigLen, pkey);
+ EVP_MD_CTX_free(ctx);
free(buf1);
if(err == ERR_LIB_NONE)
err = ERR_OK;
diff --git a/libdigidoc/DigiDocSAXParser.c b/libdigidoc/DigiDocSAXParser.c
index 0bebe63..4aa46e9 100644
--- a/libdigidoc/DigiDocSAXParser.c
+++ b/libdigidoc/DigiDocSAXParser.c
@@ -56,6 +56,18 @@ static char g_szDataFileFlush2[] = "<DataFile Id=\"%s\" ContentType=\"%s\">";
#include <wchar.h>
#endif
+#if OPENSSL_VERSION_NUMBER < 0x10010000L
+static EVP_ENCODE_CTX *EVP_ENCODE_CTX_new()
+{
+ return (EVP_ENCODE_CTX*)OPENSSL_malloc(sizeof(EVP_ENCODE_CTX));
+}
+
+static void EVP_ENCODE_CTX_free(EVP_ENCODE_CTX *ctx)
+{
+ OPENSSL_free(ctx);
+}
+#endif
+
extern int ddocCheckFormatAndVer(const char* format, const char* version);
extern char* canonicalizeXML(char* source, int len);
extern int escapeXMLSymbols(const char* src, int srclen, char** dest);
@@ -79,7 +91,7 @@ typedef struct SigDocParse_st {
char ctx4[300];
char ctx5[300];
BIO* bDataFile;
- EVP_ENCODE_CTX ectx;
+ EVP_ENCODE_CTX *ectx;
SHA_CTX sctx, sctx2; // sha1 digest context and alternat dig context
int errcode;
char* szInputFileName;
@@ -405,7 +417,8 @@ void handleStartDataFile(SigDocParse* pctx, const xmlChar *name, const xmlChar *
strncpy(pctx->ctx2, id, sizeof(pctx->ctx2)-1);
ddocDebug(4, "handleStartDataFile", "Start DF: %s", id);
if(ctype && !strcmp(ctype, CONTENT_EMBEDDED_BASE64)) {
- EVP_DecodeInit(&(pctx->ectx));
+ pctx->ectx = EVP_ENCODE_CTX_new();
+ EVP_DecodeInit(pctx->ectx);
ddocDebug(3, "handleStartDataFile", "Init sha1");
SHA1_Init(&(pctx->sctx));
SHA1_Init(&(pctx->sctx2));
@@ -494,7 +507,7 @@ void handleDataFile(SigDocParse* pctx, const xmlChar *value, int len)
i = (i + 512 > len) ? len : i + 512;
l = sizeof(buf);
memset(buf, 0, sizeof(buf));
- EVP_DecodeUpdate(&(pctx->ectx), (unsigned char*)buf, &l, (unsigned char*)value + j, i - j);
+ EVP_DecodeUpdate(pctx->ectx, (unsigned char*)buf, &l, (unsigned char*)value + j, i - j);
BIO_write(pctx->bDataFile, buf, l);
j = i;
}
@@ -506,7 +519,7 @@ void handleDataFile(SigDocParse* pctx, const xmlChar *value, int len)
i = (i + 512 > len) ? len : i + 512;
l = sizeof(buf);
memset(buf, 0, sizeof(buf));
- EVP_DecodeUpdate(&(pctx->ectx), (unsigned char*)buf, &l, (unsigned char*)value + j, i - j);
+ EVP_DecodeUpdate(pctx->ectx, (unsigned char*)buf, &l, (unsigned char*)value + j, i - j);
if(pctx->bDataFile)
BIO_write(pctx->bDataFile, buf, l);
buf[l] = 0;
@@ -553,7 +566,8 @@ void handleEndDataFile(SigDocParse* pctx, const xmlChar *name)
if(pctx->bDataFile &&
!strcmp(pDf->szContentType, CONTENT_EMBEDDED_BASE64)) {
l1 = sizeof(buf);
- EVP_DecodeFinal(&(pctx->ectx), (unsigned char*)buf, &l1);
+ EVP_DecodeFinal(pctx->ectx, (unsigned char*)buf, &l1);
+ EVP_ENCODE_CTX_free(pctx->ectx);
BIO_write(pctx->bDataFile, buf, l1);
BIO_free(pctx->bDataFile);
pctx->bDataFile = NULL;
@@ -2135,7 +2149,8 @@ static void extractStartElementHandler(void *ctx, const xmlChar *name, const xml
ddocDebug(4, "extractStartElementHandler", "Init collecting DF: %s mode: %s",
pctx->ctx3, pctx->ctx1);
if(!strcmp(pctx->ctx4, CONTENT_EMBEDDED_BASE64) && !pctx->bKeepBase64) {
- EVP_DecodeInit(&(pctx->ectx));
+ pctx->ectx = EVP_ENCODE_CTX_new();
+ EVP_DecodeInit(pctx->ectx);
pctx->b64pos = 0;
pctx->lSize = 0;
}
@@ -2259,7 +2274,7 @@ void extractDecodeB64(SigDocParse* pctx, const char* ch, int len, int lastBlock)
j = sizeof(decData);
memset(decData, 0, j);
ddocDebug(5, "extractDecodeB64", "decoding: %s", pctx->b64line);
- EVP_DecodeUpdate(&(pctx->ectx), (unsigned char*)decData, &j,
+ EVP_DecodeUpdate(pctx->ectx, (unsigned char*)decData, &j,
(unsigned char*)pctx->b64line, pctx->b64pos + 1);
ddocDebug(4, "extractDecodeB64", "decoding: %d -> got: %d", pctx->b64pos, j);
if(pctx->pMemBufDF)
@@ -2273,7 +2288,8 @@ void extractDecodeB64(SigDocParse* pctx, const char* ch, int len, int lastBlock)
if(l == len && lastBlock) {
j = sizeof(decData);
memset(decData, 0, j);
- EVP_DecodeFinal(&(pctx->ectx), (unsigned char*)decData, &j);
+ EVP_DecodeFinal(pctx->ectx, (unsigned char*)decData, &j);
+ EVP_ENCODE_CTX_free(pctx->ectx);
ddocDebug(4, "extractDecodeB64", "decoding final got: %d", j);
if(j > 0) {
if(pctx->pMemBufDF)
diff --git a/libdigidoc/DigiDocVerify.c b/libdigidoc/DigiDocVerify.c
index 237e285..7a8e82b 100644
--- a/libdigidoc/DigiDocVerify.c
+++ b/libdigidoc/DigiDocVerify.c
@@ -47,6 +47,28 @@
#include <openssl/pkcs12.h>
#include <openssl/rand.h>
+#if OPENSSL_VERSION_NUMBER < 0x10010000L
+static EVP_MD_CTX *EVP_MD_CTX_new()
+{
+ return (EVP_MD_CTX*)OPENSSL_malloc(sizeof(EVP_MD_CTX));
+}
+
+static void EVP_MD_CTX_free(EVP_MD_CTX *ctx)
+{
+ OPENSSL_free(ctx);
+}
+
+static const ASN1_OCTET_STRING *OCSP_resp_get0_signature(const OCSP_BASICRESP *bs)
+{
+ return bs->signature;
+}
+
+static X509_VERIFY_PARAM *X509_STORE_get0_param(X509_STORE *ctx)
+{
+ return ctx->param;
+}
+#endif
+
//--------------------< ddoc structure def >-----------------------
const XmlElemDef eTransform = {"Transform", 'Y', NULL}; /* 1.0 */
@@ -393,7 +415,7 @@ EXP_OPTION int verifyFileSignature(const char* szFileName, int nDigestType,
const char *certfile)
{
int err = ERR_OK;
- EVP_MD_CTX ctx;
+ EVP_MD_CTX *ctx;
unsigned char buf[FILE_BUFSIZE];
int i;
FILE *f;
@@ -406,13 +428,15 @@ EXP_OPTION int verifyFileSignature(const char* szFileName, int nDigestType,
if(nDigestType == DIGEST_SHA1) {
if((err = ReadPublicKey(&pkey, certfile)) == ERR_OK) {
if((f = fopen(szFileName,"rb")) != NULL) {
- EVP_VerifyInit(&ctx, EVP_sha1());
+ ctx = EVP_MD_CTX_new();
+ EVP_VerifyInit(ctx, EVP_sha1());
for (;;) {
i = fread(buf, sizeof(char), FILE_BUFSIZE, f);
if (i <= 0) break;
- EVP_VerifyUpdate (&ctx, buf, (unsigned long)i);
+ EVP_VerifyUpdate (ctx, buf, (unsigned long)i);
}
- err = EVP_VerifyFinal(&ctx, pSigBuf, nSigLen, pkey);
+ err = EVP_VerifyFinal(ctx, pSigBuf, nSigLen, pkey);
+ EVP_MD_CTX_free(ctx);
if(err == ERR_LIB_NONE)
err = ERR_OK;
fclose(f);
@@ -447,7 +471,7 @@ EXP_OPTION int verifySignature(const char* szData, unsigned long dataLen, int nD
byte* pSigBuf, int nSigLen, X509* cert)
{
int err = ERR_OK;
- EVP_MD_CTX ctx;
+ EVP_MD_CTX *ctx;
EVP_PKEY* pkey = NULL;
RETURN_IF_NULL_PARAM(szData);
@@ -457,11 +481,13 @@ EXP_OPTION int verifySignature(const char* szData, unsigned long dataLen, int nD
if(nDigestType == DIGEST_SHA1) {
if((err = GetPublicKey(&pkey, cert)) == ERR_OK) {
checkErrors();
- EVP_VerifyInit(&ctx, EVP_sha1());
+ ctx = EVP_MD_CTX_new();
+ EVP_VerifyInit(ctx, EVP_sha1());
checkErrors();
- EVP_VerifyUpdate (&ctx, szData, dataLen);
+ EVP_VerifyUpdate (ctx, szData, dataLen);
checkErrors();
- err = EVP_VerifyFinal(&ctx, pSigBuf, nSigLen, pkey);
+ err = EVP_VerifyFinal(ctx, pSigBuf, nSigLen, pkey);
+ EVP_MD_CTX_free(ctx);
if(err == ERR_LIB_NONE)
err = ERR_OK;
checkErrors();
@@ -536,6 +562,7 @@ EXP_OPTION int verifyEstIDSignature(const byte* digest, int digestLen, int nDige
{
int err = ERR_OK, nCheckSigValAsn1 = 1;
EVP_PKEY* pkey = 0;
+ RSA *rsa = 0;
byte buf2[DIGEST_LEN+2], buf3[500], buf4[200], buf5[200],buf256[DIGEST_LEN256+2];
int l2 = 0, l1;
//AM 11.02.09 ecdsa-sha1 support for LI
@@ -578,9 +605,11 @@ EXP_OPTION int verifyEstIDSignature(const byte* digest, int digestLen, int nDige
}
}else
#endif
- if(pkey->type==NID_rsaEncryption){
+ if(EVP_PKEY_base_id(pkey)==EVP_PKEY_RSA){
//clearErrors();
- l2 = RSA_public_decrypt(nSigLen, pSigBuf, buf3, pkey->pkey.rsa, RSA_PKCS1_PADDING); //RSA_PKCS1_PADDING); //RSA_NO_PADDING);
+ rsa = EVP_PKEY_get1_RSA(pkey);
+ l2 = RSA_public_decrypt(nSigLen, pSigBuf, buf3, rsa, RSA_PKCS1_PADDING); //RSA_PKCS1_PADDING); //RSA_NO_PADDING);
+ RSA_free(rsa);
checkErrors();
ddocDebug(3, "verifyEstIDSignature", "decryted sig-hash len: %d", l2);
// debug info
@@ -628,7 +657,9 @@ EXP_OPTION int verifyEstIDSignature(const byte* digest, int digestLen, int nDige
memset(buf3, 0, sizeof(buf3));
ERR_clear_error();
//swapBytes(pSigBuf, nSigLen);
- l2 = RSA_public_decrypt(nSigLen, pSigBuf, buf3, pkey->pkey.rsa, RSA_PKCS1_PADDING); //RSA_PKCS1_PADDING); //RSA_NO_PADDING);
+ rsa = EVP_PKEY_get1_RSA(pkey);
+ l2 = RSA_public_decrypt(nSigLen, pSigBuf, buf3, rsa, RSA_PKCS1_PADDING); //RSA_PKCS1_PADDING); //RSA_NO_PADDING);
+ RSA_free(rsa);
checkErrors();
ddocDebug(3, "verifyEstIDSignature", "decryted sig-hash len: %d", l2);
// debug info
@@ -1163,10 +1194,11 @@ X509_ALGOR* setSignAlgorithm(const EVP_MD * type)
/*if ((nid = EVP_MD_type(type)) != NID_undef) {
alg->algorithm=OBJ_nid2obj(nid);
}*/
- alg->algorithm = OBJ_nid2obj(type->pkey_type);
+ alg->algorithm = OBJ_nid2obj(EVP_MD_pkey_type(type));
return alg;
}
+#if OPENSSL_VERSION_NUMBER < 0x10010000L
//--------------------------------------------------
// Helper function. Converts Notary info to an OCSP
// response structure. Used in verify and file writing
@@ -1268,6 +1300,7 @@ int notary2ocspBasResp(const SignedDoc* pSigDoc, const NotaryInfo* pNotInfo, X50
// checkErrors();
return ERR_OK;
}
+#endif
//--------------------------------------------------
// Verfies NotaryInfo signature
@@ -1375,20 +1408,18 @@ int verifyOcspCertId(OCSP_RESPONSE* pResp, X509* pCert, X509* pCaCert)
OCSP_CERTID *cid = NULL;
int err = ERR_OK;
DigiDocMemBuf mbuf1, mbuf2, mbuf3;
+ ASN1_OCTET_STRING *issuerNameHash = NULL, *issuerKeyHash = NULL;
+ ASN1_INTEGER *serialNumber = NULL;
RETURN_IF_NULL_PARAM(pResp);
RETURN_IF_NULL_PARAM(pCert);
RETURN_IF_NULL_PARAM(pCaCert);
- RETURN_IF_NULL_PARAM(pResp->responseBytes);
mbuf1.pMem = 0;
mbuf1.nLen = 0;
mbuf2.pMem = 0;
mbuf2.nLen = 0;
mbuf3.pMem = 0;
mbuf3.nLen = 0;
- rb = pResp->responseBytes;
- if(OBJ_obj2nid(rb->responseType) != NID_id_pkix_OCSP_basic)
- SET_LAST_ERROR_RETURN_CODE(ERR_OCSP_UNKNOWN_TYPE);
if((br = OCSP_response_get1_basic(pResp)) == NULL)
SET_LAST_ERROR_RETURN_CODE(ERR_OCSP_NO_BASIC_RESP);
ddocCertGetSubjectDN(pCert, &mbuf2);
@@ -1396,28 +1427,22 @@ int verifyOcspCertId(OCSP_RESPONSE* pResp, X509* pCert, X509* pCaCert)
ddocDebug(4, "verifyOcspCertId", "for cert: %ld, cn: %s, ca: %s", X509_get_serialNumber(pCert), mbuf2.pMem, mbuf3.pMem);
ddocMemBuf_free(&mbuf2);
ddocMemBuf_free(&mbuf3);
- rd = br->tbsResponseData;
- if(ASN1_INTEGER_get(rd->version) != 0)
- SET_LAST_ERROR_RETURN_CODE(ERR_OCSP_WRONG_VERSION);
- if(sk_OCSP_SINGLERESP_num(rd->responses) != 1)
- SET_LAST_ERROR_RETURN_CODE(ERR_OCSP_ONE_RESPONSE);
- single = sk_OCSP_SINGLERESP_value(rd->responses, 0);
- RETURN_IF_NULL(single);
- cid = single->certId;
+ cid = OCSP_cert_to_id(EVP_sha1(), pCert, pCaCert);
RETURN_IF_NULL(cid);
+ OCSP_id_get0_info(&issuerNameHash, NULL, &issuerKeyHash, &serialNumber, cid);
// check serial number
- if(ASN1_INTEGER_cmp(cid->serialNumber, X509_get_serialNumber(pCert)) != 0) {
+ if(ASN1_INTEGER_cmp(serialNumber, X509_get_serialNumber(pCert)) != 0) {
ddocDebug(4, "verifyOcspCertId", "Looking for cert-nr: %ld buf found %ld",
- X509_get_serialNumber(pCert), ASN1_INTEGER_get(cid->serialNumber));
+ X509_get_serialNumber(pCert), ASN1_INTEGER_get(serialNumber));
return ERR_WRONG_CERT;
}
// check issuer name hash
err = ddocCertGetIssuerNameDigest(pCert, &mbuf1);
RETURN_IF_NOT(err == ERR_OK, err);
err = compareByteArrays((byte*)mbuf1.pMem, (unsigned int)mbuf1.nLen,
- cid->issuerNameHash->data, cid->issuerNameHash->length);
- mbuf2.pMem = cid->issuerNameHash->data;
- mbuf2.nLen = cid->issuerNameHash->length;
+ issuerNameHash->data, issuerNameHash->length);
+ mbuf2.pMem = issuerNameHash->data;
+ mbuf2.nLen = issuerNameHash->length;
ddocBin2Hex(&mbuf2, &mbuf3);
mbuf2.pMem = 0;
mbuf2.nLen = 0;
@@ -1432,9 +1457,9 @@ int verifyOcspCertId(OCSP_RESPONSE* pResp, X509* pCert, X509* pCaCert)
err = ddocCertGetPubkeyDigest(pCaCert, &mbuf1);
RETURN_IF_NOT(err == ERR_OK, err);
err = compareByteArrays((byte*)mbuf1.pMem, (unsigned int)mbuf1.nLen,
- cid->issuerKeyHash->data, cid->issuerKeyHash->length);
- mbuf2.pMem = cid->issuerKeyHash->data;
- mbuf2.nLen = cid->issuerKeyHash->length;
+ issuerKeyHash->data, issuerKeyHash->length);
+ mbuf2.pMem = issuerKeyHash->data;
+ mbuf2.nLen = issuerKeyHash->length;
ddocBin2Hex(&mbuf2, &mbuf3);
mbuf2.pMem = 0;
mbuf2.nLen = 0;
@@ -1482,6 +1507,7 @@ EXP_OPTION int verifyNotaryInfoCERT2(const SignedDoc* pSigDoc,
X509_STORE *store;
OCSP_RESPONSE* pResp = NULL;
OCSP_BASICRESP* bs = NULL;
+ ASN1_OCTET_STRING *signature = NULL;
STACK_OF(X509)* ver_certs = NULL;
int err = ERR_OK, l1;
X509 *certNotaryDirectCA = 0, *pCert = 0, *pCaCert = 0;
@@ -1516,7 +1542,7 @@ EXP_OPTION int verifyNotaryInfoCERT2(const SignedDoc* pSigDoc,
//WriteOCSPResponse("test2.resp", pResp);
if((setup_verifyCERT(&store, CApath, caCerts)) == ERR_OK) {
ddocNotInfo_GetProducedAt_timet(pNotInfo, &tProdAt);
- X509_VERIFY_PARAM_set_time(store->param, tProdAt);
+ X509_VERIFY_PARAM_set_time(X509_STORE_get0_param(store), tProdAt);
X509_STORE_set_flags(store, X509_V_FLAG_USE_CHECK_TIME);
// new basic response
// create OCSP basic response
@@ -1531,10 +1557,11 @@ EXP_OPTION int verifyNotaryInfoCERT2(const SignedDoc* pSigDoc,
sk_X509_push(ver_certs, notCert);
ddocDebug(3, "verifyNotaryInfoCERT", "OCSP verify err: %d, err1: %d format: %s", err, pSigInfo->nErr1, pSigDoc->szFormatVer);
// fix invalid padding flag on ddoc 1.0 signatures
+ signature = (ASN1_OCTET_STRING*)OCSP_resp_get0_signature(bs);
if((!strcmp(pSigDoc->szFormatVer, SK_XML_1_VER) && !strcmp(pSigDoc->szFormat, SK_XML_1_NAME))
- || (bs->signature->flags & 0x07)) {
- ddocDebug(3, "verifyNotaryInfoCERT", "Reset ocsp flag %d", bs->signature->flags);
- bs->signature->flags &= ~(ASN1_STRING_FLAG_BITS_LEFT|0x07);
+ || (signature->flags & 0x07)) {
+ ddocDebug(3, "verifyNotaryInfoCERT", "Reset ocsp flag %d", signature->flags);
+ signature->flags &= ~(ASN1_STRING_FLAG_BITS_LEFT|0x07);
}
err = OCSP_basic_verify(bs, ver_certs, store, OCSP_NOCHECKS);
ddocDebug(3, "verifyNotaryInfoCERT", "OCSP verify: %d, not cet: %s cn: %s", err, buf1, mbuf1.pMem);
diff --git a/libdigidoc/cdigidoc.rc b/libdigidoc/cdigidoc.rc
index 3267c28..0cace7b 100644
--- a/libdigidoc/cdigidoc.rc
+++ b/libdigidoc/cdigidoc.rc
@@ -25,14 +25,14 @@ BEGIN
BEGIN
BLOCK "040904E4"
BEGIN
- VALUE "CompanyName", "Estonian ID Card\0"
- VALUE "FileDescription", "cdigidoc\0"
- VALUE "FileVersion", VERSION "\0"
- VALUE "InternalName", "cdigidoc\0"
- VALUE "LegalCopyright", "Copyright (C) 2009-2012 Estonian ID Card"
- VALUE "OriginalFilename", "cdigidoc.exe\0"
- VALUE "ProductName", "cdigidoc\0"
- VALUE "ProductVersion", VERSION "\0"
+ VALUE "CompanyName", "RIA"
+ VALUE "FileDescription", "cdigidoc"
+ VALUE "FileVersion", VERSION
+ VALUE "InternalName", "cdigidoc"
+ VALUE "LegalCopyright", "Copyright (C) 2009-2018 Estonian Information System Authority"
+ VALUE "OriginalFilename", "cdigidoc.exe"
+ VALUE "ProductName", "cdigidoc"
+ VALUE "ProductVersion", VERSION
END
END
BLOCK "VarFileInfo"
diff --git a/libdigidoc/libdigidoc.rc b/libdigidoc/libdigidoc.rc
index 7338b52..858778d 100644
--- a/libdigidoc/libdigidoc.rc
+++ b/libdigidoc/libdigidoc.rc
@@ -25,14 +25,14 @@ BEGIN
BEGIN
BLOCK "040904E4"
BEGIN
- VALUE "CompanyName", "Estonian ID Card\0"
- VALUE "FileDescription", "libdigidoc\0"
- VALUE "FileVersion", VERSION "\0"
- VALUE "InternalName", "libdigidoc\0"
- VALUE "LegalCopyright", "Copyright (C) 2009-2012 Estonian ID Card"
- VALUE "OriginalFilename", "libdigidoc.dll\0"
- VALUE "ProductName", "libdigidoc\0"
- VALUE "ProductVersion", VERSION "\0"
+ VALUE "CompanyName", "RIA"
+ VALUE "FileDescription", "libdigidoc"
+ VALUE "FileVersion", VERSION
+ VALUE "InternalName", "libdigidoc"
+ VALUE "LegalCopyright", "Copyright (C) 2009-2018 Estonian Information System Authority"
+ VALUE "OriginalFilename", "libdigidoc.dll"
+ VALUE "ProductName", "libdigidoc"
+ VALUE "ProductVersion", VERSION
END
END
BLOCK "VarFileInfo"
diff --git a/libxml2-2.9.2-patches.zip b/libxml2-2.9.2-patches.zip
deleted file mode 100644
index 846a936..0000000
--- a/libxml2-2.9.2-patches.zip
+++ /dev/null
Binary files differ
diff --git a/prepare_win_build_environment.ps1 b/prepare_win_build_environment.ps1
index 40e2b60..92e883e 100644
--- a/prepare_win_build_environment.ps1
+++ b/prepare_win_build_environment.ps1
@@ -5,8 +5,8 @@ param(
[string]$7zip = "C:\Program Files\7-Zip\7z.exe",
[string]$cmake = "C:\Program Files (x86)\CMake\bin\cmake.exe",
[string]$vcvars = "C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\vcvarsall.bat", #$env:VCINSTALLDIR
- [string]$opensslver = "openssl-1.0.2d",
- [string]$libxml2ver = "libxml2-2.9.2",
+ [string]$opensslver = "openssl-1.0.2e",
+ [string]$libxml2ver = "libxml2-2.9.3",
[string]$zlibver = "zlib-1.2.8",
[switch]$openssl = $false,
[switch]$libxml2 = $false,
@@ -15,7 +15,7 @@ param(
$libdigidoc = split-path -parent $MyInvocation.MyCommand.Definition
if(!(Test-Path -Path $target)){
- New-Item -ItemType directory -Path $target
+ New-Item -ItemType directory -Path $target
}
Push-Location -Path $target
@@ -43,9 +43,6 @@ function libxml2() {
$client.DownloadFile("http://xmlsoft.org/sources/$libxml2ver.tar.gz", "$target\$libxml2ver.tar.gz")
& $7zip x "$libxml2ver.tar.gz"
& $7zip x "$libxml2ver.tar"
- foreach($item in $shell.NameSpace("$libdigidoc\$libxml2ver-patches.zip").items()) {
- $shell.Namespace($target).CopyHere($item,0x14)
- }
Push-Location -Path "$libxml2ver\win32"
& cscript configure.js iconv=no iso8859x=yes "prefix=$target\libxml2\x86"
diff --git a/vc2008/cdigidoc.vcproj b/vc2008/cdigidoc.vcproj
deleted file mode 100644
index d1dffa1..0000000
--- a/vc2008/cdigidoc.vcproj
+++ /dev/null
@@ -1,207 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
- ProjectType="Visual C++"
- Version="9,00"
- Name="cdigidoc"
- ProjectGUID="{53105BC1-6319-4A63-B412-99F3CC31640F}"
- RootNamespace="cdigidoc"
- Keyword="Win32Proj"
- TargetFrameworkVersion="196613"
- >
- <Platforms>
- <Platform
- Name="Win32"
- />
- </Platforms>
- <ToolFiles>
- </ToolFiles>
- <Configurations>
- <Configuration
- Name="Debug|Win32"
- OutputDirectory="$(SolutionDir)$(ConfigurationName)"
- IntermediateDirectory="$(ConfigurationName)"
- ConfigurationType="1"
- CharacterSet="1"
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- />
- <Tool
- Name="VCCLCompilerTool"
- Optimization="0"
- AdditionalIncludeDirectories="&quot;C:\Program Files (x86)\Microsoft SDKs\Windows\v5.0\Include&quot;;&quot;$(ProjectDir)\..&quot;;c:\install;c:\install\zlib\include;c:\install\openssl_shared\include;c:\hudson\workspace\libdigidoc\label\Windows_trunk\idkaat\current\libdigidoc"
- PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
- MinimalRebuild="true"
- BasicRuntimeChecks="3"
- RuntimeLibrary="3"
- UsePrecompiledHeader="0"
- WarningLevel="1"
- DebugInformationFormat="4"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- AdditionalIncludeDirectories="$(ProjectDir)\.."
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLinkerTool"
- UseLibraryDependencyInputs="true"
- AdditionalDependencies="comctl32.lib odbc32.lib odbccp32.lib libxml2.lib crypt32.lib Shlwapi.lib libeay32.lib ssleay32.lib zlib.lib wsock32.lib digidoc.lib"
- LinkIncremental="2"
- AdditionalLibraryDirectories="&quot;C:\Program Files (x86)\Microsoft SDKs\Windows\v5.0\Lib&quot;;C:\install\libxml2;C:\install\openssl_shared\lib;C:\install\zlib\lib;&quot;$(ProjectDir)\Debug&quot;"
- GenerateDebugInformation="true"
- SubSystem="1"
- TargetMachine="1"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCManifestTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCAppVerifierTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
- <Configuration
- Name="Release|Win32"
- OutputDirectory="$(SolutionDir)$(ConfigurationName)"
- IntermediateDirectory="$(ConfigurationName)"
- ConfigurationType="1"
- CharacterSet="1"
- WholeProgramOptimization="1"
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- />
- <Tool
- Name="VCCLCompilerTool"
- Optimization="2"
- EnableIntrinsicFunctions="true"
- AdditionalIncludeDirectories="&quot;C:\Program Files (x86)\Microsoft SDKs\Windows\v5.0\Include&quot;;c:\install;c:\install\zlib\include;c:\install\openssl_shared\include;&quot;$(ProjectDir)\..&quot;"
- PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
- RuntimeLibrary="2"
- EnableFunctionLevelLinking="true"
- UsePrecompiledHeader="0"
- WarningLevel="1"
- DebugInformationFormat="3"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- AdditionalIncludeDirectories="$(ProjectDir)\.."
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLinkerTool"
- UseLibraryDependencyInputs="true"
- AdditionalDependencies="comctl32.lib odbc32.lib odbccp32.lib libxml2.lib crypt32.lib Shlwapi.lib libeay32.lib ssleay32.lib zlib.lib wsock32.lib digidoc.lib"
- LinkIncremental="1"
- AdditionalLibraryDirectories="&quot;C:\Program Files (x86)\Microsoft SDKs\Windows\v5.0\Lib&quot;;C:\install\libxml2;C:\install\openssl_shared\lib;C:\install\zlib\lib;&quot;$(ProjectDir)\Release&quot;"
- GenerateDebugInformation="true"
- SubSystem="1"
- OptimizeReferences="2"
- EnableCOMDATFolding="2"
- TargetMachine="1"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCManifestTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCAppVerifierTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
- </Configurations>
- <References>
- </References>
- <Files>
- <Filter
- Name="Source Files"
- Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
- UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
- >
- <File
- RelativePath="..\libdigidoc\cdigidoc.c"
- >
- </File>
- </Filter>
- <Filter
- Name="Header Files"
- Filter="h;hpp;hxx;hm;inl;inc;xsd"
- UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
- >
- </Filter>
- <Filter
- Name="Resource Files"
- Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"
- UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
- >
- <File
- RelativePath="..\libdigidoc\cdigidoc.rc"
- >
- </File>
- </Filter>
- </Files>
- <Globals>
- </Globals>
-</VisualStudioProject>
diff --git a/vc2008/libdigidoc.ncb b/vc2008/libdigidoc.ncb
deleted file mode 100644
index f2ee18c..0000000
--- a/vc2008/libdigidoc.ncb
+++ /dev/null
Binary files differ
diff --git a/vc2008/libdigidoc.sln b/vc2008/libdigidoc.sln
deleted file mode 100644
index d236541..0000000
--- a/vc2008/libdigidoc.sln
+++ /dev/null
@@ -1,37 +0,0 @@
-
-Microsoft Visual Studio Solution File, Format Version 9.00
-# Visual Studio 2008
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libdigidoc", "libdigidoc.vcproj", "{6DB238DD-6FC1-41AD-9317-1795EB40B32A}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cdigidoc", "cdigidoc.vcproj", "{53105BC1-6319-4A63-B412-99F3CC31640F}"
- ProjectSection(ProjectDependencies) = postProject
- {6DB238DD-6FC1-41AD-9317-1795EB40B32A} = {6DB238DD-6FC1-41AD-9317-1795EB40B32A}
- EndProjectSection
-EndProject
-Global
- GlobalSection(SolutionConfigurationPlatforms) = preSolution
- Debug|Win32 = Debug|Win32
- Release|Win32 = Release|Win32
- EndGlobalSection
- GlobalSection(ProjectConfigurationPlatforms) = postSolution
- {6DB238DD-6FC1-41AD-9317-1795EB40B32A}.Debug|Win32.ActiveCfg = Debug|Win32
- {6DB238DD-6FC1-41AD-9317-1795EB40B32A}.Debug|Win32.Build.0 = Debug|Win32
- {6DB238DD-6FC1-41AD-9317-1795EB40B32A}.Release|Win32.ActiveCfg = Release|Win32
- {6DB238DD-6FC1-41AD-9317-1795EB40B32A}.Release|Win32.Build.0 = Release|Win32
- {39E94F79-A838-468B-B53A-EED12E16828D}.Debug|Win32.ActiveCfg = Debug|Win32
- {39E94F79-A838-468B-B53A-EED12E16828D}.Debug|Win32.Build.0 = Debug|Win32
- {39E94F79-A838-468B-B53A-EED12E16828D}.Release|Win32.ActiveCfg = Release|Win32
- {39E94F79-A838-468B-B53A-EED12E16828D}.Release|Win32.Build.0 = Release|Win32
- {7755CEE2-DDE2-417D-9AF9-8422C79F1C30}.Debug|Win32.ActiveCfg = Debug|Win32
- {7755CEE2-DDE2-417D-9AF9-8422C79F1C30}.Debug|Win32.Build.0 = Debug|Win32
- {7755CEE2-DDE2-417D-9AF9-8422C79F1C30}.Release|Win32.ActiveCfg = Release|Win32
- {7755CEE2-DDE2-417D-9AF9-8422C79F1C30}.Release|Win32.Build.0 = Release|Win32
- {53105BC1-6319-4A63-B412-99F3CC31640F}.Debug|Win32.ActiveCfg = Debug|Win32
- {53105BC1-6319-4A63-B412-99F3CC31640F}.Debug|Win32.Build.0 = Debug|Win32
- {53105BC1-6319-4A63-B412-99F3CC31640F}.Release|Win32.ActiveCfg = Release|Win32
- {53105BC1-6319-4A63-B412-99F3CC31640F}.Release|Win32.Build.0 = Release|Win32
- EndGlobalSection
- GlobalSection(SolutionProperties) = preSolution
- HideSolutionNode = FALSE
- EndGlobalSection
-EndGlobal
diff --git a/vc2008/libdigidoc.suo b/vc2008/libdigidoc.suo
deleted file mode 100644
index c32d2e2..0000000
--- a/vc2008/libdigidoc.suo
+++ /dev/null
Binary files differ
diff --git a/vc2008/libdigidoc.vcproj b/vc2008/libdigidoc.vcproj
deleted file mode 100644
index f80d7d5..0000000
--- a/vc2008/libdigidoc.vcproj
+++ /dev/null
@@ -1,406 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<VisualStudioProject
- ProjectType="Visual C++"
- Version="9.00"
- Name="libdigidoc"
- ProjectGUID="{6DB238DD-6FC1-41AD-9317-1795EB40B32A}"
- Keyword="Win32Proj"
- TargetFrameworkVersion="0"
- >
- <Platforms>
- <Platform
- Name="Win32"
- />
- </Platforms>
- <ToolFiles>
- </ToolFiles>
- <Configurations>
- <Configuration
- Name="Debug|Win32"
- OutputDirectory="Debug"
- IntermediateDirectory="Debug"
- ConfigurationType="2"
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- />
- <Tool
- Name="VCCLCompilerTool"
- Optimization="0"
- AdditionalIncludeDirectories="&quot;C:\Program Files (x86)\Microsoft SDKs\Windows\v5.0\Include&quot;;&quot;$(ProjectDir)\..&quot;;c:\install;c:\install\zlib\include;c:\install\openssl_shared\include;c:\hudson\workspace\libdigidoc\label\Windows_trunk\idkaat\current\libdigidoc"
- PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;LIBDIGIDOC_EXPORTS;digidoc_EXPORTS,WIN32"
- MinimalRebuild="true"
- BasicRuntimeChecks="3"
- RuntimeLibrary="3"
- UsePrecompiledHeader="0"
- WarningLevel="1"
- Detect64BitPortabilityProblems="false"
- DebugInformationFormat="4"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- AdditionalIncludeDirectories="$(ProjectDir)\.."
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLinkerTool"
- AdditionalDependencies="comctl32.lib odbc32.lib odbccp32.lib libxml2.lib crypt32.lib Shlwapi.lib libeay32.lib ssleay32.lib zlib.lib wsock32.lib"
- OutputFile="$(OutDir)\digidoc.dll"
- LinkIncremental="2"
- AdditionalLibraryDirectories="&quot;C:\Program Files (x86)\Microsoft SDKs\Windows\v5.0\Lib&quot;;C:\install\libxml2;C:\install\openssl_shared\lib;C:\install\zlib\lib;&quot;$(ProjectDir)\..&quot;"
- GenerateDebugInformation="true"
- SubSystem="2"
- TargetMachine="1"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCManifestTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCAppVerifierTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
- <Configuration
- Name="Release|Win32"
- OutputDirectory="Release"
- IntermediateDirectory="Release"
- ConfigurationType="2"
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- />
- <Tool
- Name="VCCLCompilerTool"
- AdditionalIncludeDirectories="&quot;C:\Program Files (x86)\Microsoft SDKs\Windows\v5.0\Include&quot;;c:\install;c:\install\zlib\include;c:\install\openssl_shared\include;&quot;$(ProjectDir)\..&quot;;$(NOINHERIT)"
- PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;LIBDIGIDOC_EXPORTS;digidoc_EXPORTS"
- RuntimeLibrary="2"
- UsePrecompiledHeader="0"
- WarningLevel="1"
- Detect64BitPortabilityProblems="false"
- DebugInformationFormat="3"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- AdditionalIncludeDirectories="$(ProjectDir)\.."
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLinkerTool"
- AdditionalDependencies="comctl32.lib odbc32.lib odbccp32.lib libxml2.lib crypt32.lib Shlwapi.lib libeay32.lib ssleay32.lib zlib.lib wsock32.lib"
- OutputFile="$(OutDir)\digidoc.dll"
- LinkIncremental="2"
- AdditionalLibraryDirectories="&quot;C:\Program Files (x86)\Microsoft SDKs\Windows\v5.0\Lib&quot;;C:\install\libxml2;C:\install\openssl_shared\lib;C:\install\zlib\lib;&quot;$(ProjectDir)\..&quot;"
- GenerateDebugInformation="true"
- SubSystem="2"
- OptimizeReferences="2"
- EnableCOMDATFolding="2"
- TargetMachine="1"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCManifestTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCAppVerifierTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
- </Configurations>
- <References>
- </References>
- <Files>
- <Filter
- Name="Header Files"
- Filter="h;hpp;hxx;hm;inl;inc;xsd"
- UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
- >
- <File
- RelativePath="..\libdigidoc\DigiCrypt.h"
- >
- </File>
- <File
- RelativePath="..\libdigidoc\DigiDocCert.h"
- >
- </File>
- <File
- RelativePath="..\libdigidoc\DigiDocConfig.h"
- >
- </File>
- <File
- RelativePath="..\libdigidoc\DigiDocConvert.h"
- >
- </File>
- <File
- RelativePath="..\libdigidoc\DigiDocCsp.h"
- >
- </File>
- <File
- RelativePath="..\libdigidoc\DigiDocDebug.h"
- >
- </File>
- <File
- RelativePath="..\libdigidoc\DigiDocDefs.h"
- >
- </File>
- <File
- RelativePath="..\libdigidoc\DigiDocDfExtract.h"
- >
- </File>
- <File
- RelativePath="..\libdigidoc\DigiDocEnc.h"
- >
- </File>
- <File
- RelativePath="..\libdigidoc\DigiDocEncGen.h"
- >
- </File>
- <File
- RelativePath="..\libdigidoc\DigiDocEncSAXParser.h"
- >
- </File>
- <File
- RelativePath="..\libdigidoc\DigiDocError.h"
- >
- </File>
- <File
- RelativePath="..\libdigidoc\DigiDocGen.h"
- >
- </File>
- <File
- RelativePath="..\libdigidoc\DigiDocGlobals.h"
- >
- </File>
- <File
- RelativePath="..\libdigidoc\DigiDocHTTP.h"
- >
- </File>
- <File
- RelativePath="..\libdigidoc\DigiDocLib.h"
- >
- </File>
- <File
- RelativePath="..\libdigidoc\DigiDocMem.h"
- >
- </File>
- <File
- RelativePath="..\libdigidoc\DigiDocObj.h"
- >
- </File>
- <File
- RelativePath="..\libdigidoc\DigiDocOCSP.h"
- >
- </File>
- <File
- RelativePath="..\libdigidoc\DigiDocPKCS11.h"
- >
- </File>
- <File
- RelativePath="..\libdigidoc\DigiDocSAXParser.h"
- >
- </File>
- <File
- RelativePath="..\libdigidoc\DigiDocService.h"
- >
- </File>
- <File
- RelativePath="..\libdigidoc\DigiDocStack.h"
- >
- </File>
- <File
- RelativePath="..\libdigidoc\DigiDocVerify.h"
- >
- </File>
- <File
- RelativePath="..\libdigidoc\DlgUnit.h"
- >
- </File>
- <File
- RelativePath="..\libdigidoc\resource.h"
- >
- </File>
- </Filter>
- <Filter
- Name="Resource Files"
- Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"
- UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
- >
- <File
- RelativePath="..\libdigidoc\DlgUnit.rc"
- >
- </File>
- <File
- RelativePath="..\libdigidoc\libdigidoc.rc"
- >
- </File>
- </Filter>
- <Filter
- Name="Source Files"
- Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
- UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
- >
- <File
- RelativePath="..\libdigidoc\DigiCrypt.c"
- >
- </File>
- <File
- RelativePath="..\libdigidoc\DigiDocCert.c"
- >
- </File>
- <File
- RelativePath="..\libdigidoc\DigiDocConfig.c"
- >
- </File>
- <File
- RelativePath="..\libdigidoc\DigiDocConvert.c"
- >
- </File>
- <File
- RelativePath="..\libdigidoc\DigiDocCsp.c"
- >
- </File>
- <File
- RelativePath="..\libdigidoc\DigiDocDebug.c"
- >
- </File>
- <File
- RelativePath="..\libdigidoc\DigiDocDfExtract.c"
- >
- </File>
- <File
- RelativePath="..\libdigidoc\DigiDocEnc.c"
- >
- </File>
- <File
- RelativePath="..\libdigidoc\DigiDocEncGen.c"
- >
- </File>
- <File
- RelativePath="..\libdigidoc\DigiDocEncSAXParser.c"
- >
- </File>
- <File
- RelativePath="..\libdigidoc\DigiDocError.c"
- >
- </File>
- <File
- RelativePath="..\libdigidoc\DigiDocGen.c"
- >
- </File>
- <File
- RelativePath="..\libdigidoc\DigiDocGlobals.c"
- >
- </File>
- <File
- RelativePath="..\libdigidoc\DigiDocHTTP.c"
- >
- </File>
- <File
- RelativePath="..\libdigidoc\DigiDocLib.c"
- >
- </File>
- <File
- RelativePath="..\libdigidoc\DigiDocMem.c"
- >
- </File>
- <File
- RelativePath="..\libdigidoc\DigiDocObj.c"
- >
- </File>
- <File
- RelativePath="..\libdigidoc\DigiDocOCSP.c"
- >
- </File>
- <File
- RelativePath="..\libdigidoc\DigiDocPKCS11.c"
- >
- </File>
- <File
- RelativePath="..\libdigidoc\DigiDocSAXParser.c"
- >
- </File>
- <File
- RelativePath="..\libdigidoc\DigiDocService.c"
- >
- </File>
- <File
- RelativePath="..\libdigidoc\DigiDocStack.c"
- >
- </File>
- <File
- RelativePath="..\libdigidoc\DigiDocVerify.c"
- >
- </File>
- <File
- RelativePath="..\libdigidoc\DlgUnit.c"
- >
- </File>
- <File
- RelativePath="..\libdigidoc\DlgUnitS.c"
- >
- </File>
- </Filter>
- </Files>
- <Globals>
- </Globals>
-</VisualStudioProject>
diff --git a/vc2008/libdigidoc_vs.sln b/vc2008/libdigidoc_vs.sln
deleted file mode 100644
index d236541..0000000
--- a/vc2008/libdigidoc_vs.sln
+++ /dev/null
@@ -1,37 +0,0 @@
-
-Microsoft Visual Studio Solution File, Format Version 9.00
-# Visual Studio 2008
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libdigidoc", "libdigidoc.vcproj", "{6DB238DD-6FC1-41AD-9317-1795EB40B32A}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cdigidoc", "cdigidoc.vcproj", "{53105BC1-6319-4A63-B412-99F3CC31640F}"
- ProjectSection(ProjectDependencies) = postProject
- {6DB238DD-6FC1-41AD-9317-1795EB40B32A} = {6DB238DD-6FC1-41AD-9317-1795EB40B32A}
- EndProjectSection
-EndProject
-Global
- GlobalSection(SolutionConfigurationPlatforms) = preSolution
- Debug|Win32 = Debug|Win32
- Release|Win32 = Release|Win32
- EndGlobalSection
- GlobalSection(ProjectConfigurationPlatforms) = postSolution
- {6DB238DD-6FC1-41AD-9317-1795EB40B32A}.Debug|Win32.ActiveCfg = Debug|Win32
- {6DB238DD-6FC1-41AD-9317-1795EB40B32A}.Debug|Win32.Build.0 = Debug|Win32
- {6DB238DD-6FC1-41AD-9317-1795EB40B32A}.Release|Win32.ActiveCfg = Release|Win32
- {6DB238DD-6FC1-41AD-9317-1795EB40B32A}.Release|Win32.Build.0 = Release|Win32
- {39E94F79-A838-468B-B53A-EED12E16828D}.Debug|Win32.ActiveCfg = Debug|Win32
- {39E94F79-A838-468B-B53A-EED12E16828D}.Debug|Win32.Build.0 = Debug|Win32
- {39E94F79-A838-468B-B53A-EED12E16828D}.Release|Win32.ActiveCfg = Release|Win32
- {39E94F79-A838-468B-B53A-EED12E16828D}.Release|Win32.Build.0 = Release|Win32
- {7755CEE2-DDE2-417D-9AF9-8422C79F1C30}.Debug|Win32.ActiveCfg = Debug|Win32
- {7755CEE2-DDE2-417D-9AF9-8422C79F1C30}.Debug|Win32.Build.0 = Debug|Win32
- {7755CEE2-DDE2-417D-9AF9-8422C79F1C30}.Release|Win32.ActiveCfg = Release|Win32
- {7755CEE2-DDE2-417D-9AF9-8422C79F1C30}.Release|Win32.Build.0 = Release|Win32
- {53105BC1-6319-4A63-B412-99F3CC31640F}.Debug|Win32.ActiveCfg = Debug|Win32
- {53105BC1-6319-4A63-B412-99F3CC31640F}.Debug|Win32.Build.0 = Debug|Win32
- {53105BC1-6319-4A63-B412-99F3CC31640F}.Release|Win32.ActiveCfg = Release|Win32
- {53105BC1-6319-4A63-B412-99F3CC31640F}.Release|Win32.Build.0 = Release|Win32
- EndGlobalSection
- GlobalSection(SolutionProperties) = preSolution
- HideSolutionNode = FALSE
- EndGlobalSection
-EndGlobal
diff --git a/vc2010/DigiDocLib.vcxproj b/vc2010/DigiDocLib.vcxproj
deleted file mode 100644
index 05b7274..0000000
--- a/vc2010/DigiDocLib.vcxproj
+++ /dev/null
@@ -1,206 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <ItemGroup Label="ProjectConfigurations">
- <ProjectConfiguration Include="Debug|Win32">
- <Configuration>Debug</Configuration>
- <Platform>Win32</Platform>
- </ProjectConfiguration>
- <ProjectConfiguration Include="Release|Win32">
- <Configuration>Release</Configuration>
- <Platform>Win32</Platform>
- </ProjectConfiguration>
- </ItemGroup>
- <ItemGroup>
- <ClCompile Include="libdigidoc\DigiCrypt.c" />
- <ClCompile Include="libdigidoc\DigiDocCert.c" />
- <ClCompile Include="libdigidoc\DigiDocConfig.c" />
- <ClCompile Include="libdigidoc\DigiDocConvert.c" />
- <ClCompile Include="libdigidoc\DigiDocCsp.c" />
- <ClCompile Include="libdigidoc\DigiDocDebug.c" />
- <ClCompile Include="libdigidoc\DigiDocDfExtract.c" />
- <ClCompile Include="libdigidoc\DigiDocEnc.c" />
- <ClCompile Include="libdigidoc\DigiDocEncGen.c" />
- <ClCompile Include="libdigidoc\DigiDocEncSAXParser.c" />
- <ClCompile Include="libdigidoc\DigiDocError.c" />
- <ClCompile Include="libdigidoc\DigiDocGen.c" />
- <ClCompile Include="libdigidoc\DigiDocGlobals.c" />
- <ClCompile Include="libdigidoc\DigiDocHTTP.c" />
- <ClCompile Include="libdigidoc\DigiDocLib.c" />
- <ClCompile Include="libdigidoc\DigiDocMem.c" />
- <ClCompile Include="libdigidoc\DigiDocObj.c" />
- <ClCompile Include="libdigidoc\DigiDocOCSP.c" />
- <ClCompile Include="libdigidoc\DigiDocParser.c" />
- <ClCompile Include="libdigidoc\DigiDocPKCS11.c" />
- <ClCompile Include="libdigidoc\DigiDocSAXParser.c" />
- <ClCompile Include="libdigidoc\DigiDocService.c" />
- <ClCompile Include="libdigidoc\DigiDocStack.c" />
- <ClCompile Include="libdigidoc\DigiDocVerify.c" />
- <ClCompile Include="libdigidoc\DlgUnit.c" />
- <ClCompile Include="libdigidoc\DlgUnitS.c" />
- </ItemGroup>
- <ItemGroup>
- <ClInclude Include="libdigidoc\DigiCrypt.h" />
- <ClInclude Include="libdigidoc\DigiDocCert.h" />
- <ClInclude Include="libdigidoc\DigiDocConfig.h" />
- <ClInclude Include="libdigidoc\DigiDocConvert.h" />
- <ClInclude Include="libdigidoc\DigiDocCsp.h" />
- <ClInclude Include="libdigidoc\DigiDocDebug.h" />
- <ClInclude Include="libdigidoc\DigiDocDefs.h" />
- <ClInclude Include="libdigidoc\DigiDocDfExtract.h" />
- <ClInclude Include="libdigidoc\DigiDocEnc.h" />
- <ClInclude Include="libdigidoc\DigiDocEncGen.h" />
- <ClInclude Include="libdigidoc\DigiDocEncSAXParser.h" />
- <ClInclude Include="libdigidoc\DigiDocError.h" />
- <ClInclude Include="libdigidoc\DigiDocGen.h" />
- <ClInclude Include="libdigidoc\DigiDocGlobals.h" />
- <ClInclude Include="libdigidoc\DigiDocHTTP.h" />
- <ClInclude Include="libdigidoc\DigiDocLib.h" />
- <ClInclude Include="libdigidoc\DigiDocMem.h" />
- <ClInclude Include="libdigidoc\DigiDocObj.h" />
- <ClInclude Include="libdigidoc\DigiDocOCSP.h" />
- <ClInclude Include="libdigidoc\DigiDocParser.h" />
- <ClInclude Include="libdigidoc\DigiDocPKCS11.h" />
- <ClInclude Include="libdigidoc\DigiDocSAXParser.h" />
- <ClInclude Include="libdigidoc\DigiDocService.h" />
- <ClInclude Include="libdigidoc\DigiDocStack.h" />
- <ClInclude Include="libdigidoc\DigiDocVerify.h" />
- <ClInclude Include="libdigidoc\DlgUnit.h" />
- <ClInclude Include="libdigidoc\resource.h" />
- </ItemGroup>
- <ItemGroup>
- <ResourceCompile Include="libdigidoc\DlgUnit.rc" />
- <ResourceCompile Include="libdigidoc\libdigidoc.rc" />
- </ItemGroup>
- <PropertyGroup Label="Globals">
- <SccProjectName />
- <SccLocalPath />
- </PropertyGroup>
- <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
- <ConfigurationType>DynamicLibrary</ConfigurationType>
- <UseOfMfc>false</UseOfMfc>
- </PropertyGroup>
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
- <ConfigurationType>DynamicLibrary</ConfigurationType>
- <UseOfMfc>false</UseOfMfc>
- </PropertyGroup>
- <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
- <ImportGroup Label="ExtensionSettings">
- </ImportGroup>
- <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
- <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
- <Import Project="$(VCTargetsPath)Microsoft.Cpp.UpgradeFromVC60.props" />
- </ImportGroup>
- <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
- <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
- <Import Project="$(VCTargetsPath)Microsoft.Cpp.UpgradeFromVC60.props" />
- </ImportGroup>
- <PropertyGroup Label="UserMacros" />
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
- <OutDir>.\Debug\</OutDir>
- <IntDir>.\Debug\</IntDir>
- <LinkIncremental>true</LinkIncremental>
- <TargetName>digidoc</TargetName>
- <IncludePath>C:\install;C:\install\zlib\include;C:\install\openssl_shared\include;Z:\projects\libdigidoc\trunk;$(IncludePath)</IncludePath>
- <LibraryPath>C:\install\libxml2;C:\install\openssl_shared\lib;C:\install\zlib\lib;$(LibraryPath)</LibraryPath>
- </PropertyGroup>
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
- <OutDir>.\Release\</OutDir>
- <IntDir>.\Release\</IntDir>
- <LinkIncremental>false</LinkIncremental>
- <IncludePath>Z:\projects\libdigidoc\trunk;C:\install;C:\install\openssl_shared\include;C:\install\zlib\include;$(IncludePath)</IncludePath>
- <LibraryPath>C:\install\libxml2;C:\install\openssl_shared\lib;C:\install\zlib\lib;$(LibraryPath)</LibraryPath>
- </PropertyGroup>
- <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
- <ClCompile>
- <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
- <InlineFunctionExpansion>Default</InlineFunctionExpansion>
- <FunctionLevelLinking>false</FunctionLevelLinking>
- <Optimization>Disabled</Optimization>
- <SuppressStartupBanner>true</SuppressStartupBanner>
- <WarningLevel>Level3</WarningLevel>
- <MinimalRebuild>true</MinimalRebuild>
- <DebugInformationFormat>EditAndContinue</DebugInformationFormat>
- <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;BUILDINGDLL;WITH_SOAPDEFS_H;digidoc_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <AssemblerListingLocation>.\Debug\</AssemblerListingLocation>
- <PrecompiledHeaderOutputFile>.\Debug\DigiDocLib.pch</PrecompiledHeaderOutputFile>
- <ObjectFileName>.\Debug\</ObjectFileName>
- <ProgramDataBaseFileName>.\Debug\</ProgramDataBaseFileName>
- </ClCompile>
- <Midl>
- <SuppressStartupBanner>true</SuppressStartupBanner>
- <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <TypeLibraryName>.\Debug\DigiDocLib.tlb</TypeLibraryName>
- <MkTypLibCompatible>true</MkTypLibCompatible>
- <RedirectOutputAndErrors>NUL</RedirectOutputAndErrors>
- <TargetEnvironment>Win32</TargetEnvironment>
- </Midl>
- <ResourceCompile>
- <Culture>0x041d</Culture>
- <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- </ResourceCompile>
- <Bscmake>
- <SuppressStartupBanner>true</SuppressStartupBanner>
- <OutputFile>.\Debug\DigiDocLib.bsc</OutputFile>
- </Bscmake>
- <Link>
- <SuppressStartupBanner>true</SuppressStartupBanner>
- <LinkDLL>true</LinkDLL>
- <GenerateDebugInformation>true</GenerateDebugInformation>
- <SubSystem>Windows</SubSystem>
- <OutputFile>bin/digidoc.dll</OutputFile>
- <ImportLibrary>bin\digidoc.lib</ImportLibrary>
- <AdditionalDependencies>comctl32.lib;odbc32.lib;odbccp32.lib;libxml2.lib;crypt32.lib;Shlwapi.lib;libeay32.lib;ssleay32.lib;zlib.lib;wsock32.lib;%(AdditionalDependencies)</AdditionalDependencies>
- <IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
- <IgnoreSpecificDefaultLibraries>LIBCMTD.LIB</IgnoreSpecificDefaultLibraries>
- <ShowProgress>NotSet</ShowProgress>
- </Link>
- </ItemDefinitionGroup>
- <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
- <ClCompile>
- <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
- <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
- <StringPooling>true</StringPooling>
- <FunctionLevelLinking>true</FunctionLevelLinking>
- <Optimization>MaxSpeed</Optimization>
- <SuppressStartupBanner>true</SuppressStartupBanner>
- <WarningLevel>Level3</WarningLevel>
- <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
- <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;BUILDINGDLL;WITH_SOAPDEFS_H;digidoc_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <AssemblerListingLocation>.\Release\</AssemblerListingLocation>
- <PrecompiledHeaderOutputFile>.\Release\DigiDocLib.pch</PrecompiledHeaderOutputFile>
- <ObjectFileName>.\Release\</ObjectFileName>
- <ProgramDataBaseFileName>.\Release\</ProgramDataBaseFileName>
- </ClCompile>
- <Midl>
- <SuppressStartupBanner>true</SuppressStartupBanner>
- <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <TypeLibraryName>.\Release\DigiDocLib.tlb</TypeLibraryName>
- <MkTypLibCompatible>true</MkTypLibCompatible>
- <RedirectOutputAndErrors>NUL</RedirectOutputAndErrors>
- <TargetEnvironment>Win32</TargetEnvironment>
- </Midl>
- <ResourceCompile>
- <Culture>0x041d</Culture>
- <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- </ResourceCompile>
- <Bscmake>
- <SuppressStartupBanner>true</SuppressStartupBanner>
- <OutputFile>.\Release\DigiDocLib.bsc</OutputFile>
- </Bscmake>
- <Link>
- <SuppressStartupBanner>true</SuppressStartupBanner>
- <LinkDLL>true</LinkDLL>
- <SubSystem>Windows</SubSystem>
- <IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
- <OutputFile>bin\DigiDocLib.dll</OutputFile>
- <ImportLibrary>.\Release\DigiDocLib.lib</ImportLibrary>
- <AdditionalLibraryDirectories>%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
- <AdditionalDependencies>comctl32.lib;odbc32.lib;odbccp32.lib;libxml2.lib;crypt32.lib;Shlwapi.lib;libeay32.lib;ssleay32.lib;zlib.lib;wsock32.lib;%(AdditionalDependencies)</AdditionalDependencies>
- <IgnoreSpecificDefaultLibraries>LIBCMT.lib</IgnoreSpecificDefaultLibraries>
- </Link>
- </ItemDefinitionGroup>
- <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
- <ImportGroup Label="ExtensionTargets">
- </ImportGroup>
-</Project> \ No newline at end of file
diff --git a/vc2010/digidoc.vcxproj b/vc2010/digidoc.vcxproj
deleted file mode 100644
index f066856..0000000
--- a/vc2010/digidoc.vcxproj
+++ /dev/null
@@ -1,146 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <ItemGroup Label="ProjectConfigurations">
- <ProjectConfiguration Include="Debug|Win32">
- <Configuration>Debug</Configuration>
- <Platform>Win32</Platform>
- </ProjectConfiguration>
- <ProjectConfiguration Include="Release|Win32">
- <Configuration>Release</Configuration>
- <Platform>Win32</Platform>
- </ProjectConfiguration>
- <ProjectConfiguration Include="Template|Win32">
- <Configuration>Template</Configuration>
- <Platform>Win32</Platform>
- </ProjectConfiguration>
- </ItemGroup>
- <ItemGroup>
- <ClCompile Include="libdigidoc\cdigidoc.c" />
- </ItemGroup>
- <ItemGroup>
- <ProjectReference Include="DigiDocLib.vcxproj">
- <Project>{0ab62309-a060-0bd6-a056-1f774efb4d04}</Project>
- <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
- </ProjectReference>
- </ItemGroup>
- <PropertyGroup Label="Globals">
- <SccProjectName />
- <SccLocalPath />
- </PropertyGroup>
- <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Template|Win32'" Label="Configuration">
- <ConfigurationType>Application</ConfigurationType>
- </PropertyGroup>
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
- <ConfigurationType>Application</ConfigurationType>
- <UseOfMfc>false</UseOfMfc>
- <CharacterSet>MultiByte</CharacterSet>
- </PropertyGroup>
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
- <ConfigurationType>Application</ConfigurationType>
- <UseOfMfc>false</UseOfMfc>
- <CharacterSet>MultiByte</CharacterSet>
- </PropertyGroup>
- <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
- <ImportGroup Label="ExtensionSettings">
- </ImportGroup>
- <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Template|Win32'">
- <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
- </ImportGroup>
- <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
- <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
- <Import Project="$(VCTargetsPath)Microsoft.Cpp.UpgradeFromVC60.props" />
- </ImportGroup>
- <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
- <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
- <Import Project="$(VCTargetsPath)Microsoft.Cpp.UpgradeFromVC60.props" />
- </ImportGroup>
- <PropertyGroup Label="UserMacros" />
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
- <OutDir>bin\</OutDir>
- <IntDir>.\Debug\</IntDir>
- <LinkIncremental>true</LinkIncremental>
- <ExecutablePath>$(ExecutablePath)</ExecutablePath>
- <IncludePath>Z:\projects\libdigidoc\trunk;C:\install;C:\install\openssl_shared\include;C:\install\zlib\include;$(IncludePath)</IncludePath>
- <LibraryPath>C:\install\libxml2;C:\install\openssl_shared\lib;C:\install\zlib\lib;Z:\projects\libdigidoc\trunk;$(LibraryPath)</LibraryPath>
- </PropertyGroup>
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
- <OutDir>.\Release\</OutDir>
- <IntDir>.\Release\</IntDir>
- <LinkIncremental>false</LinkIncremental>
- <IncludePath>Z:\projects\libdigidoc\trunk;C:\install;C:\install\openssl_shared\include;C:\install\zlib\include;$(IncludePath)</IncludePath>
- <LibraryPath>Z:\projects\libdigidoc\trunk\bin;Z:\projects\libdigidoc\trunk\Release;C:\install\libxml2;C:\install\openssl_static\lib;C:\install\zlib\lib;$(LibraryPath)</LibraryPath>
- </PropertyGroup>
- <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
- <ClCompile>
- <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
- <InlineFunctionExpansion>Default</InlineFunctionExpansion>
- <FunctionLevelLinking>false</FunctionLevelLinking>
- <Optimization>Disabled</Optimization>
- <SuppressStartupBanner>true</SuppressStartupBanner>
- <WarningLevel>Level3</WarningLevel>
- <MinimalRebuild>true</MinimalRebuild>
- <DebugInformationFormat>EditAndContinue</DebugInformationFormat>
- <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;WITH_SOAPDEFS_H;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <AssemblerListingLocation>.\Debug\</AssemblerListingLocation>
- <PrecompiledHeaderOutputFile>.\Debug\digidoc.pch</PrecompiledHeaderOutputFile>
- <ObjectFileName>.\Debug\</ObjectFileName>
- <ProgramDataBaseFileName>.\Debug\</ProgramDataBaseFileName>
- <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
- </ClCompile>
- <Midl>
- <TypeLibraryName>.\Debug\digidoc.tlb</TypeLibraryName>
- </Midl>
- <ResourceCompile>
- <Culture>0x0409</Culture>
- <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- </ResourceCompile>
- <Bscmake>
- <SuppressStartupBanner>true</SuppressStartupBanner>
- <OutputFile>.\Debug\digidoc.bsc</OutputFile>
- </Bscmake>
- <Link>
- <SuppressStartupBanner>true</SuppressStartupBanner>
- <GenerateDebugInformation>true</GenerateDebugInformation>
- <SubSystem>Console</SubSystem>
- <OutputFile>bin\digidoc.exe</OutputFile>
- <AdditionalDependencies>odbc32.lib;odbccp32.lib;libxml2.lib;libeay32.lib;ssleay32.lib;bin\DigiDoc.lib;zlib.lib;wsock32.lib;%(AdditionalDependencies)</AdditionalDependencies>
- </Link>
- </ItemDefinitionGroup>
- <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
- <ClCompile>
- <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
- <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
- <StringPooling>true</StringPooling>
- <FunctionLevelLinking>true</FunctionLevelLinking>
- <Optimization>MaxSpeed</Optimization>
- <SuppressStartupBanner>true</SuppressStartupBanner>
- <WarningLevel>Level4</WarningLevel>
- <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;BUILDINGDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <AssemblerListingLocation>.\Release\</AssemblerListingLocation>
- <PrecompiledHeaderOutputFile>.\Release\digidoc.pch</PrecompiledHeaderOutputFile>
- <ObjectFileName>.\Release\</ObjectFileName>
- <ProgramDataBaseFileName>.\Release\</ProgramDataBaseFileName>
- </ClCompile>
- <Midl>
- <TypeLibraryName>.\Release\digidoc.tlb</TypeLibraryName>
- </Midl>
- <ResourceCompile>
- <Culture>0x0409</Culture>
- <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- </ResourceCompile>
- <Bscmake>
- <SuppressStartupBanner>true</SuppressStartupBanner>
- <OutputFile>.\Release\digidoc.bsc</OutputFile>
- </Bscmake>
- <Link>
- <SuppressStartupBanner>true</SuppressStartupBanner>
- <SubSystem>Console</SubSystem>
- <OutputFile>bin/cdigidoc.exe</OutputFile>
- <AdditionalDependencies>odbc32.lib;odbccp32.lib;libeay32.lib;ssleay32.lib;libxml2.lib;zlib.lib;Release\DigiDocLib.lib;wsock32.lib;Shlwapi.lib;crypt32.lib;comctl32.lib;%(AdditionalDependencies)</AdditionalDependencies>
- </Link>
- </ItemDefinitionGroup>
- <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
- <ImportGroup Label="ExtensionTargets">
- </ImportGroup>
-</Project> \ No newline at end of file
diff --git a/vc2010/libdigidoc.sln b/vc2010/libdigidoc.sln
deleted file mode 100644
index 4c7fc05..0000000
--- a/vc2010/libdigidoc.sln
+++ /dev/null
@@ -1,61 +0,0 @@
-
-Microsoft Visual Studio Solution File, Format Version 11.00
-# Visual Studio 2010
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DigiDocLib", "DigiDocLib.vcxproj", "{0AB62309-A060-0BD6-A056-1F774EFB4D04}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "digidoc", "digidoc.vcxproj", "{FEA32EF4-D9F2-F7AC-E6E9-153F371AEFDF}"
-EndProject
-Global
- GlobalSection(SolutionConfigurationPlatforms) = preSolution
- Debug_2_rel|Win32 = Debug_2_rel|Win32
- Debug|Win32 = Debug|Win32
- Release MinDependency|Win32 = Release MinDependency|Win32
- Release|Win32 = Release|Win32
- Template|Win32 = Template|Win32
- EndGlobalSection
- GlobalSection(ProjectConfigurationPlatforms) = postSolution
- {0AB62309-A060-0BD6-A056-1F774EFB4D04}.Debug_2_rel|Win32.ActiveCfg = Debug|Win32
- {0AB62309-A060-0BD6-A056-1F774EFB4D04}.Debug_2_rel|Win32.Build.0 = Debug|Win32
- {0AB62309-A060-0BD6-A056-1F774EFB4D04}.Debug|Win32.ActiveCfg = Debug|Win32
- {0AB62309-A060-0BD6-A056-1F774EFB4D04}.Debug|Win32.Build.0 = Debug|Win32
- {0AB62309-A060-0BD6-A056-1F774EFB4D04}.Release MinDependency|Win32.ActiveCfg = Release|Win32
- {0AB62309-A060-0BD6-A056-1F774EFB4D04}.Release MinDependency|Win32.Build.0 = Release|Win32
- {0AB62309-A060-0BD6-A056-1F774EFB4D04}.Release|Win32.ActiveCfg = Release|Win32
- {0AB62309-A060-0BD6-A056-1F774EFB4D04}.Release|Win32.Build.0 = Release|Win32
- {0AB62309-A060-0BD6-A056-1F774EFB4D04}.Template|Win32.ActiveCfg = Release|Win32
- {0AB62309-A060-0BD6-A056-1F774EFB4D04}.Template|Win32.Build.0 = Release|Win32
- {FEA32EF4-D9F2-F7AC-E6E9-153F371AEFDF}.Debug_2_rel|Win32.ActiveCfg = Debug|Win32
- {FEA32EF4-D9F2-F7AC-E6E9-153F371AEFDF}.Debug_2_rel|Win32.Build.0 = Debug|Win32
- {FEA32EF4-D9F2-F7AC-E6E9-153F371AEFDF}.Debug|Win32.ActiveCfg = Debug|Win32
- {FEA32EF4-D9F2-F7AC-E6E9-153F371AEFDF}.Debug|Win32.Build.0 = Debug|Win32
- {FEA32EF4-D9F2-F7AC-E6E9-153F371AEFDF}.Release MinDependency|Win32.ActiveCfg = Release|Win32
- {FEA32EF4-D9F2-F7AC-E6E9-153F371AEFDF}.Release MinDependency|Win32.Build.0 = Release|Win32
- {FEA32EF4-D9F2-F7AC-E6E9-153F371AEFDF}.Release|Win32.ActiveCfg = Release|Win32
- {FEA32EF4-D9F2-F7AC-E6E9-153F371AEFDF}.Release|Win32.Build.0 = Release|Win32
- {FEA32EF4-D9F2-F7AC-E6E9-153F371AEFDF}.Template|Win32.ActiveCfg = Template|Win32
- {FEA32EF4-D9F2-F7AC-E6E9-153F371AEFDF}.Template|Win32.Build.0 = Template|Win32
- {62BC5BB8-94BD-B9D5-D004-70B7671171D6}.Debug_2_rel|Win32.ActiveCfg = Debug_2_rel|Win32
- {62BC5BB8-94BD-B9D5-D004-70B7671171D6}.Debug_2_rel|Win32.Build.0 = Debug_2_rel|Win32
- {62BC5BB8-94BD-B9D5-D004-70B7671171D6}.Debug|Win32.ActiveCfg = Debug|Win32
- {62BC5BB8-94BD-B9D5-D004-70B7671171D6}.Debug|Win32.Build.0 = Debug|Win32
- {62BC5BB8-94BD-B9D5-D004-70B7671171D6}.Release MinDependency|Win32.ActiveCfg = Release MinDependency|Win32
- {62BC5BB8-94BD-B9D5-D004-70B7671171D6}.Release MinDependency|Win32.Build.0 = Release MinDependency|Win32
- {62BC5BB8-94BD-B9D5-D004-70B7671171D6}.Release|Win32.ActiveCfg = Release MinDependency|Win32
- {62BC5BB8-94BD-B9D5-D004-70B7671171D6}.Release|Win32.Build.0 = Release MinDependency|Win32
- {62BC5BB8-94BD-B9D5-D004-70B7671171D6}.Template|Win32.ActiveCfg = Release MinDependency|Win32
- {62BC5BB8-94BD-B9D5-D004-70B7671171D6}.Template|Win32.Build.0 = Release MinDependency|Win32
- {494A3DA8-A26C-41B2-A6EA-85BC57748152}.Debug_2_rel|Win32.ActiveCfg = Debug|Win32
- {494A3DA8-A26C-41B2-A6EA-85BC57748152}.Debug_2_rel|Win32.Build.0 = Debug|Win32
- {494A3DA8-A26C-41B2-A6EA-85BC57748152}.Debug|Win32.ActiveCfg = Debug|Win32
- {494A3DA8-A26C-41B2-A6EA-85BC57748152}.Debug|Win32.Build.0 = Debug|Win32
- {494A3DA8-A26C-41B2-A6EA-85BC57748152}.Release MinDependency|Win32.ActiveCfg = Release|Win32
- {494A3DA8-A26C-41B2-A6EA-85BC57748152}.Release MinDependency|Win32.Build.0 = Release|Win32
- {494A3DA8-A26C-41B2-A6EA-85BC57748152}.Release|Win32.ActiveCfg = Release|Win32
- {494A3DA8-A26C-41B2-A6EA-85BC57748152}.Release|Win32.Build.0 = Release|Win32
- {494A3DA8-A26C-41B2-A6EA-85BC57748152}.Template|Win32.ActiveCfg = Release|Win32
- {494A3DA8-A26C-41B2-A6EA-85BC57748152}.Template|Win32.Build.0 = Release|Win32
- EndGlobalSection
- GlobalSection(SolutionProperties) = preSolution
- HideSolutionNode = FALSE
- EndGlobalSection
-EndGlobal