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

1643 Commits

Author SHA1 Message Date
Ravi Khadiwala
cc962913f7 dcap: check if enclave is in debug mode
Clients should only trust MRENCLAVE values from a non-debug
build. But, as an extra precaution, verify that the remote
enclave is not running in debug mode
2022-08-16 14:50:02 -07:00
Jordan Rose
e8d73665b4 zkgroup: Move AuthCredential redemption time checking down to Rust
This was previously in the Java layer because it only really affects
the server, but it's more consistent to have all verification in the
Rust layer. We do lose the separate exception type for it, though.
2022-08-09 13:47:17 -07:00
Jordan Rose
13b60197a9 Bump version to v0.19.3 2022-08-04 11:04:31 -07:00
Ravi Khadiwala
93cdd47a30 cds2: add jni binding for attestation metrics
Adds a java method for libsignal-server that enables extracting
attestation metrics from serialized evidence and endorsements.
Certificate and endorsement validity periods are exposed, so servers
can track if any attestation material is overly stale.
2022-08-04 10:26:47 -07:00
Ravi Khadiwala
ebc68fcb1f cds2: Adjust check time forward for clock skew
As part of DCAP attestation, the client provided timestamp is compared
to various pieces of quote collateral to verify that the collateral is
currently valid. Some of this collateral can be fresh enough such that a
client with significant clock skew may see the start of the validity
period in the future.

Allow for 1 day of clock skew, at the expense of collateral expiring
1 day earlier.
2022-08-02 11:07:20 -07:00
Jordan Rose
3c365ab1da Bump to version v0.19.2 2022-08-01 16:04:37 -07:00
Jordan Rose
eff149b398 GitHub: Build Ubuntu Node releases using Docker, for Ubuntu 16 compat
The only supported way to target an older glibc is to build against
that glibc; consequently, we need to build on an Ubuntu 16 system (or
similar) to target Ubuntu 16. This requires downloading second-party
versions of Clang and CMake, which are too old in the default Ubuntu
repository, as well as building our own Python.

Do all this in a new Dockerfile based on Ubuntu 16.04. This isn't as
rigorous as the Java "reproducible build" Dockerfile, since we're not
pinning the base image or the repositories we're fetching from, but
it's still an image with the environment and tools we need.
2022-08-01 15:59:29 -07:00
Jordan Rose
9431b5c490 Fix Python style issue caught by newer flake8
'assert' is a keyword statement, not a function.
2022-08-01 15:59:29 -07:00
Jordan Rose
668f27e31e Update boring for macOS cross-compilation 2022-08-01 12:14:43 -07:00
Jordan Rose
9d774c4d59 CocoaPods-related infrastucture improvements
- Skip building for Catalyst in pull request testing, but make up for
  it in the "Slow Tests".

- Update the README now that the Arm Mac simulator is a Tier 2 Rust
  target.

- Remove workaround for one-time incompatibility with the Arm Mac
  simulator.
2022-07-29 10:47:45 -07:00
Jordan Rose
1689d274ec device-transfer: generated private keys should be DER-encoded PKCS#8
This regressed when we switched from picky to boring because BoringSSL
accepts either PKCS#1 or PKCS#8 when initializing an RSA private key,
and so the default BoringSSL PKCS#1 serialization wasn't caught. Now
we explicitly request PCKS#8.
2022-07-28 17:51:33 -07:00
Jordan Rose
2f07edaa02 Bump to version v0.19.1 2022-07-25 17:13:19 -07:00
Jordan Rose
f456227f17 Java: drop cargo-ndk for building for Android
We can provide the necessary information in environment variables and
save a host dependency.
2022-07-25 17:11:36 -07:00
Jordan Rose
cd40df36e7 Update Dockerfile for the reproducible Java/Android build
- Use the headless variant of the JDK.
- Put most apt-get requirements at the end of the file, so that
  tweaking them can make use of Docker's per-RUN line caching.
- Added 'clang' as a build dependency for BoringSSL.
- Drop unnecessary packages:
  - apt-transport-https - we're using plain http sources at this time
  - build-essential - overkill, we just need 'make'
  - gcc-multilib - was used to build OpenSSL for testing,
    no longer necessary with the switch to BoringSSL
  - openssh-client - was used to clone from GitHub, now unused because
    all dependencies are public

And note that the "slow tests" should also be passing before a
release.
2022-07-25 16:36:36 -07:00
Jordan Rose
036b85db26 Update 'boring' to build more cleanly for Android 2022-07-25 16:29:40 -07:00
Jordan Rose
40fb8944d7 dcap: Drop unused last_attest_time from the Attestation struct
This was a remnant of a design before we settled on always passing in
the current time.
2022-07-25 16:28:22 -07:00
Jordan Rose
3c03e909b7 Update build dependencies in the top-level README 2022-07-25 15:01:09 -07:00
Jordan Rose
c8a334f511 GitHub: Add a "slow tests" CI that runs nightly
(but only if there have been any changes)

