From 09abc0734e85516475942761a3c4e090af214cf7 Mon Sep 17 00:00:00 2001 From: Hans-Christoph Steiner Date: Mon, 31 Dec 2018 22:13:32 +0100 Subject: [PATCH] format code in PRNGFixes --- .../org/fdroid/fdroid/compat/PRNGFixes.java | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/app/src/main/java/org/fdroid/fdroid/compat/PRNGFixes.java b/app/src/main/java/org/fdroid/fdroid/compat/PRNGFixes.java index 7dc71f525..b9a003e84 100644 --- a/app/src/main/java/org/fdroid/fdroid/compat/PRNGFixes.java +++ b/app/src/main/java/org/fdroid/fdroid/compat/PRNGFixes.java @@ -10,6 +10,7 @@ package org.fdroid.fdroid.compat; * freely, as long as the origin is not misrepresented. */ +import android.annotation.SuppressLint; import android.os.Build; import android.os.Process; import android.util.Log; @@ -31,18 +32,23 @@ import java.security.Security; /** * Fixes for the output of the default PRNG having low entropy. - * + *

* The fixes need to be applied via {@link #apply()} before any use of Java * Cryptography Architecture primitives. A good place to invoke them is in the * application's {@code onCreate}. + * + * @see Some SecureRandom Thoughts */ public final class PRNGFixes { private static final byte[] BUILD_FINGERPRINT_AND_DEVICE_SERIAL = - getBuildFingerprintAndDeviceSerial(); + getBuildFingerprintAndDeviceSerial(); - /** Hidden constructor to prevent instantiation. */ - private PRNGFixes() { } + /** + * Hidden constructor to prevent instantiation. + */ + private PRNGFixes() { + } /** * Applies all fixes. @@ -131,7 +137,7 @@ public final class PRNGFixes { rng2.getProvider().getClass())) { throw new SecurityException( "SecureRandom.getInstance(\"SHA1PRNG\") backed by wrong" - + " Provider: " + rng2.getProvider().getClass()); + + " Provider: " + rng2.getProvider().getClass()); } } @@ -146,7 +152,7 @@ public final class PRNGFixes { super("LinuxPRNG", 1.0, "A Linux-specific random number provider that uses" - + " /dev/urandom"); + + " /dev/urandom"); // Although /dev/urandom is not a SHA-1 PRNG, some apps // explicitly request a SHA1PRNG SecureRandom and we thus need to // prevent them from getting the default implementation whose output