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

1294 Commits

Author SHA1 Message Date
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
274f7d6e2b
Merge pull request #6 from signalapp/jrose/header-niceties
Some header niceties
2020-10-06 10:34:49 -07:00
Jordan Rose
ed5827e572
Merge pull request #5 from signalapp/jrose/avoid-unnecessary-bytearray-copies
Avoid unnecessary copies for bytearray outputs
2020-10-06 10:34:29 -07:00
Jack Lloyd
363c6146ac
Merge pull request #1 from signalapp/jack/ffi
Initial C ABI code
2020-10-06 13:33:40 -04:00
Jack Lloyd
fe28cb9679 Add a test that verifies contexts are passed back 2020-10-06 13:32:51 -04: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
8788e2c0e8 Add SignalDirection_Sending and SignalDirection_Receiving
We don't actually use the SignalDirection type in our callback because
we don't want to be responsible for a type error in a client if
there's ever another direction added ("Ambidextrous"), but this way
clients can check against names instead of magic numbers 0 and 1.
2020-10-05 18:31:34 -07:00
Jordan Rose
4b964aeb98 Add parameter names for the callback typedefs 2020-10-05 18:31:34 -07:00
Jordan Rose
0de61ca41f Avoid unnecessary copies for bytearray outputs 2020-10-05 17:40:25 -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
10bb8b01f5 GitHub: run a build as part of a PR to catch silly mistakes 2020-10-05 14:20:47 -07:00
Jack Lloyd
7e1dbcc26e Derive Clone on all types 2020-10-05 17:14:39 -04: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
ea0d4ba3ff
Merge pull request #3 from signalapp/jrose/c99-bool-again
Use 'bool' for several more Boolean results
2020-10-05 14:14:10 -07:00
Jordan Rose
077f66e460 Update for more 'bool' adoption in libsignal-ffi 2020-10-05 14:05:00 -07:00
Jordan Rose
6ef5cc0cfd Use 'bool' for several more Boolean results 2020-10-05 14:02:15 -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
a7f00db45a
Merge pull request #2 from signalapp/jrose/c99-bool
Use 'bool' for signal_fingerprint_compare
2020-10-05 12:07:28 -07:00
Jordan Rose
8ea55032f8 Use 'bool' for signal_fingerprint_compare 2020-10-05 11:47:30 -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
Jordan Rose
934cb60a5c Clone unowned object handles on demand
This fixes a correctness issue when object wrappers are returned, and
a performance issue when object wrappers are made for non-owned
handles.
2020-10-02 15:21:15 -07:00
Jack Lloyd
f4b571ce0b
Merge pull request #2 from signalapp/jack/ffi
Initial Swift binding work
2020-10-02 18:17:19 -04:00
Jack Lloyd
bcdda77a4c Remove signal_ffi.h
Generated by makefile now
2020-10-02 18:12:52 -04:00
Jack Lloyd
11986398be Use Into/From instead of an explicit conversion function 2020-10-02 17:55:05 -04:00
Jordan Rose
3ebd738652 Simplify pkg-config configuration
pkg-config already has a way to refer to "the directory of the .pc
file".
2020-10-02 14:44:53 -07:00