Do a lighter check for public keys in the mobile profile. It's faster and also quite...
authorSebastien Pouliot <sebastien@xamarin.com>
Fri, 22 Feb 2013 17:59:07 +0000 (12:59 -0500)
committerSebastien Pouliot <sebastien@xamarin.com>
Fri, 22 Feb 2013 18:03:50 +0000 (13:03 -0500)
mcs/class/corlib/System.Reflection/AssemblyName.cs

index fa14c828afef1d38f04be61b86114fcf7f710eb7..7d098d0f93ef5fe13587ed2cbff8c83a4661b6ed 100644 (file)
@@ -247,9 +247,6 @@ namespace System.Reflection {
 
                private bool IsPublicKeyValid {
                        get {
-//#if FULL_AOT_RUNTIME
-                               //return true;
-//#else
                                // check for ECMA key
                                if (publicKey.Length == 16) {
                                        int i = 0;
@@ -263,27 +260,34 @@ namespace System.Reflection {
                                switch (publicKey [0]) {
                                case 0x00: // public key inside a header
                                        if (publicKey.Length > 12 && publicKey [12] == 0x06) {
+#if MOBILE
+                                               return true;
+#else
                                                try {
                                                        CryptoConvert.FromCapiPublicKeyBlob (
                                                                publicKey, 12);
                                                        return true;
                                                } catch (CryptographicException) {
                                                }
+#endif
                                        }
                                        break;
                                case 0x06: // public key
+#if MOBILE
+                                       return true;
+#else
                                        try {
                                                CryptoConvert.FromCapiPublicKeyBlob (publicKey);
                                                return true;
                                        } catch (CryptographicException) {
                                        }
+#endif
                                        break;
                                case 0x07: // private key
                                        break;
                                }
 
                                return false;
-//#endif
                        }
                }