Commit Graph
30 Commits
Author SHA1 Message Date
Janusz Sobczak 5f4144cd0b Update SharedCredential definition
PiperOrigin-RevId: 507568902
2023-02-06 13:33:23 -08:00
Janusz Sobczak 2746a4aa2f Fix field sizes in credentials
authenticity_key must be 32 bytes. metadata_encryption_key must be 14 bytes.

PiperOrigin-RevId: 505183908
2023-01-27 12:34:51 -08:00
Janusz Sobczak 94e70d0ddd Store consumed salts in private credentials
PiperOrigin-RevId: 505167378
2023-01-27 11:30:54 -08:00
Janusz Sobczak eb282a64da Set credential start&end times
PiperOrigin-RevId: 504880260
2023-01-26 10:33:22 -08:00
Anay Wadhera c58b45eb50 Rename PublicCredential to SharedCredential and PrivateCredential to LocalCredential
PiperOrigin-RevId: 503221477
2023-01-24 12:09:21 -08:00
Anay Wadhera 43ec97b13b Add missing die_if_null.h include
PiperOrigin-RevId: 503504149
2023-01-20 12:55:38 -08:00
Janusz Sobczak ca547df4d7 Subscribe for public credentials update
Nearby Presence scanning sessions may be very long. We need a way to notify the scanner that new credentials were added during scanning.
`SubscribeForPublicCredentials()` allows us to subscribe for such updates.

PiperOrigin-RevId: 502699345
2023-01-17 15:07:14 -08:00
Anay Wadhera 44fb63f498 Use CredentialSelector for GenerateCredentials()
PiperOrigin-RevId: 501951868
2023-01-13 15:23:35 -08:00
Janusz Sobczak 0e2111afc2 Collapse success&failure callbacks into one
Instead of two callbacks:
- void on_success(Result result)
- void on_failure(Status status)
use just one callback:
void on_result(StatusOr<Result> result)

PiperOrigin-RevId: 501912034
2023-01-13 12:28:47 -08:00
Anay Wadhera 7667420e2b Use CredentialSelector for GenerateCredentials()
PiperOrigin-RevId: 501622339
2023-01-12 11:36:37 -08:00
Suet-Fei Li 084f7ebd88 Remove location namespace in third_party/nearby.
PiperOrigin-RevId: 500023196
2023-01-06 02:53:57 -08:00
Janusz Sobczak a92abac83a Update advertisement encoder/decoder
1. Update the API to accept the credentials on input instead of credential manager.
2. Update the test with values using the LDT encryption.

These changes allow us to have a more asynchronous implementaion.
When broadcasting we can:
1. Fetch the private credentials asynchronously.
2. Create the advertisement and start broadcasting when the credentials have been fetched.

When scanning we can:
1. Fetch public credentials asynchronously.
2. Start scanning for advertisements.
3. Update the decoder when new credentials are fetched.

PiperOrigin-RevId: 493998041
2022-12-08 14:36:44 -08:00
Hai Shang 6871b9d5a6 Add initial impl for UpdateRemotePublicCredentials in CredentialManager.
PiperOrigin-RevId: 491458184
2022-11-28 15:24:26 -08:00
Janusz Sobczak bc9a6ec55b Use LDT for advertisement decryption.
We are still missing the real LDT implementation, so the code is linked with a
placeholder code that doesn't do the actual encryption.

PiperOrigin-RevId: 484596294
2022-10-28 12:37:48 -07:00
Janusz Sobczak 53c504be9d Use LDT for advertisement encryption.
We are still missing the real LDT implementation, so the code is linked with a
placeholder code that doesn't do the actual encryption.

We also needed to pass the `account_name` to credential manager to choose the
correct credentials.

PiperOrigin-RevId: 483801163
2022-10-25 16:09:17 -07:00
Janusz Sobczak 4bd0337c10 Update to match revised BLE 4.2 specification
PiperOrigin-RevId: 479615854
2022-10-07 10:33:38 -07:00
Anthony Rueda 1443f3a135 Implement get public & private credentials.
PiperOrigin-RevId: 478522128
2022-10-03 09:18:19 -07:00
Anthony Rueda fd59e9aede Consolidate credential_storage callback functions. Move all callback struct definitions in a central header file compiled as part of internal/platform/implementation:comm library.
PiperOrigin-RevId: 476186596
2022-09-22 13:46:47 -07:00
Xin He 4f599a0d3e Save generated credentials and make the callback
PiperOrigin-RevId: 472776321
2022-09-07 11:50:30 -07:00
Xin He f166f1e22c Remove presence_identity struct.
PiperOrigin-RevId: 468032143
2022-08-16 14:56:38 -07:00
Xin He e5c24b8b8a Add manager app ID into the APIs
PiperOrigin-RevId: 467757514
2022-08-15 14:11:15 -07:00
Xin He 123a2cfd18 Move credentials related proto from Prensence to internal
Replace PresenceIdentityType with proto

PiperOrigin-RevId: 467294239
2022-08-12 14:18:34 -07:00
Xin He 76d45f20db Replace encrypting metadata with CBC to AES.
Provide a new API to decrypt the device metadata inside a public credential

PiperOrigin-RevId: 466936093
2022-08-11 06:23:49 -07:00
Janusz Sobczak 07119e80de Merge CertificateManager and CredentialManager
Refactoring change.
Merge CertificateManager and CredentialManager into a single interface.
Hide AdvertisementFactory in implementation/. The client app will not be using
that class directly.
Clean up build targets.

PiperOrigin-RevId: 466748133
2022-08-10 11:46:16 -07:00
Suet-Fei Li 55f20775d2 Fix internal flow
PiperOrigin-RevId: 466426960
2022-08-09 12:02:16 -07:00
hai007 0a8f1f1c39 Implement Credentials Generation APIs
PiperOrigin-RevId: 466389238
2022-08-09 09:56:54 -07:00
hai007 a732616a97 Change private/public credentials from struct to proto.
PiperOrigin-RevId: 464678736
2022-08-01 19:16:05 -07:00
hai007 0d4964da7b Splitting SaveCredentials into two separate virtual functions:
SavePrivateCredentials() and SavePublicCredentials().

Replacing Get_**_CredentialsCallback implementation with two function wrappers
instead of one function wrapper for the ExceptionOr class.

PiperOrigin-RevId: 464108110
2022-07-29 10:34:22 -07:00
hais d5f86a04d6 Replace to use IdentityType where TrustType were used.
PiperOrigin-RevId: 463713311
2022-07-27 17:07:19 -07:00
jsobczak be140a71d5 Make CredentialManager abstract
An abstract CredentialManager will help with unit testing.
Also added an empty CredentialManagerImpl class.

PiperOrigin-RevId: 463651261
2022-07-27 12:34:31 -07:00