summaryrefslogtreecommitdiff
path: root/core/java/android/util/ByteStringUtils.java
diff options
context:
space:
mode:
authorMark Rathjen <mrathjen@google.com>2017-01-23 14:15:54 -0800
committerMark Rathjen <mrathjen@google.com>2017-01-23 19:06:41 -0800
commit7599f1366e8a08781f415e73f65cf270aae36868 (patch)
treee325af936fa989f2fe2762453c7a5be2dacc2dc7 /core/java/android/util/ByteStringUtils.java
parentea617597c78e3a28304a85cfb3f790e1e36bca76 (diff)
Resolve Android security comments for Android ID migration.
- Use 32 byte key instead of 16 byte. - Use HMAC-SHA256 instead of SHA256 for ssaid generation. - Update HMAC with all package signatures. - Use delimiter in between digest arguments. This change will cause the ssaid of non-legacy installed apps (apps installed post Android ID migration OTA) to change after an uninstall and reinstall sequence. Bug: 34395671 Test: Unit tests, CTS tests, Manual tests Change-Id: I19dec57947368ee5000c2c630b1e4030d46a4ab3
Diffstat (limited to 'core/java/android/util/ByteStringUtils.java')
-rw-r--r--core/java/android/util/ByteStringUtils.java4
1 files changed, 2 insertions, 2 deletions
diff --git a/core/java/android/util/ByteStringUtils.java b/core/java/android/util/ByteStringUtils.java
index 7103e6da0625..333208db5f79 100644
--- a/core/java/android/util/ByteStringUtils.java
+++ b/core/java/android/util/ByteStringUtils.java
@@ -33,7 +33,7 @@ public final class ByteStringUtils {
* @param bytes Byte array to encode.
* @return Hex encoded string representation of bytes.
*/
- public static String toString(byte[] bytes) {
+ public static String toHexString(byte[] bytes) {
if (bytes == null || bytes.length == 0 || bytes.length % 2 != 0) {
return null;
}
@@ -55,7 +55,7 @@ public final class ByteStringUtils {
* @param str Hex encoded string to decode.
* @return Decoded byte array representation of str.
*/
- public static byte[] toByteArray(String str) {
+ public static byte[] fromHexToByteArray(String str) {
if (str == null || str.length() == 0 || str.length() % 2 != 0) {
return null;
}