[arch-commits] Commit in ptlib/trunk (PKGBUILD openssl-1.1.0.patch)
Jan de Groot
jgc at archlinux.org
Tue Mar 28 12:47:00 UTC 2017
Date: Tuesday, March 28, 2017 @ 12:46:59
Author: jgc
Revision: 291751
upgpkg: ptlib 2.10.11-6
Build with OpenSSL 1.1.0
Added:
ptlib/trunk/openssl-1.1.0.patch
Modified:
ptlib/trunk/PKGBUILD
---------------------+
PKGBUILD | 12 ++--
openssl-1.1.0.patch | 128 ++++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 135 insertions(+), 5 deletions(-)
Modified: PKGBUILD
===================================================================
--- PKGBUILD 2017-03-28 11:19:20 UTC (rev 291750)
+++ PKGBUILD 2017-03-28 12:46:59 UTC (rev 291751)
@@ -3,30 +3,32 @@
pkgname=ptlib
pkgver=2.10.11
-pkgrel=5
+pkgrel=6
pkgdesc="Portable Windows Library"
arch=('i686' 'x86_64')
url="http://www.opalvoip.org"
license=('GPL')
-depends=('sdl' 'libpulse' 'v4l-utils' 'libldap' 'openssl-1.0')
+depends=('sdl' 'libpulse' 'v4l-utils' 'libldap')
replaces=('pwlib')
conflicts=('pwlib')
source=(http://downloads.sourceforge.net/opalvoip/ptlib-$pkgver.tar.bz2
ptlib-2.10.11-bison_fixes-2.patch
- disable-sslv3.patch)
+ disable-sslv3.patch
+ openssl-1.1.0.patch)
sha256sums=('27a8ba1fd147195c0b310897f81d26f73996b77b18147e587638444cfacd681a'
'733f97ae7ceeb11e65882e56dd605decdfaa6c83418fd6c582f9fdedca924b3f'
- '6a290d636d24138282762a5a53a8c92bd1760261fcdda155b825b9d62c30fdb1')
+ '6a290d636d24138282762a5a53a8c92bd1760261fcdda155b825b9d62c30fdb1'
+ '815143893de1f9c558c4dda048066992283d619a1c685a1c078ff915bd7f0d86')
prepare() {
cd $pkgname-$pkgver
patch -Np1 -i ../ptlib-2.10.11-bison_fixes-2.patch
patch -Np1 -i ../disable-sslv3.patch
+ patch -Np1 -i ../openssl-1.1.0.patch
}
build() {
cd $pkgname-$pkgver
- export PKG_CONFIG_PATH=/usr/lib/openssl-1.0/pkgconfig
./configure --prefix=/usr --libdir=/usr/lib \
--sysconfdir=/etc --localstatedir=/var \
--enable-opal --enable-plugins \
Added: openssl-1.1.0.patch
===================================================================
--- openssl-1.1.0.patch (rev 0)
+++ openssl-1.1.0.patch 2017-03-28 12:46:59 UTC (rev 291751)
@@ -0,0 +1,128 @@
+--- a/src/ptclib/pssl.cxx 2017-03-28 14:35:23.261060113 +0200
++++ b/src/ptclib/pssl.cxx 2017-03-28 14:30:20.593853443 +0200
+@@ -140,7 +140,7 @@
+ class PSSL_BIO
+ {
+ public:
+- PSSL_BIO(BIO_METHOD *method = BIO_s_file_internal())
++ PSSL_BIO(const BIO_METHOD *method = BIO_s_file())
+ { bio = BIO_new(method); }
+
+ ~PSSL_BIO()
+@@ -627,9 +627,10 @@
+ if (dh == NULL)
+ return;
+
+- dh->p = BN_bin2bn(pData, pSize, NULL);
+- dh->g = BN_bin2bn(gData, gSize, NULL);
+- if (dh->p != NULL && dh->g != NULL)
++ BIGNUM *p = BN_bin2bn(pData, pSize, NULL);
++ BIGNUM *g = BN_bin2bn(gData, gSize, NULL);
++ DH_set0_pqg(dh, p, NULL, g);
++ if (p != NULL && p != NULL)
+ return;
+
+ DH_free(dh);
+@@ -1115,7 +1116,7 @@
+ //
+
+
+-#define PSSLCHANNEL(bio) ((PSSLChannel *)(bio->ptr))
++#define PSSLCHANNEL(bio) ((PSSLChannel *)BIO_get_data(bio))
+
+ extern "C" {
+
+@@ -1128,10 +1129,9 @@
+
+ static int Psock_new(BIO * bio)
+ {
+- bio->init = 0;
+- bio->num = 0;
+- bio->ptr = NULL; // this is really (PSSLChannel *)
+- bio->flags = 0;
++ BIO_set_init(bio, 0);
++ BIO_set_data(bio, NULL);
++ BIO_clear_flags(bio, ~0);
+
+ return(1);
+ }
+@@ -1142,13 +1142,13 @@
+ if (bio == NULL)
+ return 0;
+
+- if (bio->shutdown) {
+- if (bio->init) {
++ if (BIO_get_shutdown(bio)) {
++ if (BIO_get_init(bio)) {
+ PSSLCHANNEL(bio)->Shutdown(PSocket::ShutdownReadAndWrite);
+ PSSLCHANNEL(bio)->Close();
+ }
+- bio->init = 0;
+- bio->flags = 0;
++ BIO_set_init(bio, 0);
++ BIO_clear_flags(bio, ~0);
+ }
+ return 1;
+ }
+@@ -1158,11 +1158,11 @@
+ {
+ switch (cmd) {
+ case BIO_CTRL_SET_CLOSE:
+- bio->shutdown = (int)num;
++ BIO_set_shutdown(bio, (int)num);
+ return 1;
+
+ case BIO_CTRL_GET_CLOSE:
+- return bio->shutdown;
++ return BIO_get_shutdown(bio);
+
+ case BIO_CTRL_FLUSH:
+ return 1;
+@@ -1237,7 +1237,8 @@
+ };
+
+
+-static BIO_METHOD methods_Psock =
++static BIO_METHOD *methods_Psock = NULL;
++/*
+ {
+ BIO_TYPE_SOCKET,
+ "PTLib-PSSLChannel",
+@@ -1259,19 +1260,33 @@
+ Psock_free
+ #endif
+ };
+-
++*/
+
+ PBoolean PSSLChannel::OnOpen()
+ {
+- BIO * bio = BIO_new(&methods_Psock);
++ if (methods_Psock == NULL) {
++ methods_Psock = BIO_meth_new(BIO_TYPE_SOCKET | BIO_get_new_index(), "PTLib-PSSLChannel");
++ if (methods_Psock == NULL ||
++ BIO_meth_set_write(methods_Psock, Psock_write) ||
++ BIO_meth_set_read(methods_Psock, Psock_read) ||
++ BIO_meth_set_puts(methods_Psock, Psock_puts) ||
++ BIO_meth_set_gets(methods_Psock, NULL) ||
++ BIO_meth_set_ctrl(methods_Psock, Psock_ctrl) ||
++ BIO_meth_set_create(methods_Psock, Psock_new) ||
++ BIO_meth_set_destroy(methods_Psock, Psock_free)) {
++ SSLerr(SSL_F_SSL_SET_FD,ERR_R_BUF_LIB);
++ return PFalse;
++ }
++ }
++ BIO * bio = BIO_new(methods_Psock);
+ if (bio == NULL) {
+ SSLerr(SSL_F_SSL_SET_FD,ERR_R_BUF_LIB);
+ return PFalse;
+ }
+
+ // "Open" then bio
+- bio->ptr = this;
+- bio->init = 1;
++ BIO_set_data(bio, this);
++ BIO_set_init(bio, 1);
+
+ SSL_set_bio(ssl, bio, bio);
+ return PTrue;
More information about the arch-commits
mailing list