For now this is just exercising the Docker build, but I think we
should put some of the CocoaPods testing in here too, if not more of
the regular pull request testing.
2022-07-25 14:57:13 -07:00
Jordan Rose
c02cb26018 Bump version to 0.19.0 2022-07-22 15:36:22 -07:00
Chris Eager
8035a70509
[feature] CDS2 attestation
Implements (a subset of) Intel's DCAP attestation,
making heavy use of 'boring' for X509 and ECDSA.
Cds2Client is now ready for use!

Co-authored-by: Jordan Rose <jrose@signal.org>
Co-authored-by: Ravi Khadiwala <ravi@signal.org>
2022-07-22 12:23:57 -07:00
Danny McClanahan
c8b81c9585 [#476] set imports granularity 2022-07-20 13:10:43 -07:00
Danny McClanahan
ec3c2d32bc [#289] introduce wrapper structs for DeviceId, SignedPreKeyId, and PreKeyId 2022-07-20 13:10:43 -07:00
Danny McClanahan
9ad236264d [#470] add docs to identity_key.rs 2022-07-20 13:10:43 -07:00
Jordan Rose
3a01a7848d Node: Add missing IdentityKeyPair_Deserialize
This annoying function is implemented separately for each bridge
because it produces two results, and the optimal way of doing that for
each bridge differs.
2022-07-19 18:16:23 -07:00
Jordan Rose
018b056b08 CI: set RUST_BACKTRACE=1 for more information on rare panics 2022-07-19 16:10:54 -07:00
Jordan Rose
02d1e183a3 Update log-panics to 2.1.0 to print unresolved backtraces on mobile
Symbols are stripped on both iOS and Android by the time the app gets
to a user's device, so spending time (and code size) trying to
symbolicate backtraces is wasted. It's still useful for Desktop and
Server, though.
2022-07-18 12:48:17 -07:00
Jordan Rose
17f5718eae Revert "Replace log-panics with an equivalent without symbolicated backtraces"
This reverts commit 99aabcf203.
2022-07-18 12:48:17 -07:00
Jordan Rose
99aabcf203 Replace log-panics with an equivalent without symbolicated backtraces
On Android and iOS, the libsignal library on the device will be
stripped, so backtraces will only ever have addresses. Not
symbolicating saves on code size in the backtrace crate.
2022-07-14 12:20:54 -07:00
Jordan Rose
2abfd24e11 Support cross-compilation for BoringSSL on Linux and Windows
Update to a revision of BoringSSL that supports cross-compilation to
AArch64 for both Linux and Windows (from an x86_64 host of the same
OS), and provide the necessary environment variables for the Linux
cross-build.
2022-06-30 10:59:29 -07:00
Jordan Rose
ec4faf2601 Node: On Windows in GitHub CI, use $TMP as the build directory
Otherwise, we can run into paths that exceed the classic Windows path
limit due to the nesting of build systems (GitHub Actions > node-gyp >
Cargo > CMake > Visual Studio). Unfortunately, at least some of Visual
Studio's tools are not long-path-aware.
2022-06-30 10:59:29 -07:00
Jordan Rose
e54685b281 Bump to version v0.18.1 2022-06-29 12:01:17 -07:00
Jordan Rose
6b50c991f8 node: Include new credentials in the default zkgroup exports
And tweak the test file to remind that the top-level zkgroup/index.ts
exists, though since we still don't reference most types by name in
the tests this wouldn't have actually caught the oversight.
2022-06-29 10:13:54 -07:00
Jordan Rose
e6f149c93d zkgroup: Deprecate PniCredential operations
...but not the types at this time, because that produces extra
warnings that need silencing.
2022-06-28 17:21:41 -07:00
Jordan Rose
8135419d30 Java: Lint for deprecation, fallthroughs, and unchecked generics
And disable the deprecation lint for overriding 'finalize', which we
use for bridged object management.
2022-06-28 17:21:41 -07:00
Jordan Rose
2ccfe4eb72 GitHub: Remove "ref" field from Publish to NPM action
In the past manually-run GitHub Actions could only be run from a
branch, so specifying a tag to build had to be done explicitly. That's
no longer true, so we can remove that field.
2022-06-28 12:53:23 -07:00
Jordan Rose
b5da2eac9d Update Rust to nightly-2022-06-22 2022-06-24 10:56:48 -07:00
Jordan Rose
15c09ad419 GitHub: Improve Rust CI
- Combine stable and nightly job definitions in the workflow file
- Build bins along with benches
- Use --all-features for tests and bins and Clippy, to make sure the
  maximum amount of code is tested. (If we ever have code omitted when
  a feature is turned on, we may want to add more test configuration.)
2022-06-24 10:56:28 -07:00
Jordan Rose
964f45c7e3 zkgroup: Add a generate-server-params binary
generate-server-params takes existing server params through stdin
(base64-encoded) and generates randomness for any new keys have been
added since last time. As long as new keys are always added to the end
of ServerSecretParams and ServerPublicParams, this allows updating
zkgroup without breaking existing credentials.
2022-06-24 10:55:45 -07:00
Jordan Rose
366b030841 Re-apply "device transfer: replace picky with boring"
This reverts commit 09c043c54a.
2022-06-22 16:33:21 -07:00
Jordan Rose
2a46a5b294 Update code size for the *real* v0.18.0 2022-06-22 15:58:44 -07:00
Jordan Rose
09c043c54a Revert "device transfer: replace picky with boring"
We need to work out more kinks cross-compiling boring-sys, so revert
this for now. (But keep the fix to use the correct Android NDK.)
2022-06-22 15:56:21 -07:00
Jordan Rose
36795d019c GitHub: Update publishing workflows for BoringSSL dependency
We need to install nasm on Windows.
2022-06-21 16:17:43 -07:00
Jordan Rose
bee544ec73 Bump version to v0.18.0 2022-06-21 15:58:48 -07:00
Jordan Rose
70ec1ca26f
zkgroup: Add AuthCredentialWithPni
This is a variant of AuthCredential that carries two UUIDs, intended
to be a user's ACI and PNI. Why? Because when you've been invited to a
group, you may have been invited by your ACI or by your PNI, or by
both, and it's easier for clients to treat all those states the same
by having a credential that covers both identities. The downside is
that it's larger (both the data, obviously, but also the zkgroup proof
of validity, unsurprisingly).

AnyAuthCredentialPresentation gains a 'get_pni_ciphertext' method,
which will return `None` for the existing presentations and
`Some(encrypted_pni)` for the new credential. Having a separate
credential type but a common presentation type makes it easier for the
server to handle all possible credentials uniformly.
2022-06-21 15:11:57 -07:00
Jordan Rose
cc217911a9 zkgroup: Remove C_z from ExpiringProfileKeyCredentialPresentationProof
This term is unnecessary after all (the value of 'z' is already fixed
by the equation "Z = I^z"). We can't remove it from earlier proofs
because that would change the format, but going forward we don't need
it.
2022-06-17 17:12:05 -07:00
Jordan Rose
9e6343b6e4 Node: Force nominal typing for zkgroup ByteArray subclasses
Without this, two ByteArray types without any additional operations
are structurally equivalent, and so TypeScript permits passing one as
the other. (Thanks, Fedor!)
2022-06-17 14:14:12 -07:00
Jordan Rose
395e36e9f2
zkgroup: Add ExpiringProfileKeyCredential
Like ProfileKeyCredential, but with an expiration timestamp embedded
in it. This has its own credential type and response type, but uses
the same request type as a "classic" ProfileKeyCredential, and
generates presentations usable with AnyProfileKeyCredential-
Presentation, so that existing server code accepting presentations
will automatically do the right thing.

Adoption for servers:

- Update secret params
- When presentations are saved in group state, use 
  ProfileKeyCredentialPresentation.getStructurallyValidV1PresentationBytes()
  to maintain backwards compatibility with existing clients.
- Add an endpoint to issue ExpiringProfileKeyCredentials
- (future) Remove the endpoint that issues regular ProfileKeyCredentials

Adoption for clients, after the server has updated:

- Update public params
- Start fetching and using ExpiringProfileKeyCredentials instead of 
  regular ProfileKeyCredentials (the old endpoint will eventually
  go away)
- Node: To bring types into harmony, a receipt's expiration time has
  been changed to a `number` instead of a `bigint`
2022-06-17 13:10:10 -07:00
Jordan Rose
d404b3cec5 Build boring-sys with OPENSSL_SMALL for both iOS and Android
This trades speed for size around certain elliptic curve operations in
BoringSSL. We're using boring mostly for verifying certificates, not
the many many curve operations we do on a per-message basis, so for
now the code size is more important.
2022-06-17 11:28:10 -07:00
Jordan Rose
703ca16269 zkgroup: Rename timestamp types for future use
"RedemptionTime" becomes "CoarseRedemptionTime", highlighting its
measurement in days.

"ReceiptExpirationTime" becomes "Timestamp", highlighting its
forthcoming generalized use beyond receipts and it being the preferred
type going forward.
2022-06-16 17:38:01 -07:00
Chris Eager
2b0b5119f2
device transfer: replace picky with boring
Upcoming work in `attest` requires additional X509 support, and swapping these libraries 
is a negligible impact on binary size. This uses a fork of `cloudflare/boring`, as
we have some additions that haven’t yet been contributed upstream.
2022-06-16 13:14:17 -07:00