Skip to content

AndroidCreateDebugKey uses weak signature algorithm #1361

@ThomasZeman

Description

@ThomasZeman

Steps to Reproduce

I did this under Linux but I guess it is the same under Windows:

  1. msbuild an Xamarin.Android project with target Debug / SignAndroidPackage
  2. msbuild task _CreateAndroidDebugSigningKey calls into AndroidDebugKey
  3. AndroidDebugKey calls keytool with something like: /usr/bin/keytool -genkeypair -alias androiddebugkey -storepass android -keypass android -keystore "..debug.keystore" -dname "CN=Android Debug,O=Android,C=US" -keyalg RSA -validity 10950

Expected Behavior

Debug APK is signed with an accepted algorithm. Refer to this page:
http://www.oracle.com/technetwork/java/javase/8u131-relnotes-3565278.html

Actual Behavior

The value "RSA" for parameter keyalg leads to a signed APK which is considered not signed right after creation. Output of:

jarsigner -verify -verbose -certs ./bin/Android/AnyCPU/Release/some-Signed.apk

shows:

Signed by "CN=Android Debug, O=Android, C=US"
Digest algorithm: SHA1
Signature algorithm: MD5withRSA (weak), 2048-bit key

WARNING: The jar will be treated as unsigned, because it is signed with a weak algorithm that is now disabled by the security property:

jdk.jar.disabledAlgorithms=MD2, MD5, RSA keySize < 1024, DSA keySize < 1024

Version Information

Tried with:

java version "1.8.0_161"
Java(TM) SE Runtime Environment (build 1.8.0_161-b12)
Java HotSpot(TM) 64-Bit Server VM (build 25.161-b12, mixed mode)

xamarin-android build version 8.3.99.19

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions