[arch-commits] Commit in umurmur/trunk (PKGBUILD mbedtls2.patch)
Sergej Pupykin
spupykin at archlinux.org
Mon Sep 21 22:11:49 UTC 2015
Date: Tuesday, September 22, 2015 @ 00:11:49
Author: spupykin
Revision: 141416
upgpkg: umurmur 0.2.16_a-1
upd
Added:
umurmur/trunk/mbedtls2.patch
Modified:
umurmur/trunk/PKGBUILD
----------------+
PKGBUILD | 20 +
mbedtls2.patch | 591 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 603 insertions(+), 8 deletions(-)
Modified: PKGBUILD
===================================================================
--- PKGBUILD 2015-09-21 21:16:11 UTC (rev 141415)
+++ PKGBUILD 2015-09-21 22:11:49 UTC (rev 141416)
@@ -4,8 +4,8 @@
# Contributor: xav <xav at ethertricks dot net>
pkgname=umurmur
-pkgver=0.2.16
-pkgrel=2
+pkgver=0.2.16_a
+pkgrel=1
pkgdesc='Minimalistic Mumble server'
arch=('i686' 'x86_64')
url='https://github.com/umurmur/umurmur'
@@ -13,24 +13,28 @@
depends=('mbedtls' 'libconfig' 'protobuf-c')
install=$pkgname.install
backup=('etc/umurmur/umurmur.conf')
-source=($pkgname-$pkgver.tar.gz::$url/archive/$pkgver.tar.gz
+source=($pkgname-$pkgver.tar.gz::$url/archive/${pkgver/_/}.tar.gz
+ mbedtls2.patch
umurmur.service)
-md5sums=('5d6f5b01a0fc357e26ea9ed433031bb9'
+md5sums=('061aa71eb059eb00d2b123ec9200b405'
+ 'e8206f12304ec742221c69c151d5a817'
'd9d556e4ffa77e193fb40ce508804720')
prepare() {
- cd $pkgname-$pkgver
+ cd $pkgname-${pkgver/_/}
+ patch -p1 <$srcdir/mbedtls2.patch
./autogen.sh
}
build() {
- cd $pkgname-$pkgver
- ./configure --prefix=/usr --mandir=/usr/share/man --with-ssl=polarssl
+ cd $pkgname-${pkgver/_/}
+ LIBS="-lmbedtls -lmbedcrypto -lmbedx509" ./configure --prefix=/usr --mandir=/usr/share/man --with-ssl=polarssl
+ echo "#define USE_POLARSSL 1" >>src/config.h
make
}
package() {
- cd $pkgname-$pkgver
+ cd $pkgname-${pkgver/_/}
make DESTDIR="$pkgdir" install
install -Dm644 umurmur.conf.example "$pkgdir"/etc/umurmur/umurmur.conf
Added: mbedtls2.patch
===================================================================
--- mbedtls2.patch (rev 0)
+++ mbedtls2.patch 2015-09-21 22:11:49 UTC (rev 141416)
@@ -0,0 +1,591 @@
+Only in umurmur-0.2.16a.my: aclocal.m4
+Only in umurmur-0.2.16a.my: autom4te.cache
+diff -wbBur umurmur-0.2.16a/cmake/Modules/FindPolarSSL.cmake umurmur-0.2.16a.my/cmake/Modules/FindPolarSSL.cmake
+--- umurmur-0.2.16a/cmake/Modules/FindPolarSSL.cmake 2015-06-20 01:58:46.000000000 +0300
++++ umurmur-0.2.16a.my/cmake/Modules/FindPolarSSL.cmake 2015-09-22 01:03:32.671708759 +0300
+@@ -1,8 +1,8 @@
+ include(FindPackageHandleStandardArgs)
+ include(CheckSymbolExists)
+
+-find_path(POLARSSL_INCLUDE_DIR NAMES "version.h" PATHS /usr/pkg /usr/local /usr PATH_SUFFIXES "include/polarssl")
+-find_path(POLARSSL_LIB_DIR NAMES "libpolarssl.so" "libpolarssl.dylib" "libpolarssl.a" PATHS /usr/pkg /usr/local /usr PATH_SUFFIXES "lib" "lib/${CMAKE_LIBRARY_ARCHITECTURE}")
++find_path(POLARSSL_INCLUDE_DIR NAMES "version.h" PATHS /usr/pkg /usr/local /usr PATH_SUFFIXES "include/mbedtls")
++find_path(POLARSSL_LIB_DIR NAMES "libmbedtls.so" "libmbedtls.dylib" "libmbedtls.a" PATHS /usr/pkg /usr/local /usr PATH_SUFFIXES "lib" "lib/${CMAKE_LIBRARY_ARCHITECTURE}")
+
+ if(POLARSSL_INCLUDE_DIR AND POLARSSL_LIB_DIR)
+ set(POLARSSL_LIBRARIES polarssl)
+Only in umurmur-0.2.16a.my: compile
+Only in umurmur-0.2.16a.my: config.guess
+Only in umurmur-0.2.16a.my: config.log
+Only in umurmur-0.2.16a.my: config.status
+Only in umurmur-0.2.16a.my: config.sub
+Only in umurmur-0.2.16a.my: configure
+diff -wbBur umurmur-0.2.16a/configure.ac umurmur-0.2.16a.my/configure.ac
+--- umurmur-0.2.16a/configure.ac 2015-06-20 01:58:46.000000000 +0300
++++ umurmur-0.2.16a.my/configure.ac 2015-09-22 01:03:32.671708759 +0300
+@@ -37,10 +37,10 @@
+ AC_CANONICAL_HOST
+
+ # Configure options.
+-AC_ARG_WITH([ssl], [AC_HELP_STRING([--with-ssl=@<:@LIB@:>@], [SSL library (openssl|polarssl|gnutls) @<:@default=polarssl@:>@])], [], [with_ssl=polarssl])
++AC_ARG_WITH([ssl], [AC_HELP_STRING([--with-ssl=@<:@LIB@:>@], [SSL library (openssl|mbedtls|gnutls) @<:@default=mbedtls@:>@])], [], [with_ssl=mbedtls])
+ AC_ARG_ENABLE([shmapi], [AC_HELP_STRING([--enable-shmapi], [compile with Sharedmemory API support @<:@default=no@:>@])],[],[enable_shmapi=no] )
+-AC_ARG_ENABLE(polarssl-test-cert, [ --enable-polarssl-test-cert Link to PolarSSL test certificate and key @<:@default=no@:>@], [enable_polarssl_test_cert=yes])
+-AC_ARG_ENABLE(polarssl-havege, [ --enable-polarssl-havege Link to PolarSSL HAVEGE random generator key @<:@default=no@:>@ Default: /dev/urandom], [enable_polarssl_havege=yes])
++AC_ARG_ENABLE(mbedtls-test-cert, [ --enable-mbedtls-test-cert Link to PolarSSL test certificate and key @<:@default=no@:>@], [enable_mbedtls_test_cert=yes])
++AC_ARG_ENABLE(mbedtls-havege, [ --enable-mbedtls-havege Link to PolarSSL HAVEGE random generator key @<:@default=no@:>@ Default: /dev/urandom], [enable_mbedtls_havege=yes])
+
+ # Checks for programs.
+ AC_PROG_CC
+@@ -58,11 +58,11 @@
+ AC_CHECK_FUNC([clock_gettime], [], [AC_CHECK_LIB([rt], [clock_gettime], [], [AC_MSG_ERROR([could not find clock_gettime() in librt])])])
+ ;;
+ esac
+-AS_IF([test "x$with_ssl" = xpolarssl], [
+- AC_CHECK_HEADERS([polarssl/ssl.h], [], [AC_MSG_ERROR([could not find polarssl/ssl.h])])
+- AC_CHECK_HEADERS([polarssl/version.h], [], [AC_MSG_ERROR([could not find polarssl/version.h])])
++AS_IF([test "x$with_ssl" = xmbedtls], [
++ AC_CHECK_HEADERS([mbedtls/ssl.h], [], [AC_MSG_ERROR([could not find mbedtls/ssl.h])])
++ AC_CHECK_HEADERS([mbedtls/version.h], [], [AC_MSG_ERROR([could not find mbedtls/version.h])])
+
+- AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <polarssl/ssl.h>]],
++ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <mbedtls/ssl.h>]],
+ [[#if defined(POLARSSL_ZLIB_SUPPORT)
+ int x;
+ #endif
+@@ -70,14 +70,14 @@
+ return 0;]])],
+ [AC_CHECK_LIB([z], [deflate], [], [AC_MSG_ERROR([could not find zlib])])],
+ [])
+- AC_CHECK_LIB([polarssl], [ssl_init], [], [AC_MSG_ERROR([could not find libpolarssl])])
++ AC_CHECK_LIB([mbedtls], [mbedtls_ssl_init], [], [AC_MSG_ERROR([could not find libmbedtls])])
+ AC_DEFINE([USE_POLARSSL], [], [Use PolarSSL])
+- AS_IF([test "x$enable_polarssl_test_cert" = xyes], [
+- AC_CHECK_LIB([polarssl], [test_srv_crt], [], [AC_MSG_ERROR([could not find test_srv_crt])])
++ AS_IF([test "x$enable_mbedtls_test_cert" = xyes], [
++ AC_CHECK_LIB([mbedtls], [test_srv_crt], [], [AC_MSG_ERROR([could not find test_srv_crt])])
+ AC_DEFINE([USE_POLARSSL_TESTCERT], [], [Use PolarSSL test certificate])
+ ])
+- AS_IF([test "x$enable_polarssl_havege" = xyes], [
+- AC_CHECK_LIB([polarssl], [havege_init], [], [AC_MSG_ERROR([could not find havege_init])])
++ AS_IF([test "x$enable_mbedtls_havege" = xyes], [
++ AC_CHECK_LIB([mbedtls], [havege_init], [], [AC_MSG_ERROR([could not find havege_init])])
+ AC_DEFINE([USE_POLARSSL_HAVEGE], [], [Use PolarSSL HAVEGE random generator])
+ ])
+ ])
+Only in umurmur-0.2.16a.my: depcomp
+Only in umurmur-0.2.16a.my: install-sh
+Only in umurmur-0.2.16a.my: Makefile
+Only in umurmur-0.2.16a.my: Makefile.in
+Only in umurmur-0.2.16a.my: missing
+Only in umurmur-0.2.16a.my/src: ban.o
+Only in umurmur-0.2.16a.my/src: channel.o
+Only in umurmur-0.2.16a.my/src: client.o
+Only in umurmur-0.2.16a.my/src: config.h
+diff -wbBur umurmur-0.2.16a/src/config.h.in umurmur-0.2.16a.my/src/config.h.in
+--- umurmur-0.2.16a/src/config.h.in 2015-06-20 01:58:46.000000000 +0300
++++ umurmur-0.2.16a.my/src/config.h.in 2015-09-22 01:03:36.000000000 +0300
+@@ -1,13 +1,262 @@
+-#ifndef CONFIG_H
+-#define CONFIG_H
++/* src/config.h.in. Generated from configure.ac by autoheader. */
+
+-#cmakedefine USE_GNUTLS
+-#cmakedefine USE_POLARSSL
+-#cmakedefine USE_POLARSSL_TESTCERT
+-#cmakedefine USE_POLARSSL_HAVEGE
++/* Define to one of `_getb67', `GETB67', `getb67' for Cray-2 and Cray-YMP
++ systems. This function is required for `alloca.c' support on those systems.
++ */
++#undef CRAY_STACKSEG_END
+
+-#cmakedefine USE_SHAREDMEMORY_API
++/* Define to 1 if using `alloca.c'. */
++#undef C_ALLOCA
+
+-#define DEFAULT_CONFIG "${CMAKE_INSTALL_PREFIX}/etc/umurmur.conf"
++/* Default config */
++#undef DEFAULT_CONFIG
+
+-#endif // CONFIG_H
++/* Define to 1 if you have `alloca', as a function or macro. */
++#undef HAVE_ALLOCA
++
++/* Define to 1 if you have <alloca.h> and it should be used (not on Ultrix).
++ */
++#undef HAVE_ALLOCA_H
++
++/* Define to 1 if you have the <arpa/inet.h> header file. */
++#undef HAVE_ARPA_INET_H
++
++/* Define to 1 if you have the <fcntl.h> header file. */
++#undef HAVE_FCNTL_H
++
++/* Define to 1 if you have the `ftruncate' function. */
++#undef HAVE_FTRUNCATE
++
++/* Define to 1 if you have the `gettimeofday' function. */
++#undef HAVE_GETTIMEOFDAY
++
++/* Define to 1 if you have the <gnutls/gnutls.h> header file. */
++#undef HAVE_GNUTLS_GNUTLS_H
++
++/* Define to 1 if you have the <google/protobuf-c/protobuf-c.h> header file.
++ */
++#undef HAVE_GOOGLE_PROTOBUF_C_PROTOBUF_C_H
++
++/* Define to 1 if you have the `inet_ntoa' function. */
++#undef HAVE_INET_NTOA
++
++/* Define to 1 if you have the <inttypes.h> header file. */
++#undef HAVE_INTTYPES_H
++
++/* Define to 1 if you have the `config' library (-lconfig). */
++#undef HAVE_LIBCONFIG
++
++/* Define to 1 if you have the <libconfig.h> header file. */
++#undef HAVE_LIBCONFIG_H
++
++/* Define to 1 if you have the `crypto' library (-lcrypto). */
++#undef HAVE_LIBCRYPTO
++
++/* Define to 1 if you have the `gnutls' library (-lgnutls). */
++#undef HAVE_LIBGNUTLS
++
++/* Define to 1 if you have the `mbedtls' library (-lmbedtls). */
++#undef HAVE_LIBMBEDTLS
++
++/* Define to 1 if you have the `nettle' library (-lnettle). */
++#undef HAVE_LIBNETTLE
++
++/* Define to 1 if you have the `protobuf-c' library (-lprotobuf-c). */
++#undef HAVE_LIBPROTOBUF_C
++
++/* Define to 1 if you have the `rt' library (-lrt). */
++#undef HAVE_LIBRT
++
++/* Define to 1 if you have the `ssl' library (-lssl). */
++#undef HAVE_LIBSSL
++
++/* Define to 1 if you have the `z' library (-lz). */
++#undef HAVE_LIBZ
++
++/* Define to 1 if you have the <limits.h> header file. */
++#undef HAVE_LIMITS_H
++
++/* Define to 1 if you have the <mbedtls/ssl.h> header file. */
++#undef HAVE_MBEDTLS_SSL_H
++
++/* Define to 1 if you have the <mbedtls/version.h> header file. */
++#undef HAVE_MBEDTLS_VERSION_H
++
++/* Define to 1 if you have the `memchr' function. */
++#undef HAVE_MEMCHR
++
++/* Define to 1 if you have the `memmove' function. */
++#undef HAVE_MEMMOVE
++
++/* Define to 1 if you have the <memory.h> header file. */
++#undef HAVE_MEMORY_H
++
++/* Define to 1 if you have the `memset' function. */
++#undef HAVE_MEMSET
++
++/* Define to 1 if you have the <netinet/tcp.h> header file. */
++#undef HAVE_NETINET_TCP_H
++
++/* Define to 1 if you have the <openssl/ssl.h> header file. */
++#undef HAVE_OPENSSL_SSL_H
++
++/* Define to 1 if you have the `poll' function. */
++#undef HAVE_POLL
++
++/* Define to 1 if you have the `socket' function. */
++#undef HAVE_SOCKET
++
++/* Define to 1 if stdbool.h conforms to C99. */
++#undef HAVE_STDBOOL_H
++
++/* Define to 1 if you have the <stddef.h> header file. */
++#undef HAVE_STDDEF_H
++
++/* Define to 1 if you have the <stdint.h> header file. */
++#undef HAVE_STDINT_H
++
++/* Define to 1 if you have the <stdlib.h> header file. */
++#undef HAVE_STDLIB_H
++
++/* Define to 1 if you have the `strdup' function. */
++#undef HAVE_STRDUP
++
++/* Define to 1 if you have the <strings.h> header file. */
++#undef HAVE_STRINGS_H
++
++/* Define to 1 if you have the <string.h> header file. */
++#undef HAVE_STRING_H
++
++/* Define to 1 if you have the `strrchr' function. */
++#undef HAVE_STRRCHR
++
++/* Define to 1 if you have the <syslog.h> header file. */
++#undef HAVE_SYSLOG_H
++
++/* Define to 1 if you have the <sys/poll.h> header file. */
++#undef HAVE_SYS_POLL_H
++
++/* Define to 1 if you have the <sys/socket.h> header file. */
++#undef HAVE_SYS_SOCKET_H
++
++/* Define to 1 if you have the <sys/stat.h> header file. */
++#undef HAVE_SYS_STAT_H
++
++/* Define to 1 if you have the <sys/time.h> header file. */
++#undef HAVE_SYS_TIME_H
++
++/* Define to 1 if you have the <sys/types.h> header file. */
++#undef HAVE_SYS_TYPES_H
++
++/* Define to 1 if you have the `uname' function. */
++#undef HAVE_UNAME
++
++/* Define to 1 if you have the <unistd.h> header file. */
++#undef HAVE_UNISTD_H
++
++/* Define to 1 if the system has the type `_Bool'. */
++#undef HAVE__BOOL
++
++/* Name of package */
++#undef PACKAGE
++
++/* Define to the address where bug reports for this package should be sent. */
++#undef PACKAGE_BUGREPORT
++
++/* Define to the full name of this package. */
++#undef PACKAGE_NAME
++
++/* Define to the full name and version of this package. */
++#undef PACKAGE_STRING
++
++/* Define to the one symbol short name of this package. */
++#undef PACKAGE_TARNAME
++
++/* Define to the home page for this package. */
++#undef PACKAGE_URL
++
++/* Define to the version of this package. */
++#undef PACKAGE_VERSION
++
++/* If using the C implementation of alloca, define if you know the
++ direction of stack growth for your system; otherwise it will be
++ automatically deduced at runtime.
++ STACK_DIRECTION > 0 => grows toward higher addresses
++ STACK_DIRECTION < 0 => grows toward lower addresses
++ STACK_DIRECTION = 0 => direction of growth unknown */
++#undef STACK_DIRECTION
++
++/* Define to 1 if you have the ANSI C header files. */
++#undef STDC_HEADERS
++
++/* Use GnuTLS */
++#undef USE_GNUTLS
++
++/* Use PolarSSL */
++#undef USE_POLARSSL
++
++/* Use PolarSSL HAVEGE random generator */
++#undef USE_POLARSSL_HAVEGE
++
++/* Use PolarSSL test certificate */
++#undef USE_POLARSSL_TESTCERT
++
++/* Use sharedmemory API */
++#undef USE_SHAREDMEMORY_API
++
++/* Version number of package */
++#undef VERSION
++
++/* Define for Solaris 2.5.1 so the uint32_t typedef from <sys/synch.h>,
++ <pthread.h>, or <semaphore.h> is not used. If the typedef were allowed, the
++ #define below would cause a syntax error. */
++#undef _UINT32_T
++
++/* Define for Solaris 2.5.1 so the uint64_t typedef from <sys/synch.h>,
++ <pthread.h>, or <semaphore.h> is not used. If the typedef were allowed, the
++ #define below would cause a syntax error. */
++#undef _UINT64_T
++
++/* Define for Solaris 2.5.1 so the uint8_t typedef from <sys/synch.h>,
++ <pthread.h>, or <semaphore.h> is not used. If the typedef were allowed, the
++ #define below would cause a syntax error. */
++#undef _UINT8_T
++
++/* Define to `int' if <sys/types.h> doesn't define. */
++#undef gid_t
++
++/* Define to `__inline__' or `__inline' if that's what the C compiler
++ calls it, or to nothing if 'inline' is not supported under any name. */
++#ifndef __cplusplus
++#undef inline
++#endif
++
++/* Define to the type of a signed integer type of width exactly 32 bits if
++ such a type exists and the standard includes do not define it. */
++#undef int32_t
++
++/* Define to the type of a signed integer type of width exactly 64 bits if
++ such a type exists and the standard includes do not define it. */
++#undef int64_t
++
++/* Define to `unsigned int' if <sys/types.h> does not define. */
++#undef size_t
++
++/* Define to `int' if <sys/types.h> doesn't define. */
++#undef uid_t
++
++/* Define to the type of an unsigned integer type of width exactly 16 bits if
++ such a type exists and the standard includes do not define it. */
++#undef uint16_t
++
++/* Define to the type of an unsigned integer type of width exactly 32 bits if
++ such a type exists and the standard includes do not define it. */
++#undef uint32_t
++
++/* Define to the type of an unsigned integer type of width exactly 64 bits if
++ such a type exists and the standard includes do not define it. */
++#undef uint64_t
++
++/* Define to the type of an unsigned integer type of width exactly 8 bits if
++ such a type exists and the standard includes do not define it. */
++#undef uint8_t
+Only in umurmur-0.2.16a.my/src: config.h.in~
+Only in umurmur-0.2.16a.my/src: conf.o
+diff -wbBur umurmur-0.2.16a/src/crypt.h umurmur-0.2.16a.my/src/crypt.h
+--- umurmur-0.2.16a/src/crypt.h 2015-06-20 01:58:46.000000000 +0300
++++ umurmur-0.2.16a.my/src/crypt.h 2015-09-22 01:03:32.671708759 +0300
+@@ -36,8 +36,9 @@
+
+ #if defined(USE_POLARSSL)
+
+-#include <polarssl/havege.h>
+-#include <polarssl/aes.h>
++#include <mbedtls/compat-1.3.h>
++#include <mbedtls/havege.h>
++#include <mbedtls/aes.h>
+
+ #define CRYPT_AES_KEY aes_context
+ #define AES_BLOCK_SIZE 16
+Only in umurmur-0.2.16a.my/src: crypt.o
+Only in umurmur-0.2.16a.my/src: .deps
+Only in umurmur-0.2.16a.my/src: log.o
+Only in umurmur-0.2.16a.my/src: main.o
+Only in umurmur-0.2.16a.my/src: Makefile
+Only in umurmur-0.2.16a.my/src: Makefile.in
+Only in umurmur-0.2.16a.my/src: messagehandler.o
+Only in umurmur-0.2.16a.my/src: messages.o
+Only in umurmur-0.2.16a.my/src: Mumble.pb-c.o
+Only in umurmur-0.2.16a.my/src: pds.o
+Only in umurmur-0.2.16a.my/src: server.o
+diff -wbBur umurmur-0.2.16a/src/ssl.h umurmur-0.2.16a.my/src/ssl.h
+--- umurmur-0.2.16a/src/ssl.h 2015-06-20 01:58:46.000000000 +0300
++++ umurmur-0.2.16a.my/src/ssl.h 2015-09-22 01:07:05.505039648 +0300
+@@ -40,44 +40,17 @@
+ #include <string.h>
+
+ #if defined(USE_POLARSSL)
+-#include <polarssl/ssl.h>
+-#include <polarssl/version.h>
++#include <mbedtls/ssl.h>
++#include <mbedtls/version.h>
++#include <mbedtls/compat-1.3.h>
++#include <mbedtls/net.h>
++#include <mbedtls/x509.h>
+
+-#if defined(POLARSSL_VERSION_MAJOR)
+-#if (POLARSSL_VERSION_MAJOR < 1)
+-#error PolarSSL version 1.0.0 or greater is required!
+-#endif
+-#else
+-#error PolarSSL version 1.0.0 or greater is required!
+-#endif
+-
+-#if defined(USE_POLARSSL_HAVEGE)
+-#include <polarssl/havege.h>
+- #if (POLARSSL_VERSION_MINOR >= 1)
+- #define HAVEGE_RAND (havege_random)
+- #define RAND_bytes(_dst_, _size_) do { \
+- havege_random(&hs, _dst_, _size_); \
+- } while (0)
+- #else
+- #define HAVEGE_RAND (havege_rand)
+- #define RAND_bytes(_dst_, _size_) do { \
+- int i; \
+- for (i = 0; i < _size_; i++) { \
+- _dst_[i] = havege_rand(&hs); \
+- } \
+- } while (0)
+- #endif
+-#else
+ #define RAND_bytes(_dst_, _size_) do { urandom_bytes(NULL, _dst_, _size_); } while (0)
+ int urandom_bytes(void *ctx, unsigned char *dest, size_t len);
+-#endif
+
+-#if (POLARSSL_VERSION_MINOR >= 2)
+ #define POLARSSL_API_V1_2_ABOVE
+-#endif
+-#if (POLARSSL_VERSION_MINOR == 3)
+ #define POLARSSL_API_V1_3_ABOVE
+-#endif
+
+ #define SSLI_ERROR_WANT_READ -0x0F300 /* PolarSSL v0.x.x uses -0x0f00 -> --0x0f90, v1.x.x uses -0x7080 -> -0x7e80 */
+ #define SSLI_ERROR_WANT_WRITE -0x0F310
+diff -wbBur umurmur-0.2.16a/src/ssli_polarssl.c umurmur-0.2.16a.my/src/ssli_polarssl.c
+--- umurmur-0.2.16a/src/ssli_polarssl.c 2015-06-20 01:58:46.000000000 +0300
++++ umurmur-0.2.16a.my/src/ssli_polarssl.c 2015-09-22 01:03:32.671708759 +0300
+@@ -35,14 +35,14 @@
+ #include <stdlib.h>
+ #include <fcntl.h>
+
+-#include <polarssl/config.h>
+-#include <polarssl/havege.h>
+-#include <polarssl/certs.h>
+-#include <polarssl/x509.h>
+-#include <polarssl/ssl.h>
+-#include <polarssl/net.h>
++#include <mbedtls/config.h>
++#include <mbedtls/havege.h>
++#include <mbedtls/certs.h>
++#include <mbedtls/x509.h>
++#include <mbedtls/ssl.h>
++#include <mbedtls/net.h>
++#include <mbedtls/compat-1.3.h>
+
+-#ifdef POLARSSL_API_V1_2_ABOVE
+ int ciphers[] =
+ {
+ TLS_DHE_RSA_WITH_AES_256_CBC_SHA,
+@@ -50,17 +50,7 @@
+ TLS_RSA_WITH_AES_128_CBC_SHA,
+ 0
+ };
+-#else
+-int ciphers[] =
+-{
+- SSL_EDH_RSA_AES_256_SHA,
+- SSL_RSA_AES_256_SHA,
+- SSL_RSA_AES_128_SHA,
+- 0
+-};
+-#endif
+
+-#ifdef POLARSSL_API_V1_3_ABOVE
+ static x509_crt certificate;
+ static inline int x509parse_keyfile(rsa_context *rsa, const char *path,
+ const char *pwd)
+@@ -79,9 +69,6 @@
+ pk_free(&pk);
+ return ret;
+ }
+-#else
+-static x509_cert certificate;
+-#endif
+
+ static rsa_context key;
+ bool_t builtInTestCertificate;
+@@ -108,13 +95,8 @@
+ {
+ int rc;
+ builtInTestCertificate = true;
+-#ifdef POLARSSL_API_V1_3_ABOVE
+ rc = x509_crt_parse_rsa(&certificate, (unsigned char *)test_srv_crt,
+ strlen(test_srv_crt));
+-#else
+- rc = x509parse_crt(&certificate, (unsigned char *)test_srv_crt,
+- strlen(test_srv_crt));
+-#endif
+ if (rc != 0)
+ Log_fatal("Could not parse built-in test certificate");
+ }
+@@ -149,11 +131,7 @@
+ #endif
+ return;
+ }
+-#ifdef POLARSSL_API_V1_3_ABOVE
+ rc = x509_crt_parse_file(&certificate, crtfile);
+-#else
+- rc = x509parse_crtfile(&certificate, crtfile);
+-#endif
+ if (rc != 0) {
+ #ifdef USE_POLARSSL_TESTCERT
+ Log_warn("Could not read certificate file '%s'. Falling back to test certificate.", crtfile);
+@@ -235,27 +213,15 @@
+
+ void SSLi_deinit(void)
+ {
+-#ifdef POLARSSL_API_V1_3_ABOVE
+ x509_crt_free(&certificate);
+-#else
+- x509_free(&certificate);
+-#endif
+ rsa_free(&key);
+ }
+
+ /* Create SHA1 of last certificate in the peer's chain. */
+ bool_t SSLi_getSHA1Hash(SSL_handle_t *ssl, uint8_t *hash)
+ {
+-#ifdef POLARSSL_API_V1_3_ABOVE
+ x509_crt const *cert;
+-#else
+- x509_cert const *cert;
+-#endif
+-#ifdef POLARSSL_API_V1_2_ABOVE
+ cert = ssl_get_peer_cert(ssl);
+-#else
+- cert = ssl->peer_cert;
+-#endif
+ if (!cert) {
+ return false;
+ }
+@@ -274,9 +240,7 @@
+ if (!ssl || !ssn)
+ Log_fatal("Out of memory");
+
+- rc = ssl_init(ssl);
+- if (rc != 0 )
+- Log_fatal("Failed to initialize: %d", rc);
++ ssl_init(ssl);
+
+ ssl_set_endpoint(ssl, SSL_IS_SERVER);
+ ssl_set_authmode(ssl, SSL_VERIFY_OPTIONAL);
+@@ -288,22 +252,14 @@
+ #endif
+
+ ssl_set_dbg(ssl, pssl_debug, NULL);
+- ssl_set_bio(ssl, net_recv, fd, net_send, fd);
++ mbedtls_ssl_set_bio(ssl, &fd, net_send, net_recv, NULL);
+
+ ssl_set_ciphersuites(ssl, ciphers);
+
+-#ifdef POLARSSL_API_V1_2_ABOVE
+ ssl_set_session(ssl, ssn);
+-#else
+- ssl_set_session(ssl, 0, 0, ssn);
+-#endif
+
+- ssl_set_ca_chain(ssl, &certificate, NULL, NULL);
+-#ifdef POLARSSL_API_V1_3_ABOVE
+- ssl_set_own_cert_rsa(ssl, &certificate, &key);
+-#else
+- ssl_set_own_cert(ssl, &certificate, &key);
+-#endif
++ ssl_set_ca_chain(ssl, &certificate, NULL);
++ mbedtls_ssl_set_hs_own_cert(ssl, &certificate, &key);
+ ssl_set_dh_param(ssl, my_dhm_P, my_dhm_G);
+
+ return ssl;
+Only in umurmur-0.2.16a.my/src: ssli_polarssl.c.orig
+Only in umurmur-0.2.16a.my/src: ssli_polarssl.o
+Only in umurmur-0.2.16a.my/src: stamp-h1
+Only in umurmur-0.2.16a.my/src: timer.o
+Only in umurmur-0.2.16a.my/src: umurmurd
+Only in umurmur-0.2.16a.my/src: util.o
+Only in umurmur-0.2.16a.my/src: voicetarget.o
More information about the arch-commits
mailing list