Skip to content

Commit dc7b0bc

Browse files
committed
Fixed up the build errors
1 parent f9767e6 commit dc7b0bc

File tree

4 files changed

+9
-6
lines changed

4 files changed

+9
-6
lines changed

library/src/main/cpp/blinded_key.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#include <jni.h>
22
#include <session/blinding.hpp>
3+
#include <session/util.hpp>
34

45
#include "util.h"
56
#include "jni_utils.h"
@@ -45,13 +46,15 @@ Java_network_loki_messenger_libsession_1util_util_BlindKeyAPI_blindVersionSignRe
4546
return jni_utils::run_catching_cxx_exception_or_throws<jbyteArray>(env, [=] {
4647
auto methodC = util::string_from_jstring(env, method);
4748
auto pathC = util::string_from_jstring(env, path);
49+
auto keyBytes = util::vector_from_bytes(env, ed25519_secret_key);
50+
auto bodyBytes = body ? std::optional(util::vector_from_bytes(env, body)) : std::nullopt;
4851

4952
auto bytes = session::blind_version_sign_request(
50-
util::span_from_bytes(env, ed25519_secret_key),
53+
session::to_span(keyBytes),
5154
timestamp,
5255
methodC,
5356
pathC,
54-
body ? std::optional(util::span_from_bytes(env, body)) : std::nullopt
57+
body ? std::optional(session::to_span(*bodyBytes)) : std::nullopt
5558
);
5659
return util::bytes_from_vector(env, bytes);
5760
});

library/src/main/cpp/group_keys.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ Java_network_loki_messenger_libsession_1util_GroupKeysConfig_rekey(JNIEnv *env,
146146
auto info = reinterpret_cast<session::config::groups::Info*>(info_ptr);
147147
auto members = reinterpret_cast<session::config::groups::Members*>(members_ptr);
148148
auto rekey = keys->rekey(*info, *members);
149-
auto rekey_bytes = util::bytes_from_span(env, rekey.data());
149+
auto rekey_bytes = util::bytes_from_span(env, rekey);
150150
return rekey_bytes;
151151
}
152152

library/src/main/cpp/util.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -243,8 +243,8 @@ Java_network_loki_messenger_libsession_1util_util_Sodium_encryptForMultipleSimpl
243243
recipient_vec.emplace_back(recipient);
244244
}
245245

246-
std::vector<session::ustring_view> message_sv_vec{};
247-
std::vector<session::ustring_view> recipient_sv_vec{};
246+
std::vector<std::span<const unsigned char>> message_sv_vec{};
247+
std::vector<std::span<const unsigned char>> recipient_sv_vec{};
248248
for (int i = 0; i < size; i++) {
249249
message_sv_vec.emplace_back(session::to_span(message_vec[i]));
250250
recipient_sv_vec.emplace_back(session::to_span(recipient_vec[i]));

library/src/main/cpp/util.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
namespace util {
1818
extern std::mutex util_mutex_;
19-
jbyteArray bytes_from_vector(JNIEnv* env, std::vector<unsigned char> from_str);
19+
jbyteArray bytes_from_vector(JNIEnv* env, const std::vector<unsigned char> &from_str);
2020
std::vector<unsigned char> vector_from_bytes(JNIEnv* env, jbyteArray byteArray);
2121
jbyteArray bytes_from_span(JNIEnv* env, std::span<const unsigned char> from_str);
2222
std::string string_from_jstring(JNIEnv* env, jstring string);

0 commit comments

Comments
 (0)