Fixes a ChromeOS-deadlock during credential refill. The
previous logic blocked the IO thread that ChromeOS is using
to listen for responses from its CredentialStorage layer,
thus preventing it from signaling the latch.
Given that CheckCredentialsAndRefillIfNeeded is meant to
be async (given its continuation-passing style), this CL
avoids any thread trickiness by removing any latch-waiting
within the function. The nice side-effect of this is breaking
up the function into 3 smaller functions, which should
hopefully make it a bit more readable.
//.../g3/credential_storage_impl.cc has its mutex locks
removed -- they otherwise cause deadlocks, and are now
unnecessary.
This CL introduces a CHECK_EQ to ensure that the number of
remaining valid (not-expired) credentials is equal across the
shared and local list. This actually exposed a bug in the
credential_manager_impl_test.cc -- the test was only expiring
a public credential, and not its corresponding private credential.
Thus, the test is also updated in this CL to correctly mark
the first credential of the shared and local list as expired.
PiperOrigin-RevId: 631822135
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
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
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
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
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
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
SavePrivateCredentials() and SavePublicCredentials().
Replacing Get_**_CredentialsCallback implementation with two function wrappers
instead of one function wrapper for the ExceptionOr class.
PiperOrigin-RevId: 464108110