Imported Upstream version 7.68.0 60/225760/3 accepted/tizen/base/20200302.014345 submit/tizen_base/20200228.034741 submit/tizen_base/20200228.034800
authorSeonah Moon <seonah1.moon@samsung.com>
Mon, 24 Feb 2020 08:22:32 +0000 (17:22 +0900)
committerSeonah Moon <seonah1.moon@samsung.com>
Thu, 27 Feb 2020 01:51:41 +0000 (10:51 +0900)
Change-Id: Ifa484ccc2d444376bfa8c21ca8d9b63d8f48bf05

1  2 
Makefile.am
configure.ac
lib/Makefile.inc
lib/curl_config.h.in
lib/easy.c
lib/sendf.c
lib/url.c
packaging/curl.spec

diff --cc Makefile.am
Simple merge
diff --cc configure.ac
@@@ -3227,143 -3164,14 +3164,137 @@@ if test "$want_winidn" = "yes"; the
  fi
  
  dnl **********************************************************************
- dnl Check for the presence of IDN libraries and headers
++dnl Check for ICU-UC (IDN support)
 +dnl **********************************************************************
 +
- AC_MSG_CHECKING([whether to build with libidn2])
++AC_MSG_CHECKING([whether to build with icu-uc])
 +OPT_IDN="default"
- AC_ARG_WITH(libidn2,
- AC_HELP_STRING([--with-libidn2=PATH],[Enable libidn2 usage])
- AC_HELP_STRING([--without-libidn2],[Disable libidn2 usage]),
++AC_ARG_WITH(icu-uc,
++AC_HELP_STRING([--with-icu-uc=PATH],[Enable icu-uc usage])
++AC_HELP_STRING([--without-icu-uc],[Disable icu-uc usage]),
 +  [OPT_IDN=$withval])
 +case "$OPT_IDN" in
 +  no)
-     dnl --without-libidn2 option used
++    dnl --without-icu-uc option used
 +    want_idn="no"
 +    AC_MSG_RESULT([no])
 +    ;;
 +  default)
 +    dnl configure option not specified
 +    want_idn="yes"
 +    want_idn_path="default"
 +    AC_MSG_RESULT([(assumed) yes])
 +    ;;
 +  yes)
-     dnl --with-libidn2 option used without path
++    dnl --with-icu-uc option used without path
 +    want_idn="yes"
 +    want_idn_path="default"
 +    AC_MSG_RESULT([yes])
 +    ;;
 +  *)
-     dnl --with-libidn2 option used with path
++    dnl --with-icu-uc option used with path
 +    want_idn="yes"
 +    want_idn_path="$withval"
 +    AC_MSG_RESULT([yes ($withval)])
 +    ;;
 +esac
 +
 +if test "$want_idn" = "yes"; then
 +  dnl idn library support has been requested
 +  clean_CPPFLAGS="$CPPFLAGS"
 +  clean_LDFLAGS="$LDFLAGS"
 +  clean_LIBS="$LIBS"
 +  PKGCONFIG="no"
 +  #
 +  if test "$want_idn_path" != "default"; then
 +    dnl path has been specified
 +    IDN_PCDIR="$want_idn_path/lib$libsuff/pkgconfig"
-     CURL_CHECK_PKGCONFIG(libidn2, [$IDN_PCDIR])
++    CURL_CHECK_PKGCONFIG(icu-uc, [$IDN_PCDIR])
 +    if test "$PKGCONFIG" != "no"; then
 +      IDN_LIBS=`CURL_EXPORT_PCDIR([$IDN_PCDIR]) dnl
-         $PKGCONFIG --libs-only-l libidn2 2>/dev/null`
++        $PKGCONFIG --libs-only-l icu-uc 2>/dev/null`
 +      IDN_LDFLAGS=`CURL_EXPORT_PCDIR([$IDN_PCDIR]) dnl
