Skip to content

Commit

Permalink
archrelease: copy trunk to testing-i686, testing-x86_64
Browse files Browse the repository at this point in the history
git-svn-id: file:///srv/repos/svn-packages/svn@308347 eb2447ed-0c53-47e4-bac8-5bc4a241df78
  • Loading branch information
anatolik committed Oct 23, 2017
1 parent 3f16cf4 commit e835257
Show file tree
Hide file tree
Showing 8 changed files with 690 additions and 0 deletions.
60 changes: 60 additions & 0 deletions apr-util/repos/testing-i686/PKGBUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
# $Id$
# Maintainer: Jan de Groot <[email protected]>
# Maintainer: Pierre Schmitz <[email protected]>

pkgname=apr-util
pkgver=1.6.1
pkgrel=1
pkgdesc="The Apache Portable Runtime"
arch=('i686' 'x86_64')
url="http://apr.apache.org/"
depends=('apr' 'expat')
makedepends=('gdbm' 'libldap' 'unixodbc' 'openssl' 'nss' 'sqlite' 'libmariadbclient' 'db' 'postgresql-libs' 'python2')
optdepends=(
'gdbm: enable gdbm support'
'libldap: enable ldap support'
'unixodbc: enable odbc support'
'libmariadbclient: enable mysql/mariadb support'
'postgresql-libs: enable postgres support'
'db: enable berkley db support'
'sqlite: enable sqlite support'
'nss: enable nss crypto support'
'openssl: enable openssl crypto support'
)
license=('APACHE')
source=(https://www.apache.org/dist/apr/apr-util-${pkgver}.tar.bz2{,.asc}
disable_failing_test.patch # TODO: figure out why dbm test fails
buildconf_config.guess_sub_location.patch)
sha256sums=('d3e12f7b6ad12687572a3a39475545a072608f4ba03a6ce8a3778f607dd0035b'
'SKIP'
'c7da8c0bba36fec72ac8c477f8c71e302ec670ab3df6f33ac5aab9f0527d8c3a'
'33f3509d8ad089109c70835efc3535b27a6b5fc2fe27793d30689138f8c4f8aa')
validpgpkeys=('5B5181C2C0AB13E59DA3F7A3EC582EB639FF092C' # Jeff Trawick
'B1B96F45DFBDCCF974019235193F180AB55D9977' # William A. Rowe, Jr. <[email protected]>
'3CE3BAC2EB7BBC624D1D22D8F3B9D88CB87F79A9') # Nick Kew <[email protected]>

prepare() {
cd apr-util-$pkgver
patch -Np1 -i ../buildconf_config.guess_sub_location.patch
patch -Np1 -i ../disable_failing_test.patch
./buildconf --with-apr=`apr-1-config --srcdir`
}

build() {
cd "${srcdir}/apr-util-${pkgver}"
./configure --prefix=/usr --with-apr=/usr --with-ldap --with-crypto \
--with-gdbm=/usr --with-sqlite3=/usr --with-nss=/usr --with-odbc=/usr \
--with-berkeley-db=/usr --with-pgsql=/usr --with-mysql=/usr --with-oracle=/usr \
--with-openssl=/usr
make
}

check() {
cd "${srcdir}/apr-util-${pkgver}"
make -j1 check
}

