-
- // Versions of SecureRandom from Android <= 4.3 do not seed themselves as
- // securely as possible. This workaround should suffice until the fixed version
- // is deployed to all users. getRandomBytes, which reads from /dev/urandom,
- // which is as good as the platform can get.
- //
- // TODO(palmer): Consider getting rid of this once the updated platform has
- // shipped to everyone. Alternately, leave this in as a defense against other
- // bugs in SecureRandom.
- byte[] seed = getRandomBytes(MAC_KEY_BYTE_COUNT);
- if (seed == null) {
- return null;
- }
- random.setSeed(seed);