[packages/stunserver] - up to 1.2.15
arekm
arekm at pld-linux.org
Tue Mar 24 13:24:43 CET 2020
commit f65fe8cdec105a44c66363407765121f9209d5d6
Author: Arkadiusz Miśkiewicz <arekm at maven.pl>
Date: Tue Mar 24 13:24:37 2020 +0100
- up to 1.2.15
stunserver-openssl.patch | 112 -----------------------------------------------
stunserver.spec | 8 ++--
2 files changed, 4 insertions(+), 116 deletions(-)
---
diff --git a/stunserver.spec b/stunserver.spec
index 9cc851e..8238804 100644
--- a/stunserver.spec
+++ b/stunserver.spec
@@ -4,15 +4,14 @@
#
Summary: STUNTMAN STUN server
Name: stunserver
-Version: 1.2.13
+Version: 1.2.15
Release: 1
License: Apache v2.0
Group: Networking/Daemons
Source0: http://www.stunprotocol.org/%{name}-%{version}.tgz
-# Source0-md5: c56b74796c5447850ab29d37d947f6c6
+# Source0-md5: 8a923faa15fff05cbfb77330e5ebf116
Source1: %{name}.service
Source2: %{name}.sysconfig
-Patch0: %{name}-openssl.patch
URL: http://www.stunprotocol.org/
BuildRequires: rpmbuild(macros) >= 1.647
Requires(post,preun,postun): systemd-units >= 38
@@ -41,10 +40,11 @@ This package contains the client application.
%prep
%setup -qn %{name}
-%patch0 -p1
%build
%{__make} \
+ CC="%{__cc}" \
+ CXX="%{__cxx}" \
RELEASE_FLAGS="%{rpmcxxflags}" \
CXX_FLAGS="%{rpmcxxflags}" \
LDFLAGS="%{rpmldflags}"
diff --git a/stunserver-openssl.patch b/stunserver-openssl.patch
deleted file mode 100644
index ea09a25..0000000
--- a/stunserver-openssl.patch
+++ /dev/null
@@ -1,112 +0,0 @@
-From 0503e128de001b8f8a180f14d4599c4a608c72a8 Mon Sep 17 00:00:00 2001
-From: mkm85 <mkm85 at users.noreply.github.com>
-Date: Fri, 5 May 2017 08:21:57 +0200
-Subject: [PATCH] made it possible to compile with openssl 1.0.2 (#21)
-
-* made it possible to compile with openssl 1.1
-
-* Initiated variables to something default
----
- stuncore/stunreader.cpp | 45 ++++++++++++++++++++++++++++-------------
- 1 file changed, 31 insertions(+), 14 deletions(-)
-
-diff --git a/stuncore/stunreader.cpp b/stuncore/stunreader.cpp
-index adbe66b..cff1c2e 100644
---- a/stuncore/stunreader.cpp
-+++ b/stuncore/stunreader.cpp
-@@ -153,9 +153,19 @@ HRESULT CStunMessageReader::ValidateMessageIntegrity(uint8_t* key, size_t keylen
- uint8_t hmaccomputed[c_hmacsize] = {}; // zero-init
- unsigned int hmaclength = c_hmacsize;
- #ifndef __APPLE__
-- HMAC_CTX ctx = {};
-+ HMAC_CTX* ctx = NULL;
-+#if OPENSSL_VERSION_NUMBER < 0x10100000L
-+ HMAC_CTX ctxData = {};
-+ ctx = &ctxData;
-+ HMAC_CTX_init(ctx);
- #else
-- CCHmacContext ctx = {};
-+ ctx = HMAC_CTX_new();
-+#endif
-+#else
-+ CCHmacContext* ctx = NULL;
-+ CCHmacContext ctxData = {};
-+ ctx = &ctxData;
-+
- UNREFERENCED_VARIABLE(hmaclength);
- #endif
- uint32_t chunk32;
-@@ -195,19 +205,22 @@ HRESULT CStunMessageReader::ValidateMessageIntegrity(uint8_t* key, size_t keylen
-
- // Here comes the fun part. If there is a fingerprint attribute, we have to adjust the length header in computing the hash
- #ifndef __APPLE__
-- HMAC_CTX_init(&ctx);
-- HMAC_Init(&ctx, key, keylength, EVP_sha1());
-+#if OPENSSL_VERSION_NUMBER < 0x10100000L // could be lower!
-+ HMAC_Init(ctx, key, keylength, EVP_sha1());
- #else
-- CCHmacInit(&ctx, kCCHmacAlgSHA1, key, keylength);
-+ HMAC_Init_ex(ctx, key, keylength, EVP_sha1(), NULL);
-+#endif
-+#else
-+ CCHmacInit(ctx, kCCHmacAlgSHA1, key, keylength);
- #endif
- fContextInit = true;
-
- // message type
- Chk(stream.ReadUint16(&chunk16));
- #ifndef __APPLE__
-- HMAC_Update(&ctx, (unsigned char*)&chunk16, sizeof(chunk16));
-+ HMAC_Update(ctx, (unsigned char*)&chunk16, sizeof(chunk16));
- #else
-- CCHmacUpdate(&ctx, &chunk16, sizeof(chunk16));
-+ CCHmacUpdate(ctx, &chunk16, sizeof(chunk16));
- #endif
-
- // message length
-@@ -225,9 +238,9 @@ HRESULT CStunMessageReader::ValidateMessageIntegrity(uint8_t* key, size_t keylen
- }
-
- #ifndef __APPLE__
-- HMAC_Update(&ctx, (unsigned char*)&chunk16, sizeof(chunk16));
-+ HMAC_Update(ctx, (unsigned char*)&chunk16, sizeof(chunk16));
- #else
-- CCHmacUpdate(&ctx, &chunk16, sizeof(chunk16));
-+ CCHmacUpdate(ctx, &chunk16, sizeof(chunk16));
- #endif
-
- // now include everything up to the hash attribute itself.
-@@ -243,16 +256,16 @@ HRESULT CStunMessageReader::ValidateMessageIntegrity(uint8_t* key, size_t keylen
- {
- Chk(stream.ReadUint32(&chunk32));
- #ifndef __APPLE__
-- HMAC_Update(&ctx, (unsigned char*)&chunk32, sizeof(chunk32));
-+ HMAC_Update(ctx, (unsigned char*)&chunk32, sizeof(chunk32));
- #else
-- CCHmacUpdate(&ctx, &chunk32, sizeof(chunk32));
-+ CCHmacUpdate(ctx, &chunk32, sizeof(chunk32));
- #endif
- }
-
- #ifndef __APPLE__
-- HMAC_Final(&ctx, hmaccomputed, &hmaclength);
-+ HMAC_Final(ctx, hmaccomputed, &hmaclength);
- #else
-- CCHmacFinal(&ctx, hmaccomputed);
-+ CCHmacFinal(ctx, hmaccomputed);
- #endif
-
-
-@@ -265,7 +278,11 @@ HRESULT CStunMessageReader::ValidateMessageIntegrity(uint8_t* key, size_t keylen
- if (fContextInit)
- {
- #ifndef __APPLE__
-- HMAC_CTX_cleanup(&ctx);
-+#if OPENSSL_VERSION_NUMBER < 0x10100000L
-+ HMAC_CTX_cleanup(ctx);
-+#else
-+ HMAC_CTX_free(ctx);
-+#endif
- #else
- UNREFERENCED_VARIABLE(fContextInit);
- #endif
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/stunserver.git/commitdiff/f65fe8cdec105a44c66363407765121f9209d5d6
More information about the pld-cvs-commit
mailing list