mirror of
https://github.com/stefanocasazza/ULib.git
synced 2025-10-05 19:18:01 +08:00
sync
This commit is contained in:
parent
fc24169677
commit
58edeb9b26
|
@ -16,11 +16,11 @@ if PLUGIN
|
|||
SUBDIRS += src/ulib/net/server/plugin src/ulib/orm/driver
|
||||
endif
|
||||
if ENABLE_EXAMPLES
|
||||
SUBDIRS += examples contrib
|
||||
SUBDIRS += examples
|
||||
endif
|
||||
SUBDIRS += tests
|
||||
|
||||
DIST_SUBDIRS = include src/ulib src/ulib/net/server/plugin src/ulib/orm/driver m4 doc contrib examples tests
|
||||
DIST_SUBDIRS = include src/ulib src/ulib/net/server/plugin src/ulib/orm/driver m4 doc examples tests contrib
|
||||
|
||||
## bin_SCRIPTS = ulib-config
|
||||
|
||||
|
|
|
@ -90,7 +90,7 @@ build_triplet = @build@
|
|||
host_triplet = @host@
|
||||
target_triplet = @target@
|
||||
@PLUGIN_TRUE@am__append_1 = src/ulib/net/server/plugin src/ulib/orm/driver
|
||||
@ENABLE_EXAMPLES_TRUE@am__append_2 = examples contrib
|
||||
@ENABLE_EXAMPLES_TRUE@am__append_2 = examples
|
||||
subdir = .
|
||||
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
||||
am__aclocal_m4_deps = $(top_srcdir)/m4/ac_check_package.m4 \
|
||||
|
@ -449,7 +449,7 @@ EXTRA_DIST = cdb configure.help TODO LICENSE* README* *.spec* \
|
|||
MAINTAINERCLEANFILES = configure aclocal.m4 libtool Makefile.in Makefile INSTALL
|
||||
moduledir = @ULIB_MODULEDIR@
|
||||
SUBDIRS = include src/ulib $(am__append_1) $(am__append_2) tests
|
||||
DIST_SUBDIRS = include src/ulib src/ulib/net/server/plugin src/ulib/orm/driver m4 doc contrib examples tests
|
||||
DIST_SUBDIRS = include src/ulib src/ulib/net/server/plugin src/ulib/orm/driver m4 doc examples tests contrib
|
||||
aclocaldir = $(datadir)/aclocal
|
||||
aclocal_DATA = ULib.m4
|
||||
all: all-recursive
|
||||
|
|
347
configure
vendored
347
configure
vendored
|
@ -1056,16 +1056,16 @@ with_parser
|
|||
with_distcc
|
||||
with_libz
|
||||
enable_zip
|
||||
with_libtdb
|
||||
with_libzopfli
|
||||
with_magic
|
||||
with_ssl
|
||||
with_pcre
|
||||
with_expat
|
||||
with_libuuid
|
||||
with_curl
|
||||
with_libtdb
|
||||
with_libares
|
||||
with_ssh
|
||||
with_curl
|
||||
with_ldap
|
||||
with_dbi
|
||||
with_libevent
|
||||
|
@ -1817,16 +1817,16 @@ Optional Packages:
|
|||
--with-parser use parser generator bison/yacc
|
||||
--with-distcc using distcc we must avoid to use some gcc flags (-mtune=native,-flto,...)
|
||||
--with-libz use system LIBZ library - [will check /usr /usr/local] [default=use if present]
|
||||
--with-libtdb use system tdb library - [will check /usr /usr/local] [default=use if present]
|
||||
--with-libzopfli use system zopfli library - [will check /usr /usr/local] [default=use if present]
|
||||
--with-magic use system libmagic library - [will check /usr /usr/local] [default=use if present]
|
||||
--with-ssl use system SSL library - [will check /usr /usr/local] [default=use if present]
|
||||
--with-pcre use system PCRE library - [will check /usr /usr/local] [default=use if present]
|
||||
--with-expat use system EXPAT library - [will check /usr /usr/local] [default=use if present]
|
||||
--with-libuuid use system libuuid library - [will check /usr /usr/local]
|
||||
--with-libuuid use system libuuid library - [will check /usr /usr/local] [default=use if present]
|
||||
--with-curl use system cURL library - [will check /usr /usr/local]
|
||||
--with-libtdb use system tdb library - [will check /usr /usr/local]
|
||||
--with-libares use system c-ares library - [will check /usr /usr/local]
|
||||
--with-ssh use system SSH library - [will check /usr /usr/local]
|
||||
--with-curl use system cURL library - [will check /usr /usr/local]
|
||||
--with-ldap use system openLDAP library - [will check /usr /usr/local]
|
||||
--with-dbi use system DBI library - [will check /usr /usr/local]
|
||||
--with-libevent use system libevent library - [will check /usr /usr/local]
|
||||
|
@ -26974,7 +26974,11 @@ $as_echo_n "checking if LIBZ library is wanted... " >&6; }
|
|||
wanted=1;
|
||||
if test -z "$with_libz" ; then
|
||||
wanted=0;
|
||||
with_libz="${CROSS_ENVIRONMENT}/usr";
|
||||
if test -n "$CROSS_ENVIRONMENT" ; then
|
||||
with_libz="no";
|
||||
else
|
||||
with_libz="${CROSS_ENVIRONMENT}/usr";
|
||||
fi
|
||||
fi
|
||||
|
||||
# Check whether --with-libz was given.
|
||||
|
@ -27028,86 +27032,27 @@ fi
|
|||
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if you want to enable build of ZIP support" >&5
|
||||
$as_echo_n "checking if you want to enable build of ZIP support... " >&6; }
|
||||
if test x_$found_libz = x_yes; then
|
||||
if test -z "$enable_zip" -o x_$enable_zip != x_no; then
|
||||
enable_zip="yes"
|
||||
fi
|
||||
else
|
||||
enable_zip="no"
|
||||
fi
|
||||
# Check whether --enable-zip was given.
|
||||
if test "${enable_zip+set}" = set; then :
|
||||
enableval=$enable_zip;
|
||||
fi
|
||||
|
||||
if test "$enable_zip" != "no" -a x_$found_libz = x_yes; then
|
||||
enable_zip="yes"
|
||||
else
|
||||
enable_zip="no"
|
||||
fi
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_zip" >&5
|
||||
$as_echo "$enable_zip" >&6; }
|
||||
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if tdb library is wanted" >&5
|
||||
$as_echo_n "checking if tdb library is wanted... " >&6; }
|
||||
wanted=1;
|
||||
if test -z "$with_libtdb" ; then
|
||||
wanted=0;
|
||||
if test "$USP_FLAGS" = "-DAS_cpoll_cppsp_DO"; then
|
||||
with_libtdb="no";
|
||||
else
|
||||
with_libtdb="${CROSS_ENVIRONMENT}/usr";
|
||||
fi
|
||||
fi
|
||||
|
||||
# Check whether --with-libtdb was given.
|
||||
if test "${with_libtdb+set}" = set; then :
|
||||
withval=$with_libtdb;
|
||||
if test "$withval" = "no"; then
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
|
||||
$as_echo "no" >&6; }
|
||||
else
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
|
||||
$as_echo "yes" >&6; }
|
||||
for dir in $withval ${CROSS_ENVIRONMENT}/ ${CROSS_ENVIRONMENT}/usr ${CROSS_ENVIRONMENT}/usr/local; do
|
||||
libtdbdir="$dir"
|
||||
if test -f "$dir/include/tdb.h"; then
|
||||
found_libtdb="yes";
|
||||
break;
|
||||
fi
|
||||
done
|
||||
if test x_$found_libtdb != x_yes; then
|
||||
msg="Cannot find libtdb library";
|
||||
if test $wanted = 1; then
|
||||
as_fn_error $? "$msg" "$LINENO" 5
|
||||
else
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $msg" >&5
|
||||
$as_echo "$msg" >&6; }
|
||||
fi
|
||||
else
|
||||
echo "${T_MD}libtdb found in $libtdbdir${T_ME}"
|
||||
USE_LIBTDB=yes
|
||||
|
||||
$as_echo "#define USE_LIBTDB 1" >>confdefs.h
|
||||
|
||||
libtdb_version=$(ls $libtdbdir/lib*/libtdb.so.*.* 2>/dev/null | head -n 1 | awk -F'.so.' '{n=2; print $n}' 2>/dev/null)
|
||||
if test -z "${libtdb_version}"; then
|
||||
libtdb_version="unknown"
|
||||
fi
|
||||
ULIB_LIBS="$ULIB_LIBS -ltdb";
|
||||
if test $libtdbdir != "${CROSS_ENVIRONMENT}/" -a $libtdbdir != "${CROSS_ENVIRONMENT}/usr" -a $libtdbdir != "${CROSS_ENVIRONMENT}/usr/local"; then
|
||||
CPPFLAGS="$CPPFLAGS -I$libtdbdir/include"
|
||||
LDFLAGS="$LDFLAGS -L$libtdbdir/lib -Wl,-R$libtdbdir/lib";
|
||||
PRG_LDFLAGS="$PRG_LDFLAGS -L$libtdbdir/lib";
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
else
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
|
||||
$as_echo "no" >&6; }
|
||||
fi
|
||||
|
||||
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if zopfli library is wanted" >&5
|
||||
$as_echo_n "checking if zopfli library is wanted... " >&6; }
|
||||
wanted=1;
|
||||
if test -z "$with_libzopfli" ; then
|
||||
wanted=0;
|
||||
if test "$USP_FLAGS" = "-DAS_cpoll_cppsp_DO"; then
|
||||
if test -n "$CROSS_ENVIRONMENT" -o "$USP_FLAGS" = "-DAS_cpoll_cppsp_DO"; then
|
||||
with_libzopfli="no";
|
||||
else
|
||||
with_libzopfli="${CROSS_ENVIRONMENT}/usr";
|
||||
|
@ -27168,7 +27113,11 @@ $as_echo_n "checking if MAGIC library is wanted... " >&6; }
|
|||
wanted=1;
|
||||
if test -z "$with_magic" ; then
|
||||
wanted=0;
|
||||
with_magic="${CROSS_ENVIRONMENT}/usr";
|
||||
if test -n "$CROSS_ENVIRONMENT" -o "$USP_FLAGS" = "-DAS_cpoll_cppsp_DO"; then
|
||||
with_magic="no";
|
||||
else
|
||||
with_magic="${CROSS_ENVIRONMENT}/usr";
|
||||
fi
|
||||
fi
|
||||
|
||||
# Check whether --with-magic was given.
|
||||
|
@ -27224,7 +27173,11 @@ $as_echo_n "checking if SSL library is wanted... " >&6; }
|
|||
wanted=1;
|
||||
if test -z "$with_ssl" ; then
|
||||
wanted=0;
|
||||
with_ssl="${CROSS_ENVIRONMENT}/usr";
|
||||
if test -n "$CROSS_ENVIRONMENT" -o "$USP_FLAGS" = "-DAS_cpoll_cppsp_DO"; then
|
||||
with_ssl="no";
|
||||
else
|
||||
with_ssl="${CROSS_ENVIRONMENT}/usr";
|
||||
fi
|
||||
fi
|
||||
|
||||
# Check whether --with-ssl was given.
|
||||
|
@ -27272,8 +27225,8 @@ $as_echo "#define USE_LIBSSL 1" >>confdefs.h
|
|||
$as_echo "#define HAVE_SSL_TS 1" >>confdefs.h
|
||||
|
||||
fi
|
||||
if test x_$PKG_CONFIG != x_no; then
|
||||
ssl_version=$(pkg-config --modversion openssl)
|
||||
if test -z "$CROSS_ENVIRONMENT" -a x_$PKG_CONFIG != x_no; then
|
||||
ssl_version=$(pkg-config --modversion openssl 2>/dev/null)
|
||||
fi
|
||||
if test -z "$OPENSSL_LINK"; then
|
||||
ULIB_LIBS="-lssl -lcrypto $ULIB_LIBS";
|
||||
|
@ -27303,7 +27256,11 @@ $as_echo_n "checking if PCRE library is wanted... " >&6; }
|
|||
wanted=1;
|
||||
if test -z "$with_pcre" ; then
|
||||
wanted=0;
|
||||
with_pcre="${CROSS_ENVIRONMENT}/usr";
|
||||
if test -n "$CROSS_ENVIRONMENT" -o "$USP_FLAGS" = "-DAS_cpoll_cppsp_DO"; then
|
||||
with_pcre="no";
|
||||
else
|
||||
with_pcre="${CROSS_ENVIRONMENT}/usr";
|
||||
fi
|
||||
fi
|
||||
|
||||
# Check whether --with-pcre was given.
|
||||
|
@ -27359,7 +27316,11 @@ $as_echo_n "checking if EXPAT library for XML parsing is wanted... " >&6; }
|
|||
wanted=1;
|
||||
if test -z "$with_expat" ; then
|
||||
wanted=0;
|
||||
with_expat="${CROSS_ENVIRONMENT}/usr";
|
||||
if test -n "$CROSS_ENVIRONMENT" -o "$USP_FLAGS" = "-DAS_cpoll_cppsp_DO"; then
|
||||
with_expat="no";
|
||||
else
|
||||
with_expat="${CROSS_ENVIRONMENT}/usr";
|
||||
fi
|
||||
fi
|
||||
|
||||
# Check whether --with-expat was given.
|
||||
|
@ -27415,6 +27376,15 @@ fi
|
|||
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if libuuid library is wanted" >&5
|
||||
$as_echo_n "checking if libuuid library is wanted... " >&6; }
|
||||
wanted=1;
|
||||
if test -z "$with_libuuid" ; then
|
||||
wanted=0;
|
||||
if test -n "$CROSS_ENVIRONMENT" -o "$USP_FLAGS" = "-DAS_cpoll_cppsp_DO"; then
|
||||
with_libuuid="no";
|
||||
else
|
||||
with_libuuid="${CROSS_ENVIRONMENT}/usr";
|
||||
fi
|
||||
fi
|
||||
|
||||
# Check whether --with-libuuid was given.
|
||||
if test "${with_libuuid+set}" = set; then :
|
||||
|
@ -27445,8 +27415,8 @@ $as_echo "$msg" >&6; }
|
|||
|
||||
$as_echo "#define USE_LIBUUID 1" >>confdefs.h
|
||||
|
||||
if test x_$PKG_CONFIG != x_no; then
|
||||
libuuid_version=$(pkg-config --modversion ext2fs)
|
||||
if test -z "$CROSS_ENVIRONMENT" -a x_$PKG_CONFIG != x_no; then
|
||||
libuuid_version=$(pkg-config --modversion ext2fs 2>/dev/null)
|
||||
fi
|
||||
if test -z "${libuuid_version}"; then
|
||||
libuuid_version="unknown"
|
||||
|
@ -27466,13 +27436,126 @@ $as_echo "no" >&6; }
|
|||
fi
|
||||
|
||||
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if cURL library is wanted" >&5
|
||||
$as_echo_n "checking if cURL library is wanted... " >&6; }
|
||||
wanted=1;
|
||||
if test -z "$with_curl" ; then
|
||||
wanted=0;
|
||||
with_curl="no";
|
||||
fi
|
||||
|
||||
# Check whether --with-curl was given.
|
||||
if test "${with_curl+set}" = set; then :
|
||||
withval=$with_curl; if test "$withval" = "no"; then
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
|
||||
$as_echo "no" >&6; }
|
||||
else
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
|
||||
$as_echo "yes" >&6; }
|
||||
for dir in $withval ${CROSS_ENVIRONMENT}/ ${CROSS_ENVIRONMENT}/usr ${CROSS_ENVIRONMENT}/usr/local; do
|
||||
curldir="$dir";
|
||||
if test -f "$dir/include/curl/curl.h"; then
|
||||
found_curl="yes";
|
||||
break;
|
||||
fi
|
||||
done
|
||||
if test x_$found_curl != x_yes; then
|
||||
as_fn_error $? "Cannot find cURL library" "$LINENO" 5
|
||||
else
|
||||
echo "${T_MD}libcurl found in $curldir${T_ME}"
|
||||
USE_LIBCURL=yes
|
||||
|
||||
$as_echo "#define USE_LIBCURL 1" >>confdefs.h
|
||||
|
||||
libcurl_version=$($curldir/bin/curl-config --version 2>/dev/null | sed -e "s/libcurl //g")
|
||||
if test -z "${libcurl_version}" -a x_$PKG_CONFIG != x_no; then
|
||||
libcurl_version=$(pkg-config --modversion libcurl 2>/dev/null)
|
||||
fi
|
||||
if test -z "${libcurl_version}"; then
|
||||
libcurl_version="unknown"
|
||||
fi
|
||||
libcurl_linking=$($curldir/bin/curl-config --libs 2>/dev/null)
|
||||
if test -z "${libcurl_linking}"; then
|
||||
libcurl_linking="-lcurl"
|
||||
fi
|
||||
ULIB_LIBS="$libcurl_linking $ULIB_LIBS";
|
||||
if test $curldir != "${CROSS_ENVIRONMENT}/" -a $curldir != "${CROSS_ENVIRONMENT}/usr" -a $curldir != "${CROSS_ENVIRONMENT}/usr/local"; then
|
||||
CPPFLAGS="$CPPFLAGS -I$curldir/include";
|
||||
LDFLAGS="$LDFLAGS -L$curldir/lib -Wl,-R$curldir/lib";
|
||||
PRG_LDFLAGS="$PRG_LDFLAGS -L$curldir/lib";
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
else
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
|
||||
$as_echo "no" >&6; }
|
||||
fi
|
||||
|
||||
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if tdb library is wanted" >&5
|
||||
$as_echo_n "checking if tdb library is wanted... " >&6; }
|
||||
wanted=1;
|
||||
if test -z "$with_libtdb" ; then
|
||||
wanted=0;
|
||||
with_libtdb="no";
|
||||
fi
|
||||
|
||||
# Check whether --with-libtdb was given.
|
||||
if test "${with_libtdb+set}" = set; then :
|
||||
withval=$with_libtdb;
|
||||
if test "$withval" = "no"; then
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
|
||||
$as_echo "no" >&6; }
|
||||
else
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
|
||||
$as_echo "yes" >&6; }
|
||||
for dir in $withval ${CROSS_ENVIRONMENT}/ ${CROSS_ENVIRONMENT}/usr ${CROSS_ENVIRONMENT}/usr/local; do
|
||||
libtdbdir="$dir"
|
||||
if test -f "$dir/include/tdb.h"; then
|
||||
found_libtdb="yes";
|
||||
break;
|
||||
fi
|
||||
done
|
||||
if test x_$found_libtdb != x_yes; then
|
||||
msg="Cannot find libtdb library";
|
||||
if test $wanted = 1; then
|
||||
as_fn_error $? "$msg" "$LINENO" 5
|
||||
else
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $msg" >&5
|
||||
$as_echo "$msg" >&6; }
|
||||
fi
|
||||
else
|
||||
echo "${T_MD}libtdb found in $libtdbdir${T_ME}"
|
||||
USE_LIBTDB=yes
|
||||
|
||||
$as_echo "#define USE_LIBTDB 1" >>confdefs.h
|
||||
|
||||
libtdb_version=$(ls $libtdbdir/lib*/libtdb.so.*.* 2>/dev/null | head -n 1 | awk -F'.so.' '{n=2; print $n}' 2>/dev/null)
|
||||
if test -z "${libtdb_version}"; then
|
||||
libtdb_version="unknown"
|
||||
fi
|
||||
ULIB_LIBS="$ULIB_LIBS -ltdb";
|
||||
if test $libtdbdir != "${CROSS_ENVIRONMENT}/" -a $libtdbdir != "${CROSS_ENVIRONMENT}/usr" -a $libtdbdir != "${CROSS_ENVIRONMENT}/usr/local"; then
|
||||
CPPFLAGS="$CPPFLAGS -I$libtdbdir/include"
|
||||
LDFLAGS="$LDFLAGS -L$libtdbdir/lib -Wl,-R$libtdbdir/lib";
|
||||
PRG_LDFLAGS="$PRG_LDFLAGS -L$libtdbdir/lib";
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
else
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
|
||||
$as_echo "no" >&6; }
|
||||
fi
|
||||
|
||||
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if c-ares library for DNS resolution is wanted" >&5
|
||||
$as_echo_n "checking if c-ares library for DNS resolution is wanted... " >&6; }
|
||||
if test -n "$with_libares" ; then
|
||||
wanted=1;
|
||||
else
|
||||
wanted=1;
|
||||
if test -z "$with_libares" ; then
|
||||
wanted=0;
|
||||
with_libares="${CROSS_ENVIRONMENT}/usr";
|
||||
with_libares="no";
|
||||
fi
|
||||
|
||||
# Check whether --with-libares was given.
|
||||
|
@ -27505,8 +27588,8 @@ $as_echo "$msg" >&6; }
|
|||
|
||||
$as_echo "#define USE_C_ARES 1" >>confdefs.h
|
||||
|
||||
if test x_$PKG_CONFIG != x_no; then
|
||||
cares_version=$(pkg-config --modversion libcares)
|
||||
if test -z "$CROSS_ENVIRONMENT" -a x_$PKG_CONFIG != x_no; then
|
||||
cares_version=$(pkg-config --modversion libcares 2>/dev/null)
|
||||
fi
|
||||
if test -z "${cares_version}"; then
|
||||
cares_version="unknown"
|
||||
|
@ -27528,6 +27611,11 @@ fi
|
|||
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if SSH library is wanted" >&5
|
||||
$as_echo_n "checking if SSH library is wanted... " >&6; }
|
||||
wanted=1;
|
||||
if test -z "$with_ssh" ; then
|
||||
wanted=0;
|
||||
with_ssh="no";
|
||||
fi
|
||||
|
||||
# Check whether --with-ssh was given.
|
||||
if test "${with_ssh+set}" = set; then :
|
||||
|
@ -27571,59 +27659,13 @@ $as_echo "no" >&6; }
|
|||
fi
|
||||
|
||||
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if cURL library is wanted" >&5
|
||||
$as_echo_n "checking if cURL library is wanted... " >&6; }
|
||||
|
||||
# Check whether --with-curl was given.
|
||||
if test "${with_curl+set}" = set; then :
|
||||
withval=$with_curl; if test "$withval" = "no"; then
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
|
||||
$as_echo "no" >&6; }
|
||||
else
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
|
||||
$as_echo "yes" >&6; }
|
||||
for dir in $withval ${CROSS_ENVIRONMENT}/ ${CROSS_ENVIRONMENT}/usr ${CROSS_ENVIRONMENT}/usr/local; do
|
||||
curldir="$dir";
|
||||
if test -f "$dir/include/curl/curl.h"; then
|
||||
found_curl="yes";
|
||||
break;
|
||||
fi
|
||||
done
|
||||
if test x_$found_curl != x_yes; then
|
||||
as_fn_error $? "Cannot find cURL library" "$LINENO" 5
|
||||
else
|
||||
echo "${T_MD}libcurl found in $curldir${T_ME}"
|
||||
USE_LIBCURL=yes
|
||||
|
||||
$as_echo "#define USE_LIBCURL 1" >>confdefs.h
|
||||
|
||||
if test x_$PKG_CONFIG != x_no; then
|
||||
libcurl_version=$(pkg-config --modversion libcurl)
|
||||
fi
|
||||
if test -z "${libcurl_version}"; then
|
||||
libcurl_version=$($curldir/bin/curl-config --version 2>/dev/null | sed -e "s/libcurl //g")
|
||||
fi
|
||||
if test -z "${libcurl_version}"; then
|
||||
libcurl_version="unknown"
|
||||
fi
|
||||
libcurl_linking=$($curldir/bin/curl-config --libs 2>/dev/null)
|
||||
ULIB_LIBS="$libcurl_linking $ULIB_LIBS";
|
||||
if test $curldir != "${CROSS_ENVIRONMENT}/" -a $curldir != "${CROSS_ENVIRONMENT}/usr" -a $curldir != "${CROSS_ENVIRONMENT}/usr/local"; then
|
||||
CPPFLAGS="$CPPFLAGS -I$curldir/include";
|
||||
LDFLAGS="$LDFLAGS -L$curldir/lib -Wl,-R$curldir/lib";
|
||||
PRG_LDFLAGS="$PRG_LDFLAGS -L$curldir/lib";
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
else
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
|
||||
$as_echo "no" >&6; }
|
||||
fi
|
||||
|
||||
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if LDAP library is wanted" >&5
|
||||
$as_echo_n "checking if LDAP library is wanted... " >&6; }
|
||||
wanted=1;
|
||||
if test -z "$with_ldap" ; then
|
||||
wanted=0;
|
||||
with_ldap="no";
|
||||
fi
|
||||
|
||||
# Check whether --with-ldap was given.
|
||||
if test "${with_ldap+set}" = set; then :
|
||||
|
@ -27690,6 +27732,11 @@ fi
|
|||
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if DBI library is wanted" >&5
|
||||
$as_echo_n "checking if DBI library is wanted... " >&6; }
|
||||
wanted=1;
|
||||
if test -z "$with_dbi" ; then
|
||||
wanted=0;
|
||||
with_dbi="no";
|
||||
fi
|
||||
|
||||
# Check whether --with-dbi was given.
|
||||
if test "${with_dbi+set}" = set; then :
|
||||
|
@ -27740,6 +27787,11 @@ fi
|
|||
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if libevent library is wanted" >&5
|
||||
$as_echo_n "checking if libevent library is wanted... " >&6; }
|
||||
wanted=1;
|
||||
if test -z "$with_libevent" ; then
|
||||
wanted=0;
|
||||
with_libevent="no";
|
||||
fi
|
||||
|
||||
# Check whether --with-libevent was given.
|
||||
if test "${with_libevent+set}" = set; then :
|
||||
|
@ -27785,6 +27837,11 @@ fi
|
|||
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if libxml2 library is wanted" >&5
|
||||
$as_echo_n "checking if libxml2 library is wanted... " >&6; }
|
||||
wanted=1;
|
||||
if test -z "$with_libxml2" ; then
|
||||
wanted=0;
|
||||
with_libxml2="no";
|
||||
fi
|
||||
|
||||
# Check whether --with-libxml2 was given.
|
||||
if test "${with_libxml2+set}" = set; then :
|
||||
|
@ -27809,8 +27866,8 @@ $as_echo "yes" >&6; }
|
|||
|
||||
$as_echo "#define USE_LIBXML2 1" >>confdefs.h
|
||||
|
||||
if test x_$PKG_CONFIG != x_no; then
|
||||
libxml2_version=$(pkg-config --modversion libxml-2.0)
|
||||
if test -z "$CROSS_ENVIRONMENT" -a x_$PKG_CONFIG != x_no; then
|
||||
libxml2_version=$(pkg-config --modversion libxml-2.0 2>/dev/null)
|
||||
fi
|
||||
if test -z "${libxml2_version}"; then
|
||||
libxml2_version="unknown"
|
||||
|
@ -27834,6 +27891,11 @@ fi
|
|||
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if you want to use page-speed SDK" >&5
|
||||
$as_echo_n "checking if you want to use page-speed SDK... " >&6; }
|
||||
wanted=1;
|
||||
if test -z "$with_page_speed" ; then
|
||||
wanted=0;
|
||||
with_page_speed="no";
|
||||
fi
|
||||
|
||||
# Check whether --with-page-speed was given.
|
||||
if test "${with_page_speed+set}" = set; then :
|
||||
|
@ -27872,6 +27934,11 @@ fi
|
|||
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if you want to use V8 JavaScript Engine" >&5
|
||||
$as_echo_n "checking if you want to use V8 JavaScript Engine... " >&6; }
|
||||
wanted=1;
|
||||
if test -z "$with_v8-javascript" ; then
|
||||
wanted=0;
|
||||
with_v8-javascript="no";
|
||||
fi
|
||||
|
||||
# Check whether --with-v8-javascript was given.
|
||||
if test "${with_v8_javascript+set}" = set; then :
|
||||
|
|
|
@ -21,16 +21,13 @@
|
|||
#include <openssl/engine.h>
|
||||
|
||||
#if !defined(HAVE_OPENSSL_97) && !defined(HAVE_OPENSSL_98)
|
||||
#warning "WARNING: I must to disable some function with this version of openssl... be aware"
|
||||
|
||||
# warning "WARNING: I must to disable some function with this version of openssl... be aware"
|
||||
# define HMAC_CTX_init(ctx)
|
||||
# define HMAC_Init_ex(ctx,key,len,md,impl)
|
||||
|
||||
# define EVP_MD_CTX_init(ctx)
|
||||
# define EVP_SignInit_ex(a,b,c)
|
||||
# define EVP_MD_CTX_cleanup(ctx)
|
||||
# define EVP_VerifyInit_ex(a,b,c)
|
||||
|
||||
# define HMAC_CTX_cleanup(ctx) HMAC_cleanup(ctx)
|
||||
#endif
|
||||
|
||||
|
@ -62,14 +59,20 @@ typedef enum {
|
|||
|
||||
extern U_EXPORT UHashType u_hashType; /* What type of hash is this? */
|
||||
extern U_EXPORT EVP_PKEY* restrict u_pkey; /* private key to sign the digest */
|
||||
extern U_EXPORT EVP_MD_CTX u_mdctx; /* Context for digest */
|
||||
extern U_EXPORT const EVP_MD* restrict u_md; /* Digest instance */
|
||||
extern U_EXPORT unsigned char u_mdValue[U_MAX_HASH_SIZE]; /* Final output */
|
||||
extern U_EXPORT int u_mdLen; /* Length of digest */
|
||||
|
||||
extern U_EXPORT HMAC_CTX u_hctx; /* Context for HMAC */
|
||||
extern U_EXPORT const char* restrict u_hmac_key; /* The loaded key */
|
||||
extern U_EXPORT uint32_t u_hmac_keylen; /* The loaded key length */
|
||||
extern U_EXPORT const char* restrict u_hmac_key; /* The loaded key */
|
||||
extern U_EXPORT uint32_t u_hmac_keylen; /* The loaded key length */
|
||||
|
||||
#if OPENSSL_VERSION_NUMBER < 0x10100000L
|
||||
extern U_EXPORT HMAC_CTX u_hctx; /* Context for HMAC */
|
||||
extern U_EXPORT EVP_MD_CTX u_mdctx; /* Context for digest */
|
||||
#else
|
||||
extern U_EXPORT HMAC_CTX* u_hctx; /* Context for HMAC */
|
||||
extern U_EXPORT EVP_MD_CTX* u_mdctx; /* Context for digest */
|
||||
#endif
|
||||
|
||||
U_EXPORT void u_dgst_algoritm(int alg);
|
||||
U_EXPORT int u_dgst_get_algoritm(const char* restrict alg) __pure;
|
||||
|
@ -93,11 +96,19 @@ static inline void u_dgst_hash(unsigned char* restrict data, uint32_t length)
|
|||
|
||||
if (u_hmac_keylen)
|
||||
{
|
||||
# if OPENSSL_VERSION_NUMBER < 0x10100000L
|
||||
HMAC_Update(&u_hctx, data, length);
|
||||
# else
|
||||
HMAC_Update( u_hctx, data, length);
|
||||
# endif
|
||||
}
|
||||
else
|
||||
{
|
||||
# if OPENSSL_VERSION_NUMBER < 0x10100000L
|
||||
(void) EVP_DigestUpdate(&u_mdctx, data, length);
|
||||
# else
|
||||
(void) EVP_DigestUpdate( u_mdctx, data, length);
|
||||
# endif
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -114,8 +125,6 @@ static inline void u_dgst_hash(unsigned char* restrict data, uint32_t length)
|
|||
|
||||
U_EXPORT int u_dgst_finish(unsigned char* restrict hash, int base64); /* Finish and get hash */
|
||||
|
||||
U_EXPORT void u_dgst_reset(void); /* Reset the hash */
|
||||
|
||||
/**
|
||||
* The EVP signature routines are a high level interface to digital signatures
|
||||
*/
|
||||
|
@ -127,14 +136,22 @@ static inline void u_dgst_sign_hash(unsigned char* restrict data, uint32_t lengt
|
|||
{
|
||||
U_INTERNAL_TRACE("u_dgst_sign_hash(%.*s,%u)", U_min(length,128), data, length)
|
||||
|
||||
#if OPENSSL_VERSION_NUMBER < 0x10100000L
|
||||
(void) EVP_SignUpdate(&u_mdctx, data, length);
|
||||
#else
|
||||
(void) EVP_SignUpdate( u_mdctx, data, length);
|
||||
#endif
|
||||
}
|
||||
|
||||
static inline void u_dgst_verify_hash(unsigned char* restrict data, uint32_t length)
|
||||
{
|
||||
U_INTERNAL_TRACE("u_dgst_verify_hash(%.*s,%u)", U_min(length,128), data, length)
|
||||
|
||||
#if OPENSSL_VERSION_NUMBER < 0x10100000L
|
||||
(void) EVP_VerifyUpdate(&u_mdctx, data, length);
|
||||
#else
|
||||
(void) EVP_VerifyUpdate( u_mdctx, data, length);
|
||||
#endif
|
||||
}
|
||||
|
||||
int u_dgst_sign_finish( unsigned char* restrict sig, int base64); /* Finish and get signature */
|
||||
|
|
|
@ -188,7 +188,7 @@ using namespace std;
|
|||
// Init library
|
||||
|
||||
U_EXPORT void ULib_init();
|
||||
#ifdef USE_LIBSSL
|
||||
#if defined(USE_LIBSSL) && OPENSSL_VERSION_NUMBER < 0x10100000L
|
||||
U_EXPORT void ULib_init_openssl();
|
||||
#endif
|
||||
|
||||
|
|
|
@ -687,7 +687,7 @@
|
|||
/* Define if we have support for crc32 intrinsics */
|
||||
#undef USE_HARDWARE_CRC32
|
||||
|
||||
/* Define if enable libcurL support */
|
||||
/* Define if enable libcurl support */
|
||||
#undef USE_LIBCURL
|
||||
|
||||
/* Define if enable libdbi support */
|
||||
|
|
|
@ -1006,8 +1006,6 @@ public:
|
|||
|
||||
U_INTERNAL_DUMP("json.type_ = %d", json.type_)
|
||||
|
||||
U_INTERNAL_ASSERT_EQUALS(json.type_, NULL_VALUE)
|
||||
|
||||
json.type_ = STRING_VALUE;
|
||||
|
||||
U_INTERNAL_DUMP("pval(%p) = %V", pval, pval)
|
||||
|
@ -1041,8 +1039,6 @@ public:
|
|||
|
||||
U_INTERNAL_DUMP("json.type_ = %d", json.type_)
|
||||
|
||||
U_INTERNAL_ASSERT_EQUALS(json.type_, NULL_VALUE)
|
||||
|
||||
json.type_ = STRING_VALUE;
|
||||
|
||||
U_INTERNAL_DUMP("pval(%p) = %V", pval, ((UString*)pval)->rep)
|
||||
|
@ -1082,8 +1078,6 @@ public:
|
|||
|
||||
U_INTERNAL_DUMP("json.type_ = %d", json.type_)
|
||||
|
||||
U_INTERNAL_ASSERT_EQUALS(json.type_, NULL_VALUE)
|
||||
|
||||
json.type_ = ARRAY_VALUE;
|
||||
|
||||
uvector* pvec = (uvector*)pval;
|
||||
|
@ -1108,8 +1102,6 @@ public:
|
|||
|
||||
U_INTERNAL_DUMP("json.type_ = %d", json.type_)
|
||||
|
||||
U_ASSERT(json.isArrayOrObject())
|
||||
|
||||
for (UValue* child = json.children.head; child; child = child->next)
|
||||
{
|
||||
T* pelem;
|
||||
|
@ -1137,8 +1129,6 @@ public:
|
|||
|
||||
U_INTERNAL_DUMP("json.type_ = %d", json.type_)
|
||||
|
||||
U_ASSERT(json.isArrayOrObject())
|
||||
|
||||
for (UValue* child = json.children.head; child; child = child->next)
|
||||
{
|
||||
UString elem;
|
||||
|
@ -1162,8 +1152,6 @@ public:
|
|||
|
||||
U_INTERNAL_DUMP("json.type_ = %d", json.type_)
|
||||
|
||||
U_INTERNAL_ASSERT_EQUALS(json.type_, NULL_VALUE)
|
||||
|
||||
json.type_ = OBJECT_VALUE;
|
||||
|
||||
uhashmap* pmap = (uhashmap*)pval;
|
||||
|
@ -1201,8 +1189,6 @@ public:
|
|||
|
||||
U_INTERNAL_DUMP("json.type_ = %d", json.type_)
|
||||
|
||||
U_ASSERT(json.isObject())
|
||||
|
||||
uhashmap* pmap = (uhashmap*)pval;
|
||||
|
||||
for (UValue* child = json.children.head; child; child = child->next)
|
||||
|
@ -1236,8 +1222,6 @@ public:
|
|||
|
||||
U_INTERNAL_DUMP("json.type_ = %d", json.type_)
|
||||
|
||||
U_ASSERT(json.isObject())
|
||||
|
||||
uhashmap* pmap = (uhashmap*)pval;
|
||||
|
||||
for (UValue* child = json.children.head; child; child = child->next)
|
||||
|
@ -1269,8 +1253,6 @@ public:
|
|||
|
||||
U_INTERNAL_DUMP("json.type_ = %d", json.type_)
|
||||
|
||||
U_INTERNAL_ASSERT_EQUALS(json.type_, NULL_VALUE)
|
||||
|
||||
json.type_ = ARRAY_VALUE;
|
||||
|
||||
stdvector* pvec = (stdvector*)pval;
|
||||
|
@ -1293,8 +1275,6 @@ public:
|
|||
|
||||
U_INTERNAL_DUMP("json.type_ = %d", json.type_)
|
||||
|
||||
U_ASSERT(json.isArrayOrObject())
|
||||
|
||||
for (UValue* child = json.children.head; child; child = child->next)
|
||||
{
|
||||
T elem;
|
||||
|
|
|
@ -30,8 +30,7 @@
|
|||
|
||||
#define USP_JSON_stringify(json,class_name,obj) ((json).toJSON(UJsonTypeHandler<class_name>(obj)), USP_JSON_PUTS(json))
|
||||
|
||||
#define USP_JSON_OBJ_stringify(class_name,obj) {UValue _jtmp(OBJECT_VALUE); _jtmp.toJSON(UJsonTypeHandler<class_name>(obj)); USP_JSON_PUTS(_jtmp);}
|
||||
#define USP_JSON_ARRAY_stringify(class_name,obj) {UValue _jtmp( ARRAY_VALUE); _jtmp.toJSON(UJsonTypeHandler<class_name>(obj)); USP_JSON_PUTS(_jtmp);}
|
||||
#define USP_JSON_OBJ_stringify(class_name,obj) {UValue _jtmp; _jtmp.toJSON(UJsonTypeHandler<class_name>(obj)); USP_JSON_PUTS(_jtmp);}
|
||||
|
||||
#define USP_XML_PUTS(string) \
|
||||
((void)UClientImage_Base::_encoded->reserve((string).size() * 4), \
|
||||
|
|
|
@ -19,6 +19,11 @@
|
|||
|
||||
#include <openssl/x509.h>
|
||||
|
||||
#if OPENSSL_VERSION_NUMBER >= 0x10100000L
|
||||
# define X509_get_notBefore X509_getm_notBefore
|
||||
# define X509_get_notAfter X509_getm_notAfter
|
||||
#endif
|
||||
|
||||
template <class T> class UVector;
|
||||
template <class T> class UHashMap;
|
||||
|
||||
|
@ -252,49 +257,6 @@ public:
|
|||
|
||||
long hashCode() { return hashCode(x509); }
|
||||
|
||||
/**
|
||||
* Returns the <i>signature</i> of this certificate
|
||||
*/
|
||||
|
||||
static UString getSignature(X509* a)
|
||||
{
|
||||
U_TRACE(0, "UCertificate::getSignature(%p)", a)
|
||||
|
||||
U_INTERNAL_ASSERT_POINTER(a)
|
||||
|
||||
UString signature( (const char*) a->signature->data,
|
||||
a->signature->length );
|
||||
|
||||
U_RETURN_STRING(signature);
|
||||
}
|
||||
|
||||
UString getSignature() const { return getSignature(x509); }
|
||||
|
||||
/**
|
||||
* Returns <i>signatureAlgorithm</i> of this certificate
|
||||
*/
|
||||
|
||||
static UString getSignatureAlgorithm(X509* a)
|
||||
{
|
||||
U_TRACE(0, "UCertificate::getSignatureAlgorithm(%p)", a)
|
||||
|
||||
U_INTERNAL_ASSERT_POINTER(a)
|
||||
|
||||
UString signature_algorithm( OBJ_nid2sn( OBJ_obj2nid(a->sig_alg->algorithm) ) );
|
||||
|
||||
U_RETURN_STRING(signature_algorithm);
|
||||
}
|
||||
|
||||
UString getSignatureAlgorithm() const { return getSignatureAlgorithm(x509); }
|
||||
|
||||
/**
|
||||
* Returns the part of this certificate that is signed
|
||||
*/
|
||||
|
||||
static UString getSignable(X509* x509);
|
||||
|
||||
UString getSignable() const { return getSignable(x509); }
|
||||
|
||||
/**
|
||||
* Returns <i>publicKey</i> of this certificate
|
||||
*/
|
||||
|
@ -443,13 +405,6 @@ public:
|
|||
|
||||
UString getExponent() const;
|
||||
|
||||
/**
|
||||
* Gets X509v3 extensions as array of X509Ext objects
|
||||
*/
|
||||
|
||||
int getExtensions(UHashMap<UString>& table) const;
|
||||
|
||||
|
||||
/**
|
||||
* parse cert's \c authorityInfoAccess extension and find all the
|
||||
* instances of the \c id-ad-caIssuers access method which can be:
|
||||
|
|
|
@ -20,6 +20,11 @@
|
|||
#include <openssl/x509.h>
|
||||
#include <openssl/asn1.h>
|
||||
|
||||
#if OPENSSL_VERSION_NUMBER >= 0x10100000L
|
||||
# define X509_CRL_get_lastUpdate X509_CRL_get0_lastUpdate
|
||||
# define X509_CRL_get_nextUpdate X509_CRL_get0_nextUpdate
|
||||
#endif
|
||||
|
||||
class UCertificate;
|
||||
|
||||
/**
|
||||
|
@ -154,22 +159,6 @@ public:
|
|||
U_RETURN(version);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the <i>signature</i> of this CRL
|
||||
*/
|
||||
|
||||
UString getSignature() const
|
||||
{
|
||||
U_TRACE_NO_PARAM(0, "UCrl::getSignature()")
|
||||
|
||||
U_INTERNAL_ASSERT_POINTER(crl)
|
||||
|
||||
UString signature( (const char*) crl->signature->data,
|
||||
crl->signature->length );
|
||||
|
||||
U_RETURN_STRING(signature);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the last update of this CRL
|
||||
*/
|
||||
|
@ -180,7 +169,7 @@ public:
|
|||
|
||||
U_INTERNAL_ASSERT_POINTER(crl)
|
||||
|
||||
ASN1_UTCTIME* utctime = X509_CRL_get_lastUpdate(crl);
|
||||
const ASN1_UTCTIME* utctime = X509_CRL_get_lastUpdate(crl);
|
||||
|
||||
U_RETURN((const char*)utctime->data);
|
||||
}
|
||||
|
@ -198,7 +187,7 @@ public:
|
|||
|
||||
U_INTERNAL_ASSERT_POINTER(crl)
|
||||
|
||||
ASN1_UTCTIME* utctime = X509_CRL_get_nextUpdate(crl);
|
||||
const ASN1_UTCTIME* utctime = X509_CRL_get_nextUpdate(crl);
|
||||
|
||||
U_RETURN((const char*)utctime->data);
|
||||
}
|
||||
|
|
|
@ -53,8 +53,9 @@ public:
|
|||
private:
|
||||
static SSL_SESSION* sess;
|
||||
|
||||
static int newSession(SSL* ssl, SSL_SESSION* sess);
|
||||
static void removeSession(SSL_CTX* ctx, SSL_SESSION* sess);
|
||||
static int newSession(SSL* ssl, SSL_SESSION* sess);
|
||||
static void removeSession(SSL_CTX* ctx, SSL_SESSION* sess);
|
||||
|
||||
static SSL_SESSION* getSession(SSL* ssl, unsigned char* id, int len, int* copy);
|
||||
|
||||
U_DISALLOW_COPY_AND_ASSIGN(USSLSession)
|
||||
|
|
|
@ -115,45 +115,6 @@ public:
|
|||
U_RETURN(version);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the <i>signature</i> of this certificateRequest
|
||||
*/
|
||||
|
||||
UString getSignature() const
|
||||
{
|
||||
U_TRACE_NO_PARAM(0, "UPKCS10::getSignature()")
|
||||
|
||||
U_INTERNAL_ASSERT_POINTER(request)
|
||||
|
||||
UString signature( (const char*) request->signature->data,
|
||||
request->signature->length );
|
||||
|
||||
U_RETURN_STRING(signature);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns <i>signatureAlgorithm</i> of this certificateRequest
|
||||
*/
|
||||
|
||||
UString getSignatureAlgorithm() const
|
||||
{
|
||||
U_TRACE_NO_PARAM(0, "UPKCS10::getSignatureAlgorithm()")
|
||||
|
||||
U_INTERNAL_ASSERT_POINTER(request)
|
||||
|
||||
UString signature_algorithm( OBJ_nid2sn( OBJ_obj2nid(request->sig_alg->algorithm) ) );
|
||||
|
||||
U_RETURN_STRING(signature_algorithm);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the part of this certificateRequest that is signed
|
||||
*/
|
||||
|
||||
static UString getSignable(X509_REQ* request);
|
||||
|
||||
UString getSignable() const { return getSignable(request); }
|
||||
|
||||
/**
|
||||
* Returns <i>publicKey</i> of this certificateRequest
|
||||
*/
|
||||
|
|
|
@ -239,32 +239,7 @@ public:
|
|||
*upload_dir = dir;
|
||||
}
|
||||
|
||||
static void setHostname(const char* ptr, uint32_t len)
|
||||
{
|
||||
U_TRACE(0, "UHTTP::setHostname(%.*S,%u)", len, ptr, len)
|
||||
|
||||
// The difference between HTTP_HOST and U_HTTP_VHOST is that HTTP_HOST can include the «:PORT» text, and U_HTTP_VHOST only the name
|
||||
|
||||
U_http_host_len =
|
||||
U_http_host_vlen = len;
|
||||
U_http_info.host = ptr;
|
||||
|
||||
U_INTERNAL_DUMP("U_http_host_len = %u U_HTTP_HOST = %.*S", U_http_host_len, U_HTTP_HOST_TO_TRACE)
|
||||
|
||||
// hostname[:port]
|
||||
|
||||
for (const char* endptr = ptr+len; ptr < endptr; ++ptr)
|
||||
{
|
||||
if (*ptr == ':')
|
||||
{
|
||||
U_http_host_vlen = ptr-U_http_info.host;
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
U_INTERNAL_DUMP("U_http_host_vlen = %u U_HTTP_VHOST = %.*S", U_http_host_vlen, U_HTTP_VHOST_TO_TRACE)
|
||||
}
|
||||
static void setHostname(const char* ptr, uint32_t len);
|
||||
|
||||
static const char* getStatusDescription(uint32_t* plen = 0);
|
||||
|
||||
|
@ -1065,6 +1040,7 @@ private:
|
|||
|
||||
static void checkPath() U_NO_EXPORT;
|
||||
static bool callService() U_NO_EXPORT;
|
||||
static void checkIPClient() U_NO_EXPORT;
|
||||
static bool runDynamicPage() U_NO_EXPORT;
|
||||
static bool readBodyRequest() U_NO_EXPORT;
|
||||
static bool processFileCache() U_NO_EXPORT;
|
||||
|
@ -1091,6 +1067,23 @@ private:
|
|||
static bool readDataChunked(USocket* sk, UString* pbuffer, UString& body) U_NO_EXPORT;
|
||||
static void setResponseForRange(uint32_t start, uint32_t end, uint32_t header) U_NO_EXPORT;
|
||||
|
||||
static inline void setUpgrade(const char* ptr) U_NO_EXPORT;
|
||||
static inline void setIfModSince(const char* ptr) U_NO_EXPORT;
|
||||
static inline void setConnection(const char* ptr) U_NO_EXPORT;
|
||||
static inline void setAcceptEncoding(const char* ptr) U_NO_EXPORT;
|
||||
static inline void setContentLength(const char* ptr1, const char* ptr2) U_NO_EXPORT;
|
||||
|
||||
static inline void setRange(const char* ptr, uint32_t len) U_NO_EXPORT;
|
||||
static inline void setCookie(const char* ptr, uint32_t len) U_NO_EXPORT;
|
||||
static inline void setUserAgent(const char* ptr, uint32_t len) U_NO_EXPORT;
|
||||
static inline void setAccept(const char* ptr, uint32_t len) U_NO_EXPORT;
|
||||
static inline void setReferer(const char* ptr, uint32_t len) U_NO_EXPORT;
|
||||
static inline void setXRealIP(const char* ptr, uint32_t len) U_NO_EXPORT;
|
||||
static inline void setContentType(const char* ptr, uint32_t len) U_NO_EXPORT;
|
||||
static inline void setAcceptLanguage(const char* ptr, uint32_t len) U_NO_EXPORT;
|
||||
static inline void setXForwardedFor(const char* ptr, uint32_t len) U_NO_EXPORT;
|
||||
static inline void setXHttpForwardedFor(const char* ptr, uint32_t len) U_NO_EXPORT;
|
||||
|
||||
U_DISALLOW_COPY_AND_ASSIGN(UHTTP)
|
||||
|
||||
friend class USSIPlugIn;
|
||||
|
|
|
@ -7,7 +7,11 @@ AC_DEFUN([AC_CHECK_PACKAGE],[
|
|||
wanted=1;
|
||||
if test -z "$with_libz" ; then
|
||||
wanted=0;
|
||||
with_libz="${CROSS_ENVIRONMENT}/usr";
|
||||
if test -n "$CROSS_ENVIRONMENT" ; then
|
||||
with_libz="no";
|
||||
else
|
||||
with_libz="${CROSS_ENVIRONMENT}/usr";
|
||||
fi
|
||||
fi
|
||||
AC_ARG_WITH(libz, [ --with-libz use system LIBZ library - [[will check /usr /usr/local]] [[default=use if present]]], [
|
||||
if test "$withval" = "no"; then
|
||||
|
@ -47,66 +51,21 @@ AC_DEFUN([AC_CHECK_PACKAGE],[
|
|||
], [AC_MSG_RESULT(no)])
|
||||
|
||||
AC_MSG_CHECKING(if you want to enable build of ZIP support)
|
||||
AC_ARG_ENABLE(zip, [ --enable-zip enable build of ZIP support - require libz [[default: use if present libz]]])
|
||||
if test "$enable_zip" != "no" -a x_$found_libz = x_yes; then
|
||||
enable_zip="yes"
|
||||
if test x_$found_libz = x_yes; then
|
||||
if test -z "$enable_zip" -o x_$enable_zip != x_no; then
|
||||
enable_zip="yes"
|
||||
fi
|
||||
else
|
||||
enable_zip="no"
|
||||
fi
|
||||
AC_ARG_ENABLE(zip, [ --enable-zip enable build of ZIP support - require libz [[default: use if present libz]]])
|
||||
AC_MSG_RESULT([$enable_zip])
|
||||
|
||||
AC_MSG_CHECKING(if tdb library is wanted)
|
||||
wanted=1;
|
||||
if test -z "$with_libtdb" ; then
|
||||
wanted=0;
|
||||
if test "$USP_FLAGS" = "-DAS_cpoll_cppsp_DO"; then
|
||||
with_libtdb="no";
|
||||
else
|
||||
with_libtdb="${CROSS_ENVIRONMENT}/usr";
|
||||
fi
|
||||
fi
|
||||
AC_ARG_WITH(libtdb, [ --with-libtdb use system tdb library - [[will check /usr /usr/local]] [[default=use if present]]], [
|
||||
if test "$withval" = "no"; then
|
||||
AC_MSG_RESULT(no)
|
||||
else
|
||||
AC_MSG_RESULT(yes)
|
||||
for dir in $withval ${CROSS_ENVIRONMENT}/ ${CROSS_ENVIRONMENT}/usr ${CROSS_ENVIRONMENT}/usr/local; do
|
||||
libtdbdir="$dir"
|
||||
if test -f "$dir/include/tdb.h"; then
|
||||
found_libtdb="yes";
|
||||
break;
|
||||
fi
|
||||
done
|
||||
if test x_$found_libtdb != x_yes; then
|
||||
msg="Cannot find libtdb library";
|
||||
if test $wanted = 1; then
|
||||
AC_MSG_ERROR($msg)
|
||||
else
|
||||
AC_MSG_RESULT($msg)
|
||||
fi
|
||||
else
|
||||
echo "${T_MD}libtdb found in $libtdbdir${T_ME}"
|
||||
USE_LIBTDB=yes
|
||||
AC_DEFINE(USE_LIBTDB, 1, [Define if enable libtdb support])
|
||||
libtdb_version=$(ls $libtdbdir/lib*/libtdb.so.*.* 2>/dev/null | head -n 1 | awk -F'.so.' '{n=2; print $n}' 2>/dev/null)
|
||||
if test -z "${libtdb_version}"; then
|
||||
libtdb_version="unknown"
|
||||
fi
|
||||
ULIB_LIBS="$ULIB_LIBS -ltdb";
|
||||
if test $libtdbdir != "${CROSS_ENVIRONMENT}/" -a $libtdbdir != "${CROSS_ENVIRONMENT}/usr" -a $libtdbdir != "${CROSS_ENVIRONMENT}/usr/local"; then
|
||||
CPPFLAGS="$CPPFLAGS -I$libtdbdir/include"
|
||||
LDFLAGS="$LDFLAGS -L$libtdbdir/lib -Wl,-R$libtdbdir/lib";
|
||||
PRG_LDFLAGS="$PRG_LDFLAGS -L$libtdbdir/lib";
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
], [AC_MSG_RESULT(no)])
|
||||
|
||||
AC_MSG_CHECKING(if zopfli library is wanted)
|
||||
wanted=1;
|
||||
if test -z "$with_libzopfli" ; then
|
||||
wanted=0;
|
||||
if test "$USP_FLAGS" = "-DAS_cpoll_cppsp_DO"; then
|
||||
if test -n "$CROSS_ENVIRONMENT" -o "$USP_FLAGS" = "-DAS_cpoll_cppsp_DO"; then
|
||||
with_libzopfli="no";
|
||||
else
|
||||
with_libzopfli="${CROSS_ENVIRONMENT}/usr";
|
||||
|
@ -153,7 +112,11 @@ AC_DEFUN([AC_CHECK_PACKAGE],[
|
|||
wanted=1;
|
||||
if test -z "$with_magic" ; then
|
||||
wanted=0;
|
||||
with_magic="${CROSS_ENVIRONMENT}/usr";
|
||||
if test -n "$CROSS_ENVIRONMENT" -o "$USP_FLAGS" = "-DAS_cpoll_cppsp_DO"; then
|
||||
with_magic="no";
|
||||
else
|
||||
with_magic="${CROSS_ENVIRONMENT}/usr";
|
||||
fi
|
||||
fi
|
||||
AC_ARG_WITH(magic, [ --with-magic use system libmagic library - [[will check /usr /usr/local]] [[default=use if present]]],
|
||||
[if test "$withval" = "no"; then
|
||||
|
@ -196,7 +159,11 @@ AC_DEFUN([AC_CHECK_PACKAGE],[
|
|||
wanted=1;
|
||||
if test -z "$with_ssl" ; then
|
||||
wanted=0;
|
||||
with_ssl="${CROSS_ENVIRONMENT}/usr";
|
||||
if test -n "$CROSS_ENVIRONMENT" -o "$USP_FLAGS" = "-DAS_cpoll_cppsp_DO"; then
|
||||
with_ssl="no";
|
||||
else
|
||||
with_ssl="${CROSS_ENVIRONMENT}/usr";
|
||||
fi
|
||||
fi
|
||||
AC_ARG_WITH(ssl, [ --with-ssl use system SSL library - [[will check /usr /usr/local]] [[default=use if present]]],
|
||||
[if test "$withval" = "no"; then
|
||||
|
@ -235,8 +202,8 @@ AC_DEFUN([AC_CHECK_PACKAGE],[
|
|||
HAVE_SSL_TS="yes";
|
||||
AC_DEFINE(HAVE_SSL_TS, 1, [Define if we have time stamp support in openssl])
|
||||
fi
|
||||
if test x_$PKG_CONFIG != x_no; then
|
||||
ssl_version=$(pkg-config --modversion openssl)
|
||||
if test -z "$CROSS_ENVIRONMENT" -a x_$PKG_CONFIG != x_no; then
|
||||
ssl_version=$(pkg-config --modversion openssl 2>/dev/null)
|
||||
fi
|
||||
if test -z "$OPENSSL_LINK"; then
|
||||
ULIB_LIBS="-lssl -lcrypto $ULIB_LIBS";
|
||||
|
@ -260,7 +227,11 @@ AC_DEFUN([AC_CHECK_PACKAGE],[
|
|||
wanted=1;
|
||||
if test -z "$with_pcre" ; then
|
||||
wanted=0;
|
||||
with_pcre="${CROSS_ENVIRONMENT}/usr";
|
||||
if test -n "$CROSS_ENVIRONMENT" -o "$USP_FLAGS" = "-DAS_cpoll_cppsp_DO"; then
|
||||
with_pcre="no";
|
||||
else
|
||||
with_pcre="${CROSS_ENVIRONMENT}/usr";
|
||||
fi
|
||||
fi
|
||||
AC_ARG_WITH(pcre, [ --with-pcre use system PCRE library - [[will check /usr /usr/local]] [[default=use if present]]],
|
||||
[if test "$withval" = "no"; then
|
||||
|
@ -303,7 +274,11 @@ AC_DEFUN([AC_CHECK_PACKAGE],[
|
|||
wanted=1;
|
||||
if test -z "$with_expat" ; then
|
||||
wanted=0;
|
||||
with_expat="${CROSS_ENVIRONMENT}/usr";
|
||||
if test -n "$CROSS_ENVIRONMENT" -o "$USP_FLAGS" = "-DAS_cpoll_cppsp_DO"; then
|
||||
with_expat="no";
|
||||
else
|
||||
with_expat="${CROSS_ENVIRONMENT}/usr";
|
||||
fi
|
||||
fi
|
||||
AC_ARG_WITH(expat, [ --with-expat use system EXPAT library - [[will check /usr /usr/local]] [[default=use if present]]],
|
||||
[if test "$withval" = "no"; then
|
||||
|
@ -346,7 +321,16 @@ AC_DEFUN([AC_CHECK_PACKAGE],[
|
|||
], [AC_MSG_RESULT(no)])
|
||||
|
||||
AC_MSG_CHECKING(if libuuid library is wanted)
|
||||
AC_ARG_WITH(libuuid, [ --with-libuuid use system libuuid library - [[will check /usr /usr/local]]],
|
||||
wanted=1;
|
||||
if test -z "$with_libuuid" ; then
|
||||
wanted=0;
|
||||
if test -n "$CROSS_ENVIRONMENT" -o "$USP_FLAGS" = "-DAS_cpoll_cppsp_DO"; then
|
||||
with_libuuid="no";
|
||||
else
|
||||
with_libuuid="${CROSS_ENVIRONMENT}/usr";
|
||||
fi
|
||||
fi
|
||||
AC_ARG_WITH(libuuid, [ --with-libuuid use system libuuid library - [[will check /usr /usr/local]] [[default=use if present]]],
|
||||
[if test "$withval" = "no"; then
|
||||
AC_MSG_RESULT(no)
|
||||
else
|
||||
|
@ -369,8 +353,8 @@ AC_DEFUN([AC_CHECK_PACKAGE],[
|
|||
echo "${T_MD}libuuid found in $libuuiddir${T_ME}"
|
||||
USE_LIBUUID=yes
|
||||
AC_DEFINE(USE_LIBUUID, 1, [Define if enable libuuid support])
|
||||
if test x_$PKG_CONFIG != x_no; then
|
||||
libuuid_version=$(pkg-config --modversion ext2fs)
|
||||
if test -z "$CROSS_ENVIRONMENT" -a x_$PKG_CONFIG != x_no; then
|
||||
libuuid_version=$(pkg-config --modversion ext2fs 2>/dev/null)
|
||||
fi
|
||||
if test -z "${libuuid_version}"; then
|
||||
libuuid_version="unknown"
|
||||
|
@ -385,12 +369,99 @@ AC_DEFUN([AC_CHECK_PACKAGE],[
|
|||
fi
|
||||
], [AC_MSG_RESULT(no)])
|
||||
|
||||
AC_MSG_CHECKING(if c-ares library for DNS resolution is wanted)
|
||||
if test -n "$with_libares" ; then
|
||||
wanted=1;
|
||||
else
|
||||
AC_MSG_CHECKING(if cURL library is wanted)
|
||||
wanted=1;
|
||||
if test -z "$with_curl" ; then
|
||||
wanted=0;
|
||||
with_libares="${CROSS_ENVIRONMENT}/usr";
|
||||
with_curl="no";
|
||||
fi
|
||||
AC_ARG_WITH(curl, [ --with-curl use system cURL library - [[will check /usr /usr/local]]],
|
||||
[if test "$withval" = "no"; then
|
||||
AC_MSG_RESULT(no)
|
||||
else
|
||||
AC_MSG_RESULT(yes)
|
||||
for dir in $withval ${CROSS_ENVIRONMENT}/ ${CROSS_ENVIRONMENT}/usr ${CROSS_ENVIRONMENT}/usr/local; do
|
||||
curldir="$dir";
|
||||
if test -f "$dir/include/curl/curl.h"; then
|
||||
found_curl="yes";
|
||||
break;
|
||||
fi
|
||||
done
|
||||
if test x_$found_curl != x_yes; then
|
||||
AC_MSG_ERROR(Cannot find cURL library)
|
||||
else
|
||||
echo "${T_MD}libcurl found in $curldir${T_ME}"
|
||||
USE_LIBCURL=yes
|
||||
AC_DEFINE(USE_LIBCURL, 1, [Define if enable libcurl support])
|
||||
libcurl_version=$($curldir/bin/curl-config --version 2>/dev/null | sed -e "s/libcurl //g")
|
||||
if test -z "${libcurl_version}" -a x_$PKG_CONFIG != x_no; then
|
||||
libcurl_version=$(pkg-config --modversion libcurl 2>/dev/null)
|
||||
fi
|
||||
if test -z "${libcurl_version}"; then
|
||||
libcurl_version="unknown"
|
||||
fi
|
||||
libcurl_linking=$($curldir/bin/curl-config --libs 2>/dev/null)
|
||||
if test -z "${libcurl_linking}"; then
|
||||
libcurl_linking="-lcurl"
|
||||
fi
|
||||
ULIB_LIBS="$libcurl_linking $ULIB_LIBS";
|
||||
if test $curldir != "${CROSS_ENVIRONMENT}/" -a $curldir != "${CROSS_ENVIRONMENT}/usr" -a $curldir != "${CROSS_ENVIRONMENT}/usr/local"; then
|
||||
CPPFLAGS="$CPPFLAGS -I$curldir/include";
|
||||
LDFLAGS="$LDFLAGS -L$curldir/lib -Wl,-R$curldir/lib";
|
||||
PRG_LDFLAGS="$PRG_LDFLAGS -L$curldir/lib";
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
], [AC_MSG_RESULT(no)])
|
||||
|
||||
AC_MSG_CHECKING(if tdb library is wanted)
|
||||
wanted=1;
|
||||
if test -z "$with_libtdb" ; then
|
||||
wanted=0;
|
||||
with_libtdb="no";
|
||||
fi
|
||||
AC_ARG_WITH(libtdb, [ --with-libtdb use system tdb library - [[will check /usr /usr/local]]], [
|
||||
if test "$withval" = "no"; then
|
||||
AC_MSG_RESULT(no)
|
||||
else
|
||||
AC_MSG_RESULT(yes)
|
||||
for dir in $withval ${CROSS_ENVIRONMENT}/ ${CROSS_ENVIRONMENT}/usr ${CROSS_ENVIRONMENT}/usr/local; do
|
||||
libtdbdir="$dir"
|
||||
if test -f "$dir/include/tdb.h"; then
|
||||
found_libtdb="yes";
|
||||
break;
|
||||
fi
|
||||
done
|
||||
if test x_$found_libtdb != x_yes; then
|
||||
msg="Cannot find libtdb library";
|
||||
if test $wanted = 1; then
|
||||
AC_MSG_ERROR($msg)
|
||||
else
|
||||
AC_MSG_RESULT($msg)
|
||||
fi
|
||||
else
|
||||
echo "${T_MD}libtdb found in $libtdbdir${T_ME}"
|
||||
USE_LIBTDB=yes
|
||||
AC_DEFINE(USE_LIBTDB, 1, [Define if enable libtdb support])
|
||||
libtdb_version=$(ls $libtdbdir/lib*/libtdb.so.*.* 2>/dev/null | head -n 1 | awk -F'.so.' '{n=2; print $n}' 2>/dev/null)
|
||||
if test -z "${libtdb_version}"; then
|
||||
libtdb_version="unknown"
|
||||
fi
|
||||
ULIB_LIBS="$ULIB_LIBS -ltdb";
|
||||
if test $libtdbdir != "${CROSS_ENVIRONMENT}/" -a $libtdbdir != "${CROSS_ENVIRONMENT}/usr" -a $libtdbdir != "${CROSS_ENVIRONMENT}/usr/local"; then
|
||||
CPPFLAGS="$CPPFLAGS -I$libtdbdir/include"
|
||||
LDFLAGS="$LDFLAGS -L$libtdbdir/lib -Wl,-R$libtdbdir/lib";
|
||||
PRG_LDFLAGS="$PRG_LDFLAGS -L$libtdbdir/lib";
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
], [AC_MSG_RESULT(no)])
|
||||
|
||||
AC_MSG_CHECKING(if c-ares library for DNS resolution is wanted)
|
||||
wanted=1;
|
||||
if test -z "$with_libares" ; then
|
||||
wanted=0;
|
||||
with_libares="no";
|
||||
fi
|
||||
AC_ARG_WITH(libares, [ --with-libares use system c-ares library - [[will check /usr /usr/local]]], [
|
||||
if test "$withval" = "no"; then
|
||||
|
@ -415,8 +486,8 @@ AC_DEFUN([AC_CHECK_PACKAGE],[
|
|||
echo "${T_MD}libcares found in $caresdir${T_ME}"
|
||||
USE_C_ARES=yes
|
||||
AC_DEFINE(USE_C_ARES, 1, [Define if enable c-ares support])
|
||||
if test x_$PKG_CONFIG != x_no; then
|
||||
cares_version=$(pkg-config --modversion libcares)
|
||||
if test -z "$CROSS_ENVIRONMENT" -a x_$PKG_CONFIG != x_no; then
|
||||
cares_version=$(pkg-config --modversion libcares 2>/dev/null)
|
||||
fi
|
||||
if test -z "${cares_version}"; then
|
||||
cares_version="unknown"
|
||||
|
@ -432,6 +503,11 @@ AC_DEFUN([AC_CHECK_PACKAGE],[
|
|||
], [AC_MSG_RESULT(no)])
|
||||
|
||||
AC_MSG_CHECKING(if SSH library is wanted)
|
||||
wanted=1;
|
||||
if test -z "$with_ssh" ; then
|
||||
wanted=0;
|
||||
with_ssh="no";
|
||||
fi
|
||||
AC_ARG_WITH(ssh, [ --with-ssh use system SSH library - [[will check /usr /usr/local]]],
|
||||
[if test "$withval" = "no"; then
|
||||
AC_MSG_RESULT(no)
|
||||
|
@ -465,46 +541,12 @@ dnl libssh_version=$(grep LIBSFTP_VERSION $sshdir/include/libssh/sftp.h | cut -
|
|||
fi
|
||||
], [AC_MSG_RESULT(no)])
|
||||
|
||||
AC_MSG_CHECKING(if cURL library is wanted)
|
||||
AC_ARG_WITH(curl, [ --with-curl use system cURL library - [[will check /usr /usr/local]]],
|
||||
[if test "$withval" = "no"; then
|
||||
AC_MSG_RESULT(no)
|
||||
else
|
||||
AC_MSG_RESULT(yes)
|
||||
for dir in $withval ${CROSS_ENVIRONMENT}/ ${CROSS_ENVIRONMENT}/usr ${CROSS_ENVIRONMENT}/usr/local; do
|
||||
curldir="$dir";
|
||||
if test -f "$dir/include/curl/curl.h"; then
|
||||
found_curl="yes";
|
||||
break;
|
||||
fi
|
||||
done
|
||||
if test x_$found_curl != x_yes; then
|
||||
AC_MSG_ERROR(Cannot find cURL library)
|
||||
else
|
||||
echo "${T_MD}libcurl found in $curldir${T_ME}"
|
||||
USE_LIBCURL=yes
|
||||
AC_DEFINE(USE_LIBCURL, 1, [Define if enable libcurL support])
|
||||
if test x_$PKG_CONFIG != x_no; then
|
||||
libcurl_version=$(pkg-config --modversion libcurl)
|
||||
fi
|
||||
if test -z "${libcurl_version}"; then
|
||||
libcurl_version=$($curldir/bin/curl-config --version 2>/dev/null | sed -e "s/libcurl //g")
|
||||
fi
|
||||
if test -z "${libcurl_version}"; then
|
||||
libcurl_version="unknown"
|
||||
fi
|
||||
libcurl_linking=$($curldir/bin/curl-config --libs 2>/dev/null)
|
||||
ULIB_LIBS="$libcurl_linking $ULIB_LIBS";
|
||||
if test $curldir != "${CROSS_ENVIRONMENT}/" -a $curldir != "${CROSS_ENVIRONMENT}/usr" -a $curldir != "${CROSS_ENVIRONMENT}/usr/local"; then
|
||||
CPPFLAGS="$CPPFLAGS -I$curldir/include";
|
||||
LDFLAGS="$LDFLAGS -L$curldir/lib -Wl,-R$curldir/lib";
|
||||
PRG_LDFLAGS="$PRG_LDFLAGS -L$curldir/lib";
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
], [AC_MSG_RESULT(no)])
|
||||
|
||||
AC_MSG_CHECKING(if LDAP library is wanted)
|
||||
wanted=1;
|
||||
if test -z "$with_ldap" ; then
|
||||
wanted=0;
|
||||
with_ldap="no";
|
||||
fi
|
||||
AC_ARG_WITH(ldap, [ --with-ldap use system openLDAP library - [[will check /usr /usr/local]]],
|
||||
[if test "$withval" = "no"; then
|
||||
AC_MSG_RESULT(no)
|
||||
|
@ -561,6 +603,11 @@ dnl ldap_version=$(ldapsearch -VV 2>&1 | tail -n1 | cut -d':' -f2 | cut -d')' -
|
|||
], [AC_MSG_RESULT(no)])
|
||||
|
||||
AC_MSG_CHECKING(if DBI library is wanted)
|
||||
wanted=1;
|
||||
if test -z "$with_dbi" ; then
|
||||
wanted=0;
|
||||
with_dbi="no";
|
||||
fi
|
||||
AC_ARG_WITH(dbi, [ --with-dbi use system DBI library - [[will check /usr /usr/local]]],
|
||||
[if test "$withval" = "no"; then
|
||||
AC_MSG_RESULT(no)
|
||||
|
@ -599,6 +646,11 @@ dnl ldap_version=$(ldapsearch -VV 2>&1 | tail -n1 | cut -d':' -f2 | cut -d')' -
|
|||
], [AC_MSG_RESULT(no)])
|
||||
|
||||
AC_MSG_CHECKING(if libevent library is wanted)
|
||||
wanted=1;
|
||||
if test -z "$with_libevent" ; then
|
||||
wanted=0;
|
||||
with_libevent="no";
|
||||
fi
|
||||
AC_ARG_WITH(libevent, [ --with-libevent use system libevent library - [[will check /usr /usr/local]]],
|
||||
[if test "$withval" = "no"; then
|
||||
AC_MSG_RESULT(no)
|
||||
|
@ -632,6 +684,11 @@ dnl ldap_version=$(ldapsearch -VV 2>&1 | tail -n1 | cut -d':' -f2 | cut -d')' -
|
|||
], [AC_MSG_RESULT(no)])
|
||||
|
||||
AC_MSG_CHECKING(if libxml2 library is wanted)
|
||||
wanted=1;
|
||||
if test -z "$with_libxml2" ; then
|
||||
wanted=0;
|
||||
with_libxml2="no";
|
||||
fi
|
||||
AC_ARG_WITH(libxml2, [ --with-libxml2 use system libxml2 library - [[will check /usr /usr/local]]],
|
||||
[if test "$withval" = "no"; then
|
||||
AC_MSG_RESULT(no)
|
||||
|
@ -650,8 +707,8 @@ dnl ldap_version=$(ldapsearch -VV 2>&1 | tail -n1 | cut -d':' -f2 | cut -d')' -
|
|||
echo "${T_MD}libxml2 found in $libxml2dir${T_ME}"
|
||||
USE_LIBXML2=yes
|
||||
AC_DEFINE(USE_LIBXML2, 1, [Define if enable libxml2 support])
|
||||
if test x_$PKG_CONFIG != x_no; then
|
||||
libxml2_version=$(pkg-config --modversion libxml-2.0)
|
||||
if test -z "$CROSS_ENVIRONMENT" -a x_$PKG_CONFIG != x_no; then
|
||||
libxml2_version=$(pkg-config --modversion libxml-2.0 2>/dev/null)
|
||||
fi
|
||||
if test -z "${libxml2_version}"; then
|
||||
libxml2_version="unknown"
|
||||
|
@ -669,6 +726,11 @@ dnl ldap_version=$(ldapsearch -VV 2>&1 | tail -n1 | cut -d':' -f2 | cut -d')' -
|
|||
], [AC_MSG_RESULT(no)])
|
||||
|
||||
AC_MSG_CHECKING(if you want to use page-speed SDK)
|
||||
wanted=1;
|
||||
if test -z "$with_page_speed" ; then
|
||||
wanted=0;
|
||||
with_page_speed="no";
|
||||
fi
|
||||
AC_ARG_WITH(page-speed, [ --with-page-speed use google page-speed SDK - [[will check /usr /usr/local]]],
|
||||
[if test "$withval" = "no"; then
|
||||
AC_MSG_RESULT(no)
|
||||
|
@ -695,6 +757,11 @@ dnl ldap_version=$(ldapsearch -VV 2>&1 | tail -n1 | cut -d':' -f2 | cut -d')' -
|
|||
], [AC_MSG_RESULT(no)])
|
||||
|
||||
AC_MSG_CHECKING(if you want to use V8 JavaScript Engine)
|
||||
wanted=1;
|
||||
if test -z "$with_v8-javascript" ; then
|
||||
wanted=0;
|
||||
with_v8-javascript="no";
|
||||
fi
|
||||
AC_ARG_WITH(v8-javascript, [ --with-v8-javascript use V8 JavaScript Engine - [[will check /usr /usr/local]]],
|
||||
[if test "$withval" = "no"; then
|
||||
AC_MSG_RESULT(no)
|
||||
|
|
|
@ -43,7 +43,7 @@ define Package/nodog/conffiles
|
|||
endef
|
||||
|
||||
NODOG_OPTIONS:= --disable-examples \
|
||||
--with-ssl --with-libz \
|
||||
--with-ssl --with-libz --with-libtdb \
|
||||
--without-expat --without-magic --without-pcre \
|
||||
--disable-static --disable-new-ldflags --disable-zip --disable-LFS \
|
||||
--enable-log --enable-captive-portal --enable-static-server-plugin="nocat http" \
|
||||
|
|
|
@ -42,7 +42,7 @@ extern "C" {
|
|||
|
||||
// ------------------- zlib-style API's
|
||||
|
||||
mz_ulong mz_adler32(mz_ulong adler, const unsigned char *ptr, size_t buf_len)
|
||||
__pure mz_ulong mz_adler32(mz_ulong adler, const unsigned char *ptr, size_t buf_len)
|
||||
{
|
||||
mz_uint32 i, s1 = (mz_uint32)(adler & 0xffff), s2 = (mz_uint32)(adler >> 16);
|
||||
size_t block_len = buf_len % 5552;
|
||||
|
@ -92,7 +92,7 @@ mz_ulong mz_adler32(mz_ulong adler, const unsigned char *ptr, size_t buf_len)
|
|||
}
|
||||
#else
|
||||
// Faster, but larger CPU cache footprint.
|
||||
mz_ulong mz_crc32(mz_ulong crc, const mz_uint8 *ptr, size_t buf_len)
|
||||
__pure mz_ulong mz_crc32(mz_ulong crc, const mz_uint8 *ptr, size_t buf_len)
|
||||
{
|
||||
static const mz_uint32 s_crc_table[256] =
|
||||
{
|
||||
|
@ -557,7 +557,7 @@ int mz_uncompress(unsigned char *pDest, mz_ulong *pDest_len, const unsigned char
|
|||
return mz_inflateEnd(&stream);
|
||||
}
|
||||
|
||||
const char *mz_error(int err)
|
||||
__pure const char *mz_error(int err)
|
||||
{
|
||||
static struct
|
||||
{
|
||||
|
@ -2565,12 +2565,12 @@ tdefl_status tdefl_init(tdefl_compressor *d, tdefl_put_buf_func_ptr pPut_buf_fun
|
|||
return TDEFL_STATUS_OKAY;
|
||||
}
|
||||
|
||||
tdefl_status tdefl_get_prev_return_status(tdefl_compressor *d)
|
||||
__pure tdefl_status tdefl_get_prev_return_status(tdefl_compressor *d)
|
||||
{
|
||||
return d->m_prev_return_status;
|
||||
}
|
||||
|
||||
mz_uint32 tdefl_get_adler32(tdefl_compressor *d)
|
||||
__pure mz_uint32 tdefl_get_adler32(tdefl_compressor *d)
|
||||
{
|
||||
return d->m_adler32;
|
||||
}
|
||||
|
|
|
@ -26,6 +26,14 @@
|
|||
#define U_DECRYPT 0
|
||||
#define U_STR_MAGIC "Salted__"
|
||||
|
||||
#if OPENSSL_VERSION_NUMBER >= 0x10100000L
|
||||
# define des_cblock DES_cblock
|
||||
# define des_key_schedule DES_key_schedule
|
||||
# define des_string_to_key DES_string_to_key
|
||||
# define RAND_pseudo_bytes RAND_bytes
|
||||
# define des_set_odd_parity DES_set_odd_parity
|
||||
#endif
|
||||
|
||||
static const char* password;
|
||||
|
||||
static const EVP_MD* md;
|
||||
|
@ -48,12 +56,21 @@ void u_des_init(void)
|
|||
u__memcpy(&inp_ivec, &key, sizeof(inp_ivec), __PRETTY_FUNCTION__);
|
||||
u__memcpy(&out_ivec, &key, sizeof(out_ivec), __PRETTY_FUNCTION__);
|
||||
|
||||
#if OPENSSL_VERSION_NUMBER < 0x10100000L
|
||||
(void) des_set_key(&inp_ivec, inp1_sched);
|
||||
(void) des_set_key(&inp_ivec, inp2_sched);
|
||||
(void) des_set_key(&inp_ivec, inp3_sched);
|
||||
(void) des_set_key(&out_ivec, out1_sched);
|
||||
(void) des_set_key(&out_ivec, out2_sched);
|
||||
(void) des_set_key(&out_ivec, out3_sched);
|
||||
#else
|
||||
(void) DES_set_key(&inp_ivec, &inp1_sched);
|
||||
(void) DES_set_key(&inp_ivec, &inp2_sched);
|
||||
(void) DES_set_key(&inp_ivec, &inp3_sched);
|
||||
(void) DES_set_key(&out_ivec, &out1_sched);
|
||||
(void) DES_set_key(&out_ivec, &out2_sched);
|
||||
(void) DES_set_key(&out_ivec, &out3_sched);
|
||||
#endif
|
||||
}
|
||||
|
||||
void u_des3_init(void)
|
||||
|
@ -128,7 +145,11 @@ long u_des_encode(const unsigned char* restrict inp, long len, unsigned char* re
|
|||
* The extra state information to record how much of the 64bit block we have used is contained in inp_num
|
||||
*/
|
||||
|
||||
des_ede3_cfb64_encrypt(inp, out, len, out1_sched, out2_sched, out3_sched, &out_ivec, &inp_num, DES_ENCRYPT);
|
||||
#if OPENSSL_VERSION_NUMBER < 0x10100000L
|
||||
des_ede3_cfb64_encrypt(inp, out, len, out1_sched, out2_sched, out3_sched, &out_ivec, &inp_num, DES_ENCRYPT);
|
||||
#else
|
||||
DES_ede3_cfb64_encrypt(inp, out, len, &out1_sched, &out2_sched, &out3_sched, &out_ivec, &inp_num, DES_ENCRYPT);
|
||||
#endif
|
||||
|
||||
U_INTERNAL_PRINT("inp_num = %d", inp_num)
|
||||
|
||||
|
@ -181,7 +202,11 @@ long u_des_decode(const unsigned char* restrict inp, long len, unsigned char* re
|
|||
* The extra state information to record how much of the 64bit block we have used is contained in out_num
|
||||
*/
|
||||
|
||||
des_ede3_cfb64_encrypt(inp, out, len, inp1_sched, inp2_sched, inp3_sched, &inp_ivec, &out_num, DES_DECRYPT);
|
||||
#if OPENSSL_VERSION_NUMBER < 0x10100000L
|
||||
des_ede3_cfb64_encrypt(inp, out, len, inp1_sched, inp2_sched, inp3_sched, &inp_ivec, &out_num, DES_DECRYPT);
|
||||
#else
|
||||
DES_ede3_cfb64_encrypt(inp, out, len, &inp1_sched, &inp2_sched, &inp3_sched, &inp_ivec, &out_num, DES_DECRYPT);
|
||||
#endif
|
||||
|
||||
U_INTERNAL_PRINT("out_num = %d", out_num)
|
||||
|
||||
|
|
|
@ -16,16 +16,28 @@
|
|||
#include <ulib/base/coder/base64.h>
|
||||
#include <ulib/base/coder/hexdump.h>
|
||||
|
||||
#if OPENSSL_VERSION_NUMBER >= 0x10100000L
|
||||
# ifndef OPENSSL_NO_SHA0
|
||||
# define OPENSSL_NO_SHA0
|
||||
# endif
|
||||
#endif
|
||||
|
||||
UHashType u_hashType; /* What type of hash is this? */
|
||||
EVP_PKEY* restrict u_pkey; /* private key to sign the digest */
|
||||
EVP_MD_CTX u_mdctx; /* Context for digest */
|
||||
const EVP_MD* restrict u_md; /* Digest instance */
|
||||
unsigned char u_mdValue[U_MAX_HASH_SIZE]; /* Final output */
|
||||
int u_mdLen; /* Length of digest */
|
||||
|
||||
HMAC_CTX u_hctx; /* Context for HMAC */
|
||||
const char* restrict u_hmac_key; /* The loaded key */
|
||||
uint32_t u_hmac_keylen; /* The loaded key length */
|
||||
const char* restrict u_hmac_key; /* The loaded key */
|
||||
uint32_t u_hmac_keylen; /* The loaded key length */
|
||||
|
||||
#if OPENSSL_VERSION_NUMBER < 0x10100000L
|
||||
HMAC_CTX u_hctx; /* Context for HMAC */
|
||||
EVP_MD_CTX u_mdctx; /* Context for digest */
|
||||
#else
|
||||
HMAC_CTX* u_hctx; /* Context for HMAC */
|
||||
EVP_MD_CTX* u_mdctx; /* Context for digest */
|
||||
#endif
|
||||
|
||||
__pure int u_dgst_get_algoritm(const char* restrict alg)
|
||||
{
|
||||
|
@ -113,37 +125,30 @@ void u_dgst_init(int alg, const char* restrict _key, uint32_t keylen)
|
|||
u_hmac_key = _key;
|
||||
u_hmac_keylen = keylen;
|
||||
|
||||
# if OPENSSL_VERSION_NUMBER < 0x10100000L
|
||||
HMAC_CTX_cleanup(&u_hctx);
|
||||
HMAC_CTX_init(&u_hctx);
|
||||
|
||||
HMAC_Init_ex(&u_hctx, _key, keylen, u_md, 0);
|
||||
# else
|
||||
if (u_hctx) (void) HMAC_CTX_reset(u_hctx);
|
||||
else u_hctx = HMAC_CTX_new();
|
||||
|
||||
HMAC_Init_ex(u_hctx, _key, keylen, u_md, 0);
|
||||
# endif
|
||||
}
|
||||
else
|
||||
{
|
||||
EVP_MD_CTX_cleanup(&u_mdctx);
|
||||
# if OPENSSL_VERSION_NUMBER < 0x10100000L
|
||||
EVP_MD_CTX_cleanup(&u_mdctx);
|
||||
|
||||
(void) EVP_DigestInit(&u_mdctx, u_md);
|
||||
}
|
||||
}
|
||||
# else
|
||||
if (u_mdctx) EVP_MD_CTX_reset(u_mdctx);
|
||||
else u_mdctx = EVP_MD_CTX_new();
|
||||
|
||||
void u_dgst_reset(void) /* Reset the hash */
|
||||
{
|
||||
U_INTERNAL_TRACE("u_dgst_reset()")
|
||||
|
||||
U_INTERNAL_PRINT("alg = %d", u_hashType)
|
||||
|
||||
U_INTERNAL_ASSERT_POINTER(u_md)
|
||||
|
||||
if (u_hmac_keylen)
|
||||
{
|
||||
HMAC_CTX_cleanup(&u_hctx);
|
||||
|
||||
HMAC_CTX_init(&u_hctx);
|
||||
|
||||
HMAC_Init_ex(&u_hctx, u_hmac_key, u_hmac_keylen, u_md, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
EVP_MD_CTX_cleanup(&u_mdctx);
|
||||
(void) EVP_DigestInit(&u_mdctx, u_md);
|
||||
(void) EVP_DigestInit_ex(u_mdctx, u_md, 0);
|
||||
# endif
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -156,7 +161,7 @@ static int u_finish(unsigned char* restrict ptr, int base64)
|
|||
|
||||
if (base64 == 0) return u_hexdump_encode(u_mdValue, u_mdLen, ptr);
|
||||
if (base64 == 1) return u_base64_encode( u_mdValue, u_mdLen, ptr);
|
||||
if (base64 == -1) u__memcpy(ptr, u_mdValue, u_mdLen, __PRETTY_FUNCTION__);
|
||||
if (base64 == -1) u__memcpy(ptr, u_mdValue, u_mdLen, __PRETTY_FUNCTION__);
|
||||
|
||||
return u_mdLen;
|
||||
}
|
||||
|
@ -169,11 +174,19 @@ int u_dgst_finish(unsigned char* restrict hash, int base64) /* Finish and get ha
|
|||
|
||||
if (u_hmac_keylen)
|
||||
{
|
||||
# if OPENSSL_VERSION_NUMBER < 0x10100000L
|
||||
HMAC_Final(&u_hctx, u_mdValue, (unsigned int*)&u_mdLen);
|
||||
# else
|
||||
HMAC_Final( u_hctx, u_mdValue, (unsigned int*)&u_mdLen);
|
||||
# endif
|
||||
}
|
||||
else
|
||||
{
|
||||
# if OPENSSL_VERSION_NUMBER < 0x10100000L
|
||||
(void) EVP_DigestFinal(&u_mdctx, u_mdValue, (unsigned int*)&u_mdLen);
|
||||
# else
|
||||
(void) EVP_DigestFinal( u_mdctx, u_mdValue, (unsigned int*)&u_mdLen);
|
||||
# endif
|
||||
}
|
||||
|
||||
if (hash) return u_finish(hash, base64);
|
||||
|
@ -189,16 +202,17 @@ void u_dgst_sign_init(int alg, ENGINE* impl)
|
|||
|
||||
u_dgst_algoritm(alg);
|
||||
|
||||
#if OPENSSL_VERSION_NUMBER < 0x10100000L
|
||||
EVP_MD_CTX_cleanup(&u_mdctx);
|
||||
|
||||
EVP_MD_CTX_init(&u_mdctx);
|
||||
|
||||
/**
|
||||
* sets up signing context ctx to use digest type from ENGINE impl.
|
||||
* u_mdctx must be initialized with EVP_MD_CTX_init() before calling this function
|
||||
*/
|
||||
|
||||
EVP_SignInit_ex(&u_mdctx, u_md, impl);
|
||||
#else
|
||||
if (u_mdctx) EVP_MD_CTX_reset(u_mdctx);
|
||||
else u_mdctx = EVP_MD_CTX_new();
|
||||
|
||||
(void) EVP_DigestInit_ex(u_mdctx, u_md, impl);
|
||||
#endif
|
||||
}
|
||||
|
||||
void u_dgst_verify_init(int alg, ENGINE* restrict impl)
|
||||
|
@ -207,16 +221,17 @@ void u_dgst_verify_init(int alg, ENGINE* restrict impl)
|
|||
|
||||
u_dgst_algoritm(alg);
|
||||
|
||||
#if OPENSSL_VERSION_NUMBER < 0x10100000L
|
||||
EVP_MD_CTX_cleanup(&u_mdctx);
|
||||
|
||||
EVP_MD_CTX_init(&u_mdctx);
|
||||
|
||||
/**
|
||||
* sets up signing context ctx to use digest type from ENGINE impl.
|
||||
* u_mdctx must be initialized with EVP_MD_CTX_init() before calling this function
|
||||
*/
|
||||
|
||||
EVP_VerifyInit_ex(&u_mdctx, u_md, impl);
|
||||
#else
|
||||
if (u_mdctx) EVP_MD_CTX_reset(u_mdctx);
|
||||
else u_mdctx = EVP_MD_CTX_new();
|
||||
|
||||
(void) EVP_DigestInit_ex(u_mdctx, u_md, impl);
|
||||
#endif
|
||||
}
|
||||
|
||||
int u_dgst_sign_finish(unsigned char* restrict sig, int base64) /* Finish and get signature */
|
||||
|
@ -225,7 +240,11 @@ int u_dgst_sign_finish(unsigned char* restrict sig, int base64) /* Finish and ge
|
|||
|
||||
U_INTERNAL_ASSERT_POINTER(u_pkey)
|
||||
|
||||
#if OPENSSL_VERSION_NUMBER < 0x10100000L
|
||||
(void) EVP_SignFinal(&u_mdctx, u_mdValue, (unsigned int*)&u_mdLen, u_pkey);
|
||||
#else
|
||||
(void) EVP_SignFinal( u_mdctx, u_mdValue, (unsigned int*)&u_mdLen, u_pkey);
|
||||
#endif
|
||||
|
||||
if (sig) return u_finish(sig, base64);
|
||||
|
||||
|
@ -238,5 +257,9 @@ int u_dgst_verify_finish(unsigned char* restrict sigbuf, uint32_t siglen)
|
|||
|
||||
U_INTERNAL_ASSERT_POINTER(u_pkey)
|
||||
|
||||
#if OPENSSL_VERSION_NUMBER < 0x10100000L
|
||||
return EVP_VerifyFinal(&u_mdctx, sigbuf, siglen, u_pkey);
|
||||
#else
|
||||
return EVP_VerifyFinal( u_mdctx, sigbuf, siglen, u_pkey);
|
||||
#endif
|
||||
}
|
||||
|
|
|
@ -378,8 +378,27 @@ FORCE_INLINE U32 XXH32_endian_align(const void* input, size_t len, U32 seed, XXH
|
|||
return h32;
|
||||
}
|
||||
|
||||
#ifdef __GNUC__
|
||||
# define GCC_VERSION_NUM (__GNUC__ * 10000 + \
|
||||
__GNUC_MINOR__ * 100 + \
|
||||
__GNUC_PATCHLEVEL__)
|
||||
# if GCC_VERSION_NUM > 29600 && GCC_VERSION_NUM != 30303 /* Test for GCC == 3.3.3 (SuSE Linux) */
|
||||
# if defined(LINUX) || defined(__LINUX__) || defined(__linux__) || defined(__linux)
|
||||
# define U_LINUX
|
||||
# elif defined(_MSC_VER) || defined(WIN32) || defined(_WIN32)
|
||||
# define _MSWINDOWS_
|
||||
# endif
|
||||
# if defined(U_LINUX) || defined(_MSWINDOWS_)
|
||||
# define __pure __attribute__((pure))
|
||||
# endif
|
||||
# else
|
||||
# define __pure
|
||||
# endif
|
||||
#else
|
||||
# define __pure
|
||||
#endif /* __GNUC__ */
|
||||
|
||||
XXH_PUBLIC_API unsigned int XXH32 (const void* input, size_t len, unsigned int seed)
|
||||
XXH_PUBLIC_API __pure unsigned int XXH32 (const void* input, size_t len, unsigned int seed)
|
||||
{
|
||||
#if 0
|
||||
/* Simple version, good for code maintenance, but unfortunately slow for small inputs */
|
||||
|
@ -519,7 +538,7 @@ FORCE_INLINE U64 XXH64_endian_align(const void* input, size_t len, U64 seed, XXH
|
|||
}
|
||||
|
||||
|
||||
XXH_PUBLIC_API unsigned long long XXH64 (const void* input, size_t len, unsigned long long seed)
|
||||
XXH_PUBLIC_API __pure unsigned long long XXH64 (const void* input, size_t len, unsigned long long seed)
|
||||
{
|
||||
#if 0
|
||||
/* Simple version, good for code maintenance, but unfortunately slow for small inputs */
|
||||
|
@ -771,7 +790,7 @@ FORCE_INLINE U32 XXH32_digest_endian (const XXH32_state_t* state, XXH_endianess
|
|||
}
|
||||
|
||||
|
||||
XXH_PUBLIC_API unsigned int XXH32_digest (const XXH32_state_t* state_in)
|
||||
XXH_PUBLIC_API __pure unsigned int XXH32_digest (const XXH32_state_t* state_in)
|
||||
{
|
||||
XXH_endianess endian_detected = (XXH_endianess)XXH_CPU_LITTLE_ENDIAN;
|
||||
|
||||
|
@ -966,7 +985,7 @@ FORCE_INLINE U64 XXH64_digest_endian (const XXH64_state_t* state, XXH_endianess
|
|||
}
|
||||
|
||||
|
||||
XXH_PUBLIC_API unsigned long long XXH64_digest (const XXH64_state_t* state_in)
|
||||
XXH_PUBLIC_API __pure unsigned long long XXH64_digest (const XXH64_state_t* state_in)
|
||||
{
|
||||
XXH_endianess endian_detected = (XXH_endianess)XXH_CPU_LITTLE_ENDIAN;
|
||||
|
||||
|
@ -1001,12 +1020,12 @@ XXH_PUBLIC_API void XXH64_canonicalFromHash(XXH64_canonical_t* dst, XXH64_hash_t
|
|||
(void) memcpy(dst, &hash, sizeof(*dst));
|
||||
}
|
||||
|
||||
XXH_PUBLIC_API XXH32_hash_t XXH32_hashFromCanonical(const XXH32_canonical_t* src)
|
||||
XXH_PUBLIC_API __pure XXH32_hash_t XXH32_hashFromCanonical(const XXH32_canonical_t* src)
|
||||
{
|
||||
return XXH_readBE32(src);
|
||||
}
|
||||
|
||||
XXH_PUBLIC_API XXH64_hash_t XXH64_hashFromCanonical(const XXH64_canonical_t* src)
|
||||
XXH_PUBLIC_API __pure XXH64_hash_t XXH64_hashFromCanonical(const XXH64_canonical_t* src)
|
||||
{
|
||||
return XXH_readBE64(src);
|
||||
}
|
||||
|
|
|
@ -150,6 +150,7 @@ void UTrace::trace_syscall(const char* format, uint32_t fmt_size, ...)
|
|||
|
||||
U_INTERNAL_PRINT("buffer_syscall=%s", buffer_syscall)
|
||||
|
||||
/*
|
||||
if (active[0])
|
||||
{
|
||||
flag_syscall_read_or_write[0] = (strncmp(format, U_CONSTANT_TO_PARAM("::read(")) == 0 ||
|
||||
|
@ -164,6 +165,7 @@ void UTrace::trace_syscall(const char* format, uint32_t fmt_size, ...)
|
|||
time_syscall_read_or_write->start();
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
#ifdef _MSWINDOWS_
|
||||
SetLastError(0);
|
||||
|
@ -254,6 +256,7 @@ void UTrace::trace_sysreturn(bool error, const char* format, uint32_t fmt_size,
|
|||
|
||||
if (active[0])
|
||||
{
|
||||
/*
|
||||
if (error == false &&
|
||||
flag_syscall_read_or_write[0])
|
||||
{
|
||||
|
@ -283,6 +286,7 @@ void UTrace::trace_sysreturn(bool error, const char* format, uint32_t fmt_size,
|
|||
}
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
struct iovec iov[3] = { { (caddr_t)u_trace_tab, u_trace_num_tab },
|
||||
{ (caddr_t)buffer_syscall, buffer_syscall_len },
|
||||
|
|
|
@ -44,7 +44,7 @@ U_EXPORT void operator delete[](void* p, long unsigned int) { free(p); }
|
|||
# endif
|
||||
#endif
|
||||
|
||||
#ifdef USE_LIBSSL
|
||||
#if defined(USE_LIBSSL) && OPENSSL_VERSION_NUMBER < 0x10100000L
|
||||
# include <openssl/ssl.h>
|
||||
# include <openssl/rand.h>
|
||||
# include <openssl/conf.h>
|
||||
|
@ -227,7 +227,7 @@ void ULib_init()
|
|||
|
||||
UString::str_allocate(0);
|
||||
|
||||
#ifdef USE_LIBSSL
|
||||
#if defined(USE_LIBSSL) && OPENSSL_VERSION_NUMBER < 0x10100000L
|
||||
ULib_init_openssl();
|
||||
#endif
|
||||
|
||||
|
|
|
@ -484,7 +484,6 @@ static void yy_destructor(
|
|||
YYCODETYPE yymajor, /* Type code for object to destroy */
|
||||
YYMINORTYPE *yypminor /* The object to be destroyed */
|
||||
){
|
||||
expressionParserARG_FETCH;
|
||||
switch( yymajor ){
|
||||
/* Here is inserted the actions which take place when a
|
||||
** terminal or non-terminal is destroyed. This can happen
|
||||
|
@ -599,7 +598,7 @@ int expressionParserStackPeak(void *p){
|
|||
** Find the appropriate action for a parser given the terminal
|
||||
** look-ahead token iLookAhead.
|
||||
*/
|
||||
static int yy_find_shift_action(
|
||||
__pure static int yy_find_shift_action(
|
||||
yyParser *pParser, /* The parser */
|
||||
YYCODETYPE iLookAhead /* The look-ahead token */
|
||||
){
|
||||
|
@ -665,7 +664,7 @@ static int yy_find_shift_action(
|
|||
** Find the appropriate action for a parser given the non-terminal
|
||||
** look-ahead token iLookAhead.
|
||||
*/
|
||||
static int yy_find_reduce_action(
|
||||
__pure static int yy_find_reduce_action(
|
||||
int stateno, /* Current state number */
|
||||
YYCODETYPE iLookAhead /* The look-ahead token */
|
||||
){
|
||||
|
@ -1459,7 +1458,6 @@ static void yy_reduce(
|
|||
break;
|
||||
/********** End reduce actions ************************************************/
|
||||
};
|
||||
assert( yyruleno>=0 && yyruleno<sizeof(yyRuleInfo)/sizeof(yyRuleInfo[0]) );
|
||||
yygoto = yyRuleInfo[yyruleno].lhs;
|
||||
yysize = yyRuleInfo[yyruleno].nrhs;
|
||||
yypParser->yyidx -= yysize;
|
||||
|
|
|
@ -471,12 +471,14 @@ int UHttpPlugIn::handlerInit()
|
|||
{
|
||||
U_INTERNAL_DUMP("OPENSSL_VERSION_NUMBER = %ld", OPENSSL_VERSION_NUMBER)
|
||||
|
||||
# if OPENSSL_VERSION_NUMBER < 0x10100000L
|
||||
if (U_SYSCALL_NO_PARAM(SSLeay) < OPENSSL_VERSION_NUMBER)
|
||||
{
|
||||
U_ERROR("SSL: this version of mod_http was compiled against a newer library (%s, "
|
||||
"version currently loaded is %s) - may result in undefined or erroneous behavior",
|
||||
OPENSSL_VERSION_TEXT, SSLeay_version(SSLEAY_VERSION));
|
||||
}
|
||||
# endif
|
||||
|
||||
/**
|
||||
* #ifdef OPENSSL_FIPS
|
||||
|
|
|
@ -380,8 +380,13 @@ if (USP_JFIND_REQUEST("type", type))
|
|||
}
|
||||
else if (type.equal(U_CONSTANT_TO_PARAM("cells")))
|
||||
{
|
||||
BusinessCell* pcell;
|
||||
ResponseCells response;
|
||||
|
||||
U_NEW(BusinessCell, pcell, BusinessCell);
|
||||
|
||||
response.businesses.push_back(pcell);
|
||||
|
||||
USP_JSON_OBJ_stringify(ResponseCells, response);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -31,7 +31,7 @@ static void usp_fork_db()
|
|||
pstmt_db->into(pworld_db->randomNumber);
|
||||
|
||||
# ifndef AS_cpoll_cppsp_DO
|
||||
U_NEW(UValue, pvalue, UValue(OBJECT_VALUE));
|
||||
U_NEW(UValue, pvalue, UValue);
|
||||
# endif
|
||||
}
|
||||
}
|
||||
|
|
|
@ -30,7 +30,7 @@ static void usp_fork_edb()
|
|||
U_MEMCPY(buffer, "{\"query\":{\"match\":{\"_id\":\"", QLEN);
|
||||
|
||||
#ifndef AS_cpoll_cppsp_DO
|
||||
U_NEW(UValue, pvalue, UValue(OBJECT_VALUE));
|
||||
U_NEW(UValue, pvalue, UValue);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
|
@ -31,7 +31,7 @@ static void usp_fork_equery()
|
|||
U_MEMCPY(buffer, "{\"query\":{\"match\":{\"_id\":\"", QLEN);
|
||||
|
||||
#ifndef AS_cpoll_cppsp_DO
|
||||
U_NEW(UValue, pvalue, UValue(ARRAY_VALUE));
|
||||
U_NEW(UValue, pvalue, UValue);
|
||||
U_NEW(UVector<World*>, pvworld_query, UVector<World*>(500));
|
||||
#endif
|
||||
}
|
||||
|
|
|
@ -41,7 +41,7 @@ static void usp_fork_eupdate()
|
|||
pbuffer2 = buffer2 + QLEN;
|
||||
|
||||
#ifndef AS_cpoll_cppsp_DO
|
||||
U_NEW(UValue, pvalue, UValue(ARRAY_VALUE));
|
||||
U_NEW(UValue, pvalue, UValue);
|
||||
U_NEW(UVector<World*>, pvworld_update, UVector<World*>(500));
|
||||
#endif
|
||||
}
|
||||
|
|
|
@ -32,7 +32,7 @@ static void usp_fork_mdb()
|
|||
}
|
||||
|
||||
#ifndef AS_cpoll_cppsp_DO
|
||||
U_NEW(UValue, pvalue, UValue(OBJECT_VALUE));
|
||||
U_NEW(UValue, pvalue, UValue);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
|
@ -33,7 +33,7 @@ static void usp_fork_mquery()
|
|||
}
|
||||
|
||||
#ifndef AS_cpoll_cppsp_DO
|
||||
U_NEW(UValue, pvalue, UValue(ARRAY_VALUE));
|
||||
U_NEW(UValue, pvalue, UValue);
|
||||
U_NEW(UVector<World*>, pvworld_query, UVector<World*>(500));
|
||||
#endif
|
||||
}
|
||||
|
|
|
@ -33,7 +33,7 @@ static void usp_fork_mupdate()
|
|||
}
|
||||
|
||||
#ifndef AS_cpoll_cppsp_DO
|
||||
U_NEW(UValue, pvalue, UValue(ARRAY_VALUE));
|
||||
U_NEW(UValue, pvalue, UValue);
|
||||
U_NEW(UVector<World*>, pvworld_update, UVector<World*>(500));
|
||||
#endif
|
||||
}
|
||||
|
|
|
@ -34,7 +34,7 @@ static void usp_fork_query()
|
|||
pstmt_query->into(pworld_query->randomNumber);
|
||||
|
||||
# ifndef AS_cpoll_cppsp_DO
|
||||
U_NEW(UValue, pvalue, UValue(ARRAY_VALUE));
|
||||
U_NEW(UValue, pvalue, UValue);
|
||||
U_NEW(UVector<World*>, pvworld_query, UVector<World*>(500));
|
||||
# endif
|
||||
}
|
||||
|
|
|
@ -28,7 +28,7 @@ static void usp_fork_rdb()
|
|||
U_MEMCPY(buffer, "world:", U_CONSTANT_SIZE("world:"));
|
||||
|
||||
#ifndef AS_cpoll_cppsp_DO
|
||||
U_NEW(UValue, pvalue, UValue(OBJECT_VALUE));
|
||||
U_NEW(UValue, pvalue, UValue);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
|
@ -29,7 +29,7 @@ static void usp_fork_rquery()
|
|||
U_NEW(UVector<World*>, pvworld_query, UVector<World*>(500));
|
||||
|
||||
#ifndef AS_cpoll_cppsp_DO
|
||||
U_NEW(UValue, pvalue, UValue(ARRAY_VALUE));
|
||||
U_NEW(UValue, pvalue, UValue);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
|
@ -29,7 +29,7 @@ static void usp_fork_rupdate()
|
|||
U_NEW(UVector<World*>, pvworld, UVector<World*>(500));
|
||||
|
||||
#ifndef AS_cpoll_cppsp_DO
|
||||
U_NEW(UValue, pvalue, UValue(ARRAY_VALUE));
|
||||
U_NEW(UValue, pvalue, UValue);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
|
@ -41,7 +41,7 @@ static void usp_fork_update()
|
|||
pstmt2->use( pworld_update->randomNumber, pworld_update->id);
|
||||
|
||||
# ifndef AS_cpoll_cppsp_DO
|
||||
U_NEW(UValue, pvalue, UValue(ARRAY_VALUE));
|
||||
U_NEW(UValue, pvalue, UValue);
|
||||
U_NEW(UVector<World*>, pvworld_update, UVector<World*>(500));
|
||||
# endif
|
||||
}
|
||||
|
|
|
@ -27,6 +27,10 @@
|
|||
|
||||
#include <openssl/pem.h>
|
||||
|
||||
#if OPENSSL_VERSION_NUMBER >= 0x10100000L
|
||||
# define ASN1_STRING_data ASN1_STRING_get0_data
|
||||
#endif
|
||||
|
||||
bool UCertificate::verify_result;
|
||||
X509_STORE_CTX* UCertificate::csc;
|
||||
UVector<UCertificate*>* UCertificate::vcert;
|
||||
|
@ -174,27 +178,6 @@ bool UCertificate::isSameIssuerAndSubject() const
|
|||
U_RETURN(false);
|
||||
}
|
||||
|
||||
UString UCertificate::getSignable(X509* _x509)
|
||||
{
|
||||
U_TRACE(1, "UCertificate::getSignable(%p)", _x509)
|
||||
|
||||
U_INTERNAL_ASSERT_POINTER(_x509)
|
||||
|
||||
unsigned len = U_SYSCALL(i2d_X509_CINF, "%p,%p", _x509->cert_info, 0);
|
||||
|
||||
UString signable(len);
|
||||
|
||||
unsigned char* data = (unsigned char*) signable.data();
|
||||
|
||||
(void) U_SYSCALL(i2d_X509_CINF, "%p,%p", _x509->cert_info, &data);
|
||||
|
||||
// len = u__strlen(data, __PRETTY_FUNCTION__);
|
||||
|
||||
signable.size_adjust(len);
|
||||
|
||||
U_RETURN_STRING(signable);
|
||||
}
|
||||
|
||||
UString UCertificate::checkForSerialNumber(long number)
|
||||
{
|
||||
U_TRACE(1, "UCertificate::checkForSerialNumber(%ld)", number)
|
||||
|
@ -315,48 +298,6 @@ unsigned UCertificate::getSignerCertificates(UVector<UCertificate*>& vec, STACK_
|
|||
U_RETURN(result);
|
||||
}
|
||||
|
||||
// Gets X509v3 extensions as array of X509Ext objects
|
||||
|
||||
int UCertificate::getExtensions(UHashMap<UString>& table) const
|
||||
{
|
||||
U_TRACE(1, "UCertificate::getExtensions(%p)", &table)
|
||||
|
||||
U_INTERNAL_ASSERT_POINTER(x509)
|
||||
|
||||
int count = U_SYSCALL(X509_get_ext_count, "%p", x509);
|
||||
|
||||
if (count > 0)
|
||||
{
|
||||
UString key, str;
|
||||
char buffer[4096];
|
||||
|
||||
BIO* out = (BIO*) U_SYSCALL(BIO_new, "%p", BIO_s_mem());
|
||||
|
||||
for (int i = 0; i < count; ++i)
|
||||
{
|
||||
X509_EXTENSION* ext = X509_get_ext(x509, i); /* NO DUP - don't free! */
|
||||
|
||||
U_INTERNAL_ASSERT_POINTER(ext)
|
||||
|
||||
key.assign(OBJ_nid2ln(OBJ_obj2nid(ext->object)));
|
||||
|
||||
if (!X509V3_EXT_print(out, ext, 0, 0)) M_ASN1_OCTET_STRING_print(out, ext->value);
|
||||
|
||||
int len = BIO_read(out, buffer, sizeof(buffer));
|
||||
|
||||
(void) str.replace(buffer, len);
|
||||
|
||||
U_INTERNAL_DUMP("ext[%d] = <%V,%V>", i, key.rep, str.rep)
|
||||
|
||||
table.insert(key, str);
|
||||
}
|
||||
|
||||
(void) U_SYSCALL(BIO_free, "%p", out);
|
||||
}
|
||||
|
||||
U_RETURN(count);
|
||||
}
|
||||
|
||||
U_NO_EXPORT UString UCertificate::getRevocationURI(const void* gens)
|
||||
{
|
||||
U_TRACE(0, "UCertificate::getRevocationURI(%p)", gens)
|
||||
|
@ -636,12 +577,22 @@ UString UCertificate::getModulus() const
|
|||
|
||||
U_INTERNAL_ASSERT_POINTER(x509)
|
||||
|
||||
UString result;
|
||||
const BIGNUM* bn;
|
||||
char buffer[4096];
|
||||
|
||||
EVP_PKEY* pkey = getSubjectPublicKey();
|
||||
|
||||
BIGNUM* bn = (pkey->type == EVP_PKEY_RSA ? pkey->pkey.rsa->n
|
||||
: pkey->pkey.dsa->pub_key); // EVP_PKEY_DSA
|
||||
#if OPENSSL_VERSION_NUMBER < 0x10100000L
|
||||
bn = (pkey->type == EVP_PKEY_RSA ? pkey->pkey.rsa->n
|
||||
: pkey->pkey.dsa->pub_key); // EVP_PKEY_DSA
|
||||
#else
|
||||
RSA* rsa = EVP_PKEY_get1_RSA(pkey);
|
||||
|
||||
RSA_get0_key(rsa, &bn, 0, 0);
|
||||
|
||||
RSA_free(rsa);
|
||||
#endif
|
||||
|
||||
int len = U_SYSCALL(BN_bn2bin, "%p,%p", bn, (unsigned char*)buffer);
|
||||
|
||||
|
@ -651,12 +602,12 @@ UString UCertificate::getModulus() const
|
|||
|
||||
UBase64::encode(buffer, len, x);
|
||||
|
||||
U_SYSCALL_VOID(EVP_PKEY_free, "%p", pkey);
|
||||
|
||||
U_RETURN_STRING(x);
|
||||
result = x;
|
||||
}
|
||||
|
||||
return UString::getStringNull();
|
||||
U_SYSCALL_VOID(EVP_PKEY_free, "%p", pkey);
|
||||
|
||||
U_RETURN_STRING(result);
|
||||
}
|
||||
|
||||
UString UCertificate::getExponent() const
|
||||
|
@ -665,12 +616,22 @@ UString UCertificate::getExponent() const
|
|||
|
||||
U_INTERNAL_ASSERT_POINTER(x509)
|
||||
|
||||
UString result;
|
||||
char buffer[16];
|
||||
const BIGNUM* bn;
|
||||
|
||||
EVP_PKEY* pkey = getSubjectPublicKey();
|
||||
|
||||
BIGNUM* bn = (pkey->type == EVP_PKEY_RSA ? pkey->pkey.rsa->e
|
||||
: pkey->pkey.dsa->pub_key); // EVP_PKEY_DSA
|
||||
#if OPENSSL_VERSION_NUMBER < 0x10100000L
|
||||
bn = (pkey->type == EVP_PKEY_RSA ? pkey->pkey.rsa->e
|
||||
: pkey->pkey.dsa->pub_key); // EVP_PKEY_DSA
|
||||
#else
|
||||
RSA* rsa = EVP_PKEY_get1_RSA(pkey);
|
||||
|
||||
RSA_get0_key(rsa, 0, &bn, 0);
|
||||
|
||||
RSA_free(rsa);
|
||||
#endif
|
||||
|
||||
int len = U_SYSCALL(BN_bn2bin, "%p,%p", bn, (unsigned char*)buffer);
|
||||
|
||||
|
@ -680,12 +641,12 @@ UString UCertificate::getExponent() const
|
|||
|
||||
UBase64::encode(buffer, len, x);
|
||||
|
||||
U_SYSCALL_VOID(EVP_PKEY_free, "%p", pkey);
|
||||
|
||||
U_RETURN_STRING(x);
|
||||
result = x;
|
||||
}
|
||||
|
||||
return UString::getStringNull();
|
||||
U_SYSCALL_VOID(EVP_PKEY_free, "%p", pkey);
|
||||
|
||||
U_RETURN_STRING(result);
|
||||
}
|
||||
|
||||
UString UCertificate::getFileName(long hash, bool crl, bool* exist)
|
||||
|
|
|
@ -131,7 +131,12 @@ unsigned UCrl::getRevokedSerials(X509_CRL* _crl, long* revoked, unsigned sz)
|
|||
{
|
||||
if (i >= sz) break;
|
||||
|
||||
revoked[i++] = ASN1_INTEGER_get(rev->serialNumber);
|
||||
revoked[i++] =
|
||||
# if OPENSSL_VERSION_NUMBER < 0x10100000L
|
||||
ASN1_INTEGER_get(rev->serialNumber);
|
||||
# else
|
||||
(long) X509_REVOKED_get0_serialNumber(rev);
|
||||
# endif
|
||||
}
|
||||
|
||||
X509_REVOKED_free(rev);
|
||||
|
@ -223,7 +228,7 @@ time_t UCrl::getIssueTime(X509_CRL* _crl)
|
|||
|
||||
U_INTERNAL_ASSERT_POINTER(_crl)
|
||||
|
||||
ASN1_UTCTIME* utctime = X509_CRL_get_lastUpdate(_crl);
|
||||
const ASN1_UTCTIME* utctime = X509_CRL_get_lastUpdate(_crl);
|
||||
|
||||
time_t result = UTimeDate::getSecondFromTime((const char*)utctime->data, true, "%2u%2u%2u%2u%2u%2uZ"); // 100212124550Z
|
||||
|
||||
|
|
|
@ -79,14 +79,20 @@ int USSLSession::newSession(SSL* ssl, SSL_SESSION* _sess)
|
|||
/*
|
||||
#ifdef DEBUG
|
||||
static FILE* fp = (FILE*) U_SYSCALL(fopen, "%S,%S", "/tmp/ssl_session.new", "a");
|
||||
|
||||
if (fp) (void) U_SYSCALL(SSL_SESSION_print_fp, "%p,%p", fp, _sess);
|
||||
#endif
|
||||
*/
|
||||
|
||||
sess = _sess;
|
||||
|
||||
#if OPENSSL_VERSION_NUMBER < 0x10100000L
|
||||
UHTTP::db_session_ssl->insertDataStorage((const char*)sess->session_id, sess->session_id_length);
|
||||
#else
|
||||
unsigned int idlen;
|
||||
const unsigned char* id = (const unsigned char*) U_SYSCALL(SSL_SESSION_get_id, "", sess, &idlen);
|
||||
|
||||
UHTTP::db_session_ssl->insertDataStorage((const char*)id, idlen);
|
||||
#endif
|
||||
|
||||
U_RETURN(0);
|
||||
}
|
||||
|
@ -103,7 +109,6 @@ SSL_SESSION* USSLSession::getSession(SSL* ssl, unsigned char* id, int len, int*
|
|||
/*
|
||||
#ifdef DEBUG
|
||||
static FILE* fp = (FILE*) U_SYSCALL(fopen, "%S,%S", "/tmp/ssl_session.get", "a");
|
||||
|
||||
if (fp) (void) U_SYSCALL(SSL_SESSION_print_fp, "%p,%p", fp, sess);
|
||||
#endif
|
||||
*/
|
||||
|
@ -118,14 +123,22 @@ void USSLSession::removeSession(SSL_CTX* ctx, SSL_SESSION* _sess)
|
|||
/*
|
||||
#ifdef DEBUG
|
||||
static FILE* fp = (FILE*) U_SYSCALL(fopen, "%S,%S", "/tmp/ssl_session.del", "a");
|
||||
|
||||
if (fp) (void) U_SYSCALL(SSL_SESSION_print_fp, "%p,%p", fp, _sess);
|
||||
#endif
|
||||
*/
|
||||
|
||||
U_INTERNAL_ASSERT_POINTER(UHTTP::db_session_ssl)
|
||||
|
||||
int result = UHTTP::db_session_ssl->remove((const char*)_sess->session_id, (uint32_t)_sess->session_id_length);
|
||||
int result;
|
||||
|
||||
#if OPENSSL_VERSION_NUMBER < 0x10100000L
|
||||
result = UHTTP::db_session_ssl->remove((const char*)_sess->session_id, (uint32_t)_sess->session_id_length);
|
||||
#else
|
||||
unsigned int idlen;
|
||||
const unsigned char* id = (const unsigned char*) U_SYSCALL(SSL_SESSION_get_id, "", sess, &idlen);
|
||||
|
||||
result = UHTTP::db_session_ssl->remove((const char*)id, (uint32_t)idlen);
|
||||
#endif
|
||||
|
||||
// -2: The entry was already marked deleted in the hash-tree
|
||||
|
||||
|
|
|
@ -86,7 +86,13 @@ USSLSocket::USSLSocket(bool bSocketIsIPv6, SSL_CTX* _ctx, bool bserver) : USocke
|
|||
U_INTERNAL_ASSERT_POINTER(ctx)
|
||||
}
|
||||
|
||||
ctx->references++; // We don't want our destructor to delete ctx if still in use...
|
||||
// We don't want our destructor to delete ctx if still in use...
|
||||
|
||||
#if OPENSSL_VERSION_NUMBER < 0x10100000L
|
||||
ctx->references++;
|
||||
#else
|
||||
SSL_CTX_up_ref(ctx);
|
||||
#endif
|
||||
|
||||
ssl = 0;
|
||||
ret = renegotiations = 0;
|
||||
|
@ -127,7 +133,9 @@ void USSLSocket::info_callback(const SSL* ssl, int where, int ret)
|
|||
{
|
||||
U_INTERNAL_DUMP("SSL_CB_HANDSHAKE_DONE")
|
||||
|
||||
# if OPENSSL_VERSION_NUMBER < 0x10100000L
|
||||
if (ssl->s3) ssl->s3->flags |= SSL3_FLAGS_NO_RENEGOTIATE_CIPHERS;
|
||||
# endif
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -492,7 +500,7 @@ bool USSLSocket::setContext(const char* dh_file, const char* cert_file, const ch
|
|||
// These are the bit DH parameters from "Assigned Number for SKIP Protocols"
|
||||
// See there for how they were generated: http://www.skip-vpn.org/spec/numbers.html
|
||||
|
||||
#if OPENSSL_VERSION_NUMBER >= 0x10002000L
|
||||
#if OPENSSL_VERSION_NUMBER >= 0x10002000L && OPENSSL_VERSION_NUMBER < 0x10100000L
|
||||
SSL_CTX_set_ecdh_auto(ctx, 1);
|
||||
#else
|
||||
if (useDHFile(dh_file) == false) U_RETURN(false);
|
||||
|
@ -898,7 +906,9 @@ bool USSLSocket::askForClientCertificate()
|
|||
U_RETURN(false);
|
||||
}
|
||||
|
||||
#if OPENSSL_VERSION_NUMBER < 0x10100000L
|
||||
ssl->state = SSL_ST_ACCEPT;
|
||||
#endif
|
||||
|
||||
ret = U_SYSCALL(SSL_do_handshake, "%p", ssl);
|
||||
|
||||
|
@ -1235,7 +1245,9 @@ bool USSLSocket::setDataForStapling()
|
|||
|
||||
if (U_SYSCALL(X509_check_issued, "%p,%p", staple.issuer, staple.cert) == X509_V_OK)
|
||||
{
|
||||
# if OPENSSL_VERSION_NUMBER < 0x10100000L
|
||||
CRYPTO_add(&(staple.issuer->references), 1, CRYPTO_LOCK_X509);
|
||||
# endif
|
||||
|
||||
goto next;
|
||||
}
|
||||
|
|
|
@ -75,27 +75,6 @@ UString UPKCS10::getSubject(X509_REQ* _request)
|
|||
U_RETURN_STRING(subject);
|
||||
}
|
||||
|
||||
UString UPKCS10::getSignable(X509_REQ* _request)
|
||||
{
|
||||
U_TRACE(1, "UPKCS10::getSignable(%p)", _request)
|
||||
|
||||
U_INTERNAL_ASSERT_POINTER(_request)
|
||||
|
||||
unsigned len = U_SYSCALL(i2d_X509_REQ_INFO, "%p,%p", _request->req_info, 0);
|
||||
|
||||
UString signable(len);
|
||||
|
||||
unsigned char* data = (unsigned char*) signable.data();
|
||||
|
||||
(void) U_SYSCALL(i2d_X509_REQ_INFO, "%p,%p", _request->req_info, &data);
|
||||
|
||||
// len = u__strlen(data, __PRETTY_FUNCTION__);
|
||||
|
||||
signable.size_adjust(len);
|
||||
|
||||
U_RETURN_STRING(signable);
|
||||
}
|
||||
|
||||
UString UPKCS10::getEncoded(const char* format) const
|
||||
{
|
||||
U_TRACE(0, "UPKCS10::getEncoded(%S)", format)
|
||||
|
|
|
@ -540,7 +540,9 @@ ENGINE* UServices::loadEngine(const char* id, unsigned int flags)
|
|||
{
|
||||
U_TRACE(1, "UServices::loadEngine(%S,%u)", id, flags)
|
||||
|
||||
#if OPENSSL_VERSION_NUMBER < 0x10100000L
|
||||
U_SYSCALL_VOID_NO_PARAM(ENGINE_load_dynamic);
|
||||
#endif
|
||||
|
||||
ENGINE* e = (ENGINE*) U_SYSCALL(ENGINE_by_id, "%S", id);
|
||||
|
||||
|
@ -553,7 +555,7 @@ ENGINE* UServices::loadEngine(const char* id, unsigned int flags)
|
|||
e = 0;
|
||||
}
|
||||
|
||||
U_RETURN_POINTER(e,ENGINE);
|
||||
U_RETURN_POINTER(e, ENGINE);
|
||||
}
|
||||
|
||||
void UServices::releaseEngine(ENGINE* e, bool bkey)
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -12,7 +12,7 @@ SUBDIRS1 += debug
|
|||
endif
|
||||
SUBDIRS = $(SUBDIRS1) ulib
|
||||
if ENABLE_EXAMPLES
|
||||
SUBDIRS += examples contrib
|
||||
SUBDIRS += examples
|
||||
endif
|
||||
|
||||
DIST_SUBDIRS = base debug ulib examples contrib
|
||||
|
|
|
@ -89,7 +89,7 @@ build_triplet = @build@
|
|||
host_triplet = @host@
|
||||
target_triplet = @target@
|
||||
@DEBUG_TRUE@am__append_1 = debug
|
||||
@ENABLE_EXAMPLES_TRUE@am__append_2 = examples contrib
|
||||
@ENABLE_EXAMPLES_TRUE@am__append_2 = examples
|
||||
subdir = tests
|
||||
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
||||
am__aclocal_m4_deps = $(top_srcdir)/m4/ac_check_package.m4 \
|
||||
|
|
|
@ -31,7 +31,7 @@ static void usp_fork_db()
|
|||
pstmt_db->into(pworld_db->randomNumber);
|
||||
|
||||
# ifndef AS_cpoll_cppsp_DO
|
||||
U_NEW(UValue, pvalue, UValue(OBJECT_VALUE));
|
||||
U_NEW(UValue, pvalue, UValue);
|
||||
# endif
|
||||
}
|
||||
}
|
||||
|
|
|
@ -30,7 +30,7 @@ static void usp_fork_edb()
|
|||
U_MEMCPY(buffer, "{\"query\":{\"match\":{\"_id\":\"", QLEN);
|
||||
|
||||
#ifndef AS_cpoll_cppsp_DO
|
||||
U_NEW(UValue, pvalue, UValue(OBJECT_VALUE));
|
||||
U_NEW(UValue, pvalue, UValue);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
|
@ -31,7 +31,7 @@ static void usp_fork_equery()
|
|||
U_MEMCPY(buffer, "{\"query\":{\"match\":{\"_id\":\"", QLEN);
|
||||
|
||||
#ifndef AS_cpoll_cppsp_DO
|
||||
U_NEW(UValue, pvalue, UValue(ARRAY_VALUE));
|
||||
U_NEW(UValue, pvalue, UValue);
|
||||
U_NEW(UVector<World*>, pvworld_query, UVector<World*>(500));
|
||||
#endif
|
||||
}
|
||||
|
|
|
@ -41,7 +41,7 @@ static void usp_fork_eupdate()
|
|||
pbuffer2 = buffer2 + QLEN;
|
||||
|
||||
#ifndef AS_cpoll_cppsp_DO
|
||||
U_NEW(UValue, pvalue, UValue(ARRAY_VALUE));
|
||||
U_NEW(UValue, pvalue, UValue);
|
||||
U_NEW(UVector<World*>, pvworld_update, UVector<World*>(500));
|
||||
#endif
|
||||
}
|
||||
|
|
|
@ -32,7 +32,7 @@ static void usp_fork_mdb()
|
|||
}
|
||||
|
||||
#ifndef AS_cpoll_cppsp_DO
|
||||
U_NEW(UValue, pvalue, UValue(OBJECT_VALUE));
|
||||
U_NEW(UValue, pvalue, UValue);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
|
@ -33,7 +33,7 @@ static void usp_fork_mquery()
|
|||
}
|
||||
|
||||
#ifndef AS_cpoll_cppsp_DO
|
||||
U_NEW(UValue, pvalue, UValue(ARRAY_VALUE));
|
||||
U_NEW(UValue, pvalue, UValue);
|
||||
U_NEW(UVector<World*>, pvworld_query, UVector<World*>(500));
|
||||
#endif
|
||||
}
|
||||
|
|
|
@ -33,7 +33,7 @@ static void usp_fork_mupdate()
|
|||
}
|
||||
|
||||
#ifndef AS_cpoll_cppsp_DO
|
||||
U_NEW(UValue, pvalue, UValue(ARRAY_VALUE));
|
||||
U_NEW(UValue, pvalue, UValue);
|
||||
U_NEW(UVector<World*>, pvworld_update, UVector<World*>(500));
|
||||
#endif
|
||||
}
|
||||
|
|
|
@ -34,7 +34,7 @@ static void usp_fork_query()
|
|||
pstmt_query->into(pworld_query->randomNumber);
|
||||
|
||||
# ifndef AS_cpoll_cppsp_DO
|
||||
U_NEW(UValue, pvalue, UValue(ARRAY_VALUE));
|
||||
U_NEW(UValue, pvalue, UValue);
|
||||
U_NEW(UVector<World*>, pvworld_query, UVector<World*>(500));
|
||||
# endif
|
||||
}
|
||||
|
|
|
@ -28,7 +28,7 @@ static void usp_fork_rdb()
|
|||
U_MEMCPY(buffer, "world:", U_CONSTANT_SIZE("world:"));
|
||||
|
||||
#ifndef AS_cpoll_cppsp_DO
|
||||
U_NEW(UValue, pvalue, UValue(OBJECT_VALUE));
|
||||
U_NEW(UValue, pvalue, UValue);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
|
@ -29,7 +29,7 @@ static void usp_fork_rquery()
|
|||
U_NEW(UVector<World*>, pvworld_query, UVector<World*>(500));
|
||||
|
||||
#ifndef AS_cpoll_cppsp_DO
|
||||
U_NEW(UValue, pvalue, UValue(ARRAY_VALUE));
|
||||
U_NEW(UValue, pvalue, UValue);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
|
@ -29,7 +29,7 @@ static void usp_fork_rupdate()
|
|||
U_NEW(UVector<World*>, pvworld, UVector<World*>(500));
|
||||
|
||||
#ifndef AS_cpoll_cppsp_DO
|
||||
U_NEW(UValue, pvalue, UValue(ARRAY_VALUE));
|
||||
U_NEW(UValue, pvalue, UValue);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
|
@ -32,6 +32,8 @@ static void usp_fork_update()
|
|||
U_WARNING("usp_fork_update(): we cound't connect to db");
|
||||
}
|
||||
|
||||
if (UOrmDriver::isPGSQL()) *psql_update << "SET synchronous_commit TO OFF";
|
||||
|
||||
U_NEW(World, pworld_update, World);
|
||||
|
||||
pstmt1->use( pworld_update->id);
|
||||
|
@ -39,7 +41,7 @@ static void usp_fork_update()
|
|||
pstmt2->use( pworld_update->randomNumber, pworld_update->id);
|
||||
|
||||
# ifndef AS_cpoll_cppsp_DO
|
||||
U_NEW(UValue, pvalue, UValue(ARRAY_VALUE));
|
||||
U_NEW(UValue, pvalue, UValue);
|
||||
U_NEW(UVector<World*>, pvworld_update, UVector<World*>(500));
|
||||
# endif
|
||||
}
|
||||
|
|
|
@ -57,7 +57,7 @@ rm -rf $DOC_ROOT/*log \
|
|||
CAPATH="../ulib/CA/CApath"
|
||||
CACERT="../ulib/CA/username.crt"
|
||||
USER_KEY="../ulib/CA/username.key"
|
||||
LCMD="$OPENSSL s_client -no_ssl2 -quiet -cert $CACERT -key $USER_KEY -pass pass:caciucco -CApath $CAPATH -verify 0 -connect localhost:443"
|
||||
LCMD="$OPENSSL s_client -quiet -cert $CACERT -key $USER_KEY -pass pass:caciucco -CApath $CAPATH -connect localhost:443"
|
||||
|
||||
creat_link . $DOC_ROOT/$DOC_ROOT
|
||||
|
||||
|
|
|
@ -22,7 +22,7 @@ rm -rf $DOC_ROOT/*log \
|
|||
CAPATH="../ulib/CA/CApath"
|
||||
CACERT="../ulib/CA/username.crt"
|
||||
USER_KEY="../ulib/CA/username.key"
|
||||
LCMD="$OPENSSL s_client -no_ssl2 -quiet -cert $CACERT -key $USER_KEY -pass pass:caciucco -CApath $CAPATH -verify 0 -connect localhost:443"
|
||||
LCMD="$OPENSSL s_client -quiet -cert $CACERT -key $USER_KEY -pass pass:caciucco -CApath $CAPATH -connect localhost:443"
|
||||
|
||||
creat_link . $DOC_ROOT/$DOC_ROOT
|
||||
|
||||
|
|
|
@ -56,7 +56,7 @@ rm -rf $DOC_ROOT/*log \
|
|||
CAPATH="../ulib/CA/CApath"
|
||||
CACERT="../ulib/CA/username.crt"
|
||||
USER_KEY="../ulib/CA/username.key"
|
||||
LCMD="$OPENSSL s_client -no_ssl2 -quiet -cert $CACERT -key $USER_KEY -pass pass:caciucco -CApath $CAPATH -verify 0 -connect localhost:443"
|
||||
LCMD="$OPENSSL s_client -quiet -cert $CACERT -key $USER_KEY -pass pass:caciucco -CApath $CAPATH -connect localhost:443"
|
||||
|
||||
creat_link . $DOC_ROOT/$DOC_ROOT
|
||||
|
||||
|
|
|
@ -39,7 +39,7 @@ check_for_netcat
|
|||
CAPATH="../ulib/CA/CApath"
|
||||
CACERT="../ulib/CA/username.crt"
|
||||
USER_KEY="../ulib/CA/username.key"
|
||||
LCMD="$OPENSSL s_client -no_ssl2 -quiet -cert $CACERT -key $USER_KEY -pass pass:caciucco -CApath $CAPATH -verify 0 -connect"
|
||||
LCMD="$OPENSSL s_client -quiet -cert $CACERT -key $USER_KEY -pass pass:caciucco -CApath $CAPATH -connect"
|
||||
LCMD1="$LCMD localhost:4443"
|
||||
|
||||
# function : start_test
|
||||
|
|
|
@ -4,8 +4,8 @@ Four Debian releases are available on the main site:
|
|||
Debian 7.11, or wheezy. Access this release through dists/oldstable
|
||||
Debian 7.11 was released Saturday, 4th June 2016.
|
||||
|
||||
Debian 8.5, or jessie. Access this release through dists/stable
|
||||
Debian 8.5 was released Saturday, 4th June 2016.
|
||||
Debian 8.6, or jessie. Access this release through dists/stable
|
||||
Debian 8.6 was released Saturday, 17th September 2016.
|
||||
|
||||
Testing, or stretch. Access this release through dists/testing. The
|
||||
current tested development snapshot is named stretch. Packages which
|
||||
|
|
|
@ -17,9 +17,11 @@ Cache-control:no-cache
|
|||
<HTML>
|
||||
<HEAD><TITLE>chunked</TITLE></HEAD>
|
||||
|
||||
27
|
||||
27; ignore-stuff-here
|
||||
<BODY><H1>chunked</H1></BODY>
|
||||
</HTML>
|
||||
|
||||
0
|
||||
some-footer: some-value
|
||||
another-footer: another-value
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
|
||||
start_msg json
|
||||
|
||||
#UTRACE="0 100M -1"
|
||||
#UTRACE="0 100M 0"
|
||||
#UOBJDUMP="0 100k 10"
|
||||
#USIMERR="error.sim"
|
||||
export UTRACE UOBJDUMP USIMERR
|
||||
|
|
|
@ -49,7 +49,6 @@
|
|||
2
|
||||
1
|
||||
2094012269
|
||||
RSA-SHA1
|
||||
100715153055Z
|
||||
210627153055Z
|
||||
0
|
||||
|
@ -106,7 +105,6 @@ RSA-SHA1
|
|||
2
|
||||
2
|
||||
2747996067
|
||||
RSA-SHA1
|
||||
100715153102Z
|
||||
210627153102Z
|
||||
0
|
||||
|
|
|
@ -39,4 +39,3 @@
|
|||
}
|
||||
/C=IT/ST=Firenze/L=Sesto Fiorentino/O=UniRel S.R.L./OU=TMail Project/CN=Alice/emailAddress=alice@unirel.com
|
||||
0
|
||||
RSA-MD5
|
|
@ -35,6 +35,7 @@ SERVER_KEY="CA/server.key"
|
|||
SERVER_CERT="CA/server.crt"
|
||||
#fi
|
||||
|
||||
#STRACE=$TRUSS
|
||||
start_prg_background ssl_server "$SERVER_CERT" "$SERVER_KEY" "caciucco" "$CACERT" "$CAPATH" 1 ../../src/ulib/net/server/plugin/.libs echo
|
||||
|
||||
$SLEEP
|
||||
|
|
|
@ -26,12 +26,9 @@ static void check(const UString& dati_cert, const UString& dati_ca)
|
|||
<< c.getVersionNumber() << '\n'
|
||||
<< c.getSerialNumber() << '\n'
|
||||
<< c.hashCode() << '\n'
|
||||
<< c.getSignatureAlgorithm()<< '\n'
|
||||
<< c.getNotBefore() << '\n'
|
||||
<< c.getNotAfter() << '\n'
|
||||
<< c.checkValidity() << '\n'
|
||||
// << c.getSignature() << '\n'
|
||||
// << c.getSignable() << '\n'
|
||||
<< vec1 << '\n'
|
||||
<< vec2 << '\n';
|
||||
|
||||
|
|
|
@ -21,7 +21,6 @@ static void check(const UString& dati_crl, const UString& dati_ca)
|
|||
<< c.getVersionNumber() << "\n"
|
||||
<< c.getLastUpdate() << "\n"
|
||||
// << c.getRevokedSerials(revoked, 10) << "\n"
|
||||
// << c.getSignature() << "\n"
|
||||
<< c.getNextUpdate();
|
||||
|
||||
UString encoded = c.getEncoded("PEM");
|
||||
|
|
|
@ -104,8 +104,8 @@ static void testVector()
|
|||
U_TRACE(5, "testVector()")
|
||||
|
||||
bool ok;
|
||||
UValue json_vec;
|
||||
UVector<UString> y;
|
||||
UValue json_vec(ARRAY_VALUE);
|
||||
UString result, vecJson = U_STRING_FROM_CONSTANT("[\"riga 1\",\"riga 2\",\"riga 3\",\"riga 4\"]");
|
||||
|
||||
ok = JSON_parse(vecJson, y);
|
||||
|
@ -146,8 +146,8 @@ static void testMap()
|
|||
U_TRACE(5, "testMap()")
|
||||
|
||||
bool ok;
|
||||
UValue json_obj;
|
||||
UHashMap<UString> x;
|
||||
UValue json_obj(OBJECT_VALUE);
|
||||
UString result, mapJson = U_STRING_FROM_CONSTANT("{\"key1\":\"riga 1\",\"key2\":\"riga 2\",\"key3\":\"riga 3\",\"key4\":\"riga 4\"}");
|
||||
|
||||
ok = JSON_parse(mapJson, x);
|
||||
|
@ -189,7 +189,7 @@ static void testObject()
|
|||
|
||||
bool ok;
|
||||
Request request;
|
||||
UValue json_obj(OBJECT_VALUE);
|
||||
UValue json_obj;
|
||||
UString result, reqJson = U_STRING_FROM_CONSTANT("{\"token\":\"A619828KAIJ6D3\",\"type\":\"localesData\",\"radius\":\"near\",\"location\":\"40.7831 N, 73.9712 W\"}");
|
||||
|
||||
ok = JSON_parse(reqJson, request);
|
||||
|
@ -227,7 +227,7 @@ U_EXPORT main (int argc, char* argv[])
|
|||
U_TRACE(5, "main(%d)", argc)
|
||||
|
||||
#if defined(U_STDCPP_ENABLE) && defined(HAVE_CXX11) && defined(U_COMPILER_RANGE_FOR)
|
||||
UValue json_vec(ARRAY_VALUE);
|
||||
UValue json_vec;
|
||||
std::vector<unsigned int> v = {0, 1, 2, 3, 4, 5};
|
||||
UString vecJson = U_STRING_FROM_CONSTANT("[0,1,2,3,4,5]");
|
||||
|
||||
|
|
|
@ -13,12 +13,9 @@ static void check(UString& dati, const char* file)
|
|||
|
||||
UPKCS10 c(dati);
|
||||
|
||||
cout << c << "\n"
|
||||
<< c.getSubject() << "\n"
|
||||
<< c.getVersionNumber() << "\n"
|
||||
// << c.getSignature() << "\n"
|
||||
// << c.getSignable() << "\n"
|
||||
<< c.getSignatureAlgorithm();
|
||||
cout << c << "\n"
|
||||
<< c.getSubject() << "\n"
|
||||
<< c.getVersionNumber() << "\n";
|
||||
|
||||
UString encoded = c.getEncoded("PEM");
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user