[DeviceSync v2] Base64-encode metadata/group-public-key strings in prefs
Debug builds are seeing crashes after successful SyncMetadata responses, when serialized protos and public keys are being stored in prefs. These strings will likely contain non-UTF-8 characters, which are disallowed in pref values. In this CL, we base64-encode these values before persisting to prefs. We manually reproduced the crash without this patch and verified that this patch fixes the crash. We also updated unit test strings to include non-UTF-8 characters. Fixed: 1150031 Change-Id: I81d6f937110c8b010ce3bed3cad7c38c0099a025 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2545765 Auto-Submit: Josh Nohle <nohle@chromium.org> Commit-Queue: James Vecore <vecore@google.com> Reviewed-by:James Vecore <vecore@google.com> Cr-Commit-Position: refs/heads/master@{#828514}
Showing
Please register or sign in to comment