merging
authorVolker Birk <vb@pep-project.org>
Tue, 26 Apr 2016 10:49:43 +0200
changeset 548e7acfa461574
parent 547 ebba80433495
parent 540 032fcf6d5940
child 549 110f67d8b660
merging
build-mac/build-libcurl-ios.sh
build-mac/curl/curlbuild32.h
build-mac/curl/curlbuild64.h
build-mac/curl/curlbuild_.h
build-mac/libcurl.a
pEpEngine.vcxproj
pEpEngine.vcxproj.filters
src/blacklist.c
     1.1 --- a/.hgignore	Fri Mar 11 16:06:43 2016 +0100
     1.2 +++ b/.hgignore	Tue Apr 26 10:49:43 2016 +0200
     1.3 @@ -1,11 +1,12 @@
     1.4  syntax: glob
     1.5 +*.orig
     1.6  *.d
     1.7  *.o
     1.8  *~
     1.9  *.swp
    1.10  db/*.csv
    1.11  db/*.db
    1.12 -*.a
    1.13 +#*.a
    1.14  *.so
    1.15  test/pEpEngineTest
    1.16  *.exe
    1.17 @@ -19,5 +20,6 @@
    1.18  build-android/third-party
    1.19  build-android/pEpEngine-android-1
    1.20  
    1.21 +pEpEngine.vcxproj.user
    1.22  syntax: regexp
    1.23  .*xcuserdata/
     2.1 --- a/README.txt	Fri Mar 11 16:06:43 2016 +0100
     2.2 +++ b/README.txt	Tue Apr 26 10:49:43 2016 +0200
     2.3 @@ -71,7 +71,8 @@
     2.4  
     2.5  On Windows, use Visual Studio.
     2.6  
     2.7 -1. How to cross-build
     2.8 +
     2.9 +3. How to cross-build
    2.10  ---------------------
    2.11  
    2.12  For cross-building, BUILD_FOR is being used. I.e.:
    2.13 @@ -79,7 +80,7 @@
    2.14  $ BUILD_FOR=yourOS make -e
    2.15  
    2.16  
    2.17 -2. How to build the databases
    2.18 +4. How to build the databases
    2.19  -----------------------------
    2.20  
    2.21  p≡p Engine uses two databases: ~/.pEp_management (on *NIX) or
    2.22 @@ -100,3 +101,12 @@
    2.23  You can test the Trustwords in system.db using db/trustwords.py
    2.24  Both Python tools have a switch --help
    2.25  
    2.26 +
    2.27 +5. How to run the tests
    2.28 +-----------------------
    2.29 +
    2.30 +You have to import all the test keys into your local gpg instance:
    2.31 +
    2.32 +	cd test
    2.33 +	cat *.asc | gpg --import
    2.34 +
     3.1 --- a/build-android/jni/Android.mk	Fri Mar 11 16:06:43 2016 +0100
     3.2 +++ b/build-android/jni/Android.mk	Tue Apr 26 10:49:43 2016 +0200
     3.3 @@ -31,7 +31,8 @@
     3.4                     ../../src/stringpair.c \
     3.5                     ../../src/timestamp.c \
     3.6                     ../../src/trans_auto.c \
     3.7 -                   ../../src/transport.c
     3.8 +                   ../../src/transport.c \
     3.9 +                   ../../src/blacklist.c
    3.10  
    3.11  LOCAL_C_INCLUDES := ../../src \
    3.12                      $(GPGME_INCLUDE_PATH) \
     4.1 --- a/build-mac/build-libcurl-ios.sh	Fri Mar 11 16:06:43 2016 +0100
     4.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     4.3 @@ -1,53 +0,0 @@
     4.4 -#!/bin/bash
     4.5 -
     4.6 -export IPHONEOS_DEPLOYMENT_TARGET="6.0"
     4.7 -export CC="/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang"
     4.8 -
     4.9 -ARCH="armv7"
    4.10 -export CFLAGS="-arch ${ARCH} -pipe -Os -gdwarf-2 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk"
    4.11 -export LDFLAGS="-arch ${ARCH} -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk"
    4.12 -make distclean
    4.13 -./configure --disable-shared --enable-static --host="${ARCH}-apple-darwin" --enable-threaded-resolver --with-darwinssl
    4.14 -make -j `sysctl -n hw.logicalcpu_max`
    4.15 -cp lib/.libs/libcurl.a "${HOME}/Desktop/libcurl-${ARCH}.a"
    4.16 -cp include/curl/curlbuild.h ~/Desktop/curlbuild32.h
    4.17 -
    4.18 -ARCH="armv7s"
    4.19 -export CFLAGS="-arch ${ARCH} -pipe -Os -gdwarf-2 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk"
    4.20 -export LDFLAGS="-arch ${ARCH} -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk"
    4.21 -make distclean
    4.22 -./configure --disable-shared --enable-static --host="${ARCH}-apple-darwin" --enable-threaded-resolver --with-darwinssl
    4.23 -make -j `sysctl -n hw.logicalcpu_max`
    4.24 -cp lib/.libs/libcurl.a "${HOME}/Desktop/libcurl-${ARCH}.a"
    4.25 -
    4.26 -ARCH="arm64"
    4.27 -export IPHONEOS_DEPLOYMENT_TARGET="7.0"
    4.28 -export CFLAGS="-arch ${ARCH} -pipe -Os -gdwarf-2 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk"
    4.29 -export LDFLAGS="-arch ${ARCH} -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk"
    4.30 -make distclean
    4.31 -./configure --disable-shared --enable-static --host="aarch64-apple-darwin" --enable-threaded-resolver --with-darwinssl
    4.32 -make -j `sysctl -n hw.logicalcpu_max`
    4.33 -cp lib/.libs/libcurl.a "${HOME}/Desktop/libcurl-${ARCH}.a"
    4.34 -cp include/curl/curlbuild.h ~/Desktop/curlbuild64.h
    4.35 -
    4.36 -ARCH="i386"
    4.37 -export IPHONEOS_DEPLOYMENT_TARGET="6.0"
    4.38 -export CFLAGS="-arch ${ARCH} -pipe -Os -gdwarf-2 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk"
    4.39 -export CPPFLAGS="-D__IPHONE_OS_VERSION_MIN_REQUIRED=${IPHONEOS_DEPLOYMENT_TARGET%%.*}0000"
    4.40 -export LDFLAGS="-arch ${ARCH} -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk"
    4.41 -make distclean
    4.42 -./configure --disable-shared --enable-static --host="${ARCH}-apple-darwin" --enable-threaded-resolver --with-darwinssl
    4.43 -make -j `sysctl -n hw.logicalcpu_max`
    4.44 -cp lib/.libs/libcurl.a "${HOME}/Desktop/libcurl-${ARCH}.a"
    4.45 -
    4.46 -ARCH="x86_64"
    4.47 -export IPHONEOS_DEPLOYMENT_TARGET="7.0"
    4.48 -export CFLAGS="-arch ${ARCH} -pipe -Os -gdwarf-2 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk"
    4.49 -export CPPFLAGS="-D__IPHONE_OS_VERSION_MIN_REQUIRED=${IPHONEOS_DEPLOYMENT_TARGET%%.*}0000"
    4.50 -export LDFLAGS="-arch ${ARCH} -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk"
    4.51 -make distclean
    4.52 -./configure --disable-shared --enable-static --host="${ARCH}-apple-darwin" --enable-threaded-resolver --with-darwinssl
    4.53 -make -j `sysctl -n hw.logicalcpu_max`
    4.54 -cp lib/.libs/libcurl.a "${HOME}/Desktop/libcurl-${ARCH}.a"
    4.55 -
    4.56 -lipo -create -output "${HOME}/Desktop/libcurl.a" "${HOME}/Desktop/libcurl-armv7.a" "${HOME}/Desktop/libcurl-armv7s.a" "${HOME}/Desktop/libcurl-arm64.a" "${HOME}/Desktop/libcurl-i386.a" "${HOME}/Desktop/libcurl-x86_64.a"
     5.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     5.2 +++ b/build-mac/build.sh	Tue Apr 26 10:49:43 2016 +0200
     5.3 @@ -0,0 +1,25 @@
     5.4 +#!/bin/bash
     5.5 +
     5.6 +#
     5.7 +# Invoke with `sh build.sh`
     5.8 +#
     5.9 +
    5.10 +set -e
    5.11 +
    5.12 +rm -f libcurl.a
    5.13 +rm -fr curl
    5.14 +
    5.15 +wget https://curl.haxx.se/download/curl-7.48.0.tar.gz
    5.16 +gpg2 --verify curl-7.48.0.tar.gz.asc
    5.17 +tar xf curl-7.48.0.tar.gz
    5.18 +pushd curl-7.48.0
    5.19 +bash ../build_libcurl_dist.sh
    5.20 +popd
    5.21 +mv libcurl-ios-dist/lib/libcurl.a .
    5.22 +
    5.23 +#exit 1
    5.24 +
    5.25 +mv libcurl-ios-dist/include/curl .
    5.26 +rm -fr libcurl-ios-dist/
    5.27 +rm -fr curl-7.48.0
    5.28 +rm curl-7.48.0.tar.gz
     6.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     6.2 +++ b/build-mac/build_libcurl_dist.sh	Tue Apr 26 10:49:43 2016 +0200
     6.3 @@ -0,0 +1,62 @@
     6.4 +#!/bin/bash
     6.5 +
     6.6 +export DEVROOT=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain
     6.7 +DFT_DIST_DIR=../libcurl-ios-dist
     6.8 +DIST_DIR=${DIST_DIR:-$DFT_DIST_DIR}
     6.9 +
    6.10 +function check_curl_ver() {
    6.11 +echo "#include \"include/curl/curlver.h\"
    6.12 +#if LIBCURL_VERSION_MAJOR < 7 || LIBCURL_VERSION_MINOR < 40
    6.13 +#error Required curl 7.40.0+; See http://curl.haxx.se/docs/adv_20150108A.html
    6.14 +#endif"|gcc -c -o /dev/null -xc -||exit 9
    6.15 +}
    6.16 +
    6.17 +function build_for_arch() {
    6.18 +  ARCH=$1
    6.19 +  HOST=$2
    6.20 +  SYSROOT=$3
    6.21 +  PREFIX=$4
    6.22 +  IPHONEOS_DEPLOYMENT_TARGET="6.0"
    6.23 +  export PATH="${DEVROOT}/usr/bin/:${PATH}"
    6.24 +  export CFLAGS="-arch ${ARCH} -pipe -Os -gdwarf-2 -isysroot ${SYSROOT} -miphoneos-version-min=${IPHONEOS_DEPLOYMENT_TARGET} -fembed-bitcode"
    6.25 +  export LDFLAGS="-arch ${ARCH} -isysroot ${SYSROOT}"
    6.26 +  ./configure --disable-shared --enable-static ${SSL_FLAG} --host="${HOST}" --prefix=${PREFIX} && make -j8 && make install
    6.27 +}
    6.28 +
    6.29 +if [ "$1" == "openssl" ]
    6.30 +then
    6.31 +  if [ ! -d ${HOME}/Desktop/openssl-ios-dist ]
    6.32 +  then
    6.33 +    echo "Please use https://github.com/sinofool/build-openssl-ios/ to build OpenSSL for iOS first"
    6.34 +    exit 8
    6.35 +  fi
    6.36 +  export SSL_FLAG=--with-ssl=${HOME}/Desktop/openssl-ios-dist
    6.37 +else
    6.38 +  check_curl_ver
    6.39 +  export SSL_FLAG=--with-darwinssl
    6.40 +fi
    6.41 +
    6.42 +TMP_DIR=/tmp/build_libcurl_$$
    6.43 +
    6.44 +build_for_arch i386 i386-apple-darwin /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk ${TMP_DIR}/i386 || exit 1
    6.45 +build_for_arch x86_64 x86_64-apple-darwin /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk ${TMP_DIR}/x86_64 || exit 2
    6.46 +build_for_arch arm64 arm-apple-darwin /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk ${TMP_DIR}/arm64 || exit 3
    6.47 +build_for_arch armv7s armv7s-apple-darwin /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk ${TMP_DIR}/armv7s || exit 4
    6.48 +build_for_arch armv7 armv7-apple-darwin /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk ${TMP_DIR}/armv7 || exit 5
    6.49 +
    6.50 +mkdir -p ${TMP_DIR}/lib/
    6.51 +${DEVROOT}/usr/bin/lipo \
    6.52 +	-arch i386 ${TMP_DIR}/i386/lib/libcurl.a \
    6.53 +	-arch x86_64 ${TMP_DIR}/x86_64/lib/libcurl.a \
    6.54 +	-arch armv7 ${TMP_DIR}/armv7/lib/libcurl.a \
    6.55 +	-arch armv7s ${TMP_DIR}/armv7s/lib/libcurl.a \
    6.56 +	-arch arm64 ${TMP_DIR}/arm64/lib/libcurl.a \
    6.57 +	-output ${TMP_DIR}/lib/libcurl.a -create
    6.58 +
    6.59 +cp -r ${TMP_DIR}/armv7s/include ${TMP_DIR}/
    6.60 +curl -O https://raw.githubusercontent.com/sinofool/build-libcurl-ios/master/patch-include.patch
    6.61 +patch ${TMP_DIR}/include/curl/curlbuild.h < patch-include.patch
    6.62 +
    6.63 +mkdir -p ${DIST_DIR}
    6.64 +cp -r ${TMP_DIR}/include ${TMP_DIR}/lib ${DIST_DIR}
    6.65 +
     7.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     7.2 +++ b/build-mac/curl-7.48.0.tar.gz.asc	Tue Apr 26 10:49:43 2016 +0200
     7.3 @@ -0,0 +1,7 @@
     7.4 +-----BEGIN PGP SIGNATURE-----
     7.5 +Version: GnuPG v1
     7.6 +
     7.7 +iEYEABECAAYFAlbyPpsACgkQeOEcayedXJHUPwCg3XT9+/cTF0vSBZo6fA9T2PC0
     7.8 +WdAAnArdVGI5GVP7SW0wPogEb03qSXPJ
     7.9 +=H/Vf
    7.10 +-----END PGP SIGNATURE-----
     8.1 --- a/build-mac/curl/curl.h	Fri Mar 11 16:06:43 2016 +0100
     8.2 +++ b/build-mac/curl/curl.h	Tue Apr 26 10:49:43 2016 +0200
     8.3 @@ -11,7 +11,7 @@
     8.4   *
     8.5   * This software is licensed as described in the file COPYING, which
     8.6   * you should have received as part of this distribution. The terms
     8.7 - * are also available at http://curl.haxx.se/docs/copyright.html.
     8.8 + * are also available at https://curl.haxx.se/docs/copyright.html.
     8.9   *
    8.10   * You may opt to use, copy, modify, merge, publish, distribute and/or sell
    8.11   * copies of the Software, and permit persons to whom the Software is
    8.12 @@ -24,10 +24,10 @@
    8.13  
    8.14  /*
    8.15   * If you have libcurl problems, all docs and details are found here:
    8.16 - *   http://curl.haxx.se/libcurl/
    8.17 + *   https://curl.haxx.se/libcurl/
    8.18   *
    8.19   * curl-library mailing list subscription and unsubscription web interface:
    8.20 - *   http://cool.haxx.se/mailman/listinfo/curl-library/
    8.21 + *   https://cool.haxx.se/mailman/listinfo/curl-library/
    8.22   */
    8.23  
    8.24  #include "curlver.h"         /* libcurl version defines   */
    8.25 @@ -56,7 +56,8 @@
    8.26  #include <time.h>
    8.27  
    8.28  #if defined(WIN32) && !defined(_WIN32_WCE) && !defined(__CYGWIN__)
    8.29 -#if !(defined(_WINSOCKAPI_) || defined(_WINSOCK_H) || defined(__LWIP_OPT_H__))
    8.30 +#if !(defined(_WINSOCKAPI_) || defined(_WINSOCK_H) || \
    8.31 +      defined(__LWIP_OPT_H__) || defined(LWIP_HDR_OPT_H))
    8.32  /* The check above prevents the winsock2 inclusion if winsock.h already was
    8.33     included, since they can't co-exist without problems */
    8.34  #include <winsock2.h>
    8.35 @@ -112,7 +113,7 @@
    8.36  
    8.37  #ifndef curl_socket_typedef
    8.38  /* socket typedef */
    8.39 -#if defined(WIN32) && !defined(__LWIP_OPT_H__)
    8.40 +#if defined(WIN32) && !defined(__LWIP_OPT_H__) && !defined(LWIP_HDR_OPT_H)
    8.41  typedef SOCKET curl_socket_t;
    8.42  #define CURL_SOCKET_BAD INVALID_SOCKET
    8.43  #else
    8.44 @@ -127,7 +128,8 @@
    8.45    char *name;                       /* pointer to allocated name */
    8.46    long namelength;                  /* length of name length */
    8.47    char *contents;                   /* pointer to allocated data contents */
    8.48 -  long contentslength;              /* length of contents field */
    8.49 +  long contentslength;              /* length of contents field, see also
    8.50 +                                       CURL_HTTPPOST_LARGE */
    8.51    char *buffer;                     /* pointer to allocated buffer contents */
    8.52    long bufferlength;                /* length of buffer field */
    8.53    char *contenttype;                /* Content-Type */
    8.54 @@ -136,24 +138,33 @@
    8.55                                         file, this link should link to following
    8.56                                         files */
    8.57    long flags;                       /* as defined below */
    8.58 -#define HTTPPOST_FILENAME (1<<0)    /* specified content is a file name */
    8.59 -#define HTTPPOST_READFILE (1<<1)    /* specified content is a file name */
    8.60 -#define HTTPPOST_PTRNAME (1<<2)     /* name is only stored pointer
    8.61 -                                       do not free in formfree */
    8.62 -#define HTTPPOST_PTRCONTENTS (1<<3) /* contents is only stored pointer
    8.63 -                                       do not free in formfree */
    8.64 -#define HTTPPOST_BUFFER (1<<4)      /* upload file from buffer */
    8.65 -#define HTTPPOST_PTRBUFFER (1<<5)   /* upload file from pointer contents */
    8.66 -#define HTTPPOST_CALLBACK (1<<6)    /* upload file contents by using the
    8.67 -                                       regular read callback to get the data
    8.68 -                                       and pass the given pointer as custom
    8.69 -                                       pointer */
    8.70 +
    8.71 +/* specified content is a file name */
    8.72 +#define CURL_HTTPPOST_FILENAME (1<<0)
    8.73 +/* specified content is a file name */
    8.74 +#define CURL_HTTPPOST_READFILE (1<<1)
    8.75 +/* name is only stored pointer do not free in formfree */
    8.76 +#define CURL_HTTPPOST_PTRNAME (1<<2)
    8.77 +/* contents is only stored pointer do not free in formfree */
    8.78 +#define CURL_HTTPPOST_PTRCONTENTS (1<<3)
    8.79 +/* upload file from buffer */
    8.80 +#define CURL_HTTPPOST_BUFFER (1<<4)
    8.81 +/* upload file from pointer contents */
    8.82 +#define CURL_HTTPPOST_PTRBUFFER (1<<5)
    8.83 +/* upload file contents by using the regular read callback to get the data and
    8.84 +   pass the given pointer as custom pointer */
    8.85 +#define CURL_HTTPPOST_CALLBACK (1<<6)
    8.86 +/* use size in 'contentlen', added in 7.46.0 */
    8.87 +#define CURL_HTTPPOST_LARGE (1<<7)
    8.88  
    8.89    char *showfilename;               /* The file name to show. If not set, the
    8.90                                         actual file name will be used (if this
    8.91                                         is a file part) */
    8.92    void *userp;                      /* custom pointer used for
    8.93                                         HTTPPOST_CALLBACK posts */
    8.94 +  curl_off_t contentlen;            /* alternative length of contents
    8.95 +                                       field. Used if CURL_HTTPPOST_LARGE is
    8.96 +                                       set. Added in 7.46.0 */
    8.97  };
    8.98  
    8.99  /* This is the CURLOPT_PROGRESSFUNCTION callback proto. It is now considered
   8.100 @@ -725,6 +736,10 @@
   8.101     servers, a user can this way allow the vulnerability back. */
   8.102  #define CURLSSLOPT_ALLOW_BEAST (1<<0)
   8.103  
   8.104 +/* - NO_REVOKE tells libcurl to disable certificate revocation checks for those
   8.105 +   SSL backends where such behavior is present. */
   8.106 +#define CURLSSLOPT_NO_REVOKE (1<<1)
   8.107 +
   8.108  #ifndef CURL_NO_OLDIES /* define this to test if your app builds with all
   8.109                            the obsolete stuff removed! */
   8.110  
   8.111 @@ -814,9 +829,13 @@
   8.112     but 32 */
   8.113  #define CURLOPTTYPE_LONG          0
   8.114  #define CURLOPTTYPE_OBJECTPOINT   10000
   8.115 +#define CURLOPTTYPE_STRINGPOINT   10000
   8.116  #define CURLOPTTYPE_FUNCTIONPOINT 20000
   8.117  #define CURLOPTTYPE_OFF_T         30000
   8.118  
   8.119 +/* *STRINGPOINT is an alias for OBJECTPOINT to allow tools to extract the
   8.120 +   string options from the header file */
   8.121 +
   8.122  /* name is uppercase CURLOPT_<name>,
   8.123     type is one of the defined CURLOPTTYPE_<type>
   8.124     number is unique identifier */
   8.125 @@ -830,6 +849,7 @@
   8.126  /* The macro "##" is ISO C, we assume pre-ISO C doesn't support it. */
   8.127  #define LONG          CURLOPTTYPE_LONG
   8.128  #define OBJECTPOINT   CURLOPTTYPE_OBJECTPOINT
   8.129 +#define STRINGPOINT   CURLOPTTYPE_OBJECTPOINT
   8.130  #define FUNCTIONPOINT CURLOPTTYPE_FUNCTIONPOINT
   8.131  #define OFF_T         CURLOPTTYPE_OFF_T
   8.132  #define CINIT(name,type,number) CURLOPT_/**/name = type + number
   8.133 @@ -846,22 +866,22 @@
   8.134    CINIT(WRITEDATA, OBJECTPOINT, 1),
   8.135  
   8.136    /* The full URL to get/put */
   8.137 -  CINIT(URL, OBJECTPOINT, 2),
   8.138 +  CINIT(URL, STRINGPOINT, 2),
   8.139  
   8.140    /* Port number to connect to, if other than default. */
   8.141    CINIT(PORT, LONG, 3),
   8.142  
   8.143    /* Name of proxy to use. */
   8.144 -  CINIT(PROXY, OBJECTPOINT, 4),
   8.145 +  CINIT(PROXY, STRINGPOINT, 4),
   8.146  
   8.147    /* "user:password;options" to use when fetching. */
   8.148 -  CINIT(USERPWD, OBJECTPOINT, 5),
   8.149 +  CINIT(USERPWD, STRINGPOINT, 5),
   8.150  
   8.151    /* "user:password" to use with proxy. */
   8.152 -  CINIT(PROXYUSERPWD, OBJECTPOINT, 6),
   8.153 +  CINIT(PROXYUSERPWD, STRINGPOINT, 6),
   8.154  
   8.155    /* Range to get, specified as an ASCII string. */
   8.156 -  CINIT(RANGE, OBJECTPOINT, 7),
   8.157 +  CINIT(RANGE, STRINGPOINT, 7),
   8.158  
   8.159    /* not used */
   8.160  
   8.161 @@ -898,14 +918,14 @@
   8.162    CINIT(POSTFIELDS, OBJECTPOINT, 15),
   8.163  
   8.164    /* Set the referrer page (needed by some CGIs) */
   8.165 -  CINIT(REFERER, OBJECTPOINT, 16),
   8.166 +  CINIT(REFERER, STRINGPOINT, 16),
   8.167  
   8.168    /* Set the FTP PORT string (interface name, named or numerical IP address)
   8.169       Use i.e '-' to use default address. */
   8.170 -  CINIT(FTPPORT, OBJECTPOINT, 17),
   8.171 +  CINIT(FTPPORT, STRINGPOINT, 17),
   8.172  
   8.173    /* Set the User-Agent string (examined by some CGIs) */
   8.174 -  CINIT(USERAGENT, OBJECTPOINT, 18),
   8.175 +  CINIT(USERAGENT, STRINGPOINT, 18),
   8.176  
   8.177    /* If the download receives less than "low speed limit" bytes/second
   8.178     * during "low speed time" seconds, the operations is aborted.
   8.179 @@ -928,7 +948,7 @@
   8.180    CINIT(RESUME_FROM, LONG, 21),
   8.181  
   8.182    /* Set cookie in request: */
   8.183 -  CINIT(COOKIE, OBJECTPOINT, 22),
   8.184 +  CINIT(COOKIE, STRINGPOINT, 22),
   8.185  
   8.186    /* This points to a linked list of headers, struct curl_slist kind. This
   8.187       list is also used for RTSP (in spite of its name) */
   8.188 @@ -938,10 +958,10 @@
   8.189    CINIT(HTTPPOST, OBJECTPOINT, 24),
   8.190  
   8.191    /* name of the file keeping your private SSL-certificate */
   8.192 -  CINIT(SSLCERT, OBJECTPOINT, 25),
   8.193 +  CINIT(SSLCERT, STRINGPOINT, 25),
   8.194  
   8.195    /* password for the SSL or SSH private key */
   8.196 -  CINIT(KEYPASSWD, OBJECTPOINT, 26),
   8.197 +  CINIT(KEYPASSWD, STRINGPOINT, 26),
   8.198  
   8.199    /* send TYPE parameter? */
   8.200    CINIT(CRLF, LONG, 27),
   8.201 @@ -955,7 +975,7 @@
   8.202  
   8.203    /* point to a file to read the initial cookies from, also enables
   8.204       "cookie awareness" */
   8.205 -  CINIT(COOKIEFILE, OBJECTPOINT, 31),
   8.206 +  CINIT(COOKIEFILE, STRINGPOINT, 31),
   8.207  
   8.208    /* What version to specifically try to use.
   8.209       See CURL_SSLVERSION defines below. */
   8.210 @@ -974,9 +994,9 @@
   8.211       HTTP: DELETE, TRACE and others
   8.212       FTP: to use a different list command
   8.213       */
   8.214 -  CINIT(CUSTOMREQUEST, OBJECTPOINT, 36),
   8.215 -
   8.216 -  /* HTTP request, for odd commands like DELETE, TRACE and others */
   8.217 +  CINIT(CUSTOMREQUEST, STRINGPOINT, 36),
   8.218 +
   8.219 +  /* FILE handle to use instead of stderr */
   8.220    CINIT(STDERR, OBJECTPOINT, 37),
   8.221  
   8.222    /* 38 is not used */
   8.223 @@ -1033,19 +1053,19 @@
   8.224    CINIT(HTTPPROXYTUNNEL, LONG, 61),
   8.225  
   8.226    /* Set the interface string to use as outgoing network interface */
   8.227 -  CINIT(INTERFACE, OBJECTPOINT, 62),
   8.228 +  CINIT(INTERFACE, STRINGPOINT, 62),
   8.229  
   8.230    /* Set the krb4/5 security level, this also enables krb4/5 awareness.  This
   8.231     * is a string, 'clear', 'safe', 'confidential' or 'private'.  If the string
   8.232     * is set but doesn't match one of these, 'private' will be used.  */
   8.233 -  CINIT(KRBLEVEL, OBJECTPOINT, 63),
   8.234 +  CINIT(KRBLEVEL, STRINGPOINT, 63),
   8.235  
   8.236    /* Set if we should verify the peer in ssl handshake, set 1 to verify. */
   8.237    CINIT(SSL_VERIFYPEER, LONG, 64),
   8.238  
   8.239    /* The CApath or CAfile used to validate the peer certificate
   8.240       this option is used only if SSL_VERIFYPEER is true */
   8.241 -  CINIT(CAINFO, OBJECTPOINT, 65),
   8.242 +  CINIT(CAINFO, STRINGPOINT, 65),
   8.243  
   8.244    /* 66 = OBSOLETE */
   8.245    /* 67 = OBSOLETE */
   8.246 @@ -1079,10 +1099,10 @@
   8.247  
   8.248    /* Set to a file name that contains random data for libcurl to use to
   8.249       seed the random engine when doing SSL connects. */
   8.250 -  CINIT(RANDOM_FILE, OBJECTPOINT, 76),
   8.251 +  CINIT(RANDOM_FILE, STRINGPOINT, 76),
   8.252  
   8.253    /* Set to the Entropy Gathering Daemon socket pathname */
   8.254 -  CINIT(EGDSOCKET, OBJECTPOINT, 77),
   8.255 +  CINIT(EGDSOCKET, STRINGPOINT, 77),
   8.256  
   8.257    /* Time-out connect operations after this amount of seconds, if connects are
   8.258       OK within this time, then fine... This only aborts the connect phase. */
   8.259 @@ -1104,10 +1124,10 @@
   8.260  
   8.261    /* Specify which file name to write all known cookies in after completed
   8.262       operation. Set file name to "-" (dash) to make it go to stdout. */
   8.263 -  CINIT(COOKIEJAR, OBJECTPOINT, 82),
   8.264 +  CINIT(COOKIEJAR, STRINGPOINT, 82),
   8.265  
   8.266    /* Specify which SSL ciphers to use */
   8.267 -  CINIT(SSL_CIPHER_LIST, OBJECTPOINT, 83),
   8.268 +  CINIT(SSL_CIPHER_LIST, STRINGPOINT, 83),
   8.269  
   8.270    /* Specify which HTTP version to use! This must be set to one of the
   8.271       CURL_HTTP_VERSION* enums set below. */
   8.272 @@ -1119,16 +1139,16 @@
   8.273    CINIT(FTP_USE_EPSV, LONG, 85),
   8.274  
   8.275    /* type of the file keeping your SSL-certificate ("DER", "PEM", "ENG") */
   8.276 -  CINIT(SSLCERTTYPE, OBJECTPOINT, 86),
   8.277 +  CINIT(SSLCERTTYPE, STRINGPOINT, 86),
   8.278  
   8.279    /* name of the file keeping your private SSL-key */
   8.280 -  CINIT(SSLKEY, OBJECTPOINT, 87),
   8.281 +  CINIT(SSLKEY, STRINGPOINT, 87),
   8.282  
   8.283    /* type of the file keeping your private SSL-key ("DER", "PEM", "ENG") */
   8.284 -  CINIT(SSLKEYTYPE, OBJECTPOINT, 88),
   8.285 +  CINIT(SSLKEYTYPE, STRINGPOINT, 88),
   8.286  
   8.287    /* crypto engine for the SSL-sub system */
   8.288 -  CINIT(SSLENGINE, OBJECTPOINT, 89),
   8.289 +  CINIT(SSLENGINE, STRINGPOINT, 89),
   8.290  
   8.291    /* set the crypto engine for the SSL-sub system as default
   8.292       the param has no meaning...
   8.293 @@ -1155,7 +1175,7 @@
   8.294  
   8.295    /* The CApath directory used to validate the peer certificate
   8.296       this option is used only if SSL_VERIFYPEER is true */
   8.297 -  CINIT(CAPATH, OBJECTPOINT, 97),
   8.298 +  CINIT(CAPATH, STRINGPOINT, 97),
   8.299  
   8.300    /* Instruct libcurl to use a smaller receive buffer */
   8.301    CINIT(BUFFERSIZE, LONG, 98),
   8.302 @@ -1175,7 +1195,7 @@
   8.303    /* Set the Accept-Encoding string. Use this to tell a server you would like
   8.304       the response to be compressed. Before 7.21.6, this was known as
   8.305       CURLOPT_ENCODING */
   8.306 -  CINIT(ACCEPT_ENCODING, OBJECTPOINT, 102),
   8.307 +  CINIT(ACCEPT_ENCODING, STRINGPOINT, 102),
   8.308  
   8.309    /* Set pointer to private data */
   8.310    CINIT(PRIVATE, OBJECTPOINT, 103),
   8.311 @@ -1256,7 +1276,7 @@
   8.312       to parse (using the CURLOPT_NETRC option). If not set, libcurl will do
   8.313       a poor attempt to find the user's home directory and check for a .netrc
   8.314       file in there. */
   8.315 -  CINIT(NETRC_FILE, OBJECTPOINT, 118),
   8.316 +  CINIT(NETRC_FILE, STRINGPOINT, 118),
   8.317  
   8.318    /* Enable SSL/TLS for FTP, pick one of:
   8.319       CURLUSESSL_TRY     - try using SSL, proceed anyway otherwise
   8.320 @@ -1299,10 +1319,10 @@
   8.321  
   8.322    /* zero terminated string for pass on to the FTP server when asked for
   8.323       "account" info */
   8.324 -  CINIT(FTP_ACCOUNT, OBJECTPOINT, 134),
   8.325 -
   8.326 -  /* feed cookies into cookie engine */
   8.327 -  CINIT(COOKIELIST, OBJECTPOINT, 135),
   8.328 +  CINIT(FTP_ACCOUNT, STRINGPOINT, 134),
   8.329 +
   8.330 +  /* feed cookie into cookie engine */
   8.331 +  CINIT(COOKIELIST, STRINGPOINT, 135),
   8.332  
   8.333    /* ignore Content-Length */
   8.334    CINIT(IGNORE_CONTENT_LENGTH, LONG, 136),
   8.335 @@ -1348,7 +1368,7 @@
   8.336    CINIT(MAX_RECV_SPEED_LARGE, OFF_T, 146),
   8.337  
   8.338    /* Pointer to command string to send if USER/PASS fails. */
   8.339 -  CINIT(FTP_ALTERNATIVE_TO_USER, OBJECTPOINT, 147),
   8.340 +  CINIT(FTP_ALTERNATIVE_TO_USER, STRINGPOINT, 147),
   8.341  
   8.342    /* callback function for setting socket options */
   8.343    CINIT(SOCKOPTFUNCTION, FUNCTIONPOINT, 148),
   8.344 @@ -1362,8 +1382,8 @@
   8.345    CINIT(SSH_AUTH_TYPES, LONG, 151),
   8.346  
   8.347    /* Used by scp/sftp to do public/private key authentication */
   8.348 -  CINIT(SSH_PUBLIC_KEYFILE, OBJECTPOINT, 152),
   8.349 -  CINIT(SSH_PRIVATE_KEYFILE, OBJECTPOINT, 153),
   8.350 +  CINIT(SSH_PUBLIC_KEYFILE, STRINGPOINT, 152),
   8.351 +  CINIT(SSH_PRIVATE_KEYFILE, STRINGPOINT, 153),
   8.352  
   8.353    /* Send CCC (Clear Command Channel) after authentication */
   8.354    CINIT(FTP_SSL_CCC, LONG, 154),
   8.355 @@ -1387,7 +1407,7 @@
   8.356    CINIT(POSTREDIR, LONG, 161),
   8.357  
   8.358    /* used by scp/sftp to verify the host's public key */
   8.359 -  CINIT(SSH_HOST_PUBLIC_KEY_MD5, OBJECTPOINT, 162),
   8.360 +  CINIT(SSH_HOST_PUBLIC_KEY_MD5, STRINGPOINT, 162),
   8.361  
   8.362    /* Callback function for opening socket (instead of socket(2)). Optionally,
   8.363       callback is able change the address or refuse to connect returning
   8.364 @@ -1407,10 +1427,10 @@
   8.365    CINIT(SEEKDATA, OBJECTPOINT, 168),
   8.366  
   8.367    /* CRL file */
   8.368 -  CINIT(CRLFILE, OBJECTPOINT, 169),
   8.369 +  CINIT(CRLFILE, STRINGPOINT, 169),
   8.370  
   8.371    /* Issuer certificate */
   8.372 -  CINIT(ISSUERCERT, OBJECTPOINT, 170),
   8.373 +  CINIT(ISSUERCERT, STRINGPOINT, 170),
   8.374  
   8.375    /* (IPv6) Address scope */
   8.376    CINIT(ADDRESS_SCOPE, LONG, 171),
   8.377 @@ -1420,12 +1440,12 @@
   8.378    CINIT(CERTINFO, LONG, 172),
   8.379  
   8.380    /* "name" and "pwd" to use when fetching. */
   8.381 -  CINIT(USERNAME, OBJECTPOINT, 173),
   8.382 -  CINIT(PASSWORD, OBJECTPOINT, 174),
   8.383 +  CINIT(USERNAME, STRINGPOINT, 173),
   8.384 +  CINIT(PASSWORD, STRINGPOINT, 174),
   8.385  
   8.386      /* "name" and "pwd" to use with Proxy when fetching. */
   8.387 -  CINIT(PROXYUSERNAME, OBJECTPOINT, 175),
   8.388 -  CINIT(PROXYPASSWORD, OBJECTPOINT, 176),
   8.389 +  CINIT(PROXYUSERNAME, STRINGPOINT, 175),
   8.390 +  CINIT(PROXYPASSWORD, STRINGPOINT, 176),
   8.391  
   8.392    /* Comma separated list of hostnames defining no-proxy zones. These should
   8.393       match both hostnames directly, and hostnames within a domain. For
   8.394 @@ -1434,13 +1454,13 @@
   8.395       implementations of this, .local.com will be considered to be the same as
   8.396       local.com. A single * is the only valid wildcard, and effectively
   8.397       disables the use of proxy. */
   8.398 -  CINIT(NOPROXY, OBJECTPOINT, 177),
   8.399 +  CINIT(NOPROXY, STRINGPOINT, 177),
   8.400  
   8.401    /* block size for TFTP transfers */
   8.402    CINIT(TFTP_BLKSIZE, LONG, 178),
   8.403  
   8.404    /* Socks Service */
   8.405 -  CINIT(SOCKS5_GSSAPI_SERVICE, OBJECTPOINT, 179),
   8.406 +  CINIT(SOCKS5_GSSAPI_SERVICE, STRINGPOINT, 179),
   8.407  
   8.408    /* Socks Service */
   8.409    CINIT(SOCKS5_GSSAPI_NEC, LONG, 180),
   8.410 @@ -1458,7 +1478,7 @@
   8.411    CINIT(REDIR_PROTOCOLS, LONG, 182),
   8.412  
   8.413    /* set the SSH knownhost file name to use */
   8.414 -  CINIT(SSH_KNOWNHOSTS, OBJECTPOINT, 183),
   8.415 +  CINIT(SSH_KNOWNHOSTS, STRINGPOINT, 183),
   8.416  
   8.417    /* set the SSH host key callback, must point to a curl_sshkeycallback
   8.418       function */
   8.419 @@ -1468,9 +1488,9 @@
   8.420    CINIT(SSH_KEYDATA, OBJECTPOINT, 185),
   8.421  
   8.422    /* set the SMTP mail originator */
   8.423 -  CINIT(MAIL_FROM, OBJECTPOINT, 186),
   8.424 -
   8.425 -  /* set the SMTP mail receiver(s) */
   8.426 +  CINIT(MAIL_FROM, STRINGPOINT, 186),
   8.427 +
   8.428 +  /* set the list of SMTP mail receiver(s) */
   8.429    CINIT(MAIL_RCPT, OBJECTPOINT, 187),
   8.430  
   8.431    /* FTP: send PRET before PASV */
   8.432 @@ -1480,13 +1500,13 @@
   8.433    CINIT(RTSP_REQUEST, LONG, 189),
   8.434  
   8.435    /* The RTSP session identifier */
   8.436 -  CINIT(RTSP_SESSION_ID, OBJECTPOINT, 190),
   8.437 +  CINIT(RTSP_SESSION_ID, STRINGPOINT, 190),
   8.438  
   8.439    /* The RTSP stream URI */
   8.440 -  CINIT(RTSP_STREAM_URI, OBJECTPOINT, 191),
   8.441 +  CINIT(RTSP_STREAM_URI, STRINGPOINT, 191),
   8.442  
   8.443    /* The Transport: header to use in RTSP requests */
   8.444 -  CINIT(RTSP_TRANSPORT, OBJECTPOINT, 192),
   8.445 +  CINIT(RTSP_TRANSPORT, STRINGPOINT, 192),
   8.446  
   8.447    /* Manually initialize the client RTSP CSeq for this handle */
   8.448    CINIT(RTSP_CLIENT_CSEQ, LONG, 193),
   8.449 @@ -1524,13 +1544,13 @@
   8.450    CINIT(RESOLVE, OBJECTPOINT, 203),
   8.451  
   8.452    /* Set a username for authenticated TLS */
   8.453 -  CINIT(TLSAUTH_USERNAME, OBJECTPOINT, 204),
   8.454 +  CINIT(TLSAUTH_USERNAME, STRINGPOINT, 204),
   8.455  
   8.456    /* Set a password for authenticated TLS */
   8.457 -  CINIT(TLSAUTH_PASSWORD, OBJECTPOINT, 205),
   8.458 +  CINIT(TLSAUTH_PASSWORD, STRINGPOINT, 205),
   8.459  
   8.460    /* Set authentication type for authenticated TLS */
   8.461 -  CINIT(TLSAUTH_TYPE, OBJECTPOINT, 206),
   8.462 +  CINIT(TLSAUTH_TYPE, STRINGPOINT, 206),
   8.463  
   8.464    /* Set to 1 to enable the "TE:" header in HTTP requests to ask for
   8.465       compressed transfer-encoded responses. Set to 0 to disable the use of TE:
   8.466 @@ -1553,7 +1573,7 @@
   8.467    CINIT(GSSAPI_DELEGATION, LONG, 210),
   8.468  
   8.469    /* Set the name servers to use for DNS resolution */
   8.470 -  CINIT(DNS_SERVERS, OBJECTPOINT, 211),
   8.471 +  CINIT(DNS_SERVERS, STRINGPOINT, 211),
   8.472  
   8.473    /* Time-out accept operations (currently for FTP only) after this amount
   8.474       of miliseconds. */
   8.475 @@ -1570,7 +1590,7 @@
   8.476    CINIT(SSL_OPTIONS, LONG, 216),
   8.477  
   8.478    /* Set the SMTP auth originator */
   8.479 -  CINIT(MAIL_AUTH, OBJECTPOINT, 217),
   8.480 +  CINIT(MAIL_AUTH, STRINGPOINT, 217),
   8.481  
   8.482    /* Enable/disable SASL initial response */
   8.483    CINIT(SASL_IR, LONG, 218),
   8.484 @@ -1581,23 +1601,23 @@
   8.485    CINIT(XFERINFOFUNCTION, FUNCTIONPOINT, 219),
   8.486  
   8.487    /* The XOAUTH2 bearer token */
   8.488 -  CINIT(XOAUTH2_BEARER, OBJECTPOINT, 220),
   8.489 +  CINIT(XOAUTH2_BEARER, STRINGPOINT, 220),
   8.490  
   8.491    /* Set the interface string to use as outgoing network
   8.492     * interface for DNS requests.
   8.493     * Only supported by the c-ares DNS backend */
   8.494 -  CINIT(DNS_INTERFACE, OBJECTPOINT, 221),
   8.495 +  CINIT(DNS_INTERFACE, STRINGPOINT, 221),
   8.496  
   8.497    /* Set the local IPv4 address to use for outgoing DNS requests.
   8.498     * Only supported by the c-ares DNS backend */
   8.499 -  CINIT(DNS_LOCAL_IP4, OBJECTPOINT, 222),
   8.500 +  CINIT(DNS_LOCAL_IP4, STRINGPOINT, 222),
   8.501  
   8.502    /* Set the local IPv4 address to use for outgoing DNS requests.
   8.503     * Only supported by the c-ares DNS backend */
   8.504 -  CINIT(DNS_LOCAL_IP6, OBJECTPOINT, 223),
   8.505 +  CINIT(DNS_LOCAL_IP6, STRINGPOINT, 223),
   8.506  
   8.507    /* Set authentication options directly */
   8.508 -  CINIT(LOGIN_OPTIONS, OBJECTPOINT, 224),
   8.509 +  CINIT(LOGIN_OPTIONS, STRINGPOINT, 224),
   8.510  
   8.511    /* Enable/disable TLS NPN extension (http2 over ssl might fail without) */
   8.512    CINIT(SSL_ENABLE_NPN, LONG, 225),
   8.513 @@ -1618,10 +1638,10 @@
   8.514  
   8.515    /* The public key in DER form used to validate the peer public key
   8.516       this option is used only if SSL_VERIFYPEER is true */
   8.517 -  CINIT(PINNEDPUBLICKEY, OBJECTPOINT, 230),
   8.518 +  CINIT(PINNEDPUBLICKEY, STRINGPOINT, 230),
   8.519  
   8.520    /* Path to Unix domain socket */
   8.521 -  CINIT(UNIX_SOCKET_PATH, OBJECTPOINT, 231),
   8.522 +  CINIT(UNIX_SOCKET_PATH, STRINGPOINT, 231),
   8.523  
   8.524    /* Set if we should verify the certificate status. */
   8.525    CINIT(SSL_VERIFYSTATUS, LONG, 232),
   8.526 @@ -1633,14 +1653,29 @@
   8.527    CINIT(PATH_AS_IS, LONG, 234),
   8.528  
   8.529    /* Proxy Service Name */
   8.530 -  CINIT(PROXY_SERVICE_NAME, OBJECTPOINT, 235),
   8.531 +  CINIT(PROXY_SERVICE_NAME, STRINGPOINT, 235),
   8.532  
   8.533    /* Service Name */
   8.534 -  CINIT(SERVICE_NAME, OBJECTPOINT, 236),
   8.535 +  CINIT(SERVICE_NAME, STRINGPOINT, 236),
   8.536  
   8.537    /* Wait/don't wait for pipe/mutex to clarify */
   8.538    CINIT(PIPEWAIT, LONG, 237),
   8.539  
   8.540 +  /* Set the protocol used when curl is given a URL without a protocol */
   8.541 +  CINIT(DEFAULT_PROTOCOL, STRINGPOINT, 238),
   8.542 +
   8.543 +  /* Set stream weight, 1 - 256 (default is 16) */
   8.544 +  CINIT(STREAM_WEIGHT, LONG, 239),
   8.545 +
   8.546 +  /* Set stream dependency on another CURL handle */
   8.547 +  CINIT(STREAM_DEPENDS, OBJECTPOINT, 240),
   8.548 +
   8.549 +  /* Set E-xclusive stream dependency on another CURL handle */
   8.550 +  CINIT(STREAM_DEPENDS_E, OBJECTPOINT, 241),
   8.551 +
   8.552 +  /* Do not send any tftp option requests to the server */
   8.553 +  CINIT(TFTP_NO_OPTIONS, LONG, 242),
   8.554 +
   8.555    CURLOPT_LASTENTRY /* the last unused */
   8.556  } CURLoption;
   8.557  
   8.558 @@ -1690,7 +1725,8 @@
   8.559                               for us! */
   8.560    CURL_HTTP_VERSION_1_0,  /* please use HTTP 1.0 in the request */
   8.561    CURL_HTTP_VERSION_1_1,  /* please use HTTP 1.1 in the request */
   8.562 -  CURL_HTTP_VERSION_2_0,  /* please use HTTP 2.0 in the request */
   8.563 +  CURL_HTTP_VERSION_2_0,  /* please use HTTP 2 in the request */
   8.564 +  CURL_HTTP_VERSION_2TLS, /* use version 2 for HTTPS, version 1.1 for HTTP */
   8.565  
   8.566    CURL_HTTP_VERSION_LAST /* *ILLEGAL* http version */
   8.567  };
   8.568 @@ -1815,6 +1851,7 @@
   8.569    CFINIT(OBSOLETE2),
   8.570  
   8.571    CFINIT(STREAM),
   8.572 +  CFINIT(CONTENTLEN), /* added in 7.46.0, provide a curl_off_t length */
   8.573  
   8.574    CURLFORM_LASTENTRY /* the last unused */
   8.575  } CURLformoption;
   8.576 @@ -2069,12 +2106,13 @@
   8.577    CURLSSLBACKEND_CYASSL = 7,
   8.578    CURLSSLBACKEND_SCHANNEL = 8,
   8.579    CURLSSLBACKEND_DARWINSSL = 9,
   8.580 -  CURLSSLBACKEND_AXTLS = 10
   8.581 +  CURLSSLBACKEND_AXTLS = 10,
   8.582 +  CURLSSLBACKEND_MBEDTLS = 11
   8.583  } curl_sslbackend;
   8.584  
   8.585  /* Information about the SSL library used and the respective internal SSL
   8.586     handle, which can be used to obtain further information regarding the
   8.587 -   connection. Asked for with CURLINFO_TLS_SESSION. */
   8.588 +   connection. Asked for with CURLINFO_TLS_SSL_PTR or CURLINFO_TLS_SESSION. */
   8.589  struct curl_tlssessioninfo {
   8.590    curl_sslbackend backend;
   8.591    void *internals;
   8.592 @@ -2084,6 +2122,7 @@
   8.593  #define CURLINFO_LONG     0x200000
   8.594  #define CURLINFO_DOUBLE   0x300000
   8.595  #define CURLINFO_SLIST    0x400000
   8.596 +#define CURLINFO_SOCKET   0x500000
   8.597  #define CURLINFO_MASK     0x0fffff
   8.598  #define CURLINFO_TYPEMASK 0xf00000
   8.599  
   8.600 @@ -2132,9 +2171,11 @@
   8.601    CURLINFO_LOCAL_IP         = CURLINFO_STRING + 41,
   8.602    CURLINFO_LOCAL_PORT       = CURLINFO_LONG   + 42,
   8.603    CURLINFO_TLS_SESSION      = CURLINFO_SLIST  + 43,
   8.604 +  CURLINFO_ACTIVESOCKET     = CURLINFO_SOCKET + 44,
   8.605 +  CURLINFO_TLS_SSL_PTR      = CURLINFO_SLIST  + 45,
   8.606    /* Fill in new entries below here! */
   8.607  
   8.608 -  CURLINFO_LASTONE          = 43
   8.609 +  CURLINFO_LASTONE          = 45
   8.610  } CURLINFO;
   8.611  
   8.612  /* CURLINFO_RESPONSE_CODE is the new name for the option previously known as
   8.613 @@ -2294,6 +2335,8 @@
   8.614  #define CURL_VERSION_GSSAPI       (1<<17) /* Built against a GSS-API library */
   8.615  #define CURL_VERSION_KERBEROS5    (1<<18) /* Kerberos V5 auth is supported */
   8.616  #define CURL_VERSION_UNIX_SOCKETS (1<<19) /* Unix domain sockets support */
   8.617 +#define CURL_VERSION_PSL          (1<<20) /* Mozilla's Public Suffix List, used
   8.618 +                                             for cookie domain verification */
   8.619  
   8.620   /*
   8.621   * NAME curl_version_info()
     9.1 --- a/build-mac/curl/curlbuild.h	Fri Mar 11 16:06:43 2016 +0100
     9.2 +++ b/build-mac/curl/curlbuild.h	Tue Apr 26 10:49:43 2016 +0200
     9.3 @@ -1,12 +1,234 @@
     9.4 -#ifdef __LP64__
     9.5 +/* include/curl/curlbuild.h.  Generated from curlbuild.h.in by configure.  */
     9.6 +#ifndef __CURL_CURLBUILD_H
     9.7 +#define __CURL_CURLBUILD_H
     9.8 +/***************************************************************************
     9.9 + *                                  _   _ ____  _
    9.10 + *  Project                     ___| | | |  _ \| |
    9.11 + *                             / __| | | | |_) | |
    9.12 + *                            | (__| |_| |  _ <| |___
    9.13 + *                             \___|\___/|_| \_\_____|
    9.14 + *
    9.15 + * Copyright (C) 1998 - 2012, Daniel Stenberg, <daniel@haxx.se>, et al.
    9.16 + *
    9.17 + * This software is licensed as described in the file COPYING, which
    9.18 + * you should have received as part of this distribution. The terms
    9.19 + * are also available at https://curl.haxx.se/docs/copyright.html.
    9.20 + *
    9.21 + * You may opt to use, copy, modify, merge, publish, distribute and/or sell
    9.22 + * copies of the Software, and permit persons to whom the Software is
    9.23 + * furnished to do so, under the terms of the COPYING file.
    9.24 + *
    9.25 + * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
    9.26 + * KIND, either express or implied.
    9.27 + *
    9.28 + ***************************************************************************/
    9.29  
    9.30 -// 64-bit code
    9.31 -#include "curlbuild64.h"
    9.32 +/* ================================================================ */
    9.33 +/*               NOTES FOR CONFIGURE CAPABLE SYSTEMS                */
    9.34 +/* ================================================================ */
    9.35  
    9.36 -#else
    9.37 +/*
    9.38 + * NOTE 1:
    9.39 + * -------
    9.40 + *
    9.41 + * Nothing in this file is intended to be modified or adjusted by the
    9.42 + * curl library user nor by the curl library builder.
    9.43 + *
    9.44 + * If you think that something actually needs to be changed, adjusted
    9.45 + * or fixed in this file, then, report it on the libcurl development
    9.46 + * mailing list: https://cool.haxx.se/mailman/listinfo/curl-library/
    9.47 + *
    9.48 + * This header file shall only export symbols which are 'curl' or 'CURL'
    9.49 + * prefixed, otherwise public name space would be polluted.
    9.50 + *
    9.51 + * NOTE 2:
    9.52 + * -------
    9.53 + *
    9.54 + * Right now you might be staring at file include/curl/curlbuild.h.in or
    9.55 + * at file include/curl/curlbuild.h, this is due to the following reason:
    9.56 + *
    9.57 + * On systems capable of running the configure script, the configure process
    9.58 + * will overwrite the distributed include/curl/curlbuild.h file with one that
    9.59 + * is suitable and specific to the library being configured and built, which
    9.60 + * is generated from the include/curl/curlbuild.h.in template file.
    9.61 + *
    9.62 + */
    9.63  
    9.64 -// 32-bit code
    9.65 -#include "curlbuild32.h"
    9.66 +/* ================================================================ */
    9.67 +/*  DEFINITION OF THESE SYMBOLS SHALL NOT TAKE PLACE ANYWHERE ELSE  */
    9.68 +/* ================================================================ */
    9.69  
    9.70 +#ifdef CURL_SIZEOF_LONG
    9.71 +#error "CURL_SIZEOF_LONG shall not be defined except in curlbuild.h"
    9.72 +   Error Compilation_aborted_CURL_SIZEOF_LONG_already_defined
    9.73  #endif
    9.74  
    9.75 +#ifdef CURL_TYPEOF_CURL_SOCKLEN_T
    9.76 +#error "CURL_TYPEOF_CURL_SOCKLEN_T shall not be defined except in curlbuild.h"
    9.77 +   Error Compilation_aborted_CURL_TYPEOF_CURL_SOCKLEN_T_already_defined
    9.78 +#endif
    9.79 +
    9.80 +#ifdef CURL_SIZEOF_CURL_SOCKLEN_T
    9.81 +#error "CURL_SIZEOF_CURL_SOCKLEN_T shall not be defined except in curlbuild.h"
    9.82 +   Error Compilation_aborted_CURL_SIZEOF_CURL_SOCKLEN_T_already_defined
    9.83 +#endif
    9.84 +
    9.85 +#ifdef CURL_TYPEOF_CURL_OFF_T
    9.86 +#error "CURL_TYPEOF_CURL_OFF_T shall not be defined except in curlbuild.h"
    9.87 +   Error Compilation_aborted_CURL_TYPEOF_CURL_OFF_T_already_defined
    9.88 +#endif
    9.89 +
    9.90 +#ifdef CURL_FORMAT_CURL_OFF_T
    9.91 +#error "CURL_FORMAT_CURL_OFF_T shall not be defined except in curlbuild.h"
    9.92 +   Error Compilation_aborted_CURL_FORMAT_CURL_OFF_T_already_defined
    9.93 +#endif
    9.94 +
    9.95 +#ifdef CURL_FORMAT_CURL_OFF_TU
    9.96 +#error "CURL_FORMAT_CURL_OFF_TU shall not be defined except in curlbuild.h"
    9.97 +   Error Compilation_aborted_CURL_FORMAT_CURL_OFF_TU_already_defined
    9.98 +#endif
    9.99 +
   9.100 +#ifdef CURL_FORMAT_OFF_T
   9.101 +#error "CURL_FORMAT_OFF_T shall not be defined except in curlbuild.h"
   9.102 +   Error Compilation_aborted_CURL_FORMAT_OFF_T_already_defined
   9.103 +#endif
   9.104 +
   9.105 +#ifdef CURL_SIZEOF_CURL_OFF_T
   9.106 +#error "CURL_SIZEOF_CURL_OFF_T shall not be defined except in curlbuild.h"
   9.107 +   Error Compilation_aborted_CURL_SIZEOF_CURL_OFF_T_already_defined
   9.108 +#endif
   9.109 +
   9.110 +#ifdef CURL_SUFFIX_CURL_OFF_T
   9.111 +#error "CURL_SUFFIX_CURL_OFF_T shall not be defined except in curlbuild.h"
   9.112 +   Error Compilation_aborted_CURL_SUFFIX_CURL_OFF_T_already_defined
   9.113 +#endif
   9.114 +
   9.115 +#ifdef CURL_SUFFIX_CURL_OFF_TU
   9.116 +#error "CURL_SUFFIX_CURL_OFF_TU shall not be defined except in curlbuild.h"
   9.117 +   Error Compilation_aborted_CURL_SUFFIX_CURL_OFF_TU_already_defined
   9.118 +#endif
   9.119 +
   9.120 +/* ================================================================ */
   9.121 +/*  EXTERNAL INTERFACE SETTINGS FOR CONFIGURE CAPABLE SYSTEMS ONLY  */
   9.122 +/* ================================================================ */
   9.123 +
   9.124 +/* Configure process defines this to 1 when it finds out that system  */
   9.125 +/* header file ws2tcpip.h must be included by the external interface. */
   9.126 +/* #undef CURL_PULL_WS2TCPIP_H */
   9.127 +#ifdef CURL_PULL_WS2TCPIP_H
   9.128 +#  ifndef WIN32_LEAN_AND_MEAN
   9.129 +#    define WIN32_LEAN_AND_MEAN
   9.130 +#  endif
   9.131 +#  include <windows.h>
   9.132 +#  include <winsock2.h>
   9.133 +#  include <ws2tcpip.h>
   9.134 +#endif
   9.135 +
   9.136 +/* Configure process defines this to 1 when it finds out that system   */
   9.137 +/* header file sys/types.h must be included by the external interface. */
   9.138 +#define CURL_PULL_SYS_TYPES_H 1
   9.139 +#ifdef CURL_PULL_SYS_TYPES_H
   9.140 +#  include <sys/types.h>
   9.141 +#endif
   9.142 +
   9.143 +/* Configure process defines this to 1 when it finds out that system */
   9.144 +/* header file stdint.h must be included by the external interface.  */
   9.145 +#ifdef __LP64__
   9.146 +/* #undef CURL_PULL_STDINT_H */
   9.147 +#else
   9.148 +#define CURL_PULL_STDINT_H 1
   9.149 +#endif
   9.150 +#ifdef CURL_PULL_STDINT_H
   9.151 +#  include <stdint.h>
   9.152 +#endif
   9.153 +
   9.154 +/* Configure process defines this to 1 when it finds out that system  */
   9.155 +/* header file inttypes.h must be included by the external interface. */
   9.156 +#ifdef __LP64__
   9.157 +/* #undef CURL_PULL_INTTYPES_H */
   9.158 +#else
   9.159 +#define CURL_PULL_INTTYPES_H 1
   9.160 +#endif
   9.161 +#ifdef CURL_PULL_INTTYPES_H
   9.162 +#  include <inttypes.h>
   9.163 +#endif
   9.164 +
   9.165 +/* Configure process defines this to 1 when it finds out that system    */
   9.166 +/* header file sys/socket.h must be included by the external interface. */
   9.167 +#define CURL_PULL_SYS_SOCKET_H 1
   9.168 +#ifdef CURL_PULL_SYS_SOCKET_H
   9.169 +#  include <sys/socket.h>
   9.170 +#endif
   9.171 +
   9.172 +/* Configure process defines this to 1 when it finds out that system  */
   9.173 +/* header file sys/poll.h must be included by the external interface. */
   9.174 +/* #undef CURL_PULL_SYS_POLL_H */
   9.175 +#ifdef CURL_PULL_SYS_POLL_H
   9.176 +#  include <sys/poll.h>
   9.177 +#endif
   9.178 +
   9.179 +/* The size of `long', as computed by sizeof. */
   9.180 +#ifdef __LP64__
   9.181 +#define CURL_SIZEOF_LONG 8
   9.182 +#else
   9.183 +#define CURL_SIZEOF_LONG 4
   9.184 +#endif
   9.185 +
   9.186 +/* Integral data type used for curl_socklen_t. */
   9.187 +#define CURL_TYPEOF_CURL_SOCKLEN_T socklen_t
   9.188 +
   9.189 +/* The size of `curl_socklen_t', as computed by sizeof. */
   9.190 +#define CURL_SIZEOF_CURL_SOCKLEN_T 4
   9.191 +
   9.192 +/* Data type definition of curl_socklen_t. */
   9.193 +typedef CURL_TYPEOF_CURL_SOCKLEN_T curl_socklen_t;
   9.194 +
   9.195 +/* Signed integral data type used for curl_off_t. */
   9.196 +#ifdef __LP64__
   9.197 +#define CURL_TYPEOF_CURL_OFF_T long
   9.198 +#else
   9.199 +#define CURL_TYPEOF_CURL_OFF_T int64_t
   9.200 +#endif
   9.201 +
   9.202 +/* Data type definition of curl_off_t. */
   9.203 +typedef CURL_TYPEOF_CURL_OFF_T curl_off_t;
   9.204 +
   9.205 +/* curl_off_t formatting string directive without "%" conversion specifier. */
   9.206 +#ifdef __LP64__
   9.207 +#define CURL_FORMAT_CURL_OFF_T "ld"
   9.208 +#else
   9.209 +#define CURL_FORMAT_CURL_OFF_T "lld"
   9.210 +#endif
   9.211 +
   9.212 +/* unsigned curl_off_t formatting string without "%" conversion specifier. */
   9.213 +#ifdef __LP64__
   9.214 +#define CURL_FORMAT_CURL_OFF_TU "lu"
   9.215 +#else
   9.216 +#define CURL_FORMAT_CURL_OFF_TU "llu"
   9.217 +#endif
   9.218 +
   9.219 +/* curl_off_t formatting string directive with "%" conversion specifier. */
   9.220 +#ifdef __LP64__
   9.221 +#define CURL_FORMAT_OFF_T "%ld"
   9.222 +#else
   9.223 +#define CURL_FORMAT_OFF_T "%lld"
   9.224 +#endif
   9.225 +
   9.226 +/* The size of `curl_off_t', as computed by sizeof. */
   9.227 +#define CURL_SIZEOF_CURL_OFF_T 8
   9.228 +
   9.229 +/* curl_off_t constant suffix. */
   9.230 +#ifdef __LP64__
   9.231 +#define CURL_SUFFIX_CURL_OFF_T L
   9.232 +#else
   9.233 +#define CURL_SUFFIX_CURL_OFF_T LL
   9.234 +#endif
   9.235 +
   9.236 +/* unsigned curl_off_t constant suffix. */
   9.237 +#ifdef __LP64__
   9.238 +#define CURL_SUFFIX_CURL_OFF_TU UL
   9.239 +#else
   9.240 +#define CURL_SUFFIX_CURL_OFF_TU ULL
   9.241 +#endif
   9.242 +
   9.243 +#endif /* __CURL_CURLBUILD_H */
    10.1 --- a/build-mac/curl/curlbuild32.h	Fri Mar 11 16:06:43 2016 +0100
    10.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    10.3 @@ -1,198 +0,0 @@
    10.4 -/* include/curl/curlbuild.h.  Generated from curlbuild.h.in by configure.  */
    10.5 -#ifndef __CURL_CURLBUILD_H
    10.6 -#define __CURL_CURLBUILD_H
    10.7 -/***************************************************************************
    10.8 - *                                  _   _ ____  _
    10.9 - *  Project                     ___| | | |  _ \| |
   10.10 - *                             / __| | | | |_) | |
   10.11 - *                            | (__| |_| |  _ <| |___
   10.12 - *                             \___|\___/|_| \_\_____|
   10.13 - *
   10.14 - * Copyright (C) 1998 - 2012, Daniel Stenberg, <daniel@haxx.se>, et al.
   10.15 - *
   10.16 - * This software is licensed as described in the file COPYING, which
   10.17 - * you should have received as part of this distribution. The terms
   10.18 - * are also available at http://curl.haxx.se/docs/copyright.html.
   10.19 - *
   10.20 - * You may opt to use, copy, modify, merge, publish, distribute and/or sell
   10.21 - * copies of the Software, and permit persons to whom the Software is
   10.22 - * furnished to do so, under the terms of the COPYING file.
   10.23 - *
   10.24 - * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
   10.25 - * KIND, either express or implied.
   10.26 - *
   10.27 - ***************************************************************************/
   10.28 -
   10.29 -/* ================================================================ */
   10.30 -/*               NOTES FOR CONFIGURE CAPABLE SYSTEMS                */
   10.31 -/* ================================================================ */
   10.32 -
   10.33 -/*
   10.34 - * NOTE 1:
   10.35 - * -------
   10.36 - *
   10.37 - * Nothing in this file is intended to be modified or adjusted by the
   10.38 - * curl library user nor by the curl library builder.
   10.39 - *
   10.40 - * If you think that something actually needs to be changed, adjusted
   10.41 - * or fixed in this file, then, report it on the libcurl development
   10.42 - * mailing list: http://cool.haxx.se/mailman/listinfo/curl-library/
   10.43 - *
   10.44 - * This header file shall only export symbols which are 'curl' or 'CURL'
   10.45 - * prefixed, otherwise public name space would be polluted.
   10.46 - *
   10.47 - * NOTE 2:
   10.48 - * -------
   10.49 - *
   10.50 - * Right now you might be staring at file include/curl/curlbuild.h.in or
   10.51 - * at file include/curl/curlbuild.h, this is due to the following reason:
   10.52 - *
   10.53 - * On systems capable of running the configure script, the configure process
   10.54 - * will overwrite the distributed include/curl/curlbuild.h file with one that
   10.55 - * is suitable and specific to the library being configured and built, which
   10.56 - * is generated from the include/curl/curlbuild.h.in template file.
   10.57 - *
   10.58 - */
   10.59 -
   10.60 -/* ================================================================ */
   10.61 -/*  DEFINITION OF THESE SYMBOLS SHALL NOT TAKE PLACE ANYWHERE ELSE  */
   10.62 -/* ================================================================ */
   10.63 -
   10.64 -#ifdef CURL_SIZEOF_LONG
   10.65 -#error "CURL_SIZEOF_LONG shall not be defined except in curlbuild.h"
   10.66 -   Error Compilation_aborted_CURL_SIZEOF_LONG_already_defined
   10.67 -#endif
   10.68 -
   10.69 -#ifdef CURL_TYPEOF_CURL_SOCKLEN_T
   10.70 -#error "CURL_TYPEOF_CURL_SOCKLEN_T shall not be defined except in curlbuild.h"
   10.71 -   Error Compilation_aborted_CURL_TYPEOF_CURL_SOCKLEN_T_already_defined
   10.72 -#endif
   10.73 -
   10.74 -#ifdef CURL_SIZEOF_CURL_SOCKLEN_T
   10.75 -#error "CURL_SIZEOF_CURL_SOCKLEN_T shall not be defined except in curlbuild.h"
   10.76 -   Error Compilation_aborted_CURL_SIZEOF_CURL_SOCKLEN_T_already_defined
   10.77 -#endif
   10.78 -
   10.79 -#ifdef CURL_TYPEOF_CURL_OFF_T
   10.80 -#error "CURL_TYPEOF_CURL_OFF_T shall not be defined except in curlbuild.h"
   10.81 -   Error Compilation_aborted_CURL_TYPEOF_CURL_OFF_T_already_defined
   10.82 -#endif
   10.83 -
   10.84 -#ifdef CURL_FORMAT_CURL_OFF_T
   10.85 -#error "CURL_FORMAT_CURL_OFF_T shall not be defined except in curlbuild.h"
   10.86 -   Error Compilation_aborted_CURL_FORMAT_CURL_OFF_T_already_defined
   10.87 -#endif
   10.88 -
   10.89 -#ifdef CURL_FORMAT_CURL_OFF_TU
   10.90 -#error "CURL_FORMAT_CURL_OFF_TU shall not be defined except in curlbuild.h"
   10.91 -   Error Compilation_aborted_CURL_FORMAT_CURL_OFF_TU_already_defined
   10.92 -#endif
   10.93 -
   10.94 -#ifdef CURL_FORMAT_OFF_T
   10.95 -#error "CURL_FORMAT_OFF_T shall not be defined except in curlbuild.h"
   10.96 -   Error Compilation_aborted_CURL_FORMAT_OFF_T_already_defined
   10.97 -#endif
   10.98 -
   10.99 -#ifdef CURL_SIZEOF_CURL_OFF_T
  10.100 -#error "CURL_SIZEOF_CURL_OFF_T shall not be defined except in curlbuild.h"
  10.101 -   Error Compilation_aborted_CURL_SIZEOF_CURL_OFF_T_already_defined
  10.102 -#endif
  10.103 -
  10.104 -#ifdef CURL_SUFFIX_CURL_OFF_T
  10.105 -#error "CURL_SUFFIX_CURL_OFF_T shall not be defined except in curlbuild.h"
  10.106 -   Error Compilation_aborted_CURL_SUFFIX_CURL_OFF_T_already_defined
  10.107 -#endif
  10.108 -
  10.109 -#ifdef CURL_SUFFIX_CURL_OFF_TU
  10.110 -#error "CURL_SUFFIX_CURL_OFF_TU shall not be defined except in curlbuild.h"
  10.111 -   Error Compilation_aborted_CURL_SUFFIX_CURL_OFF_TU_already_defined
  10.112 -#endif
  10.113 -
  10.114 -/* ================================================================ */
  10.115 -/*  EXTERNAL INTERFACE SETTINGS FOR CONFIGURE CAPABLE SYSTEMS ONLY  */
  10.116 -/* ================================================================ */
  10.117 -
  10.118 -/* Configure process defines this to 1 when it finds out that system  */
  10.119 -/* header file ws2tcpip.h must be included by the external interface. */
  10.120 -/* #undef CURL_PULL_WS2TCPIP_H */
  10.121 -#ifdef CURL_PULL_WS2TCPIP_H
  10.122 -#  ifndef WIN32_LEAN_AND_MEAN
  10.123 -#    define WIN32_LEAN_AND_MEAN
  10.124 -#  endif
  10.125 -#  include <windows.h>
  10.126 -#  include <winsock2.h>
  10.127 -#  include <ws2tcpip.h>
  10.128 -#endif
  10.129 -
  10.130 -/* Configure process defines this to 1 when it finds out that system   */
  10.131 -/* header file sys/types.h must be included by the external interface. */
  10.132 -#define CURL_PULL_SYS_TYPES_H 1
  10.133 -#ifdef CURL_PULL_SYS_TYPES_H
  10.134 -#  include <sys/types.h>
  10.135 -#endif
  10.136 -
  10.137 -/* Configure process defines this to 1 when it finds out that system */
  10.138 -/* header file stdint.h must be included by the external interface.  */
  10.139 -#define CURL_PULL_STDINT_H 1
  10.140 -#ifdef CURL_PULL_STDINT_H
  10.141 -#  include <stdint.h>
  10.142 -#endif
  10.143 -
  10.144 -/* Configure process defines this to 1 when it finds out that system  */
  10.145 -/* header file inttypes.h must be included by the external interface. */
  10.146 -#define CURL_PULL_INTTYPES_H 1
  10.147 -#ifdef CURL_PULL_INTTYPES_H
  10.148 -#  include <inttypes.h>
  10.149 -#endif
  10.150 -
  10.151 -/* Configure process defines this to 1 when it finds out that system    */
  10.152 -/* header file sys/socket.h must be included by the external interface. */
  10.153 -#define CURL_PULL_SYS_SOCKET_H 1
  10.154 -#ifdef CURL_PULL_SYS_SOCKET_H
  10.155 -#  include <sys/socket.h>
  10.156 -#endif
  10.157 -
  10.158 -/* Configure process defines this to 1 when it finds out that system  */
  10.159 -/* header file sys/poll.h must be included by the external interface. */
  10.160 -/* #undef CURL_PULL_SYS_POLL_H */
  10.161 -#ifdef CURL_PULL_SYS_POLL_H
  10.162 -#  include <sys/poll.h>
  10.163 -#endif
  10.164 -
  10.165 -/* The size of `long', as computed by sizeof. */
  10.166 -#define CURL_SIZEOF_LONG 4
  10.167 -
  10.168 -/* Integral data type used for curl_socklen_t. */
  10.169 -#define CURL_TYPEOF_CURL_SOCKLEN_T socklen_t
  10.170 -
  10.171 -/* The size of `curl_socklen_t', as computed by sizeof. */
  10.172 -#define CURL_SIZEOF_CURL_SOCKLEN_T 4
  10.173 -
  10.174 -/* Data type definition of curl_socklen_t. */
  10.175 -typedef CURL_TYPEOF_CURL_SOCKLEN_T curl_socklen_t;
  10.176 -
  10.177 -/* Signed integral data type used for curl_off_t. */
  10.178 -#define CURL_TYPEOF_CURL_OFF_T int64_t
  10.179 -
  10.180 -/* Data type definition of curl_off_t. */
  10.181 -typedef CURL_TYPEOF_CURL_OFF_T curl_off_t;
  10.182 -
  10.183 -/* curl_off_t formatting string directive without "%" conversion specifier. */
  10.184 -#define CURL_FORMAT_CURL_OFF_T "lld"
  10.185 -
  10.186 -/* unsigned curl_off_t formatting string without "%" conversion specifier. */
  10.187 -#define CURL_FORMAT_CURL_OFF_TU "llu"
  10.188 -
  10.189 -/* curl_off_t formatting string directive with "%" conversion specifier. */
  10.190 -#define CURL_FORMAT_OFF_T "%lld"
  10.191 -
  10.192 -/* The size of `curl_off_t', as computed by sizeof. */
  10.193 -#define CURL_SIZEOF_CURL_OFF_T 8
  10.194 -
  10.195 -/* curl_off_t constant suffix. */
  10.196 -#define CURL_SUFFIX_CURL_OFF_T LL
  10.197 -
  10.198 -/* unsigned curl_off_t constant suffix. */
  10.199 -#define CURL_SUFFIX_CURL_OFF_TU ULL
  10.200 -
  10.201 -#endif /* __CURL_CURLBUILD_H */
    11.1 --- a/build-mac/curl/curlbuild64.h	Fri Mar 11 16:06:43 2016 +0100
    11.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    11.3 @@ -1,198 +0,0 @@
    11.4 -/* include/curl/curlbuild.h.  Generated from curlbuild.h.in by configure.  */
    11.5 -#ifndef __CURL_CURLBUILD_H
    11.6 -#define __CURL_CURLBUILD_H
    11.7 -/***************************************************************************
    11.8 - *                                  _   _ ____  _
    11.9 - *  Project                     ___| | | |  _ \| |
   11.10 - *                             / __| | | | |_) | |
   11.11 - *                            | (__| |_| |  _ <| |___
   11.12 - *                             \___|\___/|_| \_\_____|
   11.13 - *
   11.14 - * Copyright (C) 1998 - 2012, Daniel Stenberg, <daniel@haxx.se>, et al.
   11.15 - *
   11.16 - * This software is licensed as described in the file COPYING, which
   11.17 - * you should have received as part of this distribution. The terms
   11.18 - * are also available at http://curl.haxx.se/docs/copyright.html.
   11.19 - *
   11.20 - * You may opt to use, copy, modify, merge, publish, distribute and/or sell
   11.21 - * copies of the Software, and permit persons to whom the Software is
   11.22 - * furnished to do so, under the terms of the COPYING file.
   11.23 - *
   11.24 - * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
   11.25 - * KIND, either express or implied.
   11.26 - *
   11.27 - ***************************************************************************/
   11.28 -
   11.29 -/* ================================================================ */
   11.30 -/*               NOTES FOR CONFIGURE CAPABLE SYSTEMS                */
   11.31 -/* ================================================================ */
   11.32 -
   11.33 -/*
   11.34 - * NOTE 1:
   11.35 - * -------
   11.36 - *
   11.37 - * Nothing in this file is intended to be modified or adjusted by the
   11.38 - * curl library user nor by the curl library builder.
   11.39 - *
   11.40 - * If you think that something actually needs to be changed, adjusted
   11.41 - * or fixed in this file, then, report it on the libcurl development
   11.42 - * mailing list: http://cool.haxx.se/mailman/listinfo/curl-library/
   11.43 - *
   11.44 - * This header file shall only export symbols which are 'curl' or 'CURL'
   11.45 - * prefixed, otherwise public name space would be polluted.
   11.46 - *
   11.47 - * NOTE 2:
   11.48 - * -------
   11.49 - *
   11.50 - * Right now you might be staring at file include/curl/curlbuild.h.in or
   11.51 - * at file include/curl/curlbuild.h, this is due to the following reason:
   11.52 - *
   11.53 - * On systems capable of running the configure script, the configure process
   11.54 - * will overwrite the distributed include/curl/curlbuild.h file with one that
   11.55 - * is suitable and specific to the library being configured and built, which
   11.56 - * is generated from the include/curl/curlbuild.h.in template file.
   11.57 - *
   11.58 - */
   11.59 -
   11.60 -/* ================================================================ */
   11.61 -/*  DEFINITION OF THESE SYMBOLS SHALL NOT TAKE PLACE ANYWHERE ELSE  */
   11.62 -/* ================================================================ */
   11.63 -
   11.64 -#ifdef CURL_SIZEOF_LONG
   11.65 -#error "CURL_SIZEOF_LONG shall not be defined except in curlbuild.h"
   11.66 -   Error Compilation_aborted_CURL_SIZEOF_LONG_already_defined
   11.67 -#endif
   11.68 -
   11.69 -#ifdef CURL_TYPEOF_CURL_SOCKLEN_T
   11.70 -#error "CURL_TYPEOF_CURL_SOCKLEN_T shall not be defined except in curlbuild.h"
   11.71 -   Error Compilation_aborted_CURL_TYPEOF_CURL_SOCKLEN_T_already_defined
   11.72 -#endif
   11.73 -
   11.74 -#ifdef CURL_SIZEOF_CURL_SOCKLEN_T
   11.75 -#error "CURL_SIZEOF_CURL_SOCKLEN_T shall not be defined except in curlbuild.h"
   11.76 -   Error Compilation_aborted_CURL_SIZEOF_CURL_SOCKLEN_T_already_defined
   11.77 -#endif
   11.78 -
   11.79 -#ifdef CURL_TYPEOF_CURL_OFF_T
   11.80 -#error "CURL_TYPEOF_CURL_OFF_T shall not be defined except in curlbuild.h"
   11.81 -   Error Compilation_aborted_CURL_TYPEOF_CURL_OFF_T_already_defined
   11.82 -#endif
   11.83 -
   11.84 -#ifdef CURL_FORMAT_CURL_OFF_T
   11.85 -#error "CURL_FORMAT_CURL_OFF_T shall not be defined except in curlbuild.h"
   11.86 -   Error Compilation_aborted_CURL_FORMAT_CURL_OFF_T_already_defined
   11.87 -#endif
   11.88 -
   11.89 -#ifdef CURL_FORMAT_CURL_OFF_TU
   11.90 -#error "CURL_FORMAT_CURL_OFF_TU shall not be defined except in curlbuild.h"
   11.91 -   Error Compilation_aborted_CURL_FORMAT_CURL_OFF_TU_already_defined
   11.92 -#endif
   11.93 -
   11.94 -#ifdef CURL_FORMAT_OFF_T
   11.95 -#error "CURL_FORMAT_OFF_T shall not be defined except in curlbuild.h"
   11.96 -   Error Compilation_aborted_CURL_FORMAT_OFF_T_already_defined
   11.97 -#endif
   11.98 -
   11.99 -#ifdef CURL_SIZEOF_CURL_OFF_T
  11.100 -#error "CURL_SIZEOF_CURL_OFF_T shall not be defined except in curlbuild.h"
  11.101 -   Error Compilation_aborted_CURL_SIZEOF_CURL_OFF_T_already_defined
  11.102 -#endif
  11.103 -
  11.104 -#ifdef CURL_SUFFIX_CURL_OFF_T
  11.105 -#error "CURL_SUFFIX_CURL_OFF_T shall not be defined except in curlbuild.h"
  11.106 -   Error Compilation_aborted_CURL_SUFFIX_CURL_OFF_T_already_defined
  11.107 -#endif
  11.108 -
  11.109 -#ifdef CURL_SUFFIX_CURL_OFF_TU
  11.110 -#error "CURL_SUFFIX_CURL_OFF_TU shall not be defined except in curlbuild.h"
  11.111 -   Error Compilation_aborted_CURL_SUFFIX_CURL_OFF_TU_already_defined
  11.112 -#endif
  11.113 -
  11.114 -/* ================================================================ */
  11.115 -/*  EXTERNAL INTERFACE SETTINGS FOR CONFIGURE CAPABLE SYSTEMS ONLY  */
  11.116 -/* ================================================================ */
  11.117 -
  11.118 -/* Configure process defines this to 1 when it finds out that system  */
  11.119 -/* header file ws2tcpip.h must be included by the external interface. */
  11.120 -/* #undef CURL_PULL_WS2TCPIP_H */
  11.121 -#ifdef CURL_PULL_WS2TCPIP_H
  11.122 -#  ifndef WIN32_LEAN_AND_MEAN
  11.123 -#    define WIN32_LEAN_AND_MEAN
  11.124 -#  endif
  11.125 -#  include <windows.h>
  11.126 -#  include <winsock2.h>
  11.127 -#  include <ws2tcpip.h>
  11.128 -#endif
  11.129 -
  11.130 -/* Configure process defines this to 1 when it finds out that system   */
  11.131 -/* header file sys/types.h must be included by the external interface. */
  11.132 -#define CURL_PULL_SYS_TYPES_H 1
  11.133 -#ifdef CURL_PULL_SYS_TYPES_H
  11.134 -#  include <sys/types.h>
  11.135 -#endif
  11.136 -
  11.137 -/* Configure process defines this to 1 when it finds out that system */
  11.138 -/* header file stdint.h must be included by the external interface.  */
  11.139 -/* #undef CURL_PULL_STDINT_H */
  11.140 -#ifdef CURL_PULL_STDINT_H
  11.141 -#  include <stdint.h>
  11.142 -#endif
  11.143 -
  11.144 -/* Configure process defines this to 1 when it finds out that system  */
  11.145 -/* header file inttypes.h must be included by the external interface. */
  11.146 -/* #undef CURL_PULL_INTTYPES_H */
  11.147 -#ifdef CURL_PULL_INTTYPES_H
  11.148 -#  include <inttypes.h>
  11.149 -#endif
  11.150 -
  11.151 -/* Configure process defines this to 1 when it finds out that system    */
  11.152 -/* header file sys/socket.h must be included by the external interface. */
  11.153 -#define CURL_PULL_SYS_SOCKET_H 1
  11.154 -#ifdef CURL_PULL_SYS_SOCKET_H
  11.155 -#  include <sys/socket.h>
  11.156 -#endif
  11.157 -
  11.158 -/* Configure process defines this to 1 when it finds out that system  */
  11.159 -/* header file sys/poll.h must be included by the external interface. */
  11.160 -/* #undef CURL_PULL_SYS_POLL_H */
  11.161 -#ifdef CURL_PULL_SYS_POLL_H
  11.162 -#  include <sys/poll.h>
  11.163 -#endif
  11.164 -
  11.165 -/* The size of `long', as computed by sizeof. */
  11.166 -#define CURL_SIZEOF_LONG 8
  11.167 -
  11.168 -/* Integral data type used for curl_socklen_t. */
  11.169 -#define CURL_TYPEOF_CURL_SOCKLEN_T socklen_t
  11.170 -
  11.171 -/* The size of `curl_socklen_t', as computed by sizeof. */
  11.172 -#define CURL_SIZEOF_CURL_SOCKLEN_T 4
  11.173 -
  11.174 -/* Data type definition of curl_socklen_t. */
  11.175 -typedef CURL_TYPEOF_CURL_SOCKLEN_T curl_socklen_t;
  11.176 -
  11.177 -/* Signed integral data type used for curl_off_t. */
  11.178 -#define CURL_TYPEOF_CURL_OFF_T long
  11.179 -
  11.180 -/* Data type definition of curl_off_t. */
  11.181 -typedef CURL_TYPEOF_CURL_OFF_T curl_off_t;
  11.182 -
  11.183 -/* curl_off_t formatting string directive without "%" conversion specifier. */
  11.184 -#define CURL_FORMAT_CURL_OFF_T "ld"
  11.185 -
  11.186 -/* unsigned curl_off_t formatting string without "%" conversion specifier. */
  11.187 -#define CURL_FORMAT_CURL_OFF_TU "lu"
  11.188 -
  11.189 -/* curl_off_t formatting string directive with "%" conversion specifier. */
  11.190 -#define CURL_FORMAT_OFF_T "%ld"
  11.191 -
  11.192 -/* The size of `curl_off_t', as computed by sizeof. */
  11.193 -#define CURL_SIZEOF_CURL_OFF_T 8
  11.194 -
  11.195 -/* curl_off_t constant suffix. */
  11.196 -#define CURL_SUFFIX_CURL_OFF_T L
  11.197 -
  11.198 -/* unsigned curl_off_t constant suffix. */
  11.199 -#define CURL_SUFFIX_CURL_OFF_TU UL
  11.200 -
  11.201 -#endif /* __CURL_CURLBUILD_H */
    12.1 --- a/build-mac/curl/curlbuild_.h	Fri Mar 11 16:06:43 2016 +0100
    12.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    12.3 @@ -1,198 +0,0 @@
    12.4 -/* include/curl/curlbuild.h.  Generated from curlbuild.h.in by configure.  */
    12.5 -#ifndef __CURL_CURLBUILD_H
    12.6 -#define __CURL_CURLBUILD_H
    12.7 -/***************************************************************************
    12.8 - *                                  _   _ ____  _
    12.9 - *  Project                     ___| | | |  _ \| |
   12.10 - *                             / __| | | | |_) | |
   12.11 - *                            | (__| |_| |  _ <| |___
   12.12 - *                             \___|\___/|_| \_\_____|
   12.13 - *
   12.14 - * Copyright (C) 1998 - 2012, Daniel Stenberg, <daniel@haxx.se>, et al.
   12.15 - *
   12.16 - * This software is licensed as described in the file COPYING, which
   12.17 - * you should have received as part of this distribution. The terms
   12.18 - * are also available at http://curl.haxx.se/docs/copyright.html.
   12.19 - *
   12.20 - * You may opt to use, copy, modify, merge, publish, distribute and/or sell
   12.21 - * copies of the Software, and permit persons to whom the Software is
   12.22 - * furnished to do so, under the terms of the COPYING file.
   12.23 - *
   12.24 - * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
   12.25 - * KIND, either express or implied.
   12.26 - *
   12.27 - ***************************************************************************/
   12.28 -
   12.29 -/* ================================================================ */
   12.30 -/*               NOTES FOR CONFIGURE CAPABLE SYSTEMS                */
   12.31 -/* ================================================================ */
   12.32 -
   12.33 -/*
   12.34 - * NOTE 1:
   12.35 - * -------
   12.36 - *
   12.37 - * Nothing in this file is intended to be modified or adjusted by the
   12.38 - * curl library user nor by the curl library builder.
   12.39 - *
   12.40 - * If you think that something actually needs to be changed, adjusted
   12.41 - * or fixed in this file, then, report it on the libcurl development
   12.42 - * mailing list: http://cool.haxx.se/mailman/listinfo/curl-library/
   12.43 - *
   12.44 - * This header file shall only export symbols which are 'curl' or 'CURL'
   12.45 - * prefixed, otherwise public name space would be polluted.
   12.46 - *
   12.47 - * NOTE 2:
   12.48 - * -------
   12.49 - *
   12.50 - * Right now you might be staring at file include/curl/curlbuild.h.in or
   12.51 - * at file include/curl/curlbuild.h, this is due to the following reason:
   12.52 - *
   12.53 - * On systems capable of running the configure script, the configure process
   12.54 - * will overwrite the distributed include/curl/curlbuild.h file with one that
   12.55 - * is suitable and specific to the library being configured and built, which
   12.56 - * is generated from the include/curl/curlbuild.h.in template file.
   12.57 - *
   12.58 - */
   12.59 -
   12.60 -/* ================================================================ */
   12.61 -/*  DEFINITION OF THESE SYMBOLS SHALL NOT TAKE PLACE ANYWHERE ELSE  */
   12.62 -/* ================================================================ */
   12.63 -
   12.64 -#ifdef CURL_SIZEOF_LONG
   12.65 -#error "CURL_SIZEOF_LONG shall not be defined except in curlbuild.h"
   12.66 -   Error Compilation_aborted_CURL_SIZEOF_LONG_already_defined
   12.67 -#endif
   12.68 -
   12.69 -#ifdef CURL_TYPEOF_CURL_SOCKLEN_T
   12.70 -#error "CURL_TYPEOF_CURL_SOCKLEN_T shall not be defined except in curlbuild.h"
   12.71 -   Error Compilation_aborted_CURL_TYPEOF_CURL_SOCKLEN_T_already_defined
   12.72 -#endif
   12.73 -
   12.74 -#ifdef CURL_SIZEOF_CURL_SOCKLEN_T
   12.75 -#error "CURL_SIZEOF_CURL_SOCKLEN_T shall not be defined except in curlbuild.h"
   12.76 -   Error Compilation_aborted_CURL_SIZEOF_CURL_SOCKLEN_T_already_defined
   12.77 -#endif
   12.78 -
   12.79 -#ifdef CURL_TYPEOF_CURL_OFF_T
   12.80 -#error "CURL_TYPEOF_CURL_OFF_T shall not be defined except in curlbuild.h"
   12.81 -   Error Compilation_aborted_CURL_TYPEOF_CURL_OFF_T_already_defined
   12.82 -#endif
   12.83 -
   12.84 -#ifdef CURL_FORMAT_CURL_OFF_T
   12.85 -#error "CURL_FORMAT_CURL_OFF_T shall not be defined except in curlbuild.h"
   12.86 -   Error Compilation_aborted_CURL_FORMAT_CURL_OFF_T_already_defined
   12.87 -#endif
   12.88 -
   12.89 -#ifdef CURL_FORMAT_CURL_OFF_TU
   12.90 -#error "CURL_FORMAT_CURL_OFF_TU shall not be defined except in curlbuild.h"
   12.91 -   Error Compilation_aborted_CURL_FORMAT_CURL_OFF_TU_already_defined
   12.92 -#endif
   12.93 -
   12.94 -#ifdef CURL_FORMAT_OFF_T
   12.95 -#error "CURL_FORMAT_OFF_T shall not be defined except in curlbuild.h"
   12.96 -   Error Compilation_aborted_CURL_FORMAT_OFF_T_already_defined
   12.97 -#endif
   12.98 -
   12.99 -#ifdef CURL_SIZEOF_CURL_OFF_T
  12.100 -#error "CURL_SIZEOF_CURL_OFF_T shall not be defined except in curlbuild.h"
  12.101 -   Error Compilation_aborted_CURL_SIZEOF_CURL_OFF_T_already_defined
  12.102 -#endif
  12.103 -
  12.104 -#ifdef CURL_SUFFIX_CURL_OFF_T
  12.105 -#error "CURL_SUFFIX_CURL_OFF_T shall not be defined except in curlbuild.h"
  12.106 -   Error Compilation_aborted_CURL_SUFFIX_CURL_OFF_T_already_defined
  12.107 -#endif
  12.108 -
  12.109 -#ifdef CURL_SUFFIX_CURL_OFF_TU
  12.110 -#error "CURL_SUFFIX_CURL_OFF_TU shall not be defined except in curlbuild.h"
  12.111 -   Error Compilation_aborted_CURL_SUFFIX_CURL_OFF_TU_already_defined
  12.112 -#endif
  12.113 -
  12.114 -/* ================================================================ */
  12.115 -/*  EXTERNAL INTERFACE SETTINGS FOR CONFIGURE CAPABLE SYSTEMS ONLY  */
  12.116 -/* ================================================================ */
  12.117 -
  12.118 -/* Configure process defines this to 1 when it finds out that system  */
  12.119 -/* header file ws2tcpip.h must be included by the external interface. */
  12.120 -/* #undef CURL_PULL_WS2TCPIP_H */
  12.121 -#ifdef CURL_PULL_WS2TCPIP_H
  12.122 -#  ifndef WIN32_LEAN_AND_MEAN
  12.123 -#    define WIN32_LEAN_AND_MEAN
  12.124 -#  endif
  12.125 -#  include <windows.h>
  12.126 -#  include <winsock2.h>
  12.127 -#  include <ws2tcpip.h>
  12.128 -#endif
  12.129 -
  12.130 -/* Configure process defines this to 1 when it finds out that system   */
  12.131 -/* header file sys/types.h must be included by the external interface. */
  12.132 -#define CURL_PULL_SYS_TYPES_H 1
  12.133 -#ifdef CURL_PULL_SYS_TYPES_H
  12.134 -#  include <sys/types.h>
  12.135 -#endif
  12.136 -
  12.137 -/* Configure process defines this to 1 when it finds out that system */
  12.138 -/* header file stdint.h must be included by the external interface.  */
  12.139 -#define CURL_PULL_STDINT_H 1
  12.140 -#ifdef CURL_PULL_STDINT_H
  12.141 -#  include <stdint.h>
  12.142 -#endif
  12.143 -
  12.144 -/* Configure process defines this to 1 when it finds out that system  */
  12.145 -/* header file inttypes.h must be included by the external interface. */
  12.146 -#define CURL_PULL_INTTYPES_H 1
  12.147 -#ifdef CURL_PULL_INTTYPES_H
  12.148 -#  include <inttypes.h>
  12.149 -#endif
  12.150 -
  12.151 -/* Configure process defines this to 1 when it finds out that system    */
  12.152 -/* header file sys/socket.h must be included by the external interface. */
  12.153 -#define CURL_PULL_SYS_SOCKET_H 1
  12.154 -#ifdef CURL_PULL_SYS_SOCKET_H
  12.155 -#  include <sys/socket.h>
  12.156 -#endif
  12.157 -
  12.158 -/* Configure process defines this to 1 when it finds out that system  */
  12.159 -/* header file sys/poll.h must be included by the external interface. */
  12.160 -/* #undef CURL_PULL_SYS_POLL_H */
  12.161 -#ifdef CURL_PULL_SYS_POLL_H
  12.162 -#  include <sys/poll.h>
  12.163 -#endif
  12.164 -
  12.165 -/* The size of `long', as computed by sizeof. */
  12.166 -#define CURL_SIZEOF_LONG 4
  12.167 -
  12.168 -/* Integral data type used for curl_socklen_t. */
  12.169 -#define CURL_TYPEOF_CURL_SOCKLEN_T socklen_t
  12.170 -
  12.171 -/* The size of `curl_socklen_t', as computed by sizeof. */
  12.172 -#define CURL_SIZEOF_CURL_SOCKLEN_T 4
  12.173 -
  12.174 -/* Data type definition of curl_socklen_t. */
  12.175 -typedef CURL_TYPEOF_CURL_SOCKLEN_T curl_socklen_t;
  12.176 -
  12.177 -/* Signed integral data type used for curl_off_t. */
  12.178 -#define CURL_TYPEOF_CURL_OFF_T int64_t
  12.179 -
  12.180 -/* Data type definition of curl_off_t. */
  12.181 -typedef CURL_TYPEOF_CURL_OFF_T curl_off_t;
  12.182 -
  12.183 -/* curl_off_t formatting string directive without "%" conversion specifier. */
  12.184 -#define CURL_FORMAT_CURL_OFF_T "lld"
  12.185 -
  12.186 -/* unsigned curl_off_t formatting string without "%" conversion specifier. */
  12.187 -#define CURL_FORMAT_CURL_OFF_TU "llu"
  12.188 -
  12.189 -/* curl_off_t formatting string directive with "%" conversion specifier. */
  12.190 -#define CURL_FORMAT_OFF_T "%lld"
  12.191 -
  12.192 -/* The size of `curl_off_t', as computed by sizeof. */
  12.193 -#define CURL_SIZEOF_CURL_OFF_T 8
  12.194 -
  12.195 -/* curl_off_t constant suffix. */
  12.196 -#define CURL_SUFFIX_CURL_OFF_T LL
  12.197 -
  12.198 -/* unsigned curl_off_t constant suffix. */
  12.199 -#define CURL_SUFFIX_CURL_OFF_TU ULL
  12.200 -
  12.201 -#endif /* __CURL_CURLBUILD_H */
    13.1 --- a/build-mac/curl/curlrules.h	Fri Mar 11 16:06:43 2016 +0100
    13.2 +++ b/build-mac/curl/curlrules.h	Tue Apr 26 10:49:43 2016 +0200
    13.3 @@ -11,7 +11,7 @@
    13.4   *
    13.5   * This software is licensed as described in the file COPYING, which
    13.6   * you should have received as part of this distribution. The terms
    13.7 - * are also available at http://curl.haxx.se/docs/copyright.html.
    13.8 + * are also available at https://curl.haxx.se/docs/copyright.html.
    13.9   *
   13.10   * You may opt to use, copy, modify, merge, publish, distribute and/or sell
   13.11   * copies of the Software, and permit persons to whom the Software is
   13.12 @@ -47,7 +47,7 @@
   13.13   * library is properly built and used.
   13.14   *
   13.15   * You can find further help on the libcurl development mailing list:
   13.16 - * http://cool.haxx.se/mailman/listinfo/curl-library/
   13.17 + * https://cool.haxx.se/mailman/listinfo/curl-library/
   13.18   *
   13.19   * NOTE 2
   13.20   * ------
    14.1 --- a/build-mac/curl/curlver.h	Fri Mar 11 16:06:43 2016 +0100
    14.2 +++ b/build-mac/curl/curlver.h	Tue Apr 26 10:49:43 2016 +0200
    14.3 @@ -7,11 +7,11 @@
    14.4   *                            | (__| |_| |  _ <| |___
    14.5   *                             \___|\___/|_| \_\_____|
    14.6   *
    14.7 - * Copyright (C) 1998 - 2015, Daniel Stenberg, <daniel@haxx.se>, et al.
    14.8 + * Copyright (C) 1998 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al.
    14.9   *
   14.10   * This software is licensed as described in the file COPYING, which
   14.11   * you should have received as part of this distribution. The terms
   14.12 - * are also available at http://curl.haxx.se/docs/copyright.html.
   14.13 + * are also available at https://curl.haxx.se/docs/copyright.html.
   14.14   *
   14.15   * You may opt to use, copy, modify, merge, publish, distribute and/or sell
   14.16   * copies of the Software, and permit persons to whom the Software is
   14.17 @@ -26,16 +26,16 @@
   14.18     a script at release-time. This was made its own header file in 7.11.2 */
   14.19  
   14.20  /* This is the global package copyright */
   14.21 -#define LIBCURL_COPYRIGHT "1996 - 2015 Daniel Stenberg, <daniel@haxx.se>."
   14.22 +#define LIBCURL_COPYRIGHT "1996 - 2016 Daniel Stenberg, <daniel@haxx.se>."
   14.23  
   14.24  /* This is the version number of the libcurl package from which this header
   14.25     file origins: */
   14.26 -#define LIBCURL_VERSION "7.43.0"
   14.27 +#define LIBCURL_VERSION "7.48.0"
   14.28  
   14.29  /* The numeric version number is also available "in parts" by using these
   14.30     defines: */
   14.31  #define LIBCURL_VERSION_MAJOR 7
   14.32 -#define LIBCURL_VERSION_MINOR 43
   14.33 +#define LIBCURL_VERSION_MINOR 48
   14.34  #define LIBCURL_VERSION_PATCH 0
   14.35  
   14.36  /* This is the numeric version of the libcurl version number, meant for easier
   14.37 @@ -57,7 +57,7 @@
   14.38     CURL_VERSION_BITS() macro since curl's own configure script greps for it
   14.39     and needs it to contain the full number.
   14.40  */
   14.41 -#define LIBCURL_VERSION_NUM 0x072b00
   14.42 +#define LIBCURL_VERSION_NUM 0x073000
   14.43  
   14.44  /*
   14.45   * This is the date and time when the full source package was created. The
   14.46 @@ -68,7 +68,7 @@
   14.47   *
   14.48   * "Mon Feb 12 11:35:33 UTC 2007"
   14.49   */
   14.50 -#define LIBCURL_TIMESTAMP "Wed Jun 17 05:56:00 UTC 2015"
   14.51 +#define LIBCURL_TIMESTAMP "Wed Mar 23 06:57:50 UTC 2016"
   14.52  
   14.53  #define CURL_VERSION_BITS(x,y,z) ((x)<<16|(y)<<8|z)
   14.54  #define CURL_AT_LEAST_VERSION(x,y,z) \
    15.1 --- a/build-mac/curl/easy.h	Fri Mar 11 16:06:43 2016 +0100
    15.2 +++ b/build-mac/curl/easy.h	Tue Apr 26 10:49:43 2016 +0200
    15.3 @@ -11,7 +11,7 @@
    15.4   *
    15.5   * This software is licensed as described in the file COPYING, which
    15.6   * you should have received as part of this distribution. The terms
    15.7 - * are also available at http://curl.haxx.se/docs/copyright.html.
    15.8 + * are also available at https://curl.haxx.se/docs/copyright.html.
    15.9   *
   15.10   * You may opt to use, copy, modify, merge, publish, distribute and/or sell
   15.11   * copies of the Software, and permit persons to whom the Software is
    16.1 --- a/build-mac/curl/mprintf.h	Fri Mar 11 16:06:43 2016 +0100
    16.2 +++ b/build-mac/curl/mprintf.h	Tue Apr 26 10:49:43 2016 +0200
    16.3 @@ -11,7 +11,7 @@
    16.4   *
    16.5   * This software is licensed as described in the file COPYING, which
    16.6   * you should have received as part of this distribution. The terms
    16.7 - * are also available at http://curl.haxx.se/docs/copyright.html.
    16.8 + * are also available at https://curl.haxx.se/docs/copyright.html.
    16.9   *
   16.10   * You may opt to use, copy, modify, merge, publish, distribute and/or sell
   16.11   * copies of the Software, and permit persons to whom the Software is
    17.1 --- a/build-mac/curl/multi.h	Fri Mar 11 16:06:43 2016 +0100
    17.2 +++ b/build-mac/curl/multi.h	Tue Apr 26 10:49:43 2016 +0200
    17.3 @@ -11,7 +11,7 @@
    17.4   *
    17.5   * This software is licensed as described in the file COPYING, which
    17.6   * you should have received as part of this distribution. The terms
    17.7 - * are also available at http://curl.haxx.se/docs/copyright.html.
    17.8 + * are also available at https://curl.haxx.se/docs/copyright.html.
    17.9   *
   17.10   * You may opt to use, copy, modify, merge, publish, distribute and/or sell
   17.11   * copies of the Software, and permit persons to whom the Software is
   17.12 @@ -370,6 +370,12 @@
   17.13    /* maximum number of open connections in total */
   17.14    CINIT(MAX_TOTAL_CONNECTIONS, LONG, 13),
   17.15  
   17.16 +   /* This is the server push callback function pointer */
   17.17 +  CINIT(PUSHFUNCTION, FUNCTIONPOINT, 14),
   17.18 +
   17.19 +  /* This is the argument passed to the server push callback */
   17.20 +  CINIT(PUSHDATA, OBJECTPOINT, 15),
   17.21 +
   17.22    CURLMOPT_LASTENTRY /* the last unused */
   17.23  } CURLMoption;
   17.24  
   17.25 @@ -397,6 +403,31 @@
   17.26  CURL_EXTERN CURLMcode curl_multi_assign(CURLM *multi_handle,
   17.27                                          curl_socket_t sockfd, void *sockp);
   17.28  
   17.29 +
   17.30 +/*
   17.31 + * Name: curl_push_callback
   17.32 + *
   17.33 + * Desc: This callback gets called when a new stream is being pushed by the
   17.34 + *       server. It approves or denies the new stream.
   17.35 + *
   17.36 + * Returns: CURL_PUSH_OK or CURL_PUSH_DENY.
   17.37 + */
   17.38 +#define CURL_PUSH_OK   0
   17.39 +#define CURL_PUSH_DENY 1
   17.40 +
   17.41 +struct curl_pushheaders;  /* forward declaration only */
   17.42 +
   17.43 +CURL_EXTERN char *curl_pushheader_bynum(struct curl_pushheaders *h,
   17.44 +                                        size_t num);
   17.45 +CURL_EXTERN char *curl_pushheader_byname(struct curl_pushheaders *h,
   17.46 +                                         const char *name);
   17.47 +
   17.48 +typedef int (*curl_push_callback)(CURL *parent,
   17.49 +                                  CURL *easy,
   17.50 +                                  size_t num_headers,
   17.51 +                                  struct curl_pushheaders *headers,
   17.52 +                                  void *userp);
   17.53 +
   17.54  #ifdef __cplusplus
   17.55  } /* end of extern "C" */
   17.56  #endif
    18.1 --- a/build-mac/curl/stdcheaders.h	Fri Mar 11 16:06:43 2016 +0100
    18.2 +++ b/build-mac/curl/stdcheaders.h	Tue Apr 26 10:49:43 2016 +0200
    18.3 @@ -11,7 +11,7 @@
    18.4   *
    18.5   * This software is licensed as described in the file COPYING, which
    18.6   * you should have received as part of this distribution. The terms
    18.7 - * are also available at http://curl.haxx.se/docs/copyright.html.
    18.8 + * are also available at https://curl.haxx.se/docs/copyright.html.
    18.9   *
   18.10   * You may opt to use, copy, modify, merge, publish, distribute and/or sell
   18.11   * copies of the Software, and permit persons to whom the Software is
    19.1 --- a/build-mac/curl/typecheck-gcc.h	Fri Mar 11 16:06:43 2016 +0100
    19.2 +++ b/build-mac/curl/typecheck-gcc.h	Tue Apr 26 10:49:43 2016 +0200
    19.3 @@ -7,11 +7,11 @@
    19.4   *                            | (__| |_| |  _ <| |___
    19.5   *                             \___|\___/|_| \_\_____|
    19.6   *
    19.7 - * Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al.
    19.8 + * Copyright (C) 1998 - 2015, Daniel Stenberg, <daniel@haxx.se>, et al.
    19.9   *
   19.10   * This software is licensed as described in the file COPYING, which
   19.11   * you should have received as part of this distribution. The terms
   19.12 - * are also available at http://curl.haxx.se/docs/copyright.html.
   19.13 + * are also available at https://curl.haxx.se/docs/copyright.html.
   19.14   *
   19.15   * You may opt to use, copy, modify, merge, publish, distribute and/or sell
   19.16   * copies of the Software, and permit persons to whom the Software is
   19.17 @@ -218,60 +218,67 @@
   19.18  
   19.19  /* evaluates to true if option takes a char* argument */
   19.20  #define _curl_is_string_option(option)                                        \
   19.21 -  ((option) == CURLOPT_URL ||                                                 \
   19.22 -   (option) == CURLOPT_PROXY ||                                               \
   19.23 -   (option) == CURLOPT_INTERFACE ||                                           \
   19.24 -   (option) == CURLOPT_NETRC_FILE ||                                          \
   19.25 -   (option) == CURLOPT_USERPWD ||                                             \
   19.26 -   (option) == CURLOPT_USERNAME ||                                            \
   19.27 -   (option) == CURLOPT_PASSWORD ||                                            \
   19.28 -   (option) == CURLOPT_PROXYUSERPWD ||                                        \
   19.29 -   (option) == CURLOPT_PROXYUSERNAME ||                                       \
   19.30 -   (option) == CURLOPT_PROXYPASSWORD ||                                       \
   19.31 -   (option) == CURLOPT_NOPROXY ||                                             \
   19.32 -   (option) == CURLOPT_ACCEPT_ENCODING ||                                     \
   19.33 -   (option) == CURLOPT_REFERER ||                                             \
   19.34 -   (option) == CURLOPT_USERAGENT ||                                           \
   19.35 +  ((option) == CURLOPT_ACCEPT_ENCODING ||                                     \
   19.36 +   (option) == CURLOPT_CAINFO ||                                              \
   19.37 +   (option) == CURLOPT_CAPATH ||                                              \
   19.38     (option) == CURLOPT_COOKIE ||                                              \
   19.39     (option) == CURLOPT_COOKIEFILE ||                                          \
   19.40     (option) == CURLOPT_COOKIEJAR ||                                           \
   19.41     (option) == CURLOPT_COOKIELIST ||                                          \
   19.42 +   (option) == CURLOPT_CRLFILE ||                                             \
   19.43 +   (option) == CURLOPT_CUSTOMREQUEST ||                                       \
   19.44 +   (option) == CURLOPT_DEFAULT_PROTOCOL ||                                    \
   19.45 +   (option) == CURLOPT_DNS_INTERFACE ||                                       \
   19.46 +   (option) == CURLOPT_DNS_LOCAL_IP4 ||                                       \
   19.47 +   (option) == CURLOPT_DNS_LOCAL_IP6 ||                                       \
   19.48 +   (option) == CURLOPT_DNS_SERVERS ||                                         \
   19.49 +   (option) == CURLOPT_EGDSOCKET ||                                           \
   19.50     (option) == CURLOPT_FTPPORT ||                                             \
   19.51 +   (option) == CURLOPT_FTP_ACCOUNT ||                                         \
   19.52     (option) == CURLOPT_FTP_ALTERNATIVE_TO_USER ||                             \
   19.53 -   (option) == CURLOPT_FTP_ACCOUNT ||                                         \
   19.54 +   (option) == CURLOPT_INTERFACE ||                                           \
   19.55 +   (option) == CURLOPT_ISSUERCERT ||                                          \
   19.56 +   (option) == CURLOPT_KEYPASSWD ||                                           \
   19.57 +   (option) == CURLOPT_KRBLEVEL ||                                            \
   19.58 +   (option) == CURLOPT_LOGIN_OPTIONS ||                                       \
   19.59 +   (option) == CURLOPT_MAIL_AUTH ||                                           \
   19.60 +   (option) == CURLOPT_MAIL_FROM ||                                           \
   19.61 +   (option) == CURLOPT_NETRC_FILE ||                                          \
   19.62 +   (option) == CURLOPT_NOPROXY ||                                             \
   19.63 +   (option) == CURLOPT_PASSWORD ||                                            \
   19.64 +   (option) == CURLOPT_PINNEDPUBLICKEY ||                                     \
   19.65 +   (option) == CURLOPT_PROXY ||                                               \
   19.66 +   (option) == CURLOPT_PROXYPASSWORD ||                                       \
   19.67 +   (option) == CURLOPT_PROXYUSERNAME ||                                       \
   19.68 +   (option) == CURLOPT_PROXYUSERPWD ||                                        \
   19.69 +   (option) == CURLOPT_PROXY_SERVICE_NAME ||                                  \
   19.70 +   (option) == CURLOPT_RANDOM_FILE ||                                         \
   19.71     (option) == CURLOPT_RANGE ||                                               \
   19.72 -   (option) == CURLOPT_CUSTOMREQUEST ||                                       \
   19.73 -   (option) == CURLOPT_SSLCERT ||                                             \
   19.74 -   (option) == CURLOPT_SSLCERTTYPE ||                                         \
   19.75 -   (option) == CURLOPT_SSLKEY ||                                              \
   19.76 -   (option) == CURLOPT_SSLKEYTYPE ||                                          \
   19.77 -   (option) == CURLOPT_KEYPASSWD ||                                           \
   19.78 -   (option) == CURLOPT_SSLENGINE ||                                           \
   19.79 -   (option) == CURLOPT_CAINFO ||                                              \
   19.80 -   (option) == CURLOPT_CAPATH ||                                              \
   19.81 -   (option) == CURLOPT_RANDOM_FILE ||                                         \
   19.82 -   (option) == CURLOPT_EGDSOCKET ||                                           \
   19.83 -   (option) == CURLOPT_SSL_CIPHER_LIST ||                                     \
   19.84 -   (option) == CURLOPT_KRBLEVEL ||                                            \
   19.85 -   (option) == CURLOPT_SSH_HOST_PUBLIC_KEY_MD5 ||                             \
   19.86 -   (option) == CURLOPT_SSH_PUBLIC_KEYFILE ||                                  \
   19.87 -   (option) == CURLOPT_SSH_PRIVATE_KEYFILE ||                                 \
   19.88 -   (option) == CURLOPT_CRLFILE ||                                             \
   19.89 -   (option) == CURLOPT_ISSUERCERT ||                                          \
   19.90 -   (option) == CURLOPT_SOCKS5_GSSAPI_SERVICE ||                               \
   19.91 -   (option) == CURLOPT_SSH_KNOWNHOSTS ||                                      \
   19.92 -   (option) == CURLOPT_MAIL_FROM ||                                           \
   19.93 +   (option) == CURLOPT_REFERER ||                                             \
   19.94     (option) == CURLOPT_RTSP_SESSION_ID ||                                     \
   19.95     (option) == CURLOPT_RTSP_STREAM_URI ||                                     \
   19.96     (option) == CURLOPT_RTSP_TRANSPORT ||                                      \
   19.97 +   (option) == CURLOPT_SERVICE_NAME ||                                        \
   19.98 +   (option) == CURLOPT_SOCKS5_GSSAPI_SERVICE ||                               \
   19.99 +   (option) == CURLOPT_SSH_HOST_PUBLIC_KEY_MD5 ||                             \
  19.100 +   (option) == CURLOPT_SSH_KNOWNHOSTS ||                                      \
  19.101 +   (option) == CURLOPT_SSH_PRIVATE_KEYFILE ||                                 \
  19.102 +   (option) == CURLOPT_SSH_PUBLIC_KEYFILE ||                                  \
  19.103 +   (option) == CURLOPT_SSLCERT ||                                             \
  19.104 +   (option) == CURLOPT_SSLCERTTYPE ||                                         \
  19.105 +   (option) == CURLOPT_SSLENGINE ||                                           \
  19.106 +   (option) == CURLOPT_SSLKEY ||                                              \
  19.107 +   (option) == CURLOPT_SSLKEYTYPE ||                                          \
  19.108 +   (option) == CURLOPT_SSL_CIPHER_LIST ||                                     \
  19.109 +   (option) == CURLOPT_TLSAUTH_PASSWORD ||                                    \
  19.110 +   (option) == CURLOPT_TLSAUTH_TYPE ||                                        \
  19.111 +   (option) == CURLOPT_TLSAUTH_USERNAME ||                                    \
  19.112 +   (option) == CURLOPT_UNIX_SOCKET_PATH ||                                    \
  19.113 +   (option) == CURLOPT_URL ||                                                 \
  19.114 +   (option) == CURLOPT_USERAGENT ||                                           \
  19.115 +   (option) == CURLOPT_USERNAME ||                                            \
  19.116 +   (option) == CURLOPT_USERPWD ||                                             \
  19.117     (option) == CURLOPT_XOAUTH2_BEARER ||                                      \
  19.118 -   (option) == CURLOPT_DNS_SERVERS ||                                         \
  19.119 -   (option) == CURLOPT_DNS_INTERFACE ||                                       \
  19.120 -   (option) == CURLOPT_DNS_LOCAL_IP4 ||                                       \
  19.121 -   (option) == CURLOPT_DNS_LOCAL_IP6 ||                                       \
  19.122 -   (option) == CURLOPT_LOGIN_OPTIONS ||                                       \
  19.123 -   (option) == CURLOPT_PROXY_SERVICE_NAME ||                                  \
  19.124 -   (option) == CURLOPT_SERVICE_NAME ||                                        \
  19.125     0)
  19.126  
  19.127  /* evaluates to true if option takes a curl_write_callback argument */
  19.128 @@ -287,21 +294,22 @@
  19.129  
  19.130  /* evaluates to true if option takes a data argument to pass to a callback */
  19.131  #define _curl_is_cb_data_option(option)                                       \
  19.132 -  ((option) == CURLOPT_WRITEDATA ||                                           \
  19.133 +  ((option) == CURLOPT_CHUNK_DATA ||                                          \
  19.134 +   (option) == CURLOPT_CLOSESOCKETDATA ||                                     \
  19.135 +   (option) == CURLOPT_DEBUGDATA ||                                           \
  19.136 +   (option) == CURLOPT_FNMATCH_DATA ||                                        \
  19.137 +   (option) == CURLOPT_HEADERDATA ||                                          \
  19.138 +   (option) == CURLOPT_INTERLEAVEDATA ||                                      \
  19.139 +   (option) == CURLOPT_IOCTLDATA ||                                           \
  19.140 +   (option) == CURLOPT_OPENSOCKETDATA ||                                      \
  19.141 +   (option) == CURLOPT_PRIVATE ||                                             \
  19.142 +   (option) == CURLOPT_PROGRESSDATA ||                                        \
  19.143     (option) == CURLOPT_READDATA ||                                            \
  19.144 -   (option) == CURLOPT_IOCTLDATA ||                                           \
  19.145 +   (option) == CURLOPT_SEEKDATA ||                                            \
  19.146     (option) == CURLOPT_SOCKOPTDATA ||                                         \
  19.147 -   (option) == CURLOPT_OPENSOCKETDATA ||                                      \
  19.148 -   (option) == CURLOPT_PROGRESSDATA ||                                        \
  19.149 -   (option) == CURLOPT_HEADERDATA ||                                         \
  19.150 -   (option) == CURLOPT_DEBUGDATA ||                                           \
  19.151 +   (option) == CURLOPT_SSH_KEYDATA ||                                         \
  19.152     (option) == CURLOPT_SSL_CTX_DATA ||                                        \
  19.153 -   (option) == CURLOPT_SEEKDATA ||                                            \
  19.154 -   (option) == CURLOPT_PRIVATE ||                                             \
  19.155 -   (option) == CURLOPT_SSH_KEYDATA ||                                         \
  19.156 -   (option) == CURLOPT_INTERLEAVEDATA ||                                      \
  19.157 -   (option) == CURLOPT_CHUNK_DATA ||                                          \
  19.158 -   (option) == CURLOPT_FNMATCH_DATA ||                                        \
  19.159 +   (option) == CURLOPT_WRITEDATA ||                                           \
  19.160     0)
  19.161  
  19.162  /* evaluates to true if option takes a POST data argument (void* or char*) */
  19.163 @@ -312,13 +320,15 @@
  19.164  
  19.165  /* evaluates to true if option takes a struct curl_slist * argument */
  19.166  #define _curl_is_slist_option(option)                                         \
  19.167 -  ((option) == CURLOPT_HTTPHEADER ||                                          \
  19.168 -   (option) == CURLOPT_HTTP200ALIASES ||                                      \
  19.169 -   (option) == CURLOPT_QUOTE ||                                               \
  19.170 +  ((option) == CURLOPT_HTTP200ALIASES ||                                      \
  19.171 +   (option) == CURLOPT_HTTPHEADER ||                                          \
  19.172 +   (option) == CURLOPT_MAIL_RCPT ||                                           \
  19.173     (option) == CURLOPT_POSTQUOTE ||                                           \
  19.174     (option) == CURLOPT_PREQUOTE ||                                            \
  19.175 +   (option) == CURLOPT_PROXYHEADER ||                                         \
  19.176 +   (option) == CURLOPT_QUOTE ||                                               \
  19.177 +   (option) == CURLOPT_RESOLVE ||                                             \
  19.178     (option) == CURLOPT_TELNETOPTIONS ||                                       \
  19.179 -   (option) == CURLOPT_MAIL_RCPT ||                                           \
  19.180     0)
  19.181  
  19.182  /* groups of curl_easy_getinfo infos that take the same type of argument */
    20.1 Binary file build-mac/libcurl.a has changed
    21.1 --- a/build-mac/pEpEngine.xcodeproj/project.pbxproj	Fri Mar 11 16:06:43 2016 +0100
    21.2 +++ b/build-mac/pEpEngine.xcodeproj/project.pbxproj	Tue Apr 26 10:49:43 2016 +0200
    21.3 @@ -7,6 +7,7 @@
    21.4  	objects = {
    21.5  
    21.6  /* Begin PBXBuildFile section */
    21.7 +		430D258B1C9ED75A00B94535 /* blacklist.c in Sources */ = {isa = PBXBuildFile; fileRef = 430D258A1C9ED75A00B94535 /* blacklist.c */; };
    21.8  		6400FB861B8CA1C6005221E3 /* libnetpgp.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 645922521B8BD32B00A5AF93 /* libnetpgp.a */; };
    21.9  		6400FB8B1B8CA1CF005221E3 /* libetpan-ios.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 64289E371B8B630200FC617B /* libetpan-ios.a */; };
   21.10  		644297C51BE11CE0002BC73B /* system.db in Resources */ = {isa = PBXBuildFile; fileRef = 64951A1B1BE0FCD800B10E71 /* system.db */; };
   21.11 @@ -90,12 +91,12 @@
   21.12  /* End PBXCopyFilesBuildPhase section */
   21.13  
   21.14  /* Begin PBXFileReference section */
   21.15 +		430D258A1C9ED75A00B94535 /* blacklist.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = blacklist.c; path = ../src/blacklist.c; sourceTree = "<group>"; };
   21.16  		644297BF1BE11C65002BC73B /* pEpTrustWords.bundle */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = pEpTrustWords.bundle; sourceTree = BUILT_PRODUCTS_DIR; };
   21.17  		644297C11BE11C65002BC73B /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
   21.18  		64796A3F1B455AA5004B1C24 /* libpEpEngine.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libpEpEngine.a; sourceTree = BUILT_PRODUCTS_DIR; };
   21.19  		64951A1B1BE0FCD800B10E71 /* system.db */ = {isa = PBXFileReference; lastKnownFileType = file; name = system.db; path = ../db/system.db; sourceTree = "<group>"; };
   21.20  		649DE08A1B45C19100912F72 /* libcurl.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libcurl.a; sourceTree = "<group>"; };
   21.21 -		649DE08C1B45D3B700912F72 /* build-libcurl-ios.sh */ = {isa = PBXFileReference; lastKnownFileType = text.script.sh; path = "build-libcurl-ios.sh"; sourceTree = "<group>"; };
   21.22  		64A8264C1B455D0800EECAF0 /* bloblist.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = bloblist.c; path = ../src/bloblist.c; sourceTree = "<group>"; };
   21.23  		64A8264D1B455D0800EECAF0 /* bloblist.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = bloblist.h; path = ../src/bloblist.h; sourceTree = "<group>"; };
   21.24  		64A8264E1B455D0800EECAF0 /* cryptotech.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = cryptotech.c; path = ../src/cryptotech.c; sourceTree = "<group>"; };
   21.25 @@ -195,7 +196,6 @@
   21.26  				64951A1B1BE0FCD800B10E71 /* system.db */,
   21.27  				64DA24121B832EBA000BEE80 /* libetpan.xcodeproj */,
   21.28  				64DA240C1B832EA0000BEE80 /* netpgp.xcodeproj */,
   21.29 -				649DE08C1B45D3B700912F72 /* build-libcurl-ios.sh */,
   21.30  				649DE08A1B45C19100912F72 /* libcurl.a */,
   21.31  				64A8264B1B455C5600EECAF0 /* srcref */,
   21.32  				644297C01BE11C65002BC73B /* pEpTrustWords */,
   21.33 @@ -215,6 +215,7 @@
   21.34  		64A8264B1B455C5600EECAF0 /* srcref */ = {
   21.35  			isa = PBXGroup;
   21.36  			children = (
   21.37 +				430D258A1C9ED75A00B94535 /* blacklist.c */,
   21.38  				64A8264C1B455D0800EECAF0 /* bloblist.c */,
   21.39  				64A8264D1B455D0800EECAF0 /* bloblist.h */,
   21.40  				64A8264E1B455D0800EECAF0 /* cryptotech.c */,
   21.41 @@ -320,7 +321,7 @@
   21.42  		64796A371B455AA5004B1C24 /* Project object */ = {
   21.43  			isa = PBXProject;
   21.44  			attributes = {
   21.45 -				LastUpgradeCheck = 0720;
   21.46 +				LastUpgradeCheck = 0730;
   21.47  				ORGANIZATIONNAME = "Edouard Tisserant";
   21.48  				TargetAttributes = {
   21.49  					644297BE1BE11C65002BC73B = {
   21.50 @@ -458,6 +459,7 @@
   21.51  				64A826791B455D0800EECAF0 /* cryptotech.c in Sources */,
   21.52  				64A826781B455D0800EECAF0 /* bloblist.c in Sources */,
   21.53  				64A826881B455D0800EECAF0 /* timestamp.c in Sources */,
   21.54 +				430D258B1C9ED75A00B94535 /* blacklist.c in Sources */,
   21.55  				64A826801B455D0800EECAF0 /* mime.c in Sources */,
   21.56  				64A8267F1B455D0800EECAF0 /* message.c in Sources */,
   21.57  				64A826811B455D0800EECAF0 /* pEpEngine.c in Sources */,
   21.58 @@ -538,11 +540,13 @@
   21.59  				GCC_WARN_UNUSED_VARIABLE = YES;
   21.60  				HEADER_SEARCH_PATHS = (
   21.61  					"$(inherited)",
   21.62 -					"$(OPENSSL_SRC)/include",
   21.63  					"$(SRCROOT)",
   21.64 +					"$(SRCROOT)/../../netpgp-et/include/",
   21.65 +					"$(SRCROOT)/../../netpgp-et/src/",
   21.66 +					"$(SRCROOT)/../../netpgp-et/netpgp-xcode/openssl/include/",
   21.67  				);
   21.68  				MTL_ENABLE_DEBUG_INFO = YES;
   21.69 -				ONLY_ACTIVE_ARCH = NO;
   21.70 +				ONLY_ACTIVE_ARCH = YES;
   21.71  				SDKROOT = iphoneos;
   21.72  			};
   21.73  			name = Debug;
   21.74 @@ -579,8 +583,10 @@
   21.75  				GCC_WARN_UNUSED_VARIABLE = YES;
   21.76  				HEADER_SEARCH_PATHS = (
   21.77  					"$(inherited)",
   21.78 -					"$(OPENSSL_SRC)/include",
   21.79  					"$(SRCROOT)",
   21.80 +					"$(SRCROOT)/../../netpgp-et/include/",
   21.81 +					"$(SRCROOT)/../../netpgp-et/src/",
   21.82 +					"$(SRCROOT)/../../netpgp-et/netpgp-xcode/openssl/include/",
   21.83  				);
   21.84  				MTL_ENABLE_DEBUG_INFO = NO;
   21.85  				ONLY_ACTIVE_ARCH = NO;
    22.1 --- a/db/en.csv	Fri Mar 11 16:06:43 2016 +0100
    22.2 +++ b/db/en.csv	Tue Apr 26 10:49:43 2016 +0200
    22.3 @@ -1891,7 +1891,7 @@
    22.4  en,1890,ANESTHETIC,0
    22.5  en,1891,ANESTHETIST,0
    22.6  en,1892,ANESTHETIZE,0
    22.7 -en,1893,ANESTHETIZER,0
    22.8 +en,1893,STAPLE,0
    22.9  en,1894,ANET,0
   22.10  en,1895,ANET,0
   22.11  en,1896,ANETT,0
   22.12 @@ -7845,7 +7845,7 @@
   22.13  en,7844,CASSANDRE,0
   22.14  en,7845,CASSANDRY,0
   22.15  en,7846,CASSATT,0
   22.16 -en,7847,CASSAUNDRA,0
   22.17 +en,7847,HORSE,0
   22.18  en,7848,CASSAVA,0
   22.19  en,7849,CASSEROLE,0
   22.20  en,7850,CASSETTE,0
   22.21 @@ -11681,7 +11681,7 @@
   22.22  en,11680,CUCKOO,0
   22.23  en,11681,CUCUMBER,0
   22.24  en,11682,CUDDLE,0
   22.25 -en,11683,CUDDLY,0
   22.26 +en,11683,BATTERY,0
   22.27  en,11684,CUDGEL,0
   22.28  en,11685,CUE,0
   22.29  en,11686,CUFF,0
   22.30 @@ -16555,7 +16555,7 @@
   22.31  en,16554,EVERYPLACE,0
   22.32  en,16555,EVERYTHING,0
   22.33  en,16556,EVERYWHERE,0
   22.34 -en,16557,EVICT,0
   22.35 +en,16557,CORRECT,0
   22.36  en,16558,EVICTION,0
   22.37  en,16559,EVIDENCE,0
   22.38  en,16560,EVIDENT,0
   22.39 @@ -22884,7 +22884,7 @@
   22.40  en,22883,HORRIFYING,0
   22.41  en,22884,HORROR,0
   22.42  en,22885,HORS,0
   22.43 -en,22886,HORSE,0
   22.44 +en,22886,CASSAUNDRA,0
   22.45  en,22887,HORSEBACK,0
   22.46  en,22888,HORSEDOM,0
   22.47  en,22889,HORSEFLESH,0
   22.48 @@ -31918,7 +31918,7 @@
   22.49  en,31917,NAMER,0
   22.50  en,31918,NAMESAKE,0
   22.51  en,31919,NAMIBIA,0
   22.52 -en,31920,NAMIBIAN,0
   22.53 +en,31920,XKCD,0
   22.54  en,31921,NAMING,0
   22.55  en,31922,NAN,0
   22.56  en,31923,NANA,0
   22.57 @@ -44371,7 +44371,7 @@
   22.58  en,44370,STANZA,0
   22.59  en,44371,STAPH,0
   22.60  en,44372,STAPHS,0
   22.61 -en,44373,STAPLE,0
   22.62 +en,44373,ANESTHETIZER,0
   22.63  en,44374,STAPLED,0
   22.64  en,44375,STAPLER,0
   22.65  en,44376,STAPLETON,0
   22.66 @@ -54021,7 +54021,7 @@
   22.67  en,54020,ANESTHETIC,0
   22.68  en,54021,ANESTHETIST,0
   22.69  en,54022,ANESTHETIZE,0
   22.70 -en,54023,ANESTHETIZER,0
   22.71 +en,54023,STAPLE,0
   22.72  en,54024,ANET,0
   22.73  en,54025,ANET,0
   22.74  en,54026,ANETT,0
   22.75 @@ -56428,7 +56428,7 @@
   22.76  en,56427,BATTED,0
   22.77  en,56428,BATTEN,0
   22.78  en,56429,BATTER,0
   22.79 -en,56430,BATTERY,0
   22.80 +en,56430,CUDDLY,0
   22.81  en,56431,BATTING,0
   22.82  en,56432,BATTLE,0
   22.83  en,56433,BATTLEDORE,0
   22.84 @@ -63034,7 +63034,7 @@
   22.85  en,63033,CORRAL,0
   22.86  en,63034,CORRALLED,0
   22.87  en,63035,CORRALLING,0
   22.88 -en,63036,CORRECT,0
   22.89 +en,63036,EVICT,0
   22.90  en,63037,CORRECTABLE,0
   22.91  en,63038,CORRECTED,0
   22.92  en,63039,CORRECTION,0
   22.93 @@ -63811,7 +63811,7 @@
   22.94  en,63810,CUCKOO,0
   22.95  en,63811,CUCUMBER,0
   22.96  en,63812,CUDDLE,0
   22.97 -en,63813,CUDDLY,0
   22.98 +en,63813,BATTERY,0
   22.99  en,63814,CUDGEL,0
  22.100  en,63815,CUE,0
  22.101  en,63816,CUFF,0
    23.1 --- a/src/Makefile	Fri Mar 11 16:06:43 2016 +0100
    23.2 +++ b/src/Makefile	Tue Apr 26 10:49:43 2016 +0200
    23.3 @@ -30,7 +30,7 @@
    23.4  CFLAGS?=-I$(GPGME_IN)/include $(OPTIMIZE) -fPIC -pedantic \
    23.5  	-DSYSTEM_DB=\"$(SYSTEM_DB)\" -DLIBGPGME=\"$(LIBGPGME)\" \
    23.6  	-DSQLITE_THREADSAFE=1 -D_GNU_SOURCE
    23.7 -LDFLAGS?=-L$(GPGME_IN)/lib -shared -lc -ldl -letpan -lsqlite3 -lpthread
    23.8 +LDFLAGS?=-L$(GPGME_IN)/lib -shared -lc -ldl -letpan -lpthread
    23.9  
   23.10  else
   23.11  $(error don't know how to make for $(BUILD_FOR) on $(BUILD_ON))
    24.1 --- a/src/blacklist.c	Fri Mar 11 16:06:43 2016 +0100
    24.2 +++ b/src/blacklist.c	Tue Apr 26 10:49:43 2016 +0200
    24.3 @@ -1,4 +1,5 @@
    24.4  #include "pEp_internal.h"
    24.5 +#include "blacklist.h"
    24.6  
    24.7  DYNAMIC_API PEP_STATUS blacklist_add(PEP_SESSION session, const char *fpr)
    24.8  {
    24.9 @@ -25,12 +26,6 @@
   24.10      }
   24.11  
   24.12      sqlite3_reset(session->blacklist_add);
   24.13 -    goto the_end;
   24.14 -
   24.15 -enomem:
   24.16 -    status = PEP_OUT_OF_MEMORY;
   24.17 -
   24.18 -the_end:
   24.19      return status;
   24.20  }
   24.21  
   24.22 @@ -59,12 +54,6 @@
   24.23      }
   24.24  
   24.25      sqlite3_reset(session->blacklist_delete);
   24.26 -    goto the_end;
   24.27 -
   24.28 -enomem:
   24.29 -    status = PEP_OUT_OF_MEMORY;
   24.30 -
   24.31 -the_end:
   24.32      return status;
   24.33  }
   24.34  
   24.35 @@ -102,12 +91,6 @@
   24.36      }
   24.37  
   24.38      sqlite3_reset(session->blacklist_is_listed);
   24.39 -    goto the_end;
   24.40 -
   24.41 -enomem:
   24.42 -    status = PEP_OUT_OF_MEMORY;
   24.43 -
   24.44 -the_end:
   24.45      return status;
   24.46  }
   24.47  
    25.1 --- a/src/blacklist.h	Fri Mar 11 16:06:43 2016 +0100
    25.2 +++ b/src/blacklist.h	Tue Apr 26 10:49:43 2016 +0200
    25.3 @@ -29,6 +29,7 @@
    25.4  //  parameters:
    25.5  //      session (in)        session to use
    25.6  //      fpr (in)            fingerprint of key to blacklist
    25.7 +//      bool (out)          flags if key is blacklisted
    25.8  
    25.9  DYNAMIC_API PEP_STATUS blacklist_is_listed(
   25.10          PEP_SESSION session,
    26.1 --- a/src/cryptotech.c	Fri Mar 11 16:06:43 2016 +0100
    26.2 +++ b/src/cryptotech.c	Tue Apr 26 10:49:43 2016 +0200
    26.3 @@ -45,6 +45,9 @@
    26.4          cryptotech[PEP_crypt_OpenPGP].renew_key = pgp_renew_key;
    26.5          cryptotech[PEP_crypt_OpenPGP].revoke_key = pgp_revoke_key;
    26.6          cryptotech[PEP_crypt_OpenPGP].key_expired = pgp_key_expired;
    26.7 +#ifdef PGP_BINARY_PATH
    26.8 +        cryptotech[PEP_crypt_OpenPGP].binary_path = PGP_BINARY_PATH;
    26.9 +#endif
   26.10      }
   26.11  
   26.12      session->cryptotech = cryptotech;
    27.1 --- a/src/cryptotech.h	Fri Mar 11 16:06:43 2016 +0100
    27.2 +++ b/src/cryptotech.h	Tue Apr 26 10:49:43 2016 +0200
    27.3 @@ -63,6 +63,8 @@
    27.4  typedef PEP_STATUS (*key_expired_t)(PEP_SESSION session, const char *fpr,
    27.5          bool *expired);
    27.6  
    27.7 +typedef PEP_STATUS (*binary_path_t)(const char **path);
    27.8 +
    27.9  typedef struct _PEP_cryptotech_t {
   27.10      uint8_t id;
   27.11      // the following are default values; comm_type may vary with key length or b0rken crypto
   27.12 @@ -82,6 +84,7 @@
   27.13      renew_key_t renew_key;
   27.14      revoke_key_t revoke_key;
   27.15      key_expired_t key_expired;
   27.16 +    binary_path_t binary_path;
   27.17  } PEP_cryptotech_t;
   27.18  
   27.19  extern PEP_cryptotech_t cryptotech[PEP_crypt__count];
    28.1 --- a/src/keymanagement.c	Fri Mar 11 16:06:43 2016 +0100
    28.2 +++ b/src/keymanagement.c	Tue Apr 26 10:49:43 2016 +0200
    28.3 @@ -4,17 +4,44 @@
    28.4  #include <stdio.h>
    28.5  #include <stdlib.h>
    28.6  #include <assert.h>
    28.7 +#include <ctype.h>
    28.8  
    28.9  #include "pEp_internal.h"
   28.10  #include "keymanagement.h"
   28.11  
   28.12 -
   28.13  #ifndef EMPTYSTR
   28.14  #define EMPTYSTR(STR) ((STR) == NULL || (STR)[0] == '\0')
   28.15  #endif
   28.16  
   28.17  #define KEY_EXPIRE_DELTA (60 * 60 * 24 * 365)
   28.18  
   28.19 +// Space tolerant and case insensitive fingerprint string compare
   28.20 +static int _same_fpr(
   28.21 +        const char* fpra,
   28.22 +        size_t fpras,
   28.23 +        const char* fprb,
   28.24 +        size_t fprbs
   28.25 +    )
   28.26 +{
   28.27 +    size_t ai = 0;
   28.28 +    size_t bi = 0;
   28.29 +    
   28.30 +    do {
   28.31 +        if(fpra[ai] == 0 || fprb[bi] == 0) {
   28.32 +            return 0;
   28.33 +        } else if(fpra[ai] == ' ') {
   28.34 +            ai++;
   28.35 +        } else if(fprb[bi] == ' ') {
   28.36 +            bi++;
   28.37 +        } else if(toupper(fpra[ai]) == toupper(fprb[bi])) {
   28.38 +            ai++;
   28.39 +            bi++;
   28.40 +        }
   28.41 +    }while(ai < fpras && bi < fprbs);
   28.42 +    
   28.43 +    return ai == fpras && bi == fprbs;
   28.44 +}
   28.45 +
   28.46  DYNAMIC_API PEP_STATUS update_identity(
   28.47          PEP_SESSION session, pEp_identity * identity
   28.48      )
   28.49 @@ -73,7 +100,10 @@
   28.50              }
   28.51          }
   28.52          else /* !EMPTYSTR(identity->fpr) */ {
   28.53 -            if (strncmp(identity->fpr, stored_identity->fpr, stored_identity->fpr_size) == 0) {
   28.54 +            if (_same_fpr(identity->fpr,
   28.55 +                          identity->fpr_size,
   28.56 +                          stored_identity->fpr,
   28.57 +                          stored_identity->fpr_size)) {
   28.58                  if (_comm_type_key < PEP_ct_unconfirmed_encryption) {
   28.59                      identity->comm_type = _comm_type_key;
   28.60                  }else{
    29.1 --- a/src/message_api.c	Fri Mar 11 16:06:43 2016 +0100
    29.2 +++ b/src/message_api.c	Tue Apr 26 10:49:43 2016 +0200
    29.3 @@ -813,10 +813,15 @@
    29.4  
    29.5      if (max_comm_type == PEP_ct_compromized)
    29.6          return PEP_ct_compromized;
    29.7 +    
    29.8 +    if (max_comm_type == PEP_ct_mistrusted)
    29.9 +        return PEP_ct_mistrusted;
   29.10  
   29.11      if (status == PEP_STATUS_OK) {
   29.12          if (ident->comm_type == PEP_ct_compromized)
   29.13              return PEP_ct_compromized;
   29.14 +        else if (ident->comm_type == PEP_ct_mistrusted)
   29.15 +            return PEP_ct_mistrusted;
   29.16          else
   29.17              return MIN(max_comm_type, ident->comm_type);
   29.18      }
   29.19 @@ -955,6 +960,7 @@
   29.20      }
   29.21  
   29.22      bool dest_keys_found = true;
   29.23 +    PEP_comm_type max_comm_type = PEP_ct_pEp;
   29.24  
   29.25      identity_list * _il;
   29.26      for (_il = src->to; _il && _il->ident; _il = _il->next) {
   29.27 @@ -968,6 +974,8 @@
   29.28              _k = stringlist_add(_k, _il->ident->fpr);
   29.29              if (_k == NULL)
   29.30                  goto enomem;
   29.31 +            max_comm_type = _get_comm_type(session, max_comm_type,
   29.32 +                                           _il->ident);
   29.33          }
   29.34          else {
   29.35              dest_keys_found = false;
   29.36 @@ -987,14 +995,20 @@
   29.37              _k = stringlist_add(_k, _il->ident->fpr);
   29.38              if (_k == NULL)
   29.39                  goto enomem;
   29.40 +            max_comm_type = _get_comm_type(session, max_comm_type,
   29.41 +                                           _il->ident);
   29.42          }
   29.43          else {
   29.44              dest_keys_found = false;
   29.45              status = PEP_KEY_NOT_FOUND;
   29.46          }
   29.47      }
   29.48 -
   29.49 -    if (!dest_keys_found) {
   29.50 +    
   29.51 +    if (!dest_keys_found ||
   29.52 +        stringlist_length(keys) == 0 ||
   29.53 +        _rating(max_comm_type,
   29.54 +                PEP_rating_undefined) < PEP_rating_reliable)
   29.55 +    {
   29.56          free_stringlist(keys);
   29.57          if (!session->passive_mode)
   29.58              attach_own_key(session, src);
   29.59 @@ -1411,3 +1425,19 @@
   29.60      return status;
   29.61  }
   29.62  
   29.63 +DYNAMIC_API PEP_STATUS get_binary_path(PEP_cryptotech tech, const char **path)
   29.64 +{
   29.65 +    PEP_STATUS status = PEP_STATUS_OK;
   29.66 +
   29.67 +    assert(path);
   29.68 +    if (path == NULL)
   29.69 +        return PEP_ILLEGAL_VALUE;
   29.70 +
   29.71 +    if (cryptotech[tech].binary_path == NULL)
   29.72 +        *path = NULL;
   29.73 +    else
   29.74 +        status = cryptotech[tech].binary_path(path);
   29.75 +
   29.76 +    return status;
   29.77 +}
   29.78 +
    30.1 --- a/src/message_api.h	Fri Mar 11 16:06:43 2016 +0100
    30.2 +++ b/src/message_api.h	Tue Apr 26 10:49:43 2016 +0200
    30.3 @@ -134,6 +134,15 @@
    30.4      );
    30.5  
    30.6  
    30.7 +// get_binary_path() - retrieve path of cryptotech binary if available
    30.8 +//
    30.9 +//  parameters:
   30.10 +//      tech (in)           cryptotech to get the binary for
   30.11 +//      path (out)          path to cryptotech binary or NULL if not available
   30.12 +//                          **path is owned by the library, do not change it!
   30.13 +DYNAMIC_API PEP_STATUS get_binary_path(PEP_cryptotech tech, const char **path);
   30.14 +
   30.15 +
   30.16  #ifdef __cplusplus
   30.17  }
   30.18  #endif
    31.1 --- a/src/pEpEngine.c	Fri Mar 11 16:06:43 2016 +0100
    31.2 +++ b/src/pEpEngine.c	Tue Apr 26 10:49:43 2016 +0200
    31.3 @@ -2,20 +2,21 @@
    31.4  #include "dynamic_api.h"
    31.5  #include "cryptotech.h"
    31.6  #include "transport.h"
    31.7 +#include "blacklist.h"
    31.8  
    31.9  static int init_count = -1;
   31.10  
   31.11  DYNAMIC_API PEP_STATUS init(PEP_SESSION *session)
   31.12  {
   31.13      PEP_STATUS status = PEP_STATUS_OK;
   31.14 -	int int_result;
   31.15 -	static const char *sql_log;
   31.16 -	static const char *sql_trustword;
   31.17 -	static const char *sql_get_identity;
   31.18 -	static const char *sql_set_person;
   31.19 -	static const char *sql_set_pgp_keypair;
   31.20 -	static const char *sql_set_identity;
   31.21 -	static const char *sql_set_trust;
   31.22 +    int int_result;
   31.23 +    static const char *sql_log;
   31.24 +    static const char *sql_trustword;
   31.25 +    static const char *sql_get_identity;
   31.26 +    static const char *sql_set_person;
   31.27 +    static const char *sql_set_pgp_keypair;
   31.28 +    static const char *sql_set_identity;
   31.29 +    static const char *sql_set_trust;
   31.30      static const char *sql_get_trust;
   31.31      static const char *sql_least_trust;
   31.32      static const char *sql_mark_as_compromized;
   31.33 @@ -42,18 +43,18 @@
   31.34      if (init_count == 0)
   31.35          in_first = true;
   31.36  
   31.37 -	assert(session);
   31.38 +    assert(session);
   31.39      if (session == NULL)
   31.40          return PEP_ILLEGAL_VALUE;
   31.41  
   31.42 -	*session = NULL;
   31.43 +    *session = NULL;
   31.44  
   31.45      pEpSession *_session = calloc(1, sizeof(pEpSession));
   31.46 -	assert(_session);
   31.47 -	if (_session == NULL)
   31.48 -		goto enomem;
   31.49 +    assert(_session);
   31.50 +    if (_session == NULL)
   31.51 +        goto enomem;
   31.52  
   31.53 -	_session->version = PEP_ENGINE_VERSION;
   31.54 +    _session->version = PEP_ENGINE_VERSION;
   31.55  
   31.56      assert(LOCAL_DB);
   31.57      if (LOCAL_DB == NULL) {
   31.58 @@ -61,43 +62,43 @@
   31.59          goto pep_error;
   31.60      }
   31.61  
   31.62 -	int_result = sqlite3_open_v2(
   31.63 -			LOCAL_DB,
   31.64 -			&_session->db,
   31.65 -			SQLITE_OPEN_READWRITE
   31.66 -				| SQLITE_OPEN_CREATE
   31.67 -				| SQLITE_OPEN_FULLMUTEX
   31.68 -				| SQLITE_OPEN_PRIVATECACHE,
   31.69 -			NULL 
   31.70 -		);
   31.71 +    int_result = sqlite3_open_v2(
   31.72 +            LOCAL_DB,
   31.73 +            &_session->db,
   31.74 +            SQLITE_OPEN_READWRITE
   31.75 +                | SQLITE_OPEN_CREATE
   31.76 +                | SQLITE_OPEN_FULLMUTEX
   31.77 +                | SQLITE_OPEN_PRIVATECACHE,
   31.78 +            NULL 
   31.79 +        );
   31.80  
   31.81 -	if (int_result != SQLITE_OK) {
   31.82 -		status = PEP_INIT_CANNOT_OPEN_DB;
   31.83 +    if (int_result != SQLITE_OK) {
   31.84 +        status = PEP_INIT_CANNOT_OPEN_DB;
   31.85          goto pep_error;
   31.86 -	}
   31.87 +    }
   31.88  
   31.89 -	sqlite3_busy_timeout(_session->db, BUSY_WAIT_TIME);
   31.90 +    sqlite3_busy_timeout(_session->db, BUSY_WAIT_TIME);
   31.91  
   31.92      assert(SYSTEM_DB);
   31.93      if (SYSTEM_DB == NULL) {
   31.94 -		status = PEP_INIT_CANNOT_OPEN_SYSTEM_DB;
   31.95 +        status = PEP_INIT_CANNOT_OPEN_SYSTEM_DB;
   31.96          goto pep_error;
   31.97      }
   31.98  
   31.99 -	int_result = sqlite3_open_v2(
  31.100 -			SYSTEM_DB, &_session->system_db,
  31.101 -			SQLITE_OPEN_READONLY
  31.102 -				| SQLITE_OPEN_FULLMUTEX
  31.103 -				| SQLITE_OPEN_SHAREDCACHE,
  31.104 -			NULL
  31.105 -		);
  31.106 +    int_result = sqlite3_open_v2(
  31.107 +            SYSTEM_DB, &_session->system_db,
  31.108 +            SQLITE_OPEN_READONLY
  31.109 +                | SQLITE_OPEN_FULLMUTEX
  31.110 +                | SQLITE_OPEN_SHAREDCACHE,
  31.111 +            NULL
  31.112 +        );
  31.113  
  31.114 -	if (int_result != SQLITE_OK) {
  31.115 -		status = PEP_INIT_CANNOT_OPEN_SYSTEM_DB;
  31.116 +    if (int_result != SQLITE_OK) {
  31.117 +        status = PEP_INIT_CANNOT_OPEN_SYSTEM_DB;
  31.118          goto pep_error;
  31.119 -	}
  31.120 +    }
  31.121  
  31.122 -	sqlite3_busy_timeout(_session->system_db, 1000);
  31.123 +    sqlite3_busy_timeout(_session->system_db, 1000);
  31.124  
  31.125      if (in_first) {
  31.126          int_result = sqlite3_exec(
  31.127 @@ -185,7 +186,7 @@
  31.128          sql_log = "insert into log (title, entity, description, comment)"
  31.129                    "values (?1, ?2, ?3, ?4);";
  31.130  
  31.131 -        sql_get_identity =	"select fpr, identity.user_id, username, comm_type, lang"
  31.132 +        sql_get_identity =    "select fpr, identity.user_id, username, comm_type, lang"
  31.133                              "   from identity"
  31.134                              "   join person on id = identity.user_id"
  31.135                              "   join pgp_keypair on fpr = identity.main_key_id"
  31.136 @@ -225,23 +226,28 @@
  31.137  
  31.138          // blacklist
  31.139  
  31.140 -        sql_blacklist_add = "insert or replace into blacklist_keys (fpr) values (?1) ;";
  31.141 +        sql_blacklist_add = "insert or replace into blacklist_keys (fpr) values (?1) ;"
  31.142 +                            "delete from identity where main_key_id = ?1 ;"
  31.143 +                            "delete from pgp_keypair where fpr = ?1 ;";
  31.144 +
  31.145          sql_blacklist_delete = "delete from blacklist_keys where fpr = ?1 ;";
  31.146 +
  31.147          sql_blacklist_is_listed = "select count(*) from blacklist_keys where fpr = ?1 ;";
  31.148 +
  31.149          sql_blacklist_retrieve = "select * from blacklist_keys ;";
  31.150      }
  31.151  
  31.152      int_result = sqlite3_prepare_v2(_session->db, sql_log, (int)strlen(sql_log),
  31.153              &_session->log, NULL);
  31.154 -	assert(int_result == SQLITE_OK);
  31.155 +    assert(int_result == SQLITE_OK);
  31.156  
  31.157      int_result = sqlite3_prepare_v2(_session->system_db, sql_trustword,
  31.158              (int)strlen(sql_trustword), &_session->trustword, NULL);
  31.159 -	assert(int_result == SQLITE_OK);
  31.160 +    assert(int_result == SQLITE_OK);
  31.161  
  31.162      int_result = sqlite3_prepare_v2(_session->db, sql_get_identity,
  31.163              (int)strlen(sql_get_identity), &_session->get_identity, NULL);
  31.164 -	assert(int_result == SQLITE_OK);
  31.165 +    assert(int_result == SQLITE_OK);
  31.166  
  31.167      int_result = sqlite3_prepare_v2(_session->db, sql_set_person,
  31.168              (int)strlen(sql_set_person), &_session->set_person, NULL);
  31.169 @@ -249,15 +255,15 @@
  31.170  
  31.171      int_result = sqlite3_prepare_v2(_session->db, sql_set_pgp_keypair,
  31.172              (int)strlen(sql_set_pgp_keypair), &_session->set_pgp_keypair, NULL);
  31.173 -	assert(int_result == SQLITE_OK);
  31.174 +    assert(int_result == SQLITE_OK);
  31.175  
  31.176      int_result = sqlite3_prepare_v2(_session->db, sql_set_identity,
  31.177              (int)strlen(sql_set_identity), &_session->set_identity, NULL);
  31.178 -	assert(int_result == SQLITE_OK);
  31.179 +    assert(int_result == SQLITE_OK);
  31.180  
  31.181      int_result = sqlite3_prepare_v2(_session->db, sql_set_trust,
  31.182              (int)strlen(sql_set_trust), &_session->set_trust, NULL);
  31.183 -	assert(int_result == SQLITE_OK);
  31.184 +    assert(int_result == SQLITE_OK);
  31.185  
  31.186      int_result = sqlite3_prepare_v2(_session->db, sql_get_trust,
  31.187              (int)strlen(sql_get_trust), &_session->get_trust, NULL);
  31.188 @@ -277,11 +283,11 @@
  31.189  
  31.190      int_result = sqlite3_prepare_v2(_session->system_db, sql_languagelist,
  31.191              (int)strlen(sql_languagelist), &_session->languagelist, NULL);
  31.192 -	assert(int_result == SQLITE_OK);
  31.193 +    assert(int_result == SQLITE_OK);
  31.194  
  31.195      int_result = sqlite3_prepare_v2(_session->system_db, sql_i18n_token,
  31.196              (int)strlen(sql_i18n_token), &_session->i18n_token, NULL);
  31.197 -	assert(int_result == SQLITE_OK);
  31.198 +    assert(int_result == SQLITE_OK);
  31.199  
  31.200      // blacklist
  31.201  
  31.202 @@ -318,8 +324,8 @@
  31.203      _session->passive_mode = false;
  31.204      _session->unencrypted_subject = false;
  31.205  
  31.206 -	*session = _session;
  31.207 -	return PEP_STATUS_OK;
  31.208 +    *session = _session;
  31.209 +    return PEP_STATUS_OK;
  31.210  
  31.211  enomem:
  31.212      status = PEP_OUT_OF_MEMORY;
  31.213 @@ -334,7 +340,7 @@
  31.214      bool out_last = false;
  31.215  
  31.216      assert(init_count >= 0);
  31.217 -	assert(session);
  31.218 +    assert(session);
  31.219  
  31.220      if (!((init_count >= 0) && session))
  31.221          return;
  31.222 @@ -346,32 +352,48 @@
  31.223          out_last = true;
  31.224      --init_count;
  31.225  
  31.226 -	if (session) {
  31.227 -		if (session->db) {
  31.228 +    if (session) {
  31.229 +        if (session->db) {
  31.230 +            if (session->log)
  31.231 +                sqlite3_finalize(session->log);
  31.232              if (session->trustword)
  31.233                  sqlite3_finalize(session->trustword);
  31.234 -            if (session->log)
  31.235 -                sqlite3_finalize(session->log);
  31.236              if (session->get_identity)
  31.237                  sqlite3_finalize(session->get_identity);
  31.238 -            if (session->set_identity)
  31.239 -                sqlite3_finalize(session->set_identity);
  31.240              if (session->set_person)
  31.241                  sqlite3_finalize(session->set_person);
  31.242              if (session->set_pgp_keypair)
  31.243                  sqlite3_finalize(session->set_pgp_keypair);
  31.244 +            if (session->set_identity)
  31.245 +                sqlite3_finalize(session->set_identity);
  31.246              if (session->set_trust)
  31.247                  sqlite3_finalize(session->set_trust);
  31.248              if (session->get_trust)
  31.249                  sqlite3_finalize(session->get_trust);
  31.250              if (session->least_trust)
  31.251                  sqlite3_finalize(session->least_trust);
  31.252 +            if (session->mark_compromized)
  31.253 +                sqlite3_finalize(session->mark_compromized);
  31.254 +            if (session->crashdump)
  31.255 +                sqlite3_finalize(session->crashdump);
  31.256 +            if (session->languagelist)
  31.257 +                sqlite3_finalize(session->languagelist);
  31.258 +            if (session->i18n_token)
  31.259 +                sqlite3_finalize(session->i18n_token);
  31.260 +            if (session->blacklist_add)
  31.261 +                sqlite3_finalize(session->blacklist_add);
  31.262 +            if (session->blacklist_delete)
  31.263 +                sqlite3_finalize(session->blacklist_delete);
  31.264 +            if (session->blacklist_is_listed)
  31.265 +                sqlite3_finalize(session->blacklist_is_listed);
  31.266 +            if (session->blacklist_retrieve)
  31.267 +                sqlite3_finalize(session->blacklist_retrieve);
  31.268  
  31.269              if (session->db)
  31.270                  sqlite3_close_v2(session->db);
  31.271              if (session->system_db)
  31.272                  sqlite3_close_v2(session->system_db);
  31.273 -		}
  31.274 +        }
  31.275  
  31.276          release_transport_system(session, out_last);
  31.277          release_cryptotech(session, out_last);
  31.278 @@ -400,36 +422,36 @@
  31.279          const char *comment
  31.280      )
  31.281  {
  31.282 -	PEP_STATUS status = PEP_STATUS_OK;
  31.283 -	int result;
  31.284 +    PEP_STATUS status = PEP_STATUS_OK;
  31.285 +    int result;
  31.286  
  31.287 -	assert(session);
  31.288 -	assert(title);
  31.289 -	assert(entity);
  31.290 +    assert(session);
  31.291 +    assert(title);
  31.292 +    assert(entity);
  31.293  
  31.294      if (!(session && title && entity))
  31.295          return PEP_ILLEGAL_VALUE;
  31.296  
  31.297 -	sqlite3_reset(session->log);
  31.298 -	sqlite3_bind_text(session->log, 1, title, -1, SQLITE_STATIC);
  31.299 -	sqlite3_bind_text(session->log, 2, entity, -1, SQLITE_STATIC);
  31.300 -	if (description)
  31.301 +    sqlite3_reset(session->log);
  31.302 +    sqlite3_bind_text(session->log, 1, title, -1, SQLITE_STATIC);
  31.303 +    sqlite3_bind_text(session->log, 2, entity, -1, SQLITE_STATIC);
  31.304 +    if (description)
  31.305          sqlite3_bind_text(session->log, 3, description, -1, SQLITE_STATIC);
  31.306 -	else
  31.307 -		sqlite3_bind_null(session->log, 3);
  31.308 -	if (comment)
  31.309 -		sqlite3_bind_text(session->log, 4, comment, -1, SQLITE_STATIC);
  31.310 -	else
  31.311 -		sqlite3_bind_null(session->log, 4);
  31.312 -	do {
  31.313 -		result = sqlite3_step(session->log);
  31.314 -		assert(result == SQLITE_DONE || result == SQLITE_BUSY);
  31.315 -		if (result != SQLITE_DONE && result != SQLITE_BUSY)
  31.316 -			status = PEP_UNKNOWN_ERROR;
  31.317 -	} while (result == SQLITE_BUSY);
  31.318 -	sqlite3_reset(session->log);
  31.319 +    else
  31.320 +        sqlite3_bind_null(session->log, 3);
  31.321 +    if (comment)
  31.322 +        sqlite3_bind_text(session->log, 4, comment, -1, SQLITE_STATIC);
  31.323 +    else
  31.324 +        sqlite3_bind_null(session->log, 4);
  31.325 +    do {
  31.326 +        result = sqlite3_step(session->log);
  31.327 +        assert(result == SQLITE_DONE || result == SQLITE_BUSY);
  31.328 +        if (result != SQLITE_DONE && result != SQLITE_BUSY)
  31.329 +            status = PEP_UNKNOWN_ERROR;
  31.330 +    } while (result == SQLITE_BUSY);
  31.331 +    sqlite3_reset(session->log);
  31.332  
  31.333 -	return status;
  31.334 +    return status;
  31.335  }
  31.336  
  31.337  DYNAMIC_API PEP_STATUS trustword(
  31.338 @@ -437,45 +459,45 @@
  31.339              char **word, size_t *wsize
  31.340          )
  31.341  {
  31.342 -	PEP_STATUS status = PEP_STATUS_OK;
  31.343 -	int result;
  31.344 +    PEP_STATUS status = PEP_STATUS_OK;
  31.345 +    int result;
  31.346  
  31.347 -	assert(session);
  31.348 -	assert(word);
  31.349 -	assert(wsize);
  31.350 +    assert(session);
  31.351 +    assert(word);
  31.352 +    assert(wsize);
  31.353  
  31.354      if (!(session && word && wsize))
  31.355          return PEP_ILLEGAL_VALUE;
  31.356  
  31.357 -	*word = NULL;
  31.358 -	*wsize = 0;
  31.359 +    *word = NULL;
  31.360 +    *wsize = 0;
  31.361  
  31.362 -	if (lang == NULL)
  31.363 -		lang = "en";
  31.364 +    if (lang == NULL)
  31.365 +        lang = "en";
  31.366  
  31.367 -	assert((lang[0] >= 'A' && lang[0] <= 'Z')
  31.368 +    assert((lang[0] >= 'A' && lang[0] <= 'Z')
  31.369              || (lang[0] >= 'a' && lang[0] <= 'z'));
  31.370 -	assert((lang[1] >= 'A' && lang[1] <= 'Z')
  31.371 +    assert((lang[1] >= 'A' && lang[1] <= 'Z')
  31.372              || (lang[1] >= 'a' && lang[1] <= 'z'));
  31.373 -	assert(lang[2] == 0);
  31.374 +    assert(lang[2] == 0);
  31.375  
  31.376 -	sqlite3_reset(session->trustword);
  31.377 +    sqlite3_reset(session->trustword);
  31.378      sqlite3_bind_text(session->trustword, 1, lang, -1, SQLITE_STATIC);
  31.379 -	sqlite3_bind_int(session->trustword, 2, value);
  31.380 +    sqlite3_bind_int(session->trustword, 2, value);
  31.381  
  31.382 -	result = sqlite3_step(session->trustword);
  31.383 -	if (result == SQLITE_ROW) {
  31.384 +    result = sqlite3_step(session->trustword);
  31.385 +    if (result == SQLITE_ROW) {
  31.386          *word = strdup((const char *) sqlite3_column_text(session->trustword,
  31.387                      1));
  31.388 -		if (*word)
  31.389 +        if (*word)
  31.390              *wsize = sqlite3_column_bytes(session->trustword, 1);
  31.391 -		else
  31.392 -			status = PEP_TRUSTWORD_NOT_FOUND;
  31.393 -	} else
  31.394 -		status = PEP_TRUSTWORD_NOT_FOUND;
  31.395 +        else
  31.396 +            status = PEP_TRUSTWORD_NOT_FOUND;
  31.397 +    } else
  31.398 +        status = PEP_TRUSTWORD_NOT_FOUND;
  31.399  
  31.400 -	sqlite3_reset(session->trustword);
  31.401 -	return status;
  31.402 +    sqlite3_reset(session->trustword);
  31.403 +    return status;
  31.404  }
  31.405  
  31.406  DYNAMIC_API PEP_STATUS trustwords(
  31.407 @@ -483,23 +505,23 @@
  31.408          char **words, size_t *wsize, int max_words
  31.409      )
  31.410  {
  31.411 -	const char *source = fingerprint;
  31.412 -	char *buffer;
  31.413 -	char *dest;
  31.414 -	size_t fsize;
  31.415 +    const char *source = fingerprint;
  31.416 +    char *buffer;
  31.417 +    char *dest;
  31.418 +    size_t fsize;
  31.419      PEP_STATUS _status;
  31.420  
  31.421 -	assert(session);
  31.422 -	assert(fingerprint);
  31.423 -	assert(words);
  31.424 -	assert(wsize);
  31.425 -	assert(max_words >= 0);
  31.426 +    assert(session);
  31.427 +    assert(fingerprint);
  31.428 +    assert(words);
  31.429 +    assert(wsize);
  31.430 +    assert(max_words >= 0);
  31.431  
  31.432      if (!(session && fingerprint && words && wsize && max_words >= 0))
  31.433          return PEP_ILLEGAL_VALUE;
  31.434  
  31.435 -	*words = NULL;
  31.436 -	*wsize = 0;
  31.437 +    *words = NULL;
  31.438 +    *wsize = 0;
  31.439  
  31.440      buffer = calloc(1, MAX_TRUSTWORDS_SPACE);
  31.441      assert(buffer);
  31.442 @@ -507,67 +529,67 @@
  31.443          return PEP_OUT_OF_MEMORY;
  31.444      dest = buffer;
  31.445  
  31.446 -	fsize = strlen(fingerprint);
  31.447 +    fsize = strlen(fingerprint);
  31.448  
  31.449 -	if (!lang || !lang[0])
  31.450 -		lang = "en";
  31.451 +    if (!lang || !lang[0])
  31.452 +        lang = "en";
  31.453  
  31.454 -	assert((lang[0] >= 'A' && lang[0] <= 'Z')
  31.455 +    assert((lang[0] >= 'A' && lang[0] <= 'Z')
  31.456              || (lang[0] >= 'a' && lang[0] <= 'z'));
  31.457 -	assert((lang[1] >= 'A' && lang[1] <= 'Z')
  31.458 +    assert((lang[1] >= 'A' && lang[1] <= 'Z')
  31.459              || (lang[1] >= 'a' && lang[1] <= 'z'));
  31.460 -	assert(lang[2] == 0);
  31.461 +    assert(lang[2] == 0);
  31.462  
  31.463 -	int n_words = 0;
  31.464 -	while (source < fingerprint + fsize) {
  31.465 -		uint16_t value;
  31.466 -		char *word;
  31.467 -		size_t _wsize;
  31.468 -		int j;
  31.469 +    int n_words = 0;
  31.470 +    while (source < fingerprint + fsize) {
  31.471 +        uint16_t value;
  31.472 +        char *word;
  31.473 +        size_t _wsize;
  31.474 +        int j;
  31.475  
  31.476          for (value=0, j=0; j < 4 && source < fingerprint + fsize; ) {
  31.477 -			if (*source >= 'a' && *source <= 'f')
  31.478 -				value += (*source - 'a' + 10) << (3 - j++) * 4;
  31.479 -			else if (*source >= 'A' && *source <= 'F')
  31.480 -				value += (*source - 'A' + 10) << (3 - j++) * 4;
  31.481 -			else if (*source >= '0' && *source <= '9')
  31.482 -				value += (*source - '0') << (3 - j++) * 4;
  31.483 -			
  31.484 -			source++;
  31.485 -		}
  31.486 +            if (*source >= 'a' && *source <= 'f')
  31.487 +                value += (*source - 'a' + 10) << (3 - j++) * 4;
  31.488 +            else if (*source >= 'A' && *source <= 'F')
  31.489 +                value += (*source - 'A' + 10) << (3 - j++) * 4;
  31.490 +            else if (*source >= '0' && *source <= '9')
  31.491 +                value += (*source - '0') << (3 - j++) * 4;
  31.492 +            
  31.493 +            source++;
  31.494 +        }
  31.495  
  31.496 -		_status = trustword(session, value, lang, &word, &_wsize);
  31.497 +        _status = trustword(session, value, lang, &word, &_wsize);
  31.498          if (_status == PEP_OUT_OF_MEMORY) {
  31.499              free(buffer);
  31.500              return PEP_OUT_OF_MEMORY;
  31.501          }
  31.502 -		if (word == NULL) {
  31.503 +        if (word == NULL) {
  31.504              free(buffer);
  31.505 -			return PEP_TRUSTWORD_NOT_FOUND;
  31.506 +            return PEP_TRUSTWORD_NOT_FOUND;
  31.507          }
  31.508  
  31.509 -		if (dest + _wsize < buffer + MAX_TRUSTWORDS_SPACE - 1) {
  31.510 -			strncpy(dest, word, _wsize);
  31.511 +        if (dest + _wsize < buffer + MAX_TRUSTWORDS_SPACE - 1) {
  31.512 +            strncpy(dest, word, _wsize);
  31.513              free(word);
  31.514 -			dest += _wsize;
  31.515 -		}
  31.516 -		else {
  31.517 +            dest += _wsize;
  31.518 +        }
  31.519 +        else {
  31.520              free(word);
  31.521 -			break; // buffer full
  31.522 +            break; // buffer full
  31.523          }
  31.524  
  31.525 -		if (source < fingerprint + fsize
  31.526 +        if (source < fingerprint + fsize
  31.527                  && dest + _wsize < buffer + MAX_TRUSTWORDS_SPACE - 1)
  31.528 -			*dest++ = ' ';
  31.529 +            *dest++ = ' ';
  31.530  
  31.531 -		++n_words;
  31.532 -		if (max_words && n_words >= max_words)
  31.533 -			break;
  31.534 -	}
  31.535 +        ++n_words;
  31.536 +        if (max_words && n_words >= max_words)
  31.537 +            break;
  31.538 +    }
  31.539  
  31.540 -	*words = buffer;
  31.541 -	*wsize = dest - buffer;
  31.542 -	return PEP_STATUS_OK;
  31.543 +    *words = buffer;
  31.544 +    *wsize = dest - buffer;
  31.545 +    return PEP_STATUS_OK;
  31.546  }
  31.547  
  31.548  pEp_identity *new_identity(
  31.549 @@ -653,13 +675,13 @@
  31.550          pEp_identity **identity
  31.551      )
  31.552  {
  31.553 -	PEP_STATUS status = PEP_STATUS_OK;
  31.554 -	static pEp_identity *_identity;
  31.555 -	int result;
  31.556 -	const char *_lang;
  31.557 +    PEP_STATUS status = PEP_STATUS_OK;
  31.558 +    static pEp_identity *_identity;
  31.559 +    int result;
  31.560 +    const char *_lang;
  31.561  
  31.562 -	assert(session);
  31.563 -	assert(address);
  31.564 +    assert(session);
  31.565 +    assert(address);
  31.566      assert(address[0]);
  31.567  
  31.568      if (!(session && address && address[0]))
  31.569 @@ -669,8 +691,8 @@
  31.570      sqlite3_bind_text(session->get_identity, 1, address, -1, SQLITE_STATIC);
  31.571  
  31.572      result = sqlite3_step(session->get_identity);
  31.573 -	switch (result) {
  31.574 -	case SQLITE_ROW:
  31.575 +    switch (result) {
  31.576 +    case SQLITE_ROW:
  31.577          _identity = new_identity(
  31.578                  address,
  31.579                  (const char *) sqlite3_column_text(session->get_identity, 0),
  31.580 @@ -684,102 +706,111 @@
  31.581          _identity->comm_type = (PEP_comm_type) sqlite3_column_int(session->get_identity, 3);
  31.582          _lang = (const char *) sqlite3_column_text(session->get_identity, 4);
  31.583          if (_lang && _lang[0]) {
  31.584 -			assert(_lang[0] >= 'a' && _lang[0] <= 'z');
  31.585 -			assert(_lang[1] >= 'a' && _lang[1] <= 'z');
  31.586 -			assert(_lang[2] == 0);
  31.587 -			_identity->lang[0] = _lang[0];
  31.588 -			_identity->lang[1] = _lang[1];
  31.589 +            assert(_lang[0] >= 'a' && _lang[0] <= 'z');
  31.590 +            assert(_lang[1] >= 'a' && _lang[1] <= 'z');
  31.591 +            assert(_lang[2] == 0);
  31.592 +            _identity->lang[0] = _lang[0];
  31.593 +            _identity->lang[1] = _lang[1];
  31.594              _identity->lang[2] = 0;
  31.595 -		}
  31.596 -		*identity = _identity;
  31.597 -		break;
  31.598 -	default:
  31.599 +        }
  31.600 +        *identity = _identity;
  31.601 +        break;
  31.602 +    default:
  31.603          status = PEP_CANNOT_FIND_IDENTITY;
  31.604 -		*identity = NULL;
  31.605 -	}
  31.606 +        *identity = NULL;
  31.607 +    }
  31.608  
  31.609      sqlite3_reset(session->get_identity);
  31.610 -	return status;
  31.611 +    return status;
  31.612  }
  31.613  
  31.614  DYNAMIC_API PEP_STATUS set_identity(
  31.615          PEP_SESSION session, const pEp_identity *identity
  31.616      )
  31.617  {
  31.618 -	int result;
  31.619 +    int result;
  31.620  
  31.621 -	assert(session);
  31.622 -	assert(identity);
  31.623 -	assert(identity->address);
  31.624 -	assert(identity->fpr);
  31.625 -	assert(identity->user_id);
  31.626 -	assert(identity->username);
  31.627 +    assert(session);
  31.628 +    assert(identity);
  31.629 +    assert(identity->address);
  31.630 +    assert(identity->fpr);
  31.631 +    assert(identity->user_id);
  31.632 +    assert(identity->username);
  31.633  
  31.634      if (!(session && identity && identity->address && identity->fpr &&
  31.635                  identity->user_id && identity->username))
  31.636          return PEP_ILLEGAL_VALUE;
  31.637  
  31.638 -	sqlite3_exec(session->db, "BEGIN ;", NULL, NULL, NULL);
  31.639 +    bool listed;
  31.640 +    PEP_STATUS status = blacklist_is_listed(session, identity->fpr, &listed);
  31.641 +    assert(status == PEP_STATUS_OK);
  31.642 +    if (status != PEP_STATUS_OK)
  31.643 +        return status;
  31.644  
  31.645 -	sqlite3_reset(session->set_person);
  31.646 +    if (listed)
  31.647 +        return PEP_KEY_BLACKLISTED;
  31.648 +
  31.649 +    sqlite3_exec(session->db, "BEGIN ;", NULL, NULL, NULL);
  31.650 +
  31.651 +    sqlite3_reset(session->set_person);
  31.652      sqlite3_bind_text(session->set_person, 1, identity->user_id, -1,
  31.653              SQLITE_STATIC);
  31.654      sqlite3_bind_text(session->set_person, 2, identity->username, -1,
  31.655              SQLITE_STATIC);
  31.656 -	if (identity->lang[0])
  31.657 +    if (identity->lang[0])
  31.658          sqlite3_bind_text(session->set_person, 3, identity->lang, 1,
  31.659                  SQLITE_STATIC);
  31.660 -	else
  31.661 -		sqlite3_bind_null(session->set_person, 3);
  31.662 -	result = sqlite3_step(session->set_person);
  31.663 -	sqlite3_reset(session->set_person);
  31.664 -	if (result != SQLITE_DONE) {
  31.665 -		sqlite3_exec(session->db, "ROLLBACK ;", NULL, NULL, NULL);
  31.666 -		return PEP_CANNOT_SET_PERSON;
  31.667 -	}
  31.668 +    else
  31.669 +        sqlite3_bind_null(session->set_person, 3);
  31.670 +    result = sqlite3_step(session->set_person);
  31.671 +    sqlite3_reset(session->set_person);
  31.672 +    if (result != SQLITE_DONE) {
  31.673 +        sqlite3_exec(session->db, "ROLLBACK ;", NULL, NULL, NULL);
  31.674 +        return PEP_CANNOT_SET_PERSON;
  31.675 +    }
  31.676  
  31.677 -	sqlite3_reset(session->set_pgp_keypair);
  31.678 +    sqlite3_reset(session->set_pgp_keypair);
  31.679      sqlite3_bind_text(session->set_pgp_keypair, 1, identity->fpr, -1,
  31.680              SQLITE_STATIC);
  31.681 -	result = sqlite3_step(session->set_pgp_keypair);
  31.682 -	sqlite3_reset(session->set_pgp_keypair);
  31.683 -	if (result != SQLITE_DONE) {
  31.684 -		sqlite3_exec(session->db, "ROLLBACK ;", NULL, NULL, NULL);
  31.685 -		return PEP_CANNOT_SET_PGP_KEYPAIR;
  31.686 -	}
  31.687 +    result = sqlite3_step(session->set_pgp_keypair);
  31.688 +    sqlite3_reset(session->set_pgp_keypair);
  31.689 +    if (result != SQLITE_DONE) {
  31.690 +        sqlite3_exec(session->db, "ROLLBACK ;", NULL, NULL, NULL);
  31.691 +        return PEP_CANNOT_SET_PGP_KEYPAIR;
  31.692 +    }
  31.693  
  31.694 -	sqlite3_reset(session->set_identity);
  31.695 +    sqlite3_reset(session->set_identity);
  31.696      sqlite3_bind_text(session->set_identity, 1, identity->address, -1,
  31.697              SQLITE_STATIC);
  31.698      sqlite3_bind_text(session->set_identity, 2, identity->fpr, -1,
  31.699              SQLITE_STATIC);
  31.700      sqlite3_bind_text(session->set_identity, 3, identity->user_id, -1,
  31.701              SQLITE_STATIC);
  31.702 -	result = sqlite3_step(session->set_identity);
  31.703 -	sqlite3_reset(session->set_identity);
  31.704 -	if (result != SQLITE_DONE) {
  31.705 -		sqlite3_exec(session->db, "ROLLBACK ;", NULL, NULL, NULL);
  31.706 -		return PEP_CANNOT_SET_IDENTITY;
  31.707 -	}
  31.708 +    result = sqlite3_step(session->set_identity);
  31.709 +    sqlite3_reset(session->set_identity);
  31.710 +    if (result != SQLITE_DONE) {
  31.711 +        sqlite3_exec(session->db, "ROLLBACK ;", NULL, NULL, NULL);
  31.712 +        return PEP_CANNOT_SET_IDENTITY;
  31.713 +    }
  31.714  
  31.715 -	sqlite3_reset(session->set_trust);
  31.716 +    sqlite3_reset(session->set_trust);
  31.717      sqlite3_bind_text(session->set_trust, 1, identity->user_id, -1,
  31.718              SQLITE_STATIC);
  31.719      sqlite3_bind_text(session->set_trust, 2, identity->fpr, -1,
  31.720              SQLITE_STATIC);
  31.721 -	sqlite3_bind_int(session->set_trust, 3, identity->comm_type);
  31.722 -	result = sqlite3_step(session->set_trust);
  31.723 -	sqlite3_reset(session->set_trust);
  31.724 -	if (result != SQLITE_DONE) {
  31.725 -		sqlite3_exec(session->db, "ROLLBACK ;", NULL, NULL, NULL);
  31.726 -		return PEP_CANNOT_SET_IDENTITY;
  31.727 -	}
  31.728 +    sqlite3_bind_int(session->set_trust, 3, identity->comm_type);
  31.729 +    result = sqlite3_step(session->set_trust);
  31.730 +    sqlite3_reset(session->set_trust);
  31.731 +    if (result != SQLITE_DONE) {
  31.732 +        sqlite3_exec(session->db, "ROLLBACK ;", NULL, NULL, NULL);
  31.733 +        return PEP_CANNOT_SET_IDENTITY;
  31.734 +    }
  31.735  
  31.736      result = sqlite3_exec(session->db, "COMMIT ;", NULL, NULL, NULL);
  31.737 -	if (result == SQLITE_OK)
  31.738 -		return PEP_STATUS_OK;
  31.739 -	else
  31.740 -		return PEP_COMMIT_FAILED;
  31.741 +    if (result == SQLITE_OK)
  31.742 +        return PEP_STATUS_OK;
  31.743 +    else
  31.744 +        return PEP_COMMIT_FAILED;
  31.745  }
  31.746  
  31.747  DYNAMIC_API PEP_STATUS mark_as_compromized(
  31.748 @@ -787,19 +818,19 @@
  31.749          const char *fpr
  31.750      )
  31.751  {
  31.752 -	int result;
  31.753 +    int result;
  31.754  
  31.755 -	assert(session);
  31.756 +    assert(session);
  31.757      assert(fpr && fpr[0]);
  31.758  
  31.759      if (!(session && fpr && fpr[0]))
  31.760          return PEP_ILLEGAL_VALUE;
  31.761  
  31.762 -	sqlite3_reset(session->mark_compromized);
  31.763 +    sqlite3_reset(session->mark_compromized);
  31.764      sqlite3_bind_text(session->mark_compromized, 1, fpr, -1,
  31.765              SQLITE_STATIC);
  31.766      result = sqlite3_step(session->mark_compromized);
  31.767 -	sqlite3_reset(session->mark_compromized);
  31.768 +    sqlite3_reset(session->mark_compromized);
  31.769  
  31.770      if (result != SQLITE_DONE)
  31.771          return PEP_CANNOT_SET_IDENTITY;
  31.772 @@ -1297,8 +1328,8 @@
  31.773          return PEP_ILLEGAL_VALUE;
  31.774  
  31.775      sqlite3_reset(session->i18n_token);
  31.776 -	sqlite3_bind_text(session->i18n_token, 1, lang, -1, SQLITE_STATIC);
  31.777 -	sqlite3_bind_int(session->i18n_token, 2, phrase_id);
  31.778 +    sqlite3_bind_text(session->i18n_token, 1, lang, -1, SQLITE_STATIC);
  31.779 +    sqlite3_bind_int(session->i18n_token, 2, phrase_id);
  31.780  
  31.781      const char *_phrase = NULL;
  31.782      int result;
    32.1 --- a/src/pEpEngine.h	Fri Mar 11 16:06:43 2016 +0100
    32.2 +++ b/src/pEpEngine.h	Tue Apr 26 10:49:43 2016 +0200
    32.3 @@ -25,71 +25,72 @@
    32.4  typedef struct _pEpSession * PEP_SESSION;
    32.5  
    32.6  typedef enum {
    32.7 -	PEP_STATUS_OK									= 0,
    32.8 +    PEP_STATUS_OK                                   = 0,
    32.9  
   32.10 -	PEP_INIT_CANNOT_LOAD_GPGME						= 0x0110,
   32.11 -	PEP_INIT_GPGME_INIT_FAILED						= 0x0111,
   32.12 -	PEP_INIT_NO_GPG_HOME							= 0x0112,
   32.13 -	PEP_INIT_NETPGP_INIT_FAILED						= 0x0113,
   32.14 +    PEP_INIT_CANNOT_LOAD_GPGME                      = 0x0110,
   32.15 +    PEP_INIT_GPGME_INIT_FAILED                      = 0x0111,
   32.16 +    PEP_INIT_NO_GPG_HOME                            = 0x0112,
   32.17 +    PEP_INIT_NETPGP_INIT_FAILED                     = 0x0113,
   32.18  
   32.19 -	PEP_INIT_SQLITE3_WITHOUT_MUTEX					= 0x0120,
   32.20 -	PEP_INIT_CANNOT_OPEN_DB							= 0x0121,
   32.21 -	PEP_INIT_CANNOT_OPEN_SYSTEM_DB					= 0x0122,
   32.22 -	
   32.23 -	PEP_KEY_NOT_FOUND						        = 0x0201,
   32.24 -	PEP_KEY_HAS_AMBIG_NAME					        = 0x0202,
   32.25 -	PEP_GET_KEY_FAILED						        = 0x0203,
   32.26 -	
   32.27 -	PEP_CANNOT_FIND_IDENTITY						= 0x0301,
   32.28 -	PEP_CANNOT_SET_PERSON							= 0x0381,
   32.29 -	PEP_CANNOT_SET_PGP_KEYPAIR						= 0x0382,
   32.30 -	PEP_CANNOT_SET_IDENTITY							= 0x0383,
   32.31 +    PEP_INIT_SQLITE3_WITHOUT_MUTEX                  = 0x0120,
   32.32 +    PEP_INIT_CANNOT_OPEN_DB                         = 0x0121,
   32.33 +    PEP_INIT_CANNOT_OPEN_SYSTEM_DB                  = 0x0122,
   32.34 +    
   32.35 +    PEP_KEY_NOT_FOUND                               = 0x0201,
   32.36 +    PEP_KEY_HAS_AMBIG_NAME                          = 0x0202,
   32.37 +    PEP_GET_KEY_FAILED                              = 0x0203,
   32.38 +    
   32.39 +    PEP_CANNOT_FIND_IDENTITY                        = 0x0301,
   32.40 +    PEP_CANNOT_SET_PERSON                           = 0x0381,
   32.41 +    PEP_CANNOT_SET_PGP_KEYPAIR                      = 0x0382,
   32.42 +    PEP_CANNOT_SET_IDENTITY                         = 0x0383,
   32.43      PEP_CANNOT_SET_TRUST                            = 0x0384,
   32.44 -	
   32.45 -	PEP_UNENCRYPTED									= 0x0400,
   32.46 -	PEP_VERIFIED									= 0x0401,
   32.47 -	PEP_DECRYPTED									= 0x0402,
   32.48 -	PEP_DECRYPTED_AND_VERIFIED						= 0x0403,
   32.49 -	PEP_DECRYPT_WRONG_FORMAT						= 0x0404,
   32.50 -	PEP_DECRYPT_NO_KEY								= 0x0405,
   32.51 -	PEP_DECRYPT_SIGNATURE_DOES_NOT_MATCH			= 0x0406,
   32.52 +    PEP_KEY_BLACKLISTED                             = 0x0385,
   32.53 +    
   32.54 +    PEP_UNENCRYPTED                                 = 0x0400,
   32.55 +    PEP_VERIFIED                                    = 0x0401,
   32.56 +    PEP_DECRYPTED                                   = 0x0402,
   32.57 +    PEP_DECRYPTED_AND_VERIFIED                      = 0x0403,
   32.58 +    PEP_DECRYPT_WRONG_FORMAT                        = 0x0404,
   32.59 +    PEP_DECRYPT_NO_KEY                              = 0x0405,
   32.60 +    PEP_DECRYPT_SIGNATURE_DOES_NOT_MATCH            = 0x0406,
   32.61      PEP_VERIFY_NO_KEY                               = 0x0407,
   32.62      PEP_VERIFIED_AND_TRUSTED                        = 0x0408,
   32.63 -	PEP_CANNOT_DECRYPT_UNKNOWN						= 0x04ff,
   32.64 +    PEP_CANNOT_DECRYPT_UNKNOWN                      = 0x04ff,
   32.65  
   32.66 -	PEP_TRUSTWORD_NOT_FOUND							= 0x0501,
   32.67 +    PEP_TRUSTWORD_NOT_FOUND                         = 0x0501,
   32.68  
   32.69      PEP_CANNOT_CREATE_KEY                           = 0x0601,
   32.70      PEP_CANNOT_SEND_KEY                             = 0x0602,
   32.71  
   32.72      PEP_PHRASE_NOT_FOUND                            = 0x0701,
   32.73  
   32.74 -	PEP_COMMIT_FAILED								= 0xff01,
   32.75 +    PEP_COMMIT_FAILED                               = 0xff01,
   32.76  
   32.77      PEP_CANNOT_CREATE_TEMP_FILE                     = -5,
   32.78      PEP_ILLEGAL_VALUE                               = -4,
   32.79      PEP_BUFFER_TOO_SMALL                            = -3,
   32.80 -	PEP_OUT_OF_MEMORY								= -2,
   32.81 -	PEP_UNKNOWN_ERROR								= -1
   32.82 +    PEP_OUT_OF_MEMORY                               = -2,
   32.83 +    PEP_UNKNOWN_ERROR                               = -1
   32.84  } PEP_STATUS;
   32.85  
   32.86  
   32.87  // INIT_STATUS init() - initialize pEpEngine for a thread
   32.88  //
   32.89  //  parameters:
   32.90 -//		session (out)	init() allocates session memory and returns a pointer
   32.91 -//		                as a handle
   32.92 +//        session (out)   init() allocates session memory and returns a pointer
   32.93 +//                        as a handle
   32.94  //
   32.95  //  return value:
   32.96 -//		PEP_STATUS_OK = 0					if init() succeeds
   32.97 -//		PEP_INIT_SQLITE3_WITHOUT_MUTEX		if SQLite3 was compiled with
   32.98 -//		                                    SQLITE_THREADSAFE 0
   32.99 -//		PEP_INIT_CANNOT_LOAD_GPGME			if libgpgme.dll cannot be found
  32.100 -//		PEP_INIT_GPGME_INIT_FAILED			if GPGME init fails
  32.101 -//		PEP_INIT_CANNOT_OPEN_DB				if user's management db cannot be
  32.102 -//		                                    opened
  32.103 -//		PEP_INIT_CANNOT_OPEN_SYSTEM_DB		if system's management db cannot be
  32.104 -//		                                    opened
  32.105 +//        PEP_STATUS_OK = 0                 if init() succeeds
  32.106 +//        PEP_INIT_SQLITE3_WITHOUT_MUTEX    if SQLite3 was compiled with
  32.107 +//                                            SQLITE_THREADSAFE 0
  32.108 +//        PEP_INIT_CANNOT_LOAD_GPGME        if libgpgme.dll cannot be found
  32.109 +//        PEP_INIT_GPGME_INIT_FAILED        if GPGME init fails
  32.110 +//        PEP_INIT_CANNOT_OPEN_DB           if user's management db cannot be
  32.111 +//                                            opened
  32.112 +//        PEP_INIT_CANNOT_OPEN_SYSTEM_DB    if system's management db cannot be
  32.113 +//                                            opened
  32.114  //
  32.115  //  caveat:
  32.116  //      the pointer is valid only if the return value is PEP_STATUS_OK
  32.117 @@ -105,11 +106,11 @@
  32.118  // void release() - release thread session handle
  32.119  //
  32.120  //  parameters:
  32.121 -//		session (in)	session handle to release
  32.122 +//        session (in)    session handle to release
  32.123  //
  32.124 -//	caveat:
  32.125 -//	    the last release() can be called only when all other release() calls
  32.126 -//	    are done
  32.127 +//    caveat:
  32.128 +//        the last release() can be called only when all other release() calls
  32.129 +//        are done
  32.130  
  32.131  DYNAMIC_API void release(PEP_SESSION session);
  32.132  
  32.133 @@ -134,27 +135,27 @@
  32.134  
  32.135  // decrypt_and_verify() - decrypt and/or verify a message
  32.136  //
  32.137 -//	parameters:
  32.138 -//		session (in)	session handle
  32.139 -//		ctext (in)		cipher text to decrypt and/or verify
  32.140 -//		csize (in)		size of cipher text
  32.141 -//		ptext (out)		pointer to internal buffer with plain text
  32.142 -//		psize (out)		size of plain text
  32.143 -//		keylist (out)	list of key ids which where used to encrypt
  32.144 +//    parameters:
  32.145 +//        session (in)    session handle
  32.146 +//        ctext (in)      cipher text to decrypt and/or verify
  32.147 +//        csize (in)      size of cipher text
  32.148 +//        ptext (out)     pointer to internal buffer with plain text
  32.149 +//        psize (out)     size of plain text
  32.150 +//        keylist (out)   list of key ids which where used to encrypt
  32.151  //
  32.152 -//	return value:
  32.153 -//		PEP_UNENCRYPTED				message was unencrypted and not signed
  32.154 -//		PEP_VERIFIED				message was unencrypted, signature matches
  32.155 -//		PEP_DECRYPTED				message is decrypted now, no signature
  32.156 -//		PEP_DECRYPTED_AND_VERIFIED	message is decrypted now and verified
  32.157 -//		PEP_DECRYPT_WRONG_FORMAT	message has wrong format to handle
  32.158 -//		PEP_DECRYPT_NO_KEY			key not available to decrypt and/or verify
  32.159 -//		PEP_DECRYPT_SIGNATURE_DOES_NOT_MATCH	wrong signature
  32.160 +//    return value:
  32.161 +//        PEP_UNENCRYPTED               message was unencrypted and not signed
  32.162 +//        PEP_VERIFIED                  message was unencrypted, signature matches
  32.163 +//        PEP_DECRYPTED                 message is decrypted now, no signature
  32.164 +//        PEP_DECRYPTED_AND_VERIFIED    message is decrypted now and verified
  32.165 +//        PEP_DECRYPT_WRONG_FORMAT      message has wrong format to handle
  32.166 +//        PEP_DECRYPT_NO_KEY            key not available to decrypt and/or verify
  32.167 +//        PEP_DECRYPT_SIGNATURE_DOES_NOT_MATCH    wrong signature
  32.168  //
  32.169 -//	caveat:
  32.170 -//	    the ownerships of ptext as well as keylist are going to the caller
  32.171 -//	    the caller must use free() (or an Windoze pEp_free()) and
  32.172 -//	    free_stringlist() to free them
  32.173 +//    caveat:
  32.174 +//        the ownerships of ptext as well as keylist are going to the caller
  32.175 +//        the caller must use free() (or an Windoze pEp_free()) and
  32.176 +//        free_stringlist() to free them
  32.177  //
  32.178  //      if this function failes an error message may be the first element of
  32.179  //      keylist and the other elements may be the keys used for encryption
  32.180 @@ -173,13 +174,13 @@
  32.181  //      size (in)       size of text
  32.182  //      signature (in)  signature text
  32.183  //      sig_size (in)   size of signature
  32.184 -//		keylist (out)	list of key ids which where used to encrypt or NULL on
  32.185 -//		                error
  32.186 +//      keylist (out)   list of key ids which where used to encrypt or NULL on
  32.187 +//                        error
  32.188  //
  32.189  //  return value:
  32.190 -//		PEP_VERIFIED				message was unencrypted, signature matches
  32.191 -//		PEP_DECRYPT_NO_KEY			key not available to decrypt and/or verify
  32.192 -//		PEP_DECRYPT_SIGNATURE_DOES_NOT_MATCH	wrong signature
  32.193 +//        PEP_VERIFIED                message was unencrypted, signature matches
  32.194 +//        PEP_DECRYPT_NO_KEY          key not available to decrypt and/or verify
  32.195 +//        PEP_DECRYPT_SIGNATURE_DOES_NOT_MATCH    wrong signature
  32.196  
  32.197  DYNAMIC_API PEP_STATUS verify_text(
  32.198          PEP_SESSION session, const char *text, size_t size,
  32.199 @@ -189,24 +190,24 @@
  32.200  
  32.201  // encrypt_and_sign() - encrypt and sign a message
  32.202  //
  32.203 -//	parameters:
  32.204 -//		session (in)	session handle
  32.205 -//		keylist (in)	list of key ids to encrypt with as C strings
  32.206 -//		ptext (in)		plain text to decrypt and/or verify
  32.207 -//		psize (in)		size of plain text
  32.208 -//		ctext (out)		pointer to internal buffer with cipher text
  32.209 -//		csize (out)		size of cipher text
  32.210 +//    parameters:
  32.211 +//        session (in)    session handle
  32.212 +//        keylist (in)    list of key ids to encrypt with as C strings
  32.213 +//        ptext (in)      plain text to decrypt and/or verify
  32.214 +//        psize (in)      size of plain text
  32.215 +//        ctext (out)     pointer to internal buffer with cipher text
  32.216 +//        csize (out)     size of cipher text
  32.217  //
  32.218 -//	return value:
  32.219 -//		PEP_STATUS_OK = 0				encryption and signing succeeded
  32.220 -//		PEP_KEY_NOT_FOUND	            at least one of the receipient keys
  32.221 -//		                                could not be found
  32.222 -//		PEP_KEY_HAS_AMBIG_NAME          at least one of the receipient keys has
  32.223 -//		                                an ambiguous name
  32.224 -//		PEP_GET_KEY_FAILED		        cannot retrieve key
  32.225 +//    return value:
  32.226 +//        PEP_STATUS_OK = 0            encryption and signing succeeded
  32.227 +//        PEP_KEY_NOT_FOUND            at least one of the receipient keys
  32.228 +//                                     could not be found
  32.229 +//        PEP_KEY_HAS_AMBIG_NAME       at least one of the receipient keys has
  32.230 +//                                     an ambiguous name
  32.231 +//        PEP_GET_KEY_FAILED           cannot retrieve key
  32.232  //
  32.233 -//	caveat:
  32.234 -//	    the ownership of ctext is going to the caller
  32.235 +//    caveat:
  32.236 +//      the ownership of ctext is going to the caller
  32.237  //      the caller is responsible to free() it (on Windoze use pEp_free())
  32.238  //      the first key in keylist is being used to sign the message
  32.239  //      this implies there has to be a private key for that keypair
  32.240 @@ -220,17 +221,17 @@
  32.241  // log_event() - log a user defined event defined by UTF-8 encoded strings into
  32.242  // management log
  32.243  //
  32.244 -//	parameters:
  32.245 -//		session (in)		session handle
  32.246 -//		title (in)			C string with event name
  32.247 -//		entity (in)			C string with name of entity which is logging
  32.248 -//		description (in)	C string with long description for event or NULL if
  32.249 -//		                    omitted
  32.250 -//		comment (in)		C string with user defined comment or NULL if
  32.251 -//		                    omitted
  32.252 +//    parameters:
  32.253 +//        session (in)        session handle
  32.254 +//        title (in)          C string with event name
  32.255 +//        entity (in)         C string with name of entity which is logging
  32.256 +//        description (in)    C string with long description for event or NULL if
  32.257 +//                            omitted
  32.258 +//        comment (in)        C string with user defined comment or NULL if
  32.259 +//                            omitted
  32.260  //
  32.261 -//	return value:
  32.262 -//	    PEP_STATUS_OK       log entry created
  32.263 +//    return value:
  32.264 +//        PEP_STATUS_OK       log entry created
  32.265  
  32.266  DYNAMIC_API PEP_STATUS log_event(
  32.267          PEP_SESSION session,
  32.268 @@ -243,21 +244,21 @@
  32.269  
  32.270  // trustword() - get the corresponding trustword for a 16 bit value
  32.271  //
  32.272 -//	parameters:
  32.273 -//		session (in)		    session handle
  32.274 -//		value (in)			    value to find a trustword for
  32.275 -//		lang (in)			    C string with ISO 639-1 language code
  32.276 -//		word (out)			    pointer to C string with trustword UTF-8 encoded
  32.277 -//							    NULL if language is not supported or trustword
  32.278 -//							    wordlist is damaged or unavailable
  32.279 -//		wsize (out)			    length of trustword
  32.280 +//    parameters:
  32.281 +//        session (in)            session handle
  32.282 +//        value (in)              value to find a trustword for
  32.283 +//        lang (in)               C string with ISO 639-1 language code
  32.284 +//        word (out)              pointer to C string with trustword UTF-8 encoded
  32.285 +//                                NULL if language is not supported or trustword
  32.286 +//                                wordlist is damaged or unavailable
  32.287 +//        wsize (out)             length of trustword
  32.288  //
  32.289 -//	return value:
  32.290 -//	    PEP_STATUS_OK           trustword retrieved
  32.291 -//	    PEP_TRUSTWORD_NOT_FOUND  trustword not found
  32.292 +//    return value:
  32.293 +//        PEP_STATUS_OK            trustword retrieved
  32.294 +//        PEP_TRUSTWORD_NOT_FOUND  trustword not found
  32.295  //
  32.296 -//	caveat:
  32.297 -//		the word pointer goes to the ownership of the caller
  32.298 +//    caveat:
  32.299 +//        the word pointer goes to the ownership of the caller
  32.300  //      the caller is responsible to free() it (on Windoze use pEp_free())
  32.301  
  32.302  DYNAMIC_API PEP_STATUS trustword(
  32.303 @@ -268,25 +269,25 @@
  32.304  
  32.305  // trustwords() - get trustwords for a string of hex values of a fingerprint
  32.306  //
  32.307 -//	parameters:
  32.308 -//		session (in)		session handle
  32.309 -//		fingerprint (in)	C string with hex values to find trustwords for
  32.310 -//		lang (in)			C string with ISO 639-1 language code
  32.311 -//		words (out)			pointer to C string with trustwords UTF-8 encoded,
  32.312 -//		                    separated by a blank each
  32.313 -//							NULL if language is not supported or trustword
  32.314 -//							wordlist is damaged or unavailable
  32.315 -//		wsize (out)			length of trustwords string
  32.316 -//		max_words (in)		only generate a string with max_words;
  32.317 -//							if max_words == 0 there is no such limit
  32.318 +//    parameters:
  32.319 +//        session (in)        session handle
  32.320 +//        fingerprint (in)    C string with hex values to find trustwords for
  32.321 +//        lang (in)           C string with ISO 639-1 language code
  32.322 +//        words (out)         pointer to C string with trustwords UTF-8 encoded,
  32.323 +//                            separated by a blank each
  32.324 +//                            NULL if language is not supported or trustword
  32.325 +//                            wordlist is damaged or unavailable
  32.326 +//        wsize (out)         length of trustwords string
  32.327 +//        max_words (in)      only generate a string with max_words;
  32.328 +//                            if max_words == 0 there is no such limit
  32.329  //
  32.330 -//	return value:
  32.331 -//	    PEP_STATUS_OK           trustwords retrieved
  32.332 -//      PEP_OUT_OF_MEMORY       out of memory
  32.333 -//	    PEP_TRUSTWORD_NOT_FOUND at least one trustword not found
  32.334 +//    return value:
  32.335 +//        PEP_STATUS_OK            trustwords retrieved
  32.336 +//        PEP_OUT_OF_MEMORY        out of memory
  32.337 +//        PEP_TRUSTWORD_NOT_FOUND  at least one trustword not found
  32.338  //
  32.339 -//	caveat:
  32.340 -//		the word pointer goes to the ownership of the caller
  32.341 +//    caveat:
  32.342 +//        the word pointer goes to the ownership of the caller
  32.343  //      the caller is responsible to free() it (on Windoze use pEp_free())
  32.344  //
  32.345  //  DON'T USE THIS FUNCTION FROM HIGH LEVEL LANGUAGES!
  32.346 @@ -324,7 +325,7 @@
  32.347      // range 0x10 to 0x3f: unconfirmed encryption
  32.348  
  32.349      PEP_ct_unconfirmed_encryption = 0x10,       // generic
  32.350 -    PEP_ct_OpenPGP_weak_unconfirmed = 0x11,	    // RSA 1024 is weak
  32.351 +    PEP_ct_OpenPGP_weak_unconfirmed = 0x11,     // RSA 1024 is weak
  32.352  
  32.353      PEP_ct_to_be_checked = 0x20,                // generic
  32.354      PEP_ct_SMIME_unconfirmed = 0x21,
  32.355 @@ -345,34 +346,34 @@
  32.356      // range 0x90 to 0xbf: confirmed encryption
  32.357  
  32.358      PEP_ct_confirmed_encryption = 0x90,         // generic
  32.359 -	PEP_ct_OpenPGP_weak = 0x91,                 // RSA 1024 is weak
  32.360 +    PEP_ct_OpenPGP_weak = 0x91,                 // RSA 1024 is weak
  32.361  
  32.362      PEP_ct_to_be_checked_confirmed = 0xa0,      //generic
  32.363      PEP_ct_SMIME = 0xa1,
  32.364      PEP_ct_CMS = 0xa2,
  32.365  
  32.366      PEP_ct_strong_encryption = 0xb0,            // generic
  32.367 -	PEP_ct_OpenPGP = 0xb8,                      // key at least 2048 bit RSA or EC
  32.368 -	PEP_ct_OTR = 0xba,
  32.369 +    PEP_ct_OpenPGP = 0xb8,                      // key at least 2048 bit RSA or EC
  32.370 +    PEP_ct_OTR = 0xba,
  32.371  
  32.372      // range 0xc0 to 0xff: confirmed encryption and anonymization
  32.373  
  32.374      PEP_ct_confirmed_enc_anon = 0xc0,           // generic
  32.375 -	PEP_ct_pEp = 0xff
  32.376 +    PEP_ct_pEp = 0xff
  32.377  } PEP_comm_type;
  32.378  
  32.379  typedef struct _pEp_identity {
  32.380 -	size_t struct_size;			// size of whole struct
  32.381 -	char *address;		        // C string with address UTF-8 encoded
  32.382 -	size_t address_size;		// size of address
  32.383 -	char *fpr;			        // C string with fingerprint UTF-8 encoded
  32.384 -	size_t fpr_size;			// size of fingerprint
  32.385 -	char *user_id;		        // C string with user ID UTF-8 encoded
  32.386 -	size_t user_id_size;		// size of user ID
  32.387 -	char *username;		        // C string with user name UTF-8 encoded
  32.388 -	size_t username_size;		// size of user name
  32.389 -	PEP_comm_type comm_type;	// type of communication with this ID
  32.390 -    char lang[3];				// language of conversation
  32.391 +    size_t struct_size;         // size of whole struct
  32.392 +    char *address;              // C string with address UTF-8 encoded
  32.393 +    size_t address_size;        // size of address
  32.394 +    char *fpr;                  // C string with fingerprint UTF-8 encoded
  32.395 +    size_t fpr_size;            // size of fingerprint
  32.396 +    char *user_id;              // C string with user ID UTF-8 encoded
  32.397 +    size_t user_id_size;        // size of user ID
  32.398 +    char *username;             // C string with user name UTF-8 encoded
  32.399 +    size_t username_size;       // size of user name
  32.400 +    PEP_comm_type comm_type;    // type of communication with this ID
  32.401 +    char lang[3];               // language of conversation
  32.402                                  // ISO 639-1 ALPHA-2, last byte is 0
  32.403      bool me;                    // if this is the local user herself/himself
  32.404  } pEp_identity;
  32.405 @@ -428,18 +429,18 @@
  32.406  
  32.407  // get_identity() - get identity information
  32.408  //
  32.409 -//	parameters:
  32.410 -//		session (in)		session handle
  32.411 -//		address (in)		C string with communication address, UTF-8 encoded
  32.412 -//		identity (out)		pointer to pEp_identity structure with results or
  32.413 -//		                    NULL if failure
  32.414 +//    parameters:
  32.415 +//        session (in)        session handle
  32.416 +//        address (in)        C string with communication address, UTF-8 encoded
  32.417 +//        identity (out)      pointer to pEp_identity structure with results or
  32.418 +//                            NULL if failure
  32.419  //
  32.420 -//	caveat:
  32.421 -//	    the address string is being copied; the original string remains in the
  32.422 -//	    ownership of the caller
  32.423 -//		the resulting pEp_identity structure goes to the ownership of the
  32.424 -//		caller and has to be freed with free_identity() when not in use any
  32.425 -//		more
  32.426 +//    caveat:
  32.427 +//        the address string is being copied; the original string remains in the
  32.428 +//        ownership of the caller
  32.429 +//        the resulting pEp_identity structure goes to the ownership of the
  32.430 +//        caller and has to be freed with free_identity() when not in use any
  32.431 +//        more
  32.432  
  32.433  DYNAMIC_API PEP_STATUS get_identity(
  32.434          PEP_SESSION session, const char *address,
  32.435 @@ -449,21 +450,22 @@
  32.436  
  32.437  // set_identity() - set identity information
  32.438  //
  32.439 -//	parameters:
  32.440 -//		session (in)		session handle
  32.441 -//		identity (in)		pointer to pEp_identity structure
  32.442 +//    parameters:
  32.443 +//        session (in)        session handle
  32.444 +//        identity (in)       pointer to pEp_identity structure
  32.445  //
  32.446 -//	return value:
  32.447 -//		PEP_STATUS_OK = 0			    encryption and signing succeeded
  32.448 -//		PEP_CANNOT_SET_PERSON		    writing to table person failed
  32.449 -//		PEP_CANNOT_SET_PGP_KEYPAIR	    writing to table pgp_keypair failed
  32.450 -//		PEP_CANNOT_SET_IDENTITY		    writing to table identity failed
  32.451 -//		PEP_COMMIT_FAILED			    SQL commit failed
  32.452 +//    return value:
  32.453 +//        PEP_STATUS_OK = 0             encryption and signing succeeded
  32.454 +//        PEP_CANNOT_SET_PERSON         writing to table person failed
  32.455 +//        PEP_CANNOT_SET_PGP_KEYPAIR    writing to table pgp_keypair failed
  32.456 +//        PEP_CANNOT_SET_IDENTITY       writing to table identity failed
  32.457 +//        PEP_COMMIT_FAILED             SQL commit failed
  32.458 +//      PEP_KEY_BLACKLISTED             Key blacklisted, cannot set identity
  32.459  //
  32.460 -//	caveat:
  32.461 -//		in the identity structure you need to set the const char * fields to
  32.462 -//		UTF-8 C strings
  32.463 -//		the size fields are ignored
  32.464 +//    caveat:
  32.465 +//        in the identity structure you need to set the const char * fields to
  32.466 +//        UTF-8 C strings
  32.467 +//        the size fields are ignored
  32.468  
  32.469  DYNAMIC_API PEP_STATUS set_identity(
  32.470          PEP_SESSION session, const pEp_identity *identity
  32.471 @@ -472,9 +474,9 @@
  32.472  
  32.473  // mark_as_compromized() - mark key in trust db as compromized
  32.474  //
  32.475 -//	parameters:
  32.476 -//		session (in)		session handle
  32.477 -//		fpr (in)            fingerprint of key to mark
  32.478 +//    parameters:
  32.479 +//        session (in)        session handle
  32.480 +//        fpr (in)            fingerprint of key to mark
  32.481  
  32.482  DYNAMIC_API PEP_STATUS mark_as_compromized(
  32.483          PEP_SESSION session,
  32.484 @@ -486,12 +488,12 @@
  32.485  //
  32.486  //  parameters:
  32.487  //      session (in)            session handle
  32.488 -//		identity (inout)	    pointer to pEp_identity structure
  32.489 +//        identity (inout)      pointer to pEp_identity structure
  32.490  //
  32.491 -//	return value:
  32.492 -//		PEP_STATUS_OK = 0	    encryption and signing succeeded
  32.493 -//		PEP_ILLEGAL_VALUE       illegal values for identity fields given
  32.494 -//		PEP_CANNOT_CREATE_KEY   key engine is on strike
  32.495 +//    return value:
  32.496 +//        PEP_STATUS_OK = 0       encryption and signing succeeded
  32.497 +//        PEP_ILLEGAL_VALUE       illegal values for identity fields given
  32.498 +//        PEP_CANNOT_CREATE_KEY   key engine is on strike
  32.499  //
  32.500  //  caveat:
  32.501  //      address and username fields must be set to UTF-8 strings
  32.502 @@ -544,7 +546,7 @@
  32.503  //      session (in)            session handle
  32.504  //      fpr (in)                key id or fingerprint of key
  32.505  //      key_data (out)          ASCII armored OpenPGP key
  32.506 -//      size (out)               amount of data to handle
  32.507 +//      size (out)              amount of data to handle
  32.508  //
  32.509  //  return value:
  32.510  //      PEP_STATUS_OK = 0       key was successfully exported
  32.511 @@ -579,8 +581,8 @@
  32.512  //      keylist (out)           list of fingerprints found or NULL on error
  32.513  //
  32.514  //  caveat:
  32.515 -//	    the ownerships of keylist isgoing to the caller
  32.516 -//	    the caller must use free_stringlist() to free it
  32.517 +//        the ownerships of keylist isgoing to the caller
  32.518 +//        the caller must use free_stringlist() to free it
  32.519  
  32.520  
  32.521  DYNAMIC_API PEP_STATUS find_keys(
  32.522 @@ -751,7 +753,7 @@
  32.523  //
  32.524  //  parameters:
  32.525  //      session (in)            session handle
  32.526 -//		lang (in)			    C string with ISO 639-1 language code
  32.527 +//      lang (in)               C string with ISO 639-1 language code
  32.528  //      phrase_id (in)          id of phrase in i18n
  32.529  //      phrase (out)            phrase as UTF-8 string
  32.530  //
    33.1 --- a/src/pgp_gpg.c	Fri Mar 11 16:06:43 2016 +0100
    33.2 +++ b/src/pgp_gpg.c	Tue Apr 26 10:49:43 2016 +0200
    33.3 @@ -145,6 +145,11 @@
    33.4              = (gpgme_release_t) (intptr_t) dlsym(gpgme, "gpgme_release");
    33.5          assert(gpg.gpgme_release);
    33.6  
    33.7 +        gpg.gpgme_get_engine_info
    33.8 +            = (gpgme_get_engine_info_t) (intptr_t) dlsym(gpgme,
    33.9 +            "gpgme_get_engine_info");
   33.10 +        assert(gpg.gpgme_get_engine_info);
   33.11 +
   33.12          gpg.gpgme_set_protocol
   33.13              = (gpgme_set_protocol_t) (intptr_t) dlsym(gpgme,
   33.14              "gpgme_set_protocol");
   33.15 @@ -444,8 +449,40 @@
   33.16                      do {
   33.17                          switch (_GPGERR(gpgme_signature->status)) {
   33.18                          case GPG_ERR_NO_ERROR:
   33.19 -                            k = stringlist_add(k, gpgme_signature->fpr);
   33.20 +                        {
   33.21 +                            gpgme_key_t key;
   33.22 +                            memset(&key,0,sizeof(key));
   33.23 +
   33.24 +                            gpgme_error = gpg.gpgme_get_key(session->ctx,
   33.25 +                                gpgme_signature->fpr, &key, 0);
   33.26 +                            gpgme_error = _GPGERR(gpgme_error);
   33.27 +                            assert(gpgme_error != GPG_ERR_ENOMEM);
   33.28 +                            if (gpgme_error == GPG_ERR_ENOMEM) {
   33.29 +                                free_stringlist(_keylist);
   33.30 +                                gpg.gpgme_data_release(plain);
   33.31 +                                gpg.gpgme_data_release(cipher);
   33.32 +                                free(_buffer);
   33.33 +                                return PEP_OUT_OF_MEMORY;
   33.34 +                            }
   33.35 +                            // Primary key is given as the first subkey
   33.36 +                            if (key->subkeys && key->subkeys->fpr && key->subkeys->fpr[0]){
   33.37 +                                k = stringlist_add(k, key->subkeys->fpr);
   33.38 +                                if (k == NULL) {
   33.39 +                                    free_stringlist(_keylist);
   33.40 +                                    gpg.gpgme_data_release(plain);
   33.41 +                                    gpg.gpgme_data_release(cipher);
   33.42 +                                    free(_buffer);
   33.43 +                                    return PEP_OUT_OF_MEMORY;
   33.44 +                                }
   33.45 +                            }
   33.46 +                            else {
   33.47 +                                result = PEP_DECRYPT_SIGNATURE_DOES_NOT_MATCH;
   33.48 +                                break;
   33.49 +                            }
   33.50 +
   33.51 +                            gpg.gpgme_key_unref(key);
   33.52                              break;
   33.53 +                        }
   33.54                          case GPG_ERR_CERT_REVOKED:
   33.55                          case GPG_ERR_BAD_SIGNATURE:
   33.56                              result = PEP_DECRYPT_SIGNATURE_DOES_NOT_MATCH;
   33.57 @@ -596,13 +633,39 @@
   33.58  
   33.59              result = PEP_VERIFIED;
   33.60              do {
   33.61 -                k = stringlist_add(k, gpgme_signature->fpr);
   33.62 -                if (k == NULL) {
   33.63 +                gpgme_key_t key;
   33.64 +                memset(&key,0,sizeof(key));
   33.65 +
   33.66 +                // GPGME may give subkey's fpr instead of primary key's fpr. 
   33.67 +                // Therefore we ask for the primary fingerprint instead
   33.68 +                // we assume that gpgme_get_key can find key by subkey's fpr
   33.69 +                gpgme_error = gpg.gpgme_get_key(session->ctx,
   33.70 +                    gpgme_signature->fpr, &key, 0);
   33.71 +                gpgme_error = _GPGERR(gpgme_error);
   33.72 +                assert(gpgme_error != GPG_ERR_ENOMEM);
   33.73 +                if (gpgme_error == GPG_ERR_ENOMEM) {
   33.74                      free_stringlist(_keylist);
   33.75                      gpg.gpgme_data_release(d_text);
   33.76                      gpg.gpgme_data_release(d_sig);
   33.77                      return PEP_OUT_OF_MEMORY;
   33.78                  }
   33.79 +                // Primary key is given as the first subkey
   33.80 +                if (key->subkeys && key->subkeys->fpr && key->subkeys->fpr[0]){
   33.81 +                    k = stringlist_add(k, key->subkeys->fpr);
   33.82 +                    if (k == NULL) {
   33.83 +                        free_stringlist(_keylist);
   33.84 +                        gpg.gpgme_data_release(d_text);
   33.85 +                        gpg.gpgme_data_release(d_sig);
   33.86 +                        return PEP_OUT_OF_MEMORY;
   33.87 +                    }
   33.88 +                }
   33.89 +                else {
   33.90 +                    result = PEP_DECRYPT_SIGNATURE_DOES_NOT_MATCH;
   33.91 +                    break;
   33.92 +                }
   33.93 +
   33.94 +                gpg.gpgme_key_unref(key);
   33.95 +
   33.96                  if (gpgme_signature->summary & GPGME_SIGSUM_RED) {
   33.97                      if (gpgme_signature->summary & GPGME_SIGSUM_KEY_EXPIRED
   33.98                          || gpgme_signature->summary & GPGME_SIGSUM_SIG_EXPIRED) {
   33.99 @@ -1190,6 +1253,10 @@
  33.100      } while (gpgme_error != GPG_ERR_EOF);
  33.101  
  33.102      gpg.gpgme_op_keylist_end(session->ctx);
  33.103 +    if (_keylist->value == NULL) {
  33.104 +        free_stringlist(_keylist);
  33.105 +        _keylist = NULL;
  33.106 +    }
  33.107      *keylist = _keylist;
  33.108      return PEP_STATUS_OK;
  33.109  }
  33.110 @@ -1716,3 +1783,22 @@
  33.111      return PEP_STATUS_OK;
  33.112  }
  33.113  
  33.114 +PEP_STATUS pgp_binary(const char **path)
  33.115 +{
  33.116 +    assert(path);
  33.117 +    if (path == NULL)
  33.118 +        return PEP_ILLEGAL_VALUE;
  33.119 +
  33.120 +    *path = NULL;
  33.121 +
  33.122 +    gpgme_engine_info_t info;
  33.123 +    int err = gpg.gpgme_get_engine_info(&info);
  33.124 +    assert(err == GPG_ERR_NO_ERROR);
  33.125 +    if (err != GPG_ERR_NO_ERROR)
  33.126 +        return PEP_OUT_OF_MEMORY;
  33.127 +
  33.128 +    *path = info->file_name;
  33.129 +
  33.130 +    return PEP_STATUS_OK;
  33.131 +}
  33.132 +
    34.1 --- a/src/pgp_gpg.h	Fri Mar 11 16:06:43 2016 +0100
    34.2 +++ b/src/pgp_gpg.h	Tue Apr 26 10:49:43 2016 +0200
    34.3 @@ -64,3 +64,6 @@
    34.4          bool *expired
    34.5      );
    34.6  
    34.7 +PEP_STATUS pgp_binary(const char **path);
    34.8 +#define PGP_BINARY_PATH pgp_binary
    34.9 +
    35.1 --- a/src/pgp_gpg_internal.h	Fri Mar 11 16:06:43 2016 +0100
    35.2 +++ b/src/pgp_gpg_internal.h	Tue Apr 26 10:49:43 2016 +0200
    35.3 @@ -5,6 +5,7 @@
    35.4  // init
    35.5  
    35.6  typedef const char * (*gpgme_check_version_t)(const char*);
    35.7 +typedef gpgme_error_t (*gpgme_get_engine_info_t)(gpgme_engine_info_t *INFO);
    35.8  typedef gpgme_error_t(*gpgme_set_locale_t)(gpgme_ctx_t CTX, int CATEGORY,
    35.9      const char *VALUE);
   35.10  typedef gpgme_error_t(*gpgme_new_t)(gpgme_ctx_t *CTX);
   35.11 @@ -76,6 +77,7 @@
   35.12  struct gpg_s {
   35.13      const char * version;
   35.14      gpgme_check_version_t gpgme_check;
   35.15 +    gpgme_get_engine_info_t gpgme_get_engine_info;
   35.16      gpgme_set_locale_t gpgme_set_locale;
   35.17      gpgme_new_t gpgme_new;
   35.18      gpgme_release_t gpgme_release;
    36.1 --- a/src/pgp_netpgp.c	Fri Mar 11 16:06:43 2016 +0100
    36.2 +++ b/src/pgp_netpgp.c	Tue Apr 26 10:49:43 2016 +0200
    36.3 @@ -1454,13 +1454,14 @@
    36.4  
    36.5  PEP_STATUS pgp_renew_key(
    36.6          PEP_SESSION session,
    36.7 -        const char *keyidstr,
    36.8 +        const char *fprstr,
    36.9          const timestamp *ts
   36.10      )
   36.11  {
   36.12      pgp_key_t *pkey;
   36.13      pgp_key_t *skey;
   36.14 -    uint8_t keyid[PGP_KEY_ID_SIZE];
   36.15 +    uint8_t fpr[PGP_FINGERPRINT_SIZE];
   36.16 +    size_t length;
   36.17      unsigned from = 0;
   36.18      time_t duration;
   36.19      const uint8_t *primid;
   36.20 @@ -1468,9 +1469,9 @@
   36.21      PEP_STATUS status = PEP_STATUS_OK;
   36.22  
   36.23      assert(session);
   36.24 -    assert(keyidstr);
   36.25 +    assert(fprstr);
   36.26  
   36.27 -    if (!session || !keyidstr )
   36.28 +    if (!session || !fprstr )
   36.29          return PEP_UNKNOWN_ERROR;
   36.30  
   36.31      if(ts)
   36.32 @@ -1492,15 +1493,17 @@
   36.33          return PEP_UNKNOWN_ERROR;
   36.34      }
   36.35  
   36.36 -    if(!str_to_id(keyid, keyidstr))
   36.37 -    {
   36.38 +    
   36.39 +    if (!str_to_fpr(fprstr, fpr, &length)) {
   36.40          status = PEP_ILLEGAL_VALUE;
   36.41          goto unlock_netpgp;
   36.42      }
   36.43 -
   36.44 -    pkey = (pgp_key_t*)pgp_getkeybyid(netpgp.io, netpgp.pubring, 
   36.45 -             keyid, &from, NULL, NULL, 
   36.46 -             1, 0); /* reject revoked, accept expired */
   36.47 +    
   36.48 +    pkey = pgp_getkeybyfpr(
   36.49 +                          netpgp.io,
   36.50 +                          netpgp.pubring,
   36.51 +                          fpr, length, &from, NULL,
   36.52 +                          1, 0); /* reject revoked, accept expired */
   36.53  
   36.54      if(pkey == NULL)
   36.55      {
   36.56 @@ -1509,9 +1512,11 @@
   36.57      }
   36.58  
   36.59      from = 0;
   36.60 -    skey = (pgp_key_t*)pgp_getkeybyid(netpgp.io, netpgp.secring, 
   36.61 -             keyid, &from, NULL, NULL, 
   36.62 -             1, 0); /* reject revoked, accept expired */
   36.63 +    skey = pgp_getkeybyfpr(
   36.64 +                           netpgp.io,
   36.65 +                           netpgp.secring,
   36.66 +                           fpr, length, &from, NULL,
   36.67 +                           1, 0); /* reject revoked, accept expired */
   36.68  
   36.69      if(skey == NULL)
   36.70      {
   36.71 @@ -1525,13 +1530,22 @@
   36.72          goto unlock_netpgp;
   36.73      }
   36.74  
   36.75 -
   36.76 +    // FIXME : renew in a more gentle way
   36.77      if (!pgp_add_selfsigned_userid(skey, pkey, primid, duration))
   36.78      {
   36.79          status = PEP_CANNOT_CREATE_KEY;
   36.80          goto unlock_netpgp;
   36.81      }
   36.82  
   36.83 +    // save rings
   36.84 +    if (netpgp_save_pubring(&netpgp) &&
   36.85 +        netpgp_save_secring(&netpgp))
   36.86 +    {
   36.87 +        status = PEP_STATUS_OK;
   36.88 +    }else{
   36.89 +        status = PEP_UNKNOWN_ERROR;
   36.90 +    }
   36.91 +    
   36.92  unlock_netpgp:
   36.93      pthread_mutex_unlock(&netpgp_mutex);
   36.94  
   36.95 @@ -1540,49 +1554,53 @@
   36.96  
   36.97  PEP_STATUS pgp_revoke_key(
   36.98          PEP_SESSION session,
   36.99 -        const char *keyidstr,
  36.100 +        const char *fprstr,
  36.101          const char *reason
  36.102      )
  36.103  {
  36.104      pgp_key_t *pkey;
  36.105      pgp_key_t *skey;
  36.106 -    uint8_t keyid[PGP_KEY_ID_SIZE];
  36.107 +    uint8_t fpr[PGP_FINGERPRINT_SIZE];
  36.108 +    size_t length;
  36.109      unsigned from = 0;
  36.110  
  36.111      PEP_STATUS status = PEP_STATUS_OK;
  36.112  
  36.113      assert(session);
  36.114 -    assert(keyidstr);
  36.115 -    assert(reason);
  36.116 +    assert(fprstr);
  36.117  
  36.118 -    if (!session || !keyidstr || !reason )
  36.119 +    if (!session || !fprstr)
  36.120          return PEP_UNKNOWN_ERROR;
  36.121  
  36.122      if(pthread_mutex_lock(&netpgp_mutex)){
  36.123          return PEP_UNKNOWN_ERROR;
  36.124      }
  36.125  
  36.126 -    if(!str_to_id(keyid, keyidstr))
  36.127 -    {
  36.128 +    // FIXME : deduplicate that code w/ renew
  36.129 +    if (!str_to_fpr(fprstr, fpr, &length)) {
  36.130          status = PEP_ILLEGAL_VALUE;
  36.131          goto unlock_netpgp;
  36.132      }
  36.133 -
  36.134 -    pkey = pgp_getkeybyid(netpgp.io, netpgp.pubring, 
  36.135 -             keyid, &from, NULL, NULL, 
  36.136 -             1, 0); /* reject (already) revoked, accept expired */
  36.137 -
  36.138 +    
  36.139 +    pkey = pgp_getkeybyfpr(
  36.140 +                           netpgp.io,
  36.141 +                           netpgp.pubring,
  36.142 +                           fpr, length, &from, NULL,
  36.143 +                           1, 0); /* reject revoked, accept expired */
  36.144 +    
  36.145      if(pkey == NULL)
  36.146      {
  36.147          status = PEP_KEY_NOT_FOUND;
  36.148          goto unlock_netpgp;
  36.149      }
  36.150 -
  36.151 +    
  36.152      from = 0;
  36.153 -    skey = pgp_getkeybyid(netpgp.io, netpgp.secring, 
  36.154 -             keyid, &from, NULL, NULL, 
  36.155 -             1, 0); /* reject (already) revoked, accept expired */
  36.156 -
  36.157 +    skey = pgp_getkeybyfpr(
  36.158 +                           netpgp.io,
  36.159 +                           netpgp.secring,
  36.160 +                           fpr, length, &from, NULL,
  36.161 +                           1, 0); /* reject revoked, accept expired */
  36.162 +    
  36.163      if(skey == NULL)
  36.164      {
  36.165          status = PEP_KEY_NOT_FOUND;
    37.1 --- a/src/stringlist.c	Fri Mar 11 16:06:43 2016 +0100
    37.2 +++ b/src/stringlist.c	Tue Apr 26 10:49:43 2016 +0200
    37.3 @@ -104,6 +104,39 @@
    37.4      return len;
    37.5  }
    37.6  
    37.7 +DYNAMIC_API stringlist_t *stringlist_delete(
    37.8 +        stringlist_t *stringlist,
    37.9 +        const char *value
   37.10 +    )
   37.11 +{
   37.12 +    assert(stringlist);
   37.13 +    assert(value);
   37.14 +
   37.15 +    if (stringlist->value == NULL) {
   37.16 +        free_stringlist(stringlist);
   37.17 +        return NULL;
   37.18 +    }
   37.19 +
   37.20 +    if (value == NULL)
   37.21 +        return stringlist;
   37.22 +
   37.23 +    stringlist_t *_sl;
   37.24 +    stringlist_t *last = NULL;
   37.25 +    for (_sl = stringlist; _sl && _sl->value; _sl = _sl->next) {
   37.26 +        if (strcmp(_sl->value, value) == 0) {
   37.27 +            if (last == NULL)
   37.28 +                stringlist = stringlist->next;
   37.29 +            else
   37.30 +                last->next = _sl->next;
   37.31 +            _sl->next = NULL;
   37.32 +            free_stringlist(_sl);
   37.33 +            break;
   37.34 +        }
   37.35 +        last = _sl;
   37.36 +    }
   37.37 +    return stringlist;
   37.38 +}
   37.39 +
   37.40  DYNAMIC_API void free_stringlist(stringlist_t *stringlist)
   37.41  {
   37.42      if (stringlist) {
    38.1 --- a/src/stringlist.h	Fri Mar 11 16:06:43 2016 +0100
    38.2 +++ b/src/stringlist.h	Tue Apr 26 10:49:43 2016 +0200
    38.3 @@ -88,6 +88,21 @@
    38.4  DYNAMIC_API int stringlist_length(const stringlist_t *stringlist);
    38.5  
    38.6  
    38.7 +// stringlist_delete() - delete entry from stringlist
    38.8 +//
    38.9 +//  parameters:
   38.10 +//      stringlist (in)     stringlist struct to delete from
   38.11 +//      value (in)          data to delete
   38.12 +//
   38.13 +//  return value:
   38.14 +//      modified stringlist
   38.15 +
   38.16 +DYNAMIC_API stringlist_t *stringlist_delete(
   38.17 +        stringlist_t *stringlist,
   38.18 +        const char *value
   38.19 +    );
   38.20 +
   38.21 +
   38.22  // free_stringlist() - free memory occupied by stringlist
   38.23  //
   38.24  //  parameters:
    39.1 --- a/test/blacklist_test.cc	Fri Mar 11 16:06:43 2016 +0100
    39.2 +++ b/test/blacklist_test.cc	Tue Apr 26 10:49:43 2016 +0200
    39.3 @@ -1,5 +1,6 @@
    39.4  #include <iostream>
    39.5  #include <string>
    39.6 +#include <cstring> // for strcmp()
    39.7  #include <assert.h>
    39.8  #include "blacklist.h"
    39.9  
   39.10 @@ -38,7 +39,7 @@
   39.11      cout << "the blacklist contains now: ";
   39.12      for (stringlist_t *bl = blacklist; bl && bl->value; bl = bl->next) {
   39.13          cout << bl->value << ", ";
   39.14 -        if (strcmp(bl->value, "23") == 0)
   39.15 +        if (std::strcmp(bl->value, "23") == 0)
   39.16              in23 = true;
   39.17      }
   39.18      cout << "END\n";
    40.1 --- a/test/pEpEngineTest.cc	Fri Mar 11 16:06:43 2016 +0100
    40.2 +++ b/test/pEpEngineTest.cc	Tue Apr 26 10:49:43 2016 +0200
    40.3 @@ -1,4 +1,4 @@
    40.4 -#include <iostream>
    40.5 +#include <iostream>
    40.6  #include <fstream>
    40.7  #include <string>
    40.8  
    40.9 @@ -108,7 +108,7 @@
   40.10      cout << "calling decrypt_and_verify()\n";
   40.11      PEP_STATUS decrypt_result = decrypt_and_verify(session, cipher_buffer, cipher_length, &buf_text, &buf_size, &keylist);
   40.12  
   40.13 -    cout << "returning from decrypt_and_verify() with result == " << decrypt_result << "\n";
   40.14 +    cout << "returning from decrypt_and_verify() with result == 0x" << std::hex << decrypt_result << "\n";
   40.15      assert(decrypt_result == PEP_DECRYPTED_AND_VERIFIED);
   40.16      assert(buf_text);
   40.17      assert(keylist);
    41.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    41.2 +++ b/test/pgp_binary_test.cc	Tue Apr 26 10:49:43 2016 +0200
    41.3 @@ -0,0 +1,36 @@
    41.4 +#include <iostream>
    41.5 +#include <string>
    41.6 +#include <assert.h>
    41.7 +#include "message_api.h"
    41.8 +
    41.9 +using namespace std;
   41.10 +
   41.11 +int main() {
   41.12 +    cout << "\n*** pgp_binary_test ***\n\n";
   41.13 +
   41.14 +    PEP_SESSION session;
   41.15 +    
   41.16 +    cout << "calling init()\n";
   41.17 +    PEP_STATUS status1 = init(&session);   
   41.18 +    assert(status1 == PEP_STATUS_OK);
   41.19 +    assert(session);
   41.20 +    cout << "init() completed.\n";
   41.21 +
   41.22 +    // pgp_binary test code
   41.23 +
   41.24 +    const char *path;
   41.25 +    PEP_STATUS status2 = get_binary_path(PEP_crypt_OpenPGP, &path);
   41.26 +    assert(status2 == PEP_STATUS_OK);
   41.27 +#ifdef USE_GPG
   41.28 +    assert(path);
   41.29 +#endif
   41.30 +    if (path)
   41.31 +        cout << "PGP binary at " << path << "\n";
   41.32 +    else
   41.33 +        cout << "no PGP binary path available\n";
   41.34 +
   41.35 +    cout << "calling release()\n";
   41.36 +    release(session);
   41.37 +    return 0;
   41.38 +}
   41.39 +