Navigation


Changeset 1561:699c3fb0c57b in freeDiameter


Ignore:
Timestamp:
Jun 17, 2021, 1:44:45 AM (12 months ago)
Author:
Thomas Klausner <wiz@gatalith.at>
Branch:
default
Phase:
public
Message:

Switch from libidn to libidn2.

libidn2 is the backwards compatible successor to libidn,
and at least Red Hat 8 does not provide a dev package for libidn1.

Files:
1 deleted
12 edited

Legend:

Unmodified
Added
Removed
  • INSTALL.Fedora

    r861 r1561  
    44
    55Dependencies on Fedora 13 (from minimal system):
    6 # yum install cmake make gcc gcc-c++ flex bison lksctp-tools-devel gnutls-devel libgcrypt-devel libidn-devel
     6# yum install cmake make gcc gcc-c++ flex bison lksctp-tools-devel gnutls-devel libgcrypt-devel libidn2-devel
    77
    88In addition, if you have not already retrieved the latest source:
  • INSTALL.FreeBSD

    r921 r1561  
    35354) Install 'flex' and 'bison', same way.
    3636
    37 5) Install 'gnutls' and 'libidn', same way also.
     375) Install 'gnutls' and 'libidn2', same way also.
    3838
    39396) Retrieve freeDiameter source code:
  • INSTALL.OSX

    r1288 r1561  
    4040
    41412) Install dependencies:
    42     $ brew install mercurial cmake gnutls libgcrypt postgres mysql libidn
     42    $ brew install mercurial cmake gnutls libgcrypt postgres mysql libidn2
    4343
    4444   Notes:
    45     * GNU IDN (libidn) is optional, see below
     45    * GNU IDN (libidn2) is optional, see below
    4646    * When libusrsctp package is available, you can use it as well.
    4747        However, it requires some rework on the source code as libusrsctp is not fully
  • INSTALL.OpenSUSE

    r858 r1561  
    44
    55Dependencies on OpenSUSE 11.3 (from minimal server system installation):
    6 # zypper install cmake make gcc gcc-c++ flex bison lksctp-tools-devel libgnutls-devel libgcrypt-devel libidn-devel
     6# zypper install cmake make gcc gcc-c++ flex bison lksctp-tools-devel libgnutls-devel libgcrypt-devel libidn2-devel
    77# zypper install mercurial
    88
  • INSTALL.Ubuntu

    r1351 r1561  
    1818
    1919The following packages are required to compile freeDiameter from source:
    20  cmake make gcc g++ flex bison libsctp1 libsctp-dev libgnutls-dev libgcrypt-dev libidn11-dev
     20 cmake make gcc g++ flex bison libsctp1 libsctp-dev libgnutls-dev libgcrypt-dev libidn2-dev
    2121 
    22 (note that libidn and libsctp can be avoided by defining DISABLE_SCTP and DIAMID_IDNA_REJECT)
     22(note that libidn2 and libsctp can be avoided by defining DISABLE_SCTP and DIAMID_IDNA_REJECT)
    2323 
    2424Additionnaly, these ones may be useful:
     
    4545
    4646# Install the dependencies for building the source:
    47 sudo apt-get -y install mercurial cmake make gcc g++ bison flex libsctp-dev libgnutls-dev libgcrypt-dev libidn11-dev ssl-cert debhelper fakeroot \
     47sudo apt-get -y install mercurial cmake make gcc g++ bison flex libsctp-dev libgnutls-dev libgcrypt-dev libidn2-dev ssl-cert debhelper fakeroot \
    4848   libpq-dev libmysqlclient-dev libxml2-dev swig python-dev
    4949   
     
    8585
    86861) Install all packages dependencies
    87 # sudo apt-get install mercurial cmake make gcc g++ bison flex libsctp-dev libgnutls-dev libgcrypt-dev libidn11-dev
     87# sudo apt-get install mercurial cmake make gcc g++ bison flex libsctp-dev libgnutls-dev libgcrypt-dev libidn2-dev
    8888
    89892) (OPTION) If you will compile modules that require postgresql, also install:
  • INSTALL.pkgsrc

    r1334 r1561  
    99If you want to build and install freeDiameter from the repository,
    1010you'll need to install:
    11         pkg_add bison pkg-config libidn gnutls libgcrypt mercurial
     11        pkg_add bison pkg-config libidn2 gnutls libgcrypt mercurial
    1212and follow the usual installation note.
    1313
  • contrib/RPM/freeDiameter.spec

    r1224 r1561  
    1111
    1212BuildRequires: cmake make gcc gcc-c++ flex bison lksctp-tools-devel
    13 BuildRequires: gnutls-devel libgcrypt-devel libidn-devel
     13BuildRequires: gnutls-devel libgcrypt-devel libidn2-devel
    1414BuildRequires: mercurial       
    1515Requires: lksctp-tools 
  • contrib/debian/control

    r1310 r1561  
    55Build-Depends: debhelper ( >= 7.3.9),
    66 cmake, make, gcc, g++, bison, flex,
    7  libsctp-dev, libgnutls-dev | gnutls-dev, libidn11-dev,
     7 libsctp-dev, libgnutls-dev | gnutls-dev, libidn2-dev,
    88 libpq-dev, libmysqlclient-dev, libxml2-dev, swig, python-dev,
    99 libgcrypt11-dev | libgcrypt20-dev
  • contrib/nightly_tests/prereqs.fedora

    r1053 r1561  
    44postgresql-server postgresql-devel
    55mysql-server mysql-devel
    6 libxml2 libxml2-devel libidn-devel
     6libxml2 libxml2-devel libidn2-devel
    77swig python-devel
    88
  • include/freeDiameter/CMakeLists.txt

    r1406 r1561  
    22
    33Project("freeDiameter includes directory" C)
     4
     5INCLUDE(FindPkgConfig)
    46
    57########################
     
    136138SET(SCTP_LIBRARIES ${SCTP_LIBRARIES} PARENT_SCOPE)
    137139
    138 # IDNA process: we use libidn from GNU (unless the function & header files are included in libc)
     140# IDNA process: we use GNU libidn2
    139141IF(NOT DIAMID_IDNA_IGNORE AND NOT DIAMID_IDNA_REJECT)
    140         FIND_PACKAGE(IDNA)
    141         SET(CHECK_IDNA_SOURCE_CODE "
    142                 #include <idna.h>
    143                 int main() {
    144                    return idna_to_ascii_8z(NULL, NULL, 0);
    145                 }
    146                 ")
    147         SET(CMAKE_REQUIRED_INCLUDES ${IDNA_INCLUDE_DIR})
    148         SET(CMAKE_REQUIRED_LIBRARIES ${IDNA_LIBRARIES})
    149         CHECK_C_SOURCE_COMPILES("${CHECK_IDNA_SOURCE_CODE}" HAS_IDNA_SUPPORT)
    150         IF(NOT HAS_IDNA_SUPPORT)
    151                 MESSAGE(SEND_ERROR "Unable to find idna.h header or idna_to_ascii_8z function, please install libidn-dev or equivalent, or set DIAMID_IDNA_IGNORE or DIAMID_IDNA_REJECT")
    152         ENDIF(NOT HAS_IDNA_SUPPORT)
     142        PKG_CHECK_MODULES(IDNA libidn2)
     143        IF(NOT IDNA_FOUND)
     144                MESSAGE(SEND_ERROR "Unable to find libidn2, please install libidn2-dev or equivalent, or set DIAMID_IDNA_IGNORE or DIAMID_IDNA_REJECT")
     145        ENDIF()
    153146ELSE (NOT DIAMID_IDNA_IGNORE  AND NOT DIAMID_IDNA_REJECT)
    154147        MESSAGE(STATUS "Non-default Internationalized Domain Names (IDN) behavior selected (no stringprep).")
    155148ENDIF(NOT DIAMID_IDNA_IGNORE  AND NOT DIAMID_IDNA_REJECT)
    156 SET(IDNA_INCLUDE_DIR ${IDNA_INCLUDE_DIR} PARENT_SCOPE)
    157 SET(IDNA_LIBRARIES ${IDNA_LIBRARIES} PARENT_SCOPE)
    158149
    159150
     
    221212
    222213# LFDPROTO_LIBS = libraries required by the libfdproto.
    223 SET(LFDPROTO_LIBS ${CLOCK_GETTIME_LIBS} ${CMAKE_THREAD_LIBS_INIT} ${IDNA_LIBRARIES} PARENT_SCOPE)
     214SET(LFDPROTO_LIBS ${CLOCK_GETTIME_LIBS} ${CMAKE_THREAD_LIBS_INIT} ${IDNA_LINK_LIBRARIES} PARENT_SCOPE)
    224215# And includes paths
    225 SET(LFDPROTO_INCLUDES ${IDNA_INCLUDE_DIR} PARENT_SCOPE)
     216SET(LFDPROTO_INCLUDES ${IDNA_INCLUDE_DIRS} PARENT_SCOPE)
    226217# Dependencies: the libraries required by any code linking to libfdproto.
    227218SET(LFDPROTO_LINK_INTERFACES ${CMAKE_THREAD_LIBS_INIT} PARENT_SCOPE)
  • libfdproto/CMakeLists.txt

    r1560 r1561  
    2828SET(LFDPROTO_SRC ${LFDPROTO_SRC} PARENT_SCOPE)
    2929
    30 # Include path
    31 INCLUDE_DIRECTORIES(${LFDPROTO_INCLUDES})
    32 
    3330# Build as a shared library
    3431ADD_LIBRARY(libfdproto SHARED ${LFDPROTO_SRC})
     32
     33# Include path
     34TARGET_INCLUDE_DIRECTORIES(libfdproto PRIVATE /a/b/c ${LFDPROTO_INCLUDES})
    3535
    3636ADD_DEPENDENCIES(libfdproto version_information)
  • libfdproto/ostr.c

    r1127 r1561  
    3737
    3838#if (!defined(DIAMID_IDNA_IGNORE) && !defined(DIAMID_IDNA_REJECT))
    39 /* Process IDNA with stringprep -- See RFC5890 -- and libidn documentation... */
    40 #include <idna.h> /* idna_to_ascii_8z() */
     39/* Process IDNA with stringprep -- See RFC5890 -- and libidn2 documentation... */
     40#include <idn2.h> /* idn2_to_ascii_8z() */
    4141#endif /* !defined(DIAMID_IDNA_IGNORE) && !defined(DIAMID_IDNA_REJECT) */
    4242
     
    227227                }
    228228               
    229                 ret = idna_to_ascii_8z ( *id, &processed, IDNA_USE_STD3_ASCII_RULES );
    230                 if (ret == IDNA_SUCCESS) {
     229                ret = idn2_to_ascii_8z ( *id, &processed, IDNA_USE_STD3_ASCII_RULES );
     230                if (ret == IDN2_OK) {
    231231                        TRACE_DEBUG(INFO, "The string '%s' is not a valid DiameterIdentity, it was changed to '%s'", *id, processed);
    232232                        if (memory == 0)
     
    236236                        /* Done! */
    237237                } else {
    238                         TRACE_DEBUG(INFO, "The string '%s' is not a valid DiameterIdentity and cannot be sanitanized: %s", *id, idna_strerror (ret));
     238                        TRACE_DEBUG(INFO, "The string '%s' is not a valid DiameterIdentity and cannot be sanitized: %s", *id, idn2_strerror (ret));
    239239                        return EINVAL;
    240240                }
Note: See TracChangeset for help on using the changeset viewer.