diff options
author | Roshan Pius <rpius@google.com> | 2019-08-02 07:51:42 -0700 |
---|---|---|
committer | Roshan Pius <rpius@google.com> | 2019-08-16 12:43:50 -0700 |
commit | 952fc8f58d8034153bfb45f6139dfc518d59709a (patch) | |
tree | 8e2aa9b4be8780641afc43a16e7b0ab350f74ca6 /PREUPLOAD.cfg | |
parent | e9adc4e4c0407cda5efcf31d3ff995e0a7b07f97 (diff) |
WifiConfigStore: Store integrity data in same file
Store the computed integrity data back in the same config store file.
The previous approach of storing the integrity data in a separate file
made config store updates non-atomic (look at associated bug for
details).
New approach:
a) Store the integrity data at the start of each config store XML file
(version + integrity == metadata for each file).
b) Uprev the config store version to 2 to support the new format.
c) Since we need to an-in place integrity check, when we write the file
For writes:
i) We fill up the integrity fields with the zeroes for the expected
number of bytes in the store file contents.
ii) Compute the integrity for the entire file contents.
iii) Rewrite the document metadata (version & integrity data) with the
newly computed integrity data in store file contents.
iv) Write the file contents to disk.
For reads:
i) Parse out the version & integrity contents from the file contents.
ii) Rewrite the document metadata (version & integrity data) with zeroed
integrity data in store file contents.
iii) Compute the integrity data for the modified file contents created
from (ii) and validate the result with the parsed value from (i).
iv) If the integrity check passes, continue with the parsing of the
document, else abort.
d) Since we need fixed size fields in the integrity fields, remove
storage of keystore alias string from |EncryptedData|. This can anyway
be trivially computed from the config store file name.
Bug: 138482990
Bug: 139512160
Test: Verified that the device does not lose any stored networks on
reboot when the config store file is not modified.
Test: Verified that the device discards all stored networks on reboot
when the config store file is modified.
Test: atest com.android.server.wifi
Test: Will send for full regression test.
Change-Id: I528d3402cb047cca3793be5f1386c4bb60c39a10
Merged-In: I528d3402cb047cca3793be5f1386c4bb60c39a10
(cherry-picked from ag/9135637)
Diffstat (limited to 'PREUPLOAD.cfg')
0 files changed, 0 insertions, 0 deletions