0
0
mirror of https://github.com/signalapp/libsignal.git synced 2024-09-20 20:03:07 +02:00
Commit Graph

1294 Commits

Author SHA1 Message Date
Jack Lloyd
5c4ee6588c Remove some intermediate helper functions when creating JNI store objects
Closes #7
2020-10-19 14:50:30 -04:00
Jordan Rose
e6e389e643 Swift: Drop 'SignalProtocol' module and just use 'SignalClient'
We can use folders for grouping within targets, but it's not obvious
that "protocol" is a useful group for the stuff we have, long-term.
2020-10-19 11:29:30 -07:00
Jack Lloyd
c0b6076a2d
Merge pull request #3 from signalapp/jack/merge-jni
Merge libsignal-jni
2020-10-19 11:13:49 -04:00
Jack Lloyd
c1331eb42f Add license headers 2020-10-16 18:30:17 -04:00
Jack Lloyd
3d24f94cef Update paths and workspace config 2020-10-16 18:26:26 -04:00
Jack Lloyd
52ae600210 Merge libsignal-jni history into libsignal-client 2020-10-16 18:19:11 -04:00
Jack Lloyd
e5840644c7 Move libsignal-jni to rust/bridge/jni 2020-10-16 18:17:21 -04:00
Jordan Rose
c7ca442410 PR testing for Swift 2020-10-16 14:32:10 -07:00
Jordan Rose
79441611a7 gitignore Swift's build directory too 2020-10-16 14:28:15 -07:00
Jordan Rose
d2a4463846 Swift: Build against the in-tree libsignal-ffi
And change the full package name to "SignalClient" instead of
"SignalProtocol", since it will eventually contain multiple modules.

This configuration won't allow the package to be used as a dependency
elsewhere without the client having its own set of search paths and
stuff, but that's fine.
2020-10-16 14:25:21 -07:00
Jordan Rose
5bb6adc81f Build libsignal-ffi as a staticlib for now
We don't want it to get linked into an app multiple times, but we also
have no reason to force the Swift wrapper to be a /separate/ dynamic
library.
2020-10-16 14:25:21 -07:00
Jordan Rose
58bba8f000 Merge libsignal-protocol-swift history into libsignal-client 2020-10-16 14:24:20 -07:00
Jordan Rose
b30bf7e59d
Merge pull request #4 from signalapp/jrose/merge-ffi
Merge libsignal-ffi
2020-10-16 14:21:18 -07:00
Jordan Rose
54f363c814 Default the project to nightly Rust toolchains 2020-10-16 13:04:02 -07:00
Jordan Rose
c8834a875a Add missing license headers to libsignal-ffi sources 2020-10-16 13:01:12 -07:00
Jordan Rose
8d8504669c Move libsignal-protocol-swift to swift/ 2020-10-16 11:23:50 -07:00
Jordan Rose
2fb87a0ab4 ffi: Fold signal_ffi.h generation into the Rust build
We're going to need nightly Rust for other things anyway, so we may as
well drop the extra Makefile and just require Cargo.

Also, delete the pkg-config file now that we no longer need to access
libsignal_ffi from arbitrary locations.
2020-10-16 11:19:00 -07:00
Jordan Rose
0c996fe221 Add ffi to workspace and refer to libsignal-protocol-rust via path 2020-10-16 10:45:49 -07:00
Jordan Rose
2ea57f3582 Merge libsignal-ffi history into libsignal-client 2020-10-16 10:36:45 -07:00
Jordan Rose
e5e55b1cd1 Move libsignal-ffi to rust/bridge/ffi 2020-10-16 10:36:12 -07:00
Jack Lloyd
a4a3dc6cbb
Merge pull request #1 from signalapp/jack/move-to-subdir
Move libsignal-protocol-rust to rust/protocol
2020-10-15 15:49:07 -04:00
Jack Lloyd
a0a4ffb40f Move libsignal-protocol-rust to rust/protocol 2020-10-15 15:41:20 -04:00
Jordan Rose
fa5657c051
Merge pull request #3 from signalapp/jrose/pr-testing
GitHub: run tests on PRs
2020-10-14 11:48:51 -07:00
Jordan Rose
a409ed3815 Generate a coverage report for each PR test 2020-10-14 11:43:20 -07:00
Jordan Rose
fb56458e41 GitHub: add swiftlint action as well 2020-10-14 11:43:20 -07:00
Jordan Rose
4e9f13067a GitHub: run tests on PRs 2020-10-14 11:43:20 -07:00
Jordan Rose
b3f500b639
Merge pull request #12 from signalapp/jrose/public-dependency
Switch to the public libsignal-protocol-rust for libsignal-ffi
2020-10-14 11:37:05 -07:00
Jordan Rose
cf18ad4594
Merge pull request #11 from signalapp/jrose/CARGO_BUILD_TARGET
Makefile: Respect CARGO_BUILD_TARGET for cross-compilation
2020-10-14 11:36:48 -07:00
Jordan Rose
87c001e7c8 Switch to the public libsignal-protocol-rust for libsignal-ffi
To set up relative paths for a particular checkout of libsignal-ffi,
run the following series of commands:

