Skip to content
This repository was archived by the owner on Feb 12, 2022. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions protobuf/FingerprintProtocol.proto
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
syntax = "proto2";

package textsecure;

option java_package = "org.whispersystems.libsignal.fingerprint";
Expand Down
4 changes: 3 additions & 1 deletion protobuf/LocalStorageProtocol.proto
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
syntax = "proto2";

package textsecure;

option java_package = "org.whispersystems.libsignal.state";
Expand Down Expand Up @@ -109,4 +111,4 @@ message SenderKeyStateStructure {

message SenderKeyRecordStructure {
repeated SenderKeyStateStructure senderKeyStates = 1;
}
}
4 changes: 3 additions & 1 deletion protobuf/WhisperTextProtocol.proto
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
syntax = "proto2";

package textsecure;

option java_package = "org.whispersystems.libsignal.protocol";
Expand Down Expand Up @@ -43,4 +45,4 @@ message SenderKeyDistributionMessage {
message DeviceConsistencyCodeMessage {
optional uint32 generation = 1;
optional bytes signature = 2;
}
}
5 changes: 2 additions & 3 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
if(BUILD_SHARED_LIBS)
find_library(M_LIB m)
find_library(PBC_LIB protobuf-c)
endif()

include_directories(
Expand Down Expand Up @@ -62,17 +63,15 @@ set(signal_protocol_SRCS
)

add_subdirectory(curve25519)
add_subdirectory(protobuf-c)

add_library(signal-protocol-c
${protobuf_SRCS}
${signal_protocol_SRCS}
$<TARGET_OBJECTS:curve25519>
$<TARGET_OBJECTS:protobuf-c>
)

if(BUILD_SHARED_LIBS)
target_link_libraries(signal-protocol-c ${M_LIB})
target_link_libraries(signal-protocol-c ${M_LIB} ${PBC_LIB})
set_target_properties(signal-protocol-c PROPERTIES
VERSION ${SIGNAL_PROTOCOL_C_VERSION}
SOVERSION ${SIGNAL_PROTOCOL_C_VERSION_MAJOR}
Expand Down
8 changes: 6 additions & 2 deletions src/FingerprintProtocol.pb-c.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
void textsecure__logical_fingerprint__init
(Textsecure__LogicalFingerprint *message)
{
static Textsecure__LogicalFingerprint init_value = TEXTSECURE__LOGICAL_FINGERPRINT__INIT;
static const Textsecure__LogicalFingerprint init_value = TEXTSECURE__LOGICAL_FINGERPRINT__INIT;
*message = init_value;
}
size_t textsecure__logical_fingerprint__get_packed_size
Expand Down Expand Up @@ -47,13 +47,15 @@ void textsecure__logical_fingerprint__free_unpacked
(Textsecure__LogicalFingerprint *message,
ProtobufCAllocator *allocator)
{
if(!message)
return;
assert(message->base.descriptor == &textsecure__logical_fingerprint__descriptor);
protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator);
}
void textsecure__combined_fingerprints__init
(Textsecure__CombinedFingerprints *message)
{
static Textsecure__CombinedFingerprints init_value = TEXTSECURE__COMBINED_FINGERPRINTS__INIT;
static const Textsecure__CombinedFingerprints init_value = TEXTSECURE__COMBINED_FINGERPRINTS__INIT;
*message = init_value;
}
size_t textsecure__combined_fingerprints__get_packed_size
Expand Down Expand Up @@ -90,6 +92,8 @@ void textsecure__combined_fingerprints__free_unpacked
(Textsecure__CombinedFingerprints *message,
ProtobufCAllocator *allocator)
{
if(!message)
return;
assert(message->base.descriptor == &textsecure__combined_fingerprints__descriptor);
protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator);
}
Expand Down
6 changes: 3 additions & 3 deletions src/FingerprintProtocol.pb-c.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

