Commit Graph

72 Commits

Author SHA1 Message Date
Jordan Rose
ee6d35ed05 Point folks to libsignal-client instead 2020-11-09 13:52:12 -08:00
Jordan Rose
59297b9c09 PR testing: update for changes to libsignal-ffi's install name 2020-10-14 17:48:07 -07: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
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
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
a54dcfebe4 Fix order of arguments for hkdf 2020-10-08 16:13:48 -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
Jordan Rose
d743dbb27e
Merge pull request #12 from signalapp/jrose/public
Add 'public' to everything that should be public
2020-10-07 14:54:08 -07:00
Jordan Rose
a066e1ce6e SignalProtocolTests -> PublicAPITests
These should only use the public API surface. If we need to do any
tests that reach into internals, those can go in a separate file.
2020-10-07 14:33:05 -07:00
Jordan Rose
15b5b7f5a6 Add 'public' to everything that should be public 2020-10-07 14:33:05 -07:00
Jordan Rose
d821954061
Merge pull request #11 from signalapp/jrose/idiomatic-swift
Many small changes for more idiomatic Swift
2020-10-07 14:08:01 -07:00
Jordan Rose
c7a33f4d6e Add swiftlint configuration and fix issues 2020-10-06 12:24:33 -07:00
Jordan Rose
9e3682db86 More idiomatic function bodies, for maintainability
I've left out Util.swift and the tests in this pass, the former
because it's close to the C API layer and the latter because they're
not expected to change in the same ways.
2020-10-06 12:23:48 -07:00
Jordan Rose
4223c9b9a8 'Optional<Foo>' -> 'Foo?' 2020-10-06 12:23:41 -07:00
Jordan Rose
0267d0f237 Remove unused Foundation imports 2020-10-06 12:23:34 -07:00
Jordan Rose
740c1a1af8 Naming conventions: drop 'get' from accessor names 2020-10-06 12:23:26 -07:00
Jordan Rose
5e43423e15 ClonableHandleOwner.init(unowned:) -> init(borrowing:)
While 'unowned' has a related meaning in Swift, "borrowing" really
gets across the idea that we're emulating the Rust ownership model at
run time.
2020-10-06 12:23:19 -07:00
Jordan Rose
8bf86db173 IdentityKey.init() -> generate(), like PrivateKey.generate() 2020-10-06 12:23:12 -07:00
Jordan Rose
7441b6ab77 Naming conventions: functions and parameters
These are both lowerCamelCase, but I also did several adjustments to
make them more idiomatic Swift (label-less direct object arguments and
prepositional labels when appropriate, mostly).
2020-10-06 12:23:09 -07:00
Jordan Rose
14faf99274 More Swift-idiomatic names for protocol requirements 2020-10-06 12:20:38 -07:00
Jordan Rose
c56ad4942e Naming conventions: properties use lowerCamelCase 2020-10-06 12:20:26 -07:00
Jordan Rose
03b8b2e1db Naming conventions: enum cases use lowerCamelCase 2020-10-06 12:20:24 -07:00
Jordan Rose
2218499aac Make 'nativeHandle' accessors into properties 2020-10-06 12:20:09 -07:00
Jordan Rose
6846f64ca0
Merge pull request #10 from signalapp/jrose/adopt-SignalDirection
Adopt SignalDirection_Sending and SignalDirection_Receiving
2020-10-06 10:35:31 -07:00
Jordan Rose
76b082afca Adopt SignalDirection_Sending and SignalDirection_Receiving 2020-10-06 10:35:15 -07:00
Jordan Rose
3dd0c82042
Merge pull request #9 from signalapp/jrose/rename-to-SignalProtocol
Rename package from 'SwiftSignal' to 'SignalProtocol'
2020-10-06 10:08:11 -07:00
Jordan Rose
1695ab72c8 Rename package from 'SwiftSignal' to 'SignalProtocol' 2020-10-06 10:07:48 -07:00
Jordan Rose
f4c2e36963
Merge pull request #8 from signalapp/jrose/value-semantics
Simplify wrapper types, and assume properties used in Equatable are safe
2020-10-06 10:06:56 -07:00
Jordan Rose
b78ea031a2 Getters -> properties for structs 2020-10-05 14:40:58 -07:00
Jordan Rose
5e99a247a7 If something's safe enough to use for Equatable, assume it won't throw
The C API might be defensive about passing incorrect or null handles,
but we're assuming the Swift wrapper protects against all such failure
cases.
2020-10-05 14:29:43 -07:00
Jordan Rose
ad41f45382 Switch to structs for anything that doesn't wrap an FFI handle 2020-10-05 14:29:43 -07:00
Jordan Rose
a88e670999
Merge pull request #7 from signalapp/jrose/c99-bool-again
Update for more 'bool' adoption in libsignal-ffi
2020-10-05 14:14:20 -07:00
Jordan Rose
077f66e460 Update for more 'bool' adoption in libsignal-ffi 2020-10-05 14:05:00 -07:00
Jordan Rose
c437603cc4
Merge pull request #6 from signalapp/jrose/remove-Equatable-from-ScannableFingerprint
Remove Equatable from ScannableFingerprint
2020-10-05 12:29:35 -07:00
Jordan Rose
434548981e Remove Equatable from ScannableFingerprint
compareWith(other:) is for checking a scanned key against an expected
key, which wants to have the "local" and "remote" parts reversed.
Equatable, on the other hand, wants `x == x` to be true.
2020-10-05 12:27:06 -07:00
Jordan Rose
24afb3e3e1
Merge pull request #5 from signalapp/jrose/c99-bool
Update for 'unsigned char' -> 'bool' change in libsignal-ffi
2020-10-05 12:10:24 -07:00
Jordan Rose
aed8595203 Update for 'unsigned char' -> 'bool' change in libsignal-ffi 2020-10-05 12:09:56 -07:00
Jordan Rose
9729dd91d1
Merge pull request #1 from signalapp/jrose/clone-on-demand
Clone unowned object handles on demand
2020-10-02 15:27:13 -07:00
Jordan Rose
d5e8aa7f9d Consistently use init(owned:) for handle owners
Most wrapper types don't need the "maybe owned, maybe borrowed"
functionality of ClonableHandleOwner, but we can still be explicit
about ownership to make sure nothing gets destroyed that shouldn't.
2020-10-02 15:21:15 -07:00