echo 'Cargo.toml filter=local-deps' >> .git/info/attributes
git config filter.local-deps.smudge \
  'sed -E -e "s|{ *git *= *\"ssh://git@github\.com/signalapp/(.+)\.git\" *}|{ path = \"../\1\" } # local-deps: &|"'
git config filter.local-deps.clean \
  'sed -E -e "s|{.+} # local-deps: {(.+)}|{\1}|"'

This will replace any dependencies on GitHub repositories under the
signalapp organization with path dependencies in the parent folder.
The checkout must be named the same as the repo on GitHub.
2020-10-13 17:24:58 -07:00
Jordan Rose
5047350456 Makefile: Respect CARGO_BUILD_TARGET for cross-compilation
Explicitly /don't/ respect CARGO_BUILD_TARGET for cbindgen because
that uses a nightly toolchain, and the nightly toolchain may not
support the platform being cross-compiled for.
2020-10-13 17:17:05 -07:00
Jordan Rose
39ba4489fe Derive all (Partial)?(Ord|Eq) for IdentityKey
...instead of deriving some and synthesizing others. Caught by nightly
`cargo clippy`.
2020-10-13 11:23:01 -07:00
Jordan Rose
90cf751e8a
Merge pull request #7 from signalapp/jrose/rustfmt-clippy
Add rustfmt and clippy to our PR tests (and fix issues)
2020-10-13 11:10:33 -07:00
Jordan Rose
3d68f690f6 Add rustfmt and clippy to our PR tests (and fix issues) 2020-10-13 11:00:35 -07:00
Jordan Rose
2f38129f37
Merge pull request #10 from signalapp/jrose/NULL-can-mean-empty
Allow NULL/0 as a valid 0-length buffer
2020-10-12 15:19:52 -07:00
Jordan Rose
3c1da026f4
Merge pull request #19 from signalapp/jrose/stray-handle-property
Fix PreKeyRecord having two 'handle' properties
2020-10-12 14:29:46 -07:00
Jordan Rose
eba1dc9282 Fix PreKeyRecord having two 'handle' properties
PreKeyRecord is a ClonableHandleOwner, so the superclass was handling
all the state management, but the subclass had its own 'handle' that
was never initialized.
2020-10-12 14:17:29 -07:00
Jordan Rose
38f4b11e21 Simplify signal_hkdf_derive
For HKDF, a zero-length salt is the same as a zero-filled salt (the
default if no salt is provided), so we don't need to special-case a
NULL salt argument.
2020-10-12 12:56:30 -07:00
Jordan Rose
01238b84fb Allow NULL/0 as a valid 0-length buffer
Per usual C conventions. This won't come up much, but it's good for
completenes, as well as Swift interop that assumes this is valid.
2020-10-12 12:07:57 -07:00
Jordan Rose
555c9a358d
Merge pull request #16 from signalapp/jrose/ContiguousBytes
Make all byte buffer inputs accept any ContiguousBytes type
2020-10-12 11:10:01 -07:00
Jordan Rose
f139a56bca Make all byte buffer inputs accept any ContiguousBytes type
This helps avoid unnecessary conversions on the client side.
2020-10-12 11:09:30 -07:00
Jordan Rose
63db637083
Merge pull request #15 from signalapp/jrose/fdkh
Fix order of arguments for hkdf
2020-10-09 10:09:10 -07:00
Jordan Rose
d970f9c5d3
Merge pull request #8 from signalapp/jrose/salt-then-info
signal_hkdf_derive: fix reversal of salt and info in implementation
2020-10-08 16:17:36 -07:00
Jordan Rose
a54dcfebe4 Fix order of arguments for hkdf 2020-10-08 16:13:48 -07:00
Jordan Rose
40629189b4 signal_hkdf_derive: fix reversal of salt and info in implementation 2020-10-08 16:11:49 -07:00
Jordan Rose
0c1fe9a0db
Merge pull request #14 from signalapp/jrose/remove-unused-argument
Remove unused parameter from SenderKeyMessage.init
2020-10-08 15:54:23 -07:00
Jordan Rose
5a5a269d78 Remove unused parameter from SenderKeyMessage.init 2020-10-08 15:49:31 -07:00
Jordan Rose
abfdc320a5
Merge pull request #13 from signalapp/jrose/minor-tweaks
Minor tweaks to help integration with the existing iOS client
2020-10-08 13:22:58 -07:00
Jordan Rose
5c18a65c1a ProtocolAddress.init(name:device_id:) -> init(name:deviceId:)
One last snake_case in a public API I missed earlier.
2020-10-08 12:47:41 -07:00
Jordan Rose
35e0f6a8f9 Add InMemorySignalProtocolStore.init(identity:deviceId:)
This is primarily intended for testing, and some tests might want to
control these parameters.
2020-10-08 12:46:47 -07:00
Jordan Rose
1de19a3aaf Add IdentityKeyPair.init(publicKey:privateKey:) 2020-10-08 12:46:47 -07:00