44 changes: 29 additions & 15 deletions src/LocalStorageProtocol.pb-c.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,37 +10,37 @@
void textsecure__session_structure__chain__chain_key__init
(Textsecure__SessionStructure__Chain__ChainKey *message)
{
static Textsecure__SessionStructure__Chain__ChainKey init_value = TEXTSECURE__SESSION_STRUCTURE__CHAIN__CHAIN_KEY__INIT;
static const Textsecure__SessionStructure__Chain__ChainKey init_value = TEXTSECURE__SESSION_STRUCTURE__CHAIN__CHAIN_KEY__INIT;
*message = init_value;
}
void textsecure__session_structure__chain__message_key__init
(Textsecure__SessionStructure__Chain__MessageKey *message)
{
static Textsecure__SessionStructure__Chain__MessageKey init_value = TEXTSECURE__SESSION_STRUCTURE__CHAIN__MESSAGE_KEY__INIT;
static const Textsecure__SessionStructure__Chain__MessageKey init_value = TEXTSECURE__SESSION_STRUCTURE__CHAIN__MESSAGE_KEY__INIT;
*message = init_value;
}
void textsecure__session_structure__chain__init
(Textsecure__SessionStructure__Chain *message)
{
static Textsecure__SessionStructure__Chain init_value = TEXTSECURE__SESSION_STRUCTURE__CHAIN__INIT;
static const Textsecure__SessionStructure__Chain init_value = TEXTSECURE__SESSION_STRUCTURE__CHAIN__INIT;
*message = init_value;
}
void textsecure__session_structure__pending_key_exchange__init
(Textsecure__SessionStructure__PendingKeyExchange *message)
{
static Textsecure__SessionStructure__PendingKeyExchange init_value = TEXTSECURE__SESSION_STRUCTURE__PENDING_KEY_EXCHANGE__INIT;
static const Textsecure__SessionStructure__PendingKeyExchange init_value = TEXTSECURE__SESSION_STRUCTURE__PENDING_KEY_EXCHANGE__INIT;
*message = init_value;
}
void textsecure__session_structure__pending_pre_key__init
(Textsecure__SessionStructure__PendingPreKey *message)
{
static Textsecure__SessionStructure__PendingPreKey init_value = TEXTSECURE__SESSION_STRUCTURE__PENDING_PRE_KEY__INIT;
static const Textsecure__SessionStructure__PendingPreKey init_value = TEXTSECURE__SESSION_STRUCTURE__PENDING_PRE_KEY__INIT;
*message = init_value;
}
void textsecure__session_structure__init
(Textsecure__SessionStructure *message)
{
static Textsecure__SessionStructure init_value = TEXTSECURE__SESSION_STRUCTURE__INIT;
static const Textsecure__SessionStructure init_value = TEXTSECURE__SESSION_STRUCTURE__INIT;
*message = init_value;
}
size_t textsecure__session_structure__get_packed_size
Expand Down Expand Up @@ -77,13 +77,15 @@ void textsecure__session_structure__free_unpacked
(Textsecure__SessionStructure *message,
ProtobufCAllocator *allocator)
{
if(!message)
return;
assert(message->base.descriptor == &textsecure__session_structure__descriptor);
protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator);
}
void textsecure__record_structure__init
(Textsecure__RecordStructure *message)
{
static Textsecure__RecordStructure init_value = TEXTSECURE__RECORD_STRUCTURE__INIT;
static const Textsecure__RecordStructure init_value = TEXTSECURE__RECORD_STRUCTURE__INIT;
*message = init_value;
}
size_t textsecure__record_structure__get_packed_size
Expand Down Expand Up @@ -120,13 +122,15 @@ void textsecure__record_structure__free_unpacked
(Textsecure__RecordStructure *message,
ProtobufCAllocator *allocator)
{
if(!message)
return;
assert(message->base.descriptor == &textsecure__record_structure__descriptor);
protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator);
}
void textsecure__pre_key_record_structure__init
(Textsecure__PreKeyRecordStructure *message)
{
static Textsecure__PreKeyRecordStructure init_value = TEXTSECURE__PRE_KEY_RECORD_STRUCTURE__INIT;
static const Textsecure__PreKeyRecordStructure init_value = TEXTSECURE__PRE_KEY_RECORD_STRUCTURE__INIT;
*message = init_value;
}
size_t textsecure__pre_key_record_structure__get_packed_size
Expand Down Expand Up @@ -163,13 +167,15 @@ void textsecure__pre_key_record_structure__free_unpacked
(Textsecure__PreKeyRecordStructure *message,
ProtobufCAllocator *allocator)
{
if(!message)
return;
assert(message->base.descriptor == &textsecure__pre_key_record_structure__descriptor);
protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator);
}
void textsecure__signed_pre_key_record_structure__init
(Textsecure__SignedPreKeyRecordStructure *message)
{
static Textsecure__SignedPreKeyRecordStructure init_value = TEXTSECURE__SIGNED_PRE_KEY_RECORD_STRUCTURE__INIT;
static const Textsecure__SignedPreKeyRecordStructure init_value = TEXTSECURE__SIGNED_PRE_KEY_RECORD_STRUCTURE__INIT;
*message = init_value;
}
size_t textsecure__signed_pre_key_record_structure__get_packed_size
Expand Down Expand Up @@ -206,13 +212,15 @@ void textsecure__signed_pre_key_record_structure__free_unpacked
(Textsecure__SignedPreKeyRecordStructure *message,
ProtobufCAllocator *allocator)
{
if(!message)
return;
assert(message->base.descriptor == &textsecure__signed_pre_key_record_structure__descriptor);
protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator);
}
void textsecure__identity_key_pair_structure__init
(Textsecure__IdentityKeyPairStructure *message)
{
static Textsecure__IdentityKeyPairStructure init_value = TEXTSECURE__IDENTITY_KEY_PAIR_STRUCTURE__INIT;
static const Textsecure__IdentityKeyPairStructure init_value = TEXTSECURE__IDENTITY_KEY_PAIR_STRUCTURE__INIT;
*message = init_value;
}
size_t textsecure__identity_key_pair_structure__get_packed_size
Expand Down Expand Up @@ -249,31 +257,33 @@ void textsecure__identity_key_pair_structure__free_unpacked
(Textsecure__IdentityKeyPairStructure *message,
ProtobufCAllocator *allocator)
{
if(!message)
return;
assert(message->base.descriptor == &textsecure__identity_key_pair_structure__descriptor);
protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator);
}
void textsecure__sender_key_state_structure__sender_chain_key__init
(Textsecure__SenderKeyStateStructure__SenderChainKey *message)
{
static Textsecure__SenderKeyStateStructure__SenderChainKey init_value = TEXTSECURE__SENDER_KEY_STATE_STRUCTURE__SENDER_CHAIN_KEY__INIT;
static const Textsecure__SenderKeyStateStructure__SenderChainKey init_value = TEXTSECURE__SENDER_KEY_STATE_STRUCTURE__SENDER_CHAIN_KEY__INIT;
*message = init_value;
}
void textsecure__sender_key_state_structure__sender_message_key__init
(Textsecure__SenderKeyStateStructure__SenderMessageKey *message)
{
static Textsecure__SenderKeyStateStructure__SenderMessageKey init_value = TEXTSECURE__SENDER_KEY_STATE_STRUCTURE__SENDER_MESSAGE_KEY__INIT;
static const Textsecure__SenderKeyStateStructure__SenderMessageKey init_value = TEXTSECURE__SENDER_KEY_STATE_STRUCTURE__SENDER_MESSAGE_KEY__INIT;
*message = init_value;
}
void textsecure__sender_key_state_structure__sender_signing_key__init
(Textsecure__SenderKeyStateStructure__SenderSigningKey *message)
{
static Textsecure__SenderKeyStateStructure__SenderSigningKey init_value = TEXTSECURE__SENDER_KEY_STATE_STRUCTURE__SENDER_SIGNING_KEY__INIT;
static const Textsecure__SenderKeyStateStructure__SenderSigningKey init_value = TEXTSECURE__SENDER_KEY_STATE_STRUCTURE__SENDER_SIGNING_KEY__INIT;
*message = init_value;
}
void textsecure__sender_key_state_structure__init
(Textsecure__SenderKeyStateStructure *message)
{
static Textsecure__SenderKeyStateStructure init_value = TEXTSECURE__SENDER_KEY_STATE_STRUCTURE__INIT;
static const Textsecure__SenderKeyStateStructure init_value = TEXTSECURE__SENDER_KEY_STATE_STRUCTURE__INIT;
*message = init_value;
}
size_t textsecure__sender_key_state_structure__get_packed_size
Expand Down Expand Up @@ -310,13 +320,15 @@ void textsecure__sender_key_state_structure__free_unpacked
(Textsecure__SenderKeyStateStructure *message,
ProtobufCAllocator *allocator)
{
if(!message)
return;
assert(message->base.descriptor == &textsecure__sender_key_state_structure__descriptor);
protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator);
}
void textsecure__sender_key_record_structure__init
(Textsecure__SenderKeyRecordStructure *message)
{
static Textsecure__SenderKeyRecordStructure init_value = TEXTSECURE__SENDER_KEY_RECORD_STRUCTURE__INIT;
static const Textsecure__SenderKeyRecordStructure init_value = TEXTSECURE__SENDER_KEY_RECORD_STRUCTURE__INIT;
*message = init_value;
}
size_t textsecure__sender_key_record_structure__get_packed_size
Expand Down Expand Up @@ -353,6 +365,8 @@ void textsecure__sender_key_record_structure__free_unpacked
(Textsecure__SenderKeyRecordStructure *message,
ProtobufCAllocator *allocator)
{
if(!message)
return;
assert(message->base.descriptor == &textsecure__sender_key_record_structure__descriptor);
protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator);
}
Expand Down
Loading