14 Commits
Author SHA1 Message Date
hai007 00a2999269 Format all the files in CL786733783
PiperOrigin-RevId: 786873870
2025-07-24 16:25:18 -07:00
hai007 71cdf84236 Replace NEARBY_LOGS with LOG for all coding under google3/third_party/nearby/
PiperOrigin-RevId: 786733783
2025-07-24 09:34:17 -07:00
Bryan Kersting 79ae5cab5a Fix unsound Rust reference in np_ffi_CredentialSlab_add_v0_credential
Currently, in the Rust implementation of `np_ffi_CredentialSlab_add_v0_credential`, we take the underlying buffer of the passed `V0MatchableCredential` and turn it into a Rust `&[u8]` by calling `unsafe slice::from_raw_parts`. The safety contract of `from_raw_parts` states that the passed pointer can neither be null, nor be unaligned. In the `advertisment_decoder_rust_impl.cc` we have a code path that leads to a null pointer being passed, though. We get a nullpointer if we pass a `std::vector` of size 0. This change fixes the issue by making sure we always pass a non-null buffer.

PiperOrigin-RevId: 729417182
2025-02-21 00:37:51 -08:00
hai007 cdd6870af2 Use credential_id to correlate matched credential back to original
Upon succesfully dectypting an advertisements, the decoding library returns the id of the credential which was used to decrypt. We then use this id to correlate the decoded adv back to the original shared_credential which was used to decrypt it and save this and propagate it in the result returned to the caller

PiperOrigin-RevId: 646179759
2024-06-24 12:16:34 -07:00
hai007 a632a1f691 Cleanup header includes
including log/check.h directly leads to a build error on chrome

PiperOrigin-RevId: 631864164
2024-05-08 11:18:51 -07:00
hai007 464380d931 Implement action bit parsing logic for rust implemented decoder
- This does not change any public APIs, but makes the rust backed impl fill in
   the values of the current public API.

PiperOrigin-RevId: 629844656
2024-05-01 14:48:28 -07:00
hai007 0b04994f71 Update identity type name
PiperOrigin-RevId: 629163344
2024-04-29 13:12:45 -07:00
hai007 a1b80ff649 Update identity type name
PiperOrigin-RevId: 628545355
2024-04-26 16:57:25 -07:00
hai007 54eff829b5 Update identity type name
PiperOrigin-RevId: 628513553
2024-04-26 14:40:17 -07:00
hai007 eba96c9673 Remove unused include to fix OSS build
PiperOrigin-RevId: 627473304
2024-04-23 12:42:17 -07:00
hai007 e9c39b46b3 Fix copybara export of beto-core headers
PiperOrigin-RevId: 627449838
2024-04-23 11:23:24 -07:00
hai007 1c4bd01fe6 Update presence build rules and copybara export to OSS
- updates the build to be compatible with ldt in the open source repo

PiperOrigin-RevId: 627415836
2024-04-23 09:40:55 -07:00
hai007 d1f3a91e24 Initial implementation of rust decoder
PiperOrigin-RevId: 624312324
2024-04-12 15:40:44 -07:00
hai007 734014a841 Add build flag to switch between C++ and rust implemented parser
- Both implementations implement `AdvertisementDecoder` interface and provide the
   concrete implementation for AdvertisementDecoderImpl
 - cleanup missing includes as complained about by clang-tidy

PiperOrigin-RevId: 621187625
2024-04-02 08:43:31 -07:00