summaryrefslogtreecommitdiff
path: root/libs
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2022-10-15 18:47:50 +0300
committerGeorge Hazan <ghazan@miranda.im>2022-10-15 18:47:50 +0300
commitcda15a795d5f834fac2a239c772e538ab5a03803 (patch)
tree3163e6fa0f2e13341fdd510876ca642b2877ac36 /libs
parente94f8e5422f0f3ef013ac4d5a0e15e640bf45c07 (diff)
libsignal updated to 2.3.3
Diffstat (limited to 'libs')
-rw-r--r--libs/libsignal/src/curve.c9
-rw-r--r--libs/libsignal/src/curve.h4
-rw-r--r--libs/libsignal/src/hkdf.c2
-rw-r--r--libs/libsignal/src/hkdf.h8
-rw-r--r--libs/libsignal/src/session_cipher.c2
5 files changed, 15 insertions, 10 deletions
diff --git a/libs/libsignal/src/curve.c b/libs/libsignal/src/curve.c
index be09369a7e..df9c550b26 100644
--- a/libs/libsignal/src/curve.c
+++ b/libs/libsignal/src/curve.c
@@ -40,6 +40,13 @@ struct ec_public_key_list
UT_array *values;
};
+int curve_internal_fast_tests(int silent)
+{
+ if (all_fast_tests(silent) != 0)
+ return SG_ERR_UNKNOWN;
+ return 0;
+}
+
int curve_decode_point(ec_public_key **public_key, const uint8_t *key_data, size_t key_len, signal_context *global_context)
{
ec_public_key *key = 0;
@@ -264,7 +271,7 @@ ec_private_key *ec_key_pair_get_private(const ec_key_pair *key_pair)
return key_pair->private_key;
}
-void ec_key_pair_destroy(ec_key_pair *type)
+void ec_key_pair_destroy(signal_type_base *type)
{
ec_key_pair *key_pair = (ec_key_pair *)type;
SIGNAL_UNREF(key_pair->public_key);
diff --git a/libs/libsignal/src/curve.h b/libs/libsignal/src/curve.h
index a55e198c8c..ae6cc670da 100644
--- a/libs/libsignal/src/curve.h
+++ b/libs/libsignal/src/curve.h
@@ -12,6 +12,8 @@ extern "C" {
#define CURVE_SIGNATURE_LEN 64
#define VRF_SIGNATURE_LEN 96
+int curve_internal_fast_tests(int silent);
+
int curve_decode_point(ec_public_key **public_key, const uint8_t *key_data, size_t key_len, signal_context *global_context);
int ec_public_key_compare(const ec_public_key *key1, const ec_public_key *key2);
int ec_public_key_memcmp(const ec_public_key *key1, const ec_public_key *key2);
@@ -52,7 +54,7 @@ void ec_private_key_destroy(signal_type_base *type);
int ec_key_pair_create(ec_key_pair **key_pair, ec_public_key *public_key, ec_private_key *private_key);
ec_public_key *ec_key_pair_get_public(const ec_key_pair *key_pair);
ec_private_key *ec_key_pair_get_private(const ec_key_pair *key_pair);
-void ec_key_pair_destroy(ec_key_pair *type);
+void ec_key_pair_destroy(signal_type_base *type);
int curve_generate_private_key(signal_context *context, ec_private_key **private_key);
int curve_generate_public_key(ec_public_key **public_key, const ec_private_key *private_key);
diff --git a/libs/libsignal/src/hkdf.c b/libs/libsignal/src/hkdf.c
index d41a1f5363..d8df253c8b 100644
--- a/libs/libsignal/src/hkdf.c
+++ b/libs/libsignal/src/hkdf.c
@@ -249,7 +249,7 @@ int hkdf_compare(const hkdf_context *context1, const hkdf_context *context2)
}
}
-void hkdf_destroy(hkdf_context *type)
+void hkdf_destroy(signal_type_base *type)
{
hkdf_context *context = (hkdf_context *)type;
free(context);
diff --git a/libs/libsignal/src/hkdf.h b/libs/libsignal/src/hkdf.h
index 49601d5f52..43ee870401 100644
--- a/libs/libsignal/src/hkdf.h
+++ b/libs/libsignal/src/hkdf.h
@@ -18,15 +18,9 @@ ssize_t hkdf_derive_secrets(hkdf_context *context,
const uint8_t *info, size_t info_len,
size_t output_len);
-ssize_t hkdf_expand(hkdf_context *context,
- uint8_t **output,
- const uint8_t *prk, size_t prk_len,
- const uint8_t *info, size_t info_len,
- size_t output_len);
-
int hkdf_compare(const hkdf_context *context1, const hkdf_context *context2);
-void hkdf_destroy(hkdf_context *type);
+void hkdf_destroy(signal_type_base *type);
#ifdef __cplusplus
}
diff --git a/libs/libsignal/src/session_cipher.c b/libs/libsignal/src/session_cipher.c
index 3f5dcab953..f705509413 100644
--- a/libs/libsignal/src/session_cipher.c
+++ b/libs/libsignal/src/session_cipher.c
@@ -744,6 +744,7 @@ int session_cipher_get_remote_registration_id(session_cipher *cipher, uint32_t *
id_result = session_state_get_remote_registration_id(state);
complete:
+ SIGNAL_UNREF(record);
if(result >= 0) {
*remote_id = id_result;
}
@@ -784,6 +785,7 @@ int session_cipher_get_session_version(session_cipher *cipher, uint32_t *version
version_result = session_state_get_session_version(state);
complete:
+ SIGNAL_UNREF(record);
if(result >= 0) {
*version = version_result;
}