-         $PKGCONFIG --libs-only-L libidn2 2>/dev/null`
++        $PKGCONFIG --libs-only-L icu-uc 2>/dev/null`
 +      IDN_CPPFLAGS=`CURL_EXPORT_PCDIR([$IDN_PCDIR]) dnl
-         $PKGCONFIG --cflags-only-I libidn2 2>/dev/null`
++        $PKGCONFIG --cflags-only-I icu-uc 2>/dev/null`
 +      IDN_DIR=`echo $IDN_LDFLAGS | $SED -e 's/-L//'`
 +    else
 +      dnl pkg-config not available or provides no info
-       IDN_LIBS="-lidn2"
++      IDN_LIBS="-licu-uc"
 +      IDN_LDFLAGS="-L$want_idn_path/lib$libsuff"
 +      IDN_CPPFLAGS="-I$want_idn_path/include"
 +      IDN_DIR="$want_idn_path/lib$libsuff"
 +    fi
 +  else
 +    dnl path not specified
-     CURL_CHECK_PKGCONFIG(libidn2)
++    CURL_CHECK_PKGCONFIG(icu-uc)
 +    if test "$PKGCONFIG" != "no"; then
-       IDN_LIBS=`$PKGCONFIG --libs-only-l libidn2 2>/dev/null`
-       IDN_LDFLAGS=`$PKGCONFIG --libs-only-L libidn2 2>/dev/null`
-       IDN_CPPFLAGS=`$PKGCONFIG --cflags-only-I libidn2 2>/dev/null`
++      IDN_LIBS=`$PKGCONFIG --libs-only-l icu-uc 2>/dev/null`
++      IDN_LDFLAGS=`$PKGCONFIG --libs-only-L icu-uc 2>/dev/null`
++      IDN_CPPFLAGS=`$PKGCONFIG --cflags-only-I icu-uc 2>/dev/null`
 +      IDN_DIR=`echo $IDN_LDFLAGS | $SED -e 's/-L//'`
 +    else
 +      dnl pkg-config not available or provides no info
-       IDN_LIBS="-lidn2"
++      IDN_LIBS="-licu-uc"
 +    fi
 +  fi
 +  #
 +  if test "$PKGCONFIG" != "no"; then
 +    AC_MSG_NOTICE([pkg-config: IDN_LIBS: "$IDN_LIBS"])
 +    AC_MSG_NOTICE([pkg-config: IDN_LDFLAGS: "$IDN_LDFLAGS"])
 +    AC_MSG_NOTICE([pkg-config: IDN_CPPFLAGS: "$IDN_CPPFLAGS"])
 +    AC_MSG_NOTICE([pkg-config: IDN_DIR: "$IDN_DIR"])
 +  else
 +    AC_MSG_NOTICE([IDN_LIBS: "$IDN_LIBS"])
 +    AC_MSG_NOTICE([IDN_LDFLAGS: "$IDN_LDFLAGS"])
 +    AC_MSG_NOTICE([IDN_CPPFLAGS: "$IDN_CPPFLAGS"])
 +    AC_MSG_NOTICE([IDN_DIR: "$IDN_DIR"])
 +  fi
 +  #
-   CPPFLAGS="$CPPFLAGS $IDN_CPPFLAGS"
-   LDFLAGS="$LDFLAGS $IDN_LDFLAGS"
++  CPPFLAGS="$IDN_CPPFLAGS $CPPFLAGS"
++  LDFLAGS="$IDN_LDFLAGS $LDFLAGS"
 +  LIBS="$IDN_LIBS $LIBS"
 +  #
-   AC_MSG_CHECKING([if idn2_lookup_ul can be linked])
++  AC_MSG_CHECKING([if uidna_nameToASCII_UTF8 can be linked])
 +  AC_LINK_IFELSE([
-     AC_LANG_FUNC_LINK_TRY([idn2_lookup_ul])
++    AC_LANG_FUNC_LINK_TRY([uidna_nameToASCII_UTF8])
 +  ],[
 +    AC_MSG_RESULT([yes])
-     tst_links_libidn="yes"
++    tst_links_icu="yes"
 +  ],[
 +    AC_MSG_RESULT([no])
-     tst_links_libidn="no"
++    tst_links_icu="no"
 +  ])
 +  #
-   AC_CHECK_HEADERS( idn2.h )
-   if test "$tst_links_libidn" = "yes"; then
-     AC_DEFINE(HAVE_LIBIDN2, 1, [Define to 1 if you have the `idn2' library (-lidn2).])
++  if test "$tst_links_icu" = "yes"; then
++    AC_DEFINE(USE_ICU_IDNA, 1, [Define to 1 if you have the `icu-uc' library (-licu-uc).])
 +    dnl different versions of libidn have different setups of these:
 +
 +    AC_SUBST([IDN_ENABLED], [1])
-     curl_idn_msg="enabled (libidn2)"
++    curl_idn_msg="enabled (icu-uc)"
 +    if test -n "$IDN_DIR" -a "x$cross_compiling" != "xyes"; then
-       CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$IDN_DIR"
-       export CURL_LIBRARY_PATH
-       AC_MSG_NOTICE([Added $IDN_DIR to CURL_LIBRARY_PATH])
++      LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$IDN_DIR"
++      export LD_LIBRARY_PATH
++      AC_MSG_NOTICE([Added $IDN_DIR to LD_LIBRARY_PATH])
 +    fi
 +  else
 +    AC_MSG_WARN([Cannot find libraries for IDN support: IDN disabled])
 +    CPPFLAGS="$clean_CPPFLAGS"
 +    LDFLAGS="$clean_LDFLAGS"
 +    LIBS="$clean_LIBS"
 +  fi
- fi
 +
- dnl Let's hope this split URL remains working:
- dnl https://www15.software.ibm.com/doc_link/en_US/a_doc_lib/aixprggd/ \
- dnl genprogc/thread_quick_ref.htm
++fi
 +
 +dnl **********************************************************************
- dnl Check for ICU-UC (IDN support)
+ dnl Check for the presence of IDN libraries and headers
  dnl **********************************************************************
  
- AC_MSG_CHECKING([whether to build with icu-uc])
+ AC_MSG_CHECKING([whether to build with libidn2])
  OPT_IDN="default"
- AC_ARG_WITH(icu-uc,
- AC_HELP_STRING([--with-icu-uc=PATH],[Enable icu-uc usage])
- AC_HELP_STRING([--without-icu-uc],[Disable icu-uc usage]),
+ AC_ARG_WITH(libidn2,
+ AC_HELP_STRING([--with-libidn2=PATH],[Enable libidn2 usage])
+ AC_HELP_STRING([--without-libidn2],[Disable libidn2 usage]),
    [OPT_IDN=$withval])
  case "$OPT_IDN" in
    no)
@@@ -3475,28 -3285,14 +3408,26 @@@ if test "$want_idn" = "yes"; the
      LDFLAGS="$clean_LDFLAGS"
      LIBS="$clean_LIBS"
    fi
  fi
  
  dnl Let's hope this split URL remains working:
- dnl http://publibn.boulder.ibm.com/doc_link/en_US/a_doc_lib/aixprggd/ \
+ dnl https://www15.software.ibm.com/doc_link/en_US/a_doc_lib/aixprggd/ \
  dnl genprogc/thread_quick_ref.htm
  
-       LIBS="-ldl $LIBS"
 +dnl **********************************************************************
 +dnl Check for DLP
 +dnl **********************************************************************
 +
 +AC_ARG_ENABLE([dlp],
 +    AS_HELP_STRING([--enable-dlp], [Enable DLP usage]))
 +
 +AS_IF([test "x$enable_dlp" = "xyes"], [
 +    CPPFLAGS+=" -DUSE_TIZEN_FEATURE_DLP"
 +])
 +
 +AM_CONDITIONAL(USE_TIZEN_FEATURE_DLP, test "x$enable_dlp" = "xyes")
  
  dnl **********************************************************************
  dnl Check for nghttp2
  dnl **********************************************************************
@@@ -28,20 -28,24 +28,29 @@@ LIB_VAUTH_CFILES = vauth/vauth.c vauth/
  LIB_VAUTH_HFILES = vauth/vauth.h vauth/digest.h vauth/ntlm.h
  
  LIB_VTLS_CFILES = vtls/openssl.c vtls/gtls.c vtls/vtls.c vtls/nss.c     \
-   vtls/polarssl.c vtls/polarssl_threadlock.c vtls/axtls.c               \
-   vtls/cyassl.c vtls/schannel.c vtls/schannel_verify.c                  \
-   vtls/darwinssl.c vtls/gskit.c vtls/mbedtls.c vtls/mesalink.c
+   vtls/polarssl.c vtls/polarssl_threadlock.c                            \
+   vtls/wolfssl.c vtls/schannel.c vtls/schannel_verify.c                 \
+   vtls/sectransp.c vtls/gskit.c vtls/mbedtls.c vtls/mesalink.c          \
+   vtls/bearssl.c
  
  LIB_VTLS_HFILES = vtls/openssl.h vtls/vtls.h vtls/gtls.h                \
-   vtls/nssg.h vtls/polarssl.h vtls/polarssl_threadlock.h vtls/axtls.h   \
-   vtls/cyassl.h vtls/schannel.h vtls/darwinssl.h vtls/gskit.h           \
-   vtls/mbedtls.h vtls/mesalink.h
+   vtls/nssg.h vtls/polarssl.h vtls/polarssl_threadlock.h                \
+   vtls/wolfssl.h vtls/schannel.h vtls/sectransp.h vtls/gskit.h          \
+   vtls/mbedtls.h vtls/mesalink.h vtls/bearssl.h
+ LIB_VQUIC_CFILES = vquic/ngtcp2.c vquic/quiche.c
+ LIB_VQUIC_HFILES = vquic/ngtcp2.h vquic/quiche.h
+ LIB_VSSH_CFILES = vssh/libssh2.c vssh/libssh.c
+ LIB_VSSH_HFILES = vssh/ssh.h
  
 +if USE_TIZEN_FEATURE_DLP
 +LIB_EXTENSIONS_CFILES = extensions/curl_extensions.c
 +LIB_EXTENSIONS_HFILES = extensions/curl_extensions.h
 +endif
 +
  LIB_CFILES = file.c timeval.c base64.c hostip.c progress.c formdata.c   \
    cookie.c http.c sendf.c ftp.c url.c dict.c if2ip.c speedcheck.c       \
    ldap.c version.c getenv.c escape.c mprintf.c telnet.c netrc.c         \
@@@ -84,5 -89,7 +94,7 @@@ LIB_HFILES = arpa_telnet.h netrc.h file
  
  LIB_RCFILES = libcurl.rc
  
- CSOURCES = $(LIB_CFILES) $(LIB_VAUTH_CFILES) $(LIB_VTLS_CFILES) $(LIB_EXTENSIONS_CFILES)
- HHEADERS = $(LIB_HFILES) $(LIB_VAUTH_HFILES) $(LIB_VTLS_HFILES) $(LIB_EXTENSIONS_HFILES)
+ CSOURCES = $(LIB_CFILES) $(LIB_VAUTH_CFILES) $(LIB_VTLS_CFILES) \
 -  $(LIB_VQUIC_CFILES) $(LIB_VSSH_CFILES)
++  $(LIB_VQUIC_CFILES) $(LIB_VSSH_CFILES) $(LIB_EXTENSIONS_CFILES)
+ HHEADERS = $(LIB_HFILES) $(LIB_VAUTH_HFILES) $(LIB_VTLS_HFILES) \
 -  $(LIB_VQUIC_HFILES) $(LIB_VSSH_HFILES)
++  $(LIB_VQUIC_HFILES) $(LIB_VSSH_HFILES) $(LIB_EXTENSIONS_HFILES)
  /* if GnuTLS uses nettle as crypto backend */
  #undef USE_GNUTLS_NETTLE
  
++/* Define to 1 if you have the `icu-uc' library (-licu-uc). */
++#undef USE_ICU_IDNA
++
  /* PSL support enabled */
  #undef USE_LIBPSL
  
diff --cc lib/easy.c
Simple merge
diff --cc lib/sendf.c
Simple merge
diff --cc lib/url.c
+++ b/lib/url.c
@@@ -63,8 -65,6 +65,9 @@@
  #elif defined(USE_WIN32_IDN)
  /* prototype for curl_win32_idn_to_ascii() */
  bool curl_win32_idn_to_ascii(const char *in, char **out);
++
 +#elif defined(USE_ICU_IDNA)
 +#include <unicode/uidna.h>
  #endif  /* USE_LIBIDN2 */
  
  #include "urldata.h"
  #include "curl_memory.h"
  #include "memdebug.h"
  
 +#if defined(USE_ICU_IDNA)
 +#define MAX_DOMAIN_NAME_LEN 256
 +#endif  /* USE_ICU_IDNA */
 +
  static void conn_free(struct connectdata *conn);
- static void free_fixed_hostname(struct hostname *host);
+ static void free_idnconverted_hostname(struct hostname *host);
  static unsigned int get_protocol_family(unsigned int protocol);
  
  /* Some parts of the code (e.g. chunked encoding) assume this buffer has at
@@@ -1748,24 -1479,7 +1486,27 @@@ static CURLcode idnconvert_hostname(str
      else {
        failf(data, "Failed to convert %s to ACE;\n", host->name);
        return CURLE_URL_MALFORMAT;
-       &errorCode);
+     }
 +#elif defined(USE_ICU_IDNA)
 +    char *ace_hostname = malloc(MAX_DOMAIN_NAME_LEN * sizeof(char));
 +    UErrorCode errorCode = U_ZERO_ERROR;
 +    UIDNAInfo info = UIDNA_INFO_INITIALIZER;
 +    UIDNA *uts46 =
 +      uidna_openUTS46(UIDNA_USE_STD3_RULES|UIDNA_NONTRANSITIONAL_TO_UNICODE,
-     if(errorCode != U_ZERO_ERROR || info.errors || length < 1)
++                      &errorCode);
 +    int32_t length = uidna_nameToASCII_UTF8(uts46,
 +      host->name, strlen(host->name),
 +      ace_hostname, MAX_DOMAIN_NAME_LEN, &info, &errorCode);
 +    uidna_close(uts46);
 +
++    if(errorCode != U_ZERO_ERROR || info.errors || length < 1) {
 +      infof(data, "Failed to convert %s to ACE;\n", host->name);
++      return CURLE_URL_MALFORMAT;
++    }
 +    else {
 +      host->encalloc = ace_hostname;
 +      host->name = host->encalloc;
 +    }
  #else
      infof(data, "IDN support not present, can't parse Unicode domains\n");
  #endif
@@@ -1793,7 -1498,7 +1525,7 @@@ static void free_idnconverted_hostname(
                                   allocated by libidn */
      host->encalloc = NULL;
    }
--#elif defined(USE_WIN32_IDN)
++#elif defined(USE_WIN32_IDN) || defined(USE_ICU_IDNA)
    free(host->encalloc); /* must be freed with free() since this was
                             allocated by curl_win32_idn_to_ascii */
    host->encalloc = NULL;
index aee65e8,0000000..a2a6949
mode 100644,000000..100644
--- /dev/null
@@@ -1,136 -1,0 +1,136 @@@
- Version:    7.62.0
- Release:    5
 +Name:       curl
 +Summary:    A utility for getting files from remote servers (FTP, HTTP, and others)
++Version:    7.68.0
++Release:    1
 +Group:      Applications/Internet
 +License:    MIT
 +URL:        http://curl.haxx.se/
 +#Source0:    http://curl.haxx.se/download/%{name}-%{version}.tar.bz2
 +Source0:    %{name}-%{version}.tar.gz
 +Source1001:     %{name}.manifest
 +BuildRequires:  pkgconfig(icu-uc)
 +BuildRequires:  pkgconfig(openssl1.1)
 +BuildRequires:  pkgconfig(zlib)
 +BuildRequires:  pkgconfig(libcares)
 +BuildRequires:        pkgconfig(libnghttp2)
 +Provides:   webclient
 +
 +
 +%description
 +curl is a client to get documents/files from servers, using any of the
 +supported protocols. The command is designed to work without user
 +interaction or any kind of interactivity.
 +
 +curl offers a busload of useful tricks like proxy support, user
 +authentication, ftp upload, HTTP post, file transfer resume and more.
 +
 +%package -n libcurl
 +Summary:    A library for getting files from web servers
 +Group:      System/Libraries
 +License:    MIT
 +Requires(post): /sbin/ldconfig
 +Requires(postun): /sbin/ldconfig
 +
 +%description -n libcurl
 +This package provides a way for applications to use FTP, HTTP, Gopher and
 +other servers for getting files.
 +
 +
 +%package -n libcurl-devel
 +Summary:    Files needed for building applications with libcurl
 +Group:      Development/Libraries
 +License:    MIT
 +Requires:   libcurl = %{version}-%{release}
 +Provides:   curl-devel = %{version}-%{release}
 +Obsoletes:   curl-devel < %{version}-%{release}
 +
 +%description -n libcurl-devel
 +libcurl is the core engine of curl; this packages contains all the libs,
 +headers, and manual pages to develop applications using libcurl.
 +
 +%package -n libcurl-extension-dlp
 +Summary:      Extensions for Tizen OS
 +Provides:     libcurl-extension-dlp = %{version}-%{release}
 +Requires(post): /sbin/ldconfig
 +Requires(postun): /sbin/ldconfig
 +
 +%description -n libcurl-extension-dlp
 +libcurl extensions for Tinen OS.
 +
 +%prep
 +%setup -q
 +cp %{SOURCE1001} .
 +
 +#%patch01 -p1
 +#%patch02 -p1
 +
 +%build
 +
 +export CPPFLAGS="-DHAVE_PK11_CREATEGENERICOBJECT -DHAVE_GETIFADDRS"
 +CFLAGS+=" -fstack-protector-strong -Wl,-z,relro -D_FORTIFY_SOURCE=2 -fPIE -pie"
 +CFLAGS+=" -DHAVE_GETIFADDRS"
 +%if "%{tizen_profile_name}" == "tv"
 +CFLAGS+=" -DTIZEN_TV_EXT"
 +%endif
 +%reconfigure --without-nss --without-gnutls --with-openssl --enable-ipv6 \
 +--with-ca-path==/etc/ssl/certs \
 +--with-ca-bundle=/etc/ssl/ca-bundle.pem \
 +--with-icu-uc \
 +--with-lber-lib=lber \
 +--enable-manual --enable-versioned-symbols --enable-ares --enable-debug --enable-curldebug \
 +--disable-static \
 +--with-nghttp2 \
 +--without-zsh-functions-dir \
 +--enable-dlp \
 +
 +#--with-ca-bundle=%{_sysconfdir}/pki/tls/certs/ca-bundle.crt 
 +
 +sed -i -e 's,-L/usr/lib ,,g;s,-L/usr/lib64 ,,g;s,-L/usr/lib$,,g;s,-L/usr/lib64$,,g' \
 +Makefile libcurl.pc
 +# Remove bogus rpath
 +sed -i \
 +-e 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' \
 +-e 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool
 +
 +make %{?_smp_mflags}
 +
 +%install
 +rm -rf %{buildroot}
 +
 +rm -rf $RPM_BUILD_ROOT
 +
 +make DESTDIR=$RPM_BUILD_ROOT INSTALL="%{__install} -p" install
 +
 +rm -f ${RPM_BUILD_ROOT}%{_libdir}/libcurl{,_extension_dlp}.la
 +install -d $RPM_BUILD_ROOT/%{_datadir}/aclocal
 +install -m 644 docs/libcurl/libcurl.m4 $RPM_BUILD_ROOT/%{_datadir}/aclocal
 +
 +
 +# don't need curl's copy of the certs; use openssl's
 +find ${RPM_BUILD_ROOT} -name ca-bundle.crt -exec rm -f '{}' \;
 +rm -rf ${RPM_BUILD_ROOT}/usr/share/man
 +
 +%post -n libcurl -p /sbin/ldconfig
 +
 +%postun -n libcurl -p /sbin/ldconfig
 +
 +%files
 +%{_bindir}/curl
 +%license COPYING
 +
 +%files -n libcurl
 +%manifest %{name}.manifest
 +%{_libdir}/libcurl.so.*
 +%license COPYING
 +
 +%files -n libcurl-devel
 +%{_bindir}/curl-config*
 +%{_includedir}/curl
 +%{_libdir}/*.so
 +%{_libdir}/pkgconfig/*.pc
 +%{_datadir}/aclocal/libcurl.m4
 +
 +%files -n libcurl-extension-dlp
 +%manifest %{name}.manifest
 +%{_libdir}/libcurl_extension_dlp.so.*
 +%license COPYING