package() {
cd "${srcdir}/apr-util-${pkgver}"
make DESTDIR="${pkgdir}" install
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
From: Tollef Fog Heen <[email protected]>
Subject: Adjust path of config.guess and config.sub

---
buildconf | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

Index: trunk/buildconf
===================================================================
--- trunk.orig/buildconf
+++ trunk/buildconf
@@ -61,8 +61,8 @@
rm -f build/apr_common.m4 build/find_apr.m4 build/install.sh \
build/config.guess build/config.sub build/get-version.sh
cp -p $apr_src_dir/build/apr_common.m4 $apr_src_dir/build/find_apr.m4 \
- $apr_src_dir/build/install.sh $apr_src_dir/build/config.guess \
- $apr_src_dir/build/config.sub $apr_src_dir/build/get-version.sh \
+ $apr_src_dir/build/install.sh /usr/share/libtool/build-aux/config.guess \
+ /usr/share/libtool/build-aux/config.sub $apr_src_dir/build/get-version.sh \
build/

# Remove aclocal.m4 as it'll break some builds...
13 changes: 13 additions & 0 deletions apr-util/repos/testing-i686/disable_failing_test.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/test/testdbm.c b/test/testdbm.c
index 89d8d2f..7de9307 100644
--- a/test/testdbm.c
+++ b/test/testdbm.c
@@ -205,7 +205,7 @@ abts_suite *testdbm(abts_suite *suite)
suite = ADD_SUITE(suite);

#if APU_HAVE_GDBM
- abts_run_test(suite, test_dbm, "gdbm");
+// abts_run_test(suite, test_dbm, "gdbm");
#endif
#if APU_HAVE_NDBM
abts_run_test(suite, test_dbm, "ndbm");
250 changes: 250 additions & 0 deletions apr-util/repos/testing-i686/openssl-1.1.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,250 @@
# commit f163d8b5af9185de80d24b4dd13951dd64872aa6
# Author: Rainer Jung <[email protected]>
# Date: Sun Feb 7 14:40:46 2016 +0000
#
# Add support for OpenSSL 1.1.0:
# - Switch configure test for OpenSSL libcrypto
# from BN_init() to BN_new().
# - BN_init() is gone in OpenSSL 1.1.0.
# BN_new() exists at least since 0.9.8.
# - use OPENSSL_malloc_init() instead of
# CRYPTO_malloc_init
# - make cipherCtx a pointer. Type EVP_CIPHER_CTX
# is now opaque.
# - use EVP_CIPHER_CTX_new() in init() functions
# if initialised flag is not set (and set flag)
# - use EVP_CIPHER_CTX_free() in cleanup function
# - Improve reuse cleanup
# - call EVP_CIPHER_CTX_reset() resp.
# EVP_CIPHER_CTX_cleanup() in finish functions
# - call EVP_CIPHER_CTX_reset() resp.
# EVP_CIPHER_CTX_cleanup() when Update fails
# Backport of r1728958 and r1728963 from trunk.
#
#
# git-svn-id: https://svn.apache.org/repos/asf/apr/apr-util/branches/1.5.x@1728969 13f79535-47bb-0310-9956-ffa450edef68
#
diff --git a/build/crypto.m4 b/build/crypto.m4
index 9f9be6f..57884e3 100644
--- a/build/crypto.m4
+++ b/build/crypto.m4
@@ -88,7 +88,7 @@ AC_DEFUN([APU_CHECK_CRYPTO_OPENSSL], [
[
if test "$withval" = "yes"; then
AC_CHECK_HEADERS(openssl/x509.h, [openssl_have_headers=1])
- AC_CHECK_LIB(crypto, BN_init, AC_CHECK_LIB(ssl, SSL_accept, [openssl_have_libs=1],,-lcrypto))
+ AC_CHECK_LIB(crypto, BN_new, AC_CHECK_LIB(ssl, SSL_accept, [openssl_have_libs=1],,-lcrypto))
if test "$openssl_have_headers" != "0" && test "$openssl_have_libs" != "0"; then
apu_have_openssl=1
fi
@@ -104,7 +104,7 @@ AC_DEFUN([APU_CHECK_CRYPTO_OPENSSL], [

AC_MSG_NOTICE(checking for openssl in $withval)
AC_CHECK_HEADERS(openssl/x509.h, [openssl_have_headers=1])
- AC_CHECK_LIB(crypto, BN_init, AC_CHECK_LIB(ssl, SSL_accept, [openssl_have_libs=1],,-lcrypto))
+ AC_CHECK_LIB(crypto, BN_new, AC_CHECK_LIB(ssl, SSL_accept, [openssl_have_libs=1],,-lcrypto))
if test "$openssl_have_headers" != "0" && test "$openssl_have_libs" != "0"; then
apu_have_openssl=1
APR_ADDTO(APRUTIL_LDFLAGS, [-L$withval/lib])
@@ -113,7 +113,7 @@ AC_DEFUN([APU_CHECK_CRYPTO_OPENSSL], [

if test "$apu_have_openssl" != "1"; then
AC_CHECK_HEADERS(openssl/x509.h, [openssl_have_headers=1])
- AC_CHECK_LIB(crypto, BN_init, AC_CHECK_LIB(ssl, SSL_accept, [openssl_have_libs=1],,-lcrypto))
+ AC_CHECK_LIB(crypto, BN_new, AC_CHECK_LIB(ssl, SSL_accept, [openssl_have_libs=1],,-lcrypto))
if test "$openssl_have_headers" != "0" && test "$openssl_have_libs" != "0"; then
apu_have_openssl=1
APR_ADDTO(APRUTIL_LDFLAGS, [-L$withval/lib])
diff --git a/crypto/apr_crypto_openssl.c b/crypto/apr_crypto_openssl.c
index 0740f93..7d61fca 100644
--- a/crypto/apr_crypto_openssl.c
+++ b/crypto/apr_crypto_openssl.c
@@ -64,7 +64,7 @@ struct apr_crypto_block_t {
apr_pool_t *pool;
const apr_crypto_driver_t *provider;
const apr_crypto_t *f;
- EVP_CIPHER_CTX cipherCtx;
+ EVP_CIPHER_CTX *cipherCtx;
int initialised;
int ivSize;
int blockSize;
@@ -111,7 +111,11 @@ static apr_status_t crypto_shutdown_helper(void *data)
static apr_status_t crypto_init(apr_pool_t *pool, const char *params,
const apu_err_t **result)
{
+#if OPENSSL_VERSION_NUMBER < 0x10100000L
CRYPTO_malloc_init();
+#else
+ OPENSSL_malloc_init();
+#endif
ERR_load_crypto_strings();
/* SSL_load_error_strings(); */
OpenSSL_add_all_algorithms();
@@ -134,7 +138,7 @@ static apr_status_t crypto_block_cleanup(apr_crypto_block_t *ctx)
{

if (ctx->initialised) {
- EVP_CIPHER_CTX_cleanup(&ctx->cipherCtx);
+ EVP_CIPHER_CTX_free(ctx->cipherCtx);
ctx->initialised = 0;
}

@@ -491,8 +495,10 @@ static apr_status_t crypto_block_encrypt_init(apr_crypto_block_t **ctx,
apr_pool_cleanup_null);

/* create a new context for encryption */
- EVP_CIPHER_CTX_init(&block->cipherCtx);
- block->initialised = 1;
+ if (!block->initialised) {
+ block->cipherCtx = EVP_CIPHER_CTX_new();
+ block->initialised = 1;
+ }

/* generate an IV, if necessary */
usedIv = NULL;
@@ -519,16 +525,16 @@ static apr_status_t crypto_block_encrypt_init(apr_crypto_block_t **ctx,

/* set up our encryption context */
#if CRYPTO_OPENSSL_CONST_BUFFERS
- if (!EVP_EncryptInit_ex(&block->cipherCtx, key->cipher, config->engine,
+ if (!EVP_EncryptInit_ex(block->cipherCtx, key->cipher, config->engine,
key->key, usedIv)) {
#else
- if (!EVP_EncryptInit_ex(&block->cipherCtx, key->cipher, config->engine, (unsigned char *) key->key, (unsigned char *) usedIv)) {
+ if (!EVP_EncryptInit_ex(block->cipherCtx, key->cipher, config->engine, (unsigned char *) key->key, (unsigned char *) usedIv)) {
#endif
return APR_EINIT;
}

/* Clear up any read padding */
- if (!EVP_CIPHER_CTX_set_padding(&block->cipherCtx, key->doPad)) {
+ if (!EVP_CIPHER_CTX_set_padding(block->cipherCtx, key->doPad)) {
return APR_EPADDING;
}

@@ -582,11 +588,16 @@ static apr_status_t crypto_block_encrypt(unsigned char **out,
}

#if CRYPT_OPENSSL_CONST_BUFFERS
- if (!EVP_EncryptUpdate(&ctx->cipherCtx, (*out), &outl, in, inlen)) {
+ if (!EVP_EncryptUpdate(ctx->cipherCtx, (*out), &outl, in, inlen)) {
#else
- if (!EVP_EncryptUpdate(&ctx->cipherCtx, (*out), &outl,
+ if (!EVP_EncryptUpdate(ctx->cipherCtx, (*out), &outl,
(unsigned char *) in, inlen)) {
#endif
+#if OPENSSL_VERSION_NUMBER < 0x10100000L
+ EVP_CIPHER_CTX_cleanup(ctx->cipherCtx);
+#else
+ EVP_CIPHER_CTX_reset(ctx->cipherCtx);
+#endif
return APR_ECRYPT;
}
*outlen = outl;
@@ -616,14 +627,22 @@ static apr_status_t crypto_block_encrypt(unsigned char **out,
static apr_status_t crypto_block_encrypt_finish(unsigned char *out,
apr_size_t *outlen, apr_crypto_block_t *ctx)
{
+ apr_status_t rc = APR_SUCCESS;
int len = *outlen;

- if (EVP_EncryptFinal_ex(&ctx->cipherCtx, out, &len) == 0) {
- return APR_EPADDING;
+ if (EVP_EncryptFinal_ex(ctx->cipherCtx, out, &len) == 0) {
+ rc = APR_EPADDING;
+ }
+ else {
+ *outlen = len;
}
- *outlen = len;
+#if OPENSSL_VERSION_NUMBER < 0x10100000L
+ EVP_CIPHER_CTX_cleanup(ctx->cipherCtx);
+#else
+ EVP_CIPHER_CTX_reset(ctx->cipherCtx);
+#endif

- return APR_SUCCESS;
+ return rc;

}

@@ -662,8 +681,10 @@ static apr_status_t crypto_block_decrypt_init(apr_crypto_block_t **ctx,
apr_pool_cleanup_null);

/* create a new context for encryption */
- EVP_CIPHER_CTX_init(&block->cipherCtx);
- block->initialised = 1;
+ if (!block->initialised) {
+ block->cipherCtx = EVP_CIPHER_CTX_new();
+ block->initialised = 1;
+ }

/* generate an IV, if necessary */
if (key->ivSize) {
@@ -674,16 +695,16 @@ static apr_status_t crypto_block_decrypt_init(apr_crypto_block_t **ctx,

/* set up our encryption context */
#if CRYPTO_OPENSSL_CONST_BUFFERS
- if (!EVP_DecryptInit_ex(&block->cipherCtx, key->cipher, config->engine,
+ if (!EVP_DecryptInit_ex(block->cipherCtx, key->cipher, config->engine,
key->key, iv)) {
#else
- if (!EVP_DecryptInit_ex(&block->cipherCtx, key->cipher, config->engine, (unsigned char *) key->key, (unsigned char *) iv)) {
+ if (!EVP_DecryptInit_ex(block->cipherCtx, key->cipher, config->engine, (unsigned char *) key->key, (unsigned char *) iv)) {
#endif
return APR_EINIT;
}

/* Clear up any read padding */
- if (!EVP_CIPHER_CTX_set_padding(&block->cipherCtx, key->doPad)) {
+ if (!EVP_CIPHER_CTX_set_padding(block->cipherCtx, key->doPad)) {
return APR_EPADDING;
}

@@ -737,11 +758,16 @@ static apr_status_t crypto_block_decrypt(unsigned char **out,
}

#if CRYPT_OPENSSL_CONST_BUFFERS
- if (!EVP_DecryptUpdate(&ctx->cipherCtx, *out, &outl, in, inlen)) {
+ if (!EVP_DecryptUpdate(ctx->cipherCtx, *out, &outl, in, inlen)) {
#else
- if (!EVP_DecryptUpdate(&ctx->cipherCtx, *out, &outl, (unsigned char *) in,
+ if (!EVP_DecryptUpdate(ctx->cipherCtx, *out, &outl, (unsigned char *) in,
inlen)) {
#endif
+#if OPENSSL_VERSION_NUMBER < 0x10100000L
+ EVP_CIPHER_CTX_cleanup(ctx->cipherCtx);
+#else
+ EVP_CIPHER_CTX_reset(ctx->cipherCtx);
+#endif
return APR_ECRYPT;
}
*outlen = outl;
@@ -771,15 +797,22 @@ static apr_status_t crypto_block_decrypt(unsigned char **out,
static apr_status_t crypto_block_decrypt_finish(unsigned char *out,
apr_size_t *outlen, apr_crypto_block_t *ctx)
{
-
+ apr_status_t rc = APR_SUCCESS;
int len = *outlen;

- if (EVP_DecryptFinal_ex(&ctx->cipherCtx, out, &len) == 0) {
- return APR_EPADDING;
+ if (EVP_DecryptFinal_ex(ctx->cipherCtx, out, &len) == 0) {
+ rc = APR_EPADDING;
}
- *outlen = len;
+ else {
+ *outlen = len;
+ }
+#if OPENSSL_VERSION_NUMBER < 0x10100000L
+ EVP_CIPHER_CTX_cleanup(ctx->cipherCtx);
+#else
+ EVP_CIPHER_CTX_reset(ctx->cipherCtx);
+#endif

- return APR_SUCCESS;
+ return rc;

}

Loading

0 comments on commit e835257

Please sign in to comment.