diff options
author | Adam Vartanian <flooey@google.com> | 2017-07-11 10:17:24 +0100 |
---|---|---|
committer | Adam Vartanian <flooey@google.com> | 2017-07-20 08:55:12 +0100 |
commit | 4936950820c68699a4ace55a2a8e5f7f677a913d (patch) | |
tree | 60fd944d4a3dcd27d8a5308e7b7598afa18d2025 /bcprov/src/main/java/org/bouncycastle/crypto/generators/DSAParametersGenerator.java | |
parent | 6ec33a667cad9a33e8049206a0507fcece28fd9c (diff) | |
download | bouncycastle-4936950820c68699a4ace55a2a8e5f7f677a913d.tar.gz |
Update change markers in external/bouncycastle.
For the most part, this is just changing markers that had no explanatory
text and adding an explanation. Some more detail on two of the common
explanations:
"Unsupported algorithms": We choose not to ship a whole lot of the
various crypto algorithms that Bouncy Castle supports. Justfying each
individual choice to disable a given algorithm is out of place in the
code and also doesn't have a natural home (since each algorithm is
disabled in upwards of a dozen places), so just mark where algorithms
are disabled due to being unsupported.
"Unknown reason": I looked in the history and couldn't find any
justification for the change. Generally these changes were made in
commits with descriptions like "bouncycastle 1.49 upgrade" from multiple
years ago. I don't want to change behavior in this change, so I left
these changes as they were; these can be revisited in the future if
desired.
This change also reverts some diffs from upstream, both inside disabled
blocks of code (which is irrelevant) and ones that are active but have
no behavioral change (for example, an added package-visible constructor
that isn't called by any class in the package). There're also a number
of whitespace-only changes that revert diffs from upstream.
Bug: 63092064
Test: cts -m CtsLibcoreTestCases
Change-Id: I27c61063eda849455bc93edaf180acefb5eed217
Diffstat (limited to 'bcprov/src/main/java/org/bouncycastle/crypto/generators/DSAParametersGenerator.java')
-rw-r--r-- | bcprov/src/main/java/org/bouncycastle/crypto/generators/DSAParametersGenerator.java | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/bcprov/src/main/java/org/bouncycastle/crypto/generators/DSAParametersGenerator.java b/bcprov/src/main/java/org/bouncycastle/crypto/generators/DSAParametersGenerator.java index cec79e03..961b367d 100644 --- a/bcprov/src/main/java/org/bouncycastle/crypto/generators/DSAParametersGenerator.java +++ b/bcprov/src/main/java/org/bouncycastle/crypto/generators/DSAParametersGenerator.java @@ -7,10 +7,9 @@ import org.bouncycastle.crypto.Digest; import org.bouncycastle.crypto.params.DSAParameterGenerationParameters; import org.bouncycastle.crypto.params.DSAParameters; import org.bouncycastle.crypto.params.DSAValidationParameters; -// BEGIN android-changed -// Was: import org.bouncycastle.crypto.util.DigestFactory; +// Android-changed: Use Android digests +// import org.bouncycastle.crypto.util.DigestFactory; import org.bouncycastle.crypto.digests.AndroidDigestFactory; -// END android-added import org.bouncycastle.util.Arrays; import org.bouncycastle.util.BigIntegers; import org.bouncycastle.util.encoders.Hex; @@ -34,9 +33,9 @@ public class DSAParametersGenerator public DSAParametersGenerator() { - // BEGIN android-changed + // Android-changed: Use Android digests + // this(DigestFactory.createSHA1()); this(AndroidDigestFactory.getSHA1()); - // END android-changed } public DSAParametersGenerator(Digest digest) @@ -131,9 +130,9 @@ public class DSAParametersGenerator int n = (L - 1) / 160; byte[] w = new byte[L / 8]; - // BEGIN android-changed + // Android-changed: Use Android digests + // if (!(digest instanceof SHA1Digest)) if (!(digest.getAlgorithmName().equals("SHA-1"))) - // END android-changed { throw new IllegalStateException("can only use SHA-1 for generating FIPS 186-2 parameters"); } |