Navigation


Changeset 1561:699c3fb0c57b in freeDiameter for libfdproto


Ignore:
Timestamp:
Jun 17, 2021, 1:44:45 AM (3 years 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.

Location:
libfdproto
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • 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.