libsignal-protocol-c: update to 2.3.3

This commit is contained in:
teldra 2020-04-01 12:10:31 +02:00 committed by Helmut Pozimski
parent 2276d7fbde
commit e730f99cd4
2 changed files with 3 additions and 101 deletions

View file

@ -1,98 +0,0 @@
diff --git CMakeLists.txt CMakeLists.txt
index b31796d..d95fd3f 100644
--- CMakeLists.txt
+++ CMakeLists.txt
@@ -19,6 +19,7 @@ SET(INSTALL_PKGCONFIG_DIR "${LIB_INSTALL_DIR}/pkgconfig" CACHE PATH "Installatio
INCLUDE(CheckSymbolExists)
INCLUDE(CheckCCompilerFlag)
+INCLUDE(TestBigEndian)
CHECK_SYMBOL_EXISTS(memset_s "string.h" HAVE_MEMSET_S)
@@ -50,6 +51,11 @@ IF(HAVE_MEMSET_S)
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DHAVE_MEMSET_S=1")
ENDIF(HAVE_MEMSET_S)
+TEST_BIG_ENDIAN(WORDS_BIGENDIAN)
+IF(WORDS_BIGENDIAN)
+ ADD_DEFINITIONS(-DWORDS_BIGENDIAN)
+ENDIF(WORDS_BIGENDIAN)
+
IF(COVERAGE)
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fprofile-arcs -ftest-coverage")
SET(LINK_FLAGS "${LINK_FLAGS} -fprofile-arcs -ftest-coverage")
diff --git tests/test_common.c tests/test_common.c
index f15003c..03f95ee 100644
--- tests/test_common.c
+++ tests/test_common.c
@@ -845,3 +845,11 @@ void setup_test_sender_key_store(signal_protocol_store_context *context, signal_
signal_protocol_store_context_set_sender_key_store(context, &store);
}
+
+#ifndef __OpenBSD__
+void srand_deterministic(unsigned int seed)
+{
+ srand(seed);
+}
+#endif
+
diff --git tests/test_common.h tests/test_common.h
index 66ddc6a..db54c12 100644
--- tests/test_common.h
+++ tests/test_common.h
@@ -84,4 +84,10 @@ int test_sender_key_store_load_sender_key(signal_buffer **record, signal_buffer
void test_sender_key_store_destroy(void *user_data);
void setup_test_sender_key_store(signal_protocol_store_context *context, signal_context *global_context);
+/* Portability */
+#ifndef __OpenBSD__
+/* OpenBSD extension */
+void srand_deterministic(unsigned int seed);
+#endif
+
#endif /* TEST_COMMON_H */
diff --git tests/test_common_openssl.c tests/test_common_openssl.c
index abcb208..ab5dc9b 100644
--- tests/test_common_openssl.c
+++ tests/test_common_openssl.c
@@ -1,5 +1,6 @@
#include "test_common.h"
+#include <limits.h>
#include <openssl/opensslv.h>
#include <openssl/evp.h>
#include <openssl/hmac.h>
diff --git tests/test_session_builder.c tests/test_session_builder.c
index 5c475c6..cc388cd 100644
--- tests/test_session_builder.c
+++ tests/test_session_builder.c
@@ -1426,9 +1426,9 @@ void run_interaction(signal_protocol_store_context *alice_store, signal_protocol
}
time_t seed = time(0);
- srand(seed);
+ srand_deterministic(seed);
shuffle_buffers(alice_ooo_plaintext, 10);
- srand(seed);
+ srand_deterministic(seed);
shuffle_buffers(alice_ooo_ciphertext, 10);
fprintf(stderr, "Shuffled Alice->Bob messages created\n");
diff --git tests/test_session_cipher.c tests/test_session_cipher.c
index e761fda..419f87a 100644
--- tests/test_session_cipher.c
+++ tests/test_session_cipher.c
@@ -206,9 +206,9 @@ void generate_test_message_collections(session_cipher *cipher, signal_buffer **p
/* Randomize the two arrays using the same seed */
time_t seed = time(0);
- srand(seed);
+ srand_deterministic(seed);
shuffle_buffers(plaintext_messages, size);
- srand(seed);
+ srand_deterministic(seed);
shuffle_buffers(ciphertext_messages, size);
}

View file

@ -1,7 +1,7 @@
# Template file for 'libsignal-protocol-c'
pkgname=libsignal-protocol-c
version=2.3.2
revision=2
version=2.3.3
revision=1
build_style=cmake
configure_args="-DCMAKE_POSITION_INDEPENDENT_CODE=ON"
makedepends="libressl-devel"
@ -11,7 +11,7 @@ maintainer="teldra <teldra@rotce.de>"
license="GPL-3.0-or-later"
homepage="https://www.whispersystems.org/"
distfiles="https://github.com/signalapp/libsignal-protocol-c/archive/v${version}.tar.gz"
checksum=f3826f3045352e14027611c95449bfcfe39bfd3d093d578c70f70eee0c85000d
checksum=c22e7690546e24d46210ca92dd808f17c3102e1344cd2f9a370136a96d22319d
if [ "${XBPS_CHECK_PKGS}" ]; then
configure_args+=" -DBUILD_TESTING=1"