[runtime] Add --assembly-loader=[strict,legacy] runtime argument
[mono.git] / mono / metadata / metadata.c
index 54699c48ed7d833a7622464169ef23d2eb29489f..78dece0b24e910d5f458ca2842e47afe6d883305 100644 (file)
@@ -519,6 +519,13 @@ mono_tables_names [] = {
 
 #endif
 
+/* If TRUE (but also see DISABLE_STICT_STRONG_NAMES #define), Mono will check
+ * that the public key token and version of a candidate assembly matches the
+ * requested strong name.  If FALSE, as long as the name matches, the candidate
+ * will be allowed.
+ */
+static gboolean check_strong_names_strictly = TRUE;
+
 // Amount initially reserved in each imageset's mempool.
 // FIXME: This number is arbitrary, a more practical number should be found
 #define INITIAL_IMAGE_SET_SIZE    1024
@@ -6919,3 +6926,15 @@ mono_find_image_set_owner (void *ptr)
 
        return owner;
 }
+
+void
+mono_loader_set_strict_strong_names (gboolean enabled)
+{
+       check_strong_names_strictly = enabled;
+}
+
+gboolean
+mono_loader_get_strict_strong_names (void)
+{
+       return check_strong_names_strictly;
+}