Merge "Remove support for DSA with SHA-512 from v2 signing."

am: d71e120

* commit 'd71e12028bc8602569153f175c822f7757af2611':
  Remove support for DSA with SHA-512 from v2 signing.

Change-Id: I71b2b99a5808b231334ab616c2b6e2a660c35870
This commit is contained in:
Alex Klyubin 2016-04-07 20:07:35 +00:00 committed by android-build-merger
commit a62efba64f
2 changed files with 1 additions and 5 deletions

View file

@ -75,7 +75,6 @@ public abstract class ApkSignerV2 {
public static final int SIGNATURE_ECDSA_WITH_SHA256 = 0x0201;
public static final int SIGNATURE_ECDSA_WITH_SHA512 = 0x0202;
public static final int SIGNATURE_DSA_WITH_SHA256 = 0x0301;
public static final int SIGNATURE_DSA_WITH_SHA512 = 0x0302;
/**
* {@code .SF} file header section attribute indicating that the APK is signed not just with
@ -660,8 +659,6 @@ public abstract class ApkSignerV2 {
return Pair.create("SHA512withECDSA", null);
case SIGNATURE_DSA_WITH_SHA256:
return Pair.create("SHA256withDSA", null);
case SIGNATURE_DSA_WITH_SHA512:
return Pair.create("SHA512withDSA", null);
default:
throw new IllegalArgumentException(
"Unknown signature algorithm: 0x"
@ -679,7 +676,6 @@ public abstract class ApkSignerV2 {
case SIGNATURE_RSA_PSS_WITH_SHA512:
case SIGNATURE_RSA_PKCS1_V1_5_WITH_SHA512:
case SIGNATURE_ECDSA_WITH_SHA512:
case SIGNATURE_DSA_WITH_SHA512:
return CONTENT_DIGEST_CHUNKED_SHA512;
default:
throw new IllegalArgumentException(

View file

@ -992,7 +992,7 @@ class SignApk {
} else if ("EC".equalsIgnoreCase(keyAlgorithm)) {
return ApkSignerV2.SIGNATURE_ECDSA_WITH_SHA512;
} else if ("DSA".equalsIgnoreCase(keyAlgorithm)) {
return ApkSignerV2.SIGNATURE_DSA_WITH_SHA512;
throw new IllegalArgumentException("SHA-512 is not supported with DSA");
} else {
throw new IllegalArgumentException("Unsupported key algorithm: " + keyAlgorithm);
}