Skip to content
This repository has been archived by the owner on Oct 18, 2023. It is now read-only.

Commit

Permalink
Adapting to changes in mono 5.x in System.Security
Browse files Browse the repository at this point in the history
It looks like I was still using/building 4.8.x at Jun 13  2018, and switched to
5.18.x May 15  2019 (5.14 around Sep  6  2018?). So the last time this code
worked correctly with was 4.x:

Date:   Thu Mar 29 10:51:11 2018 +0100

    Thumbprints for windows 10 shipped fonts

TODO: check when the change was effective.
  • Loading branch information
HinTak committed Mar 4, 2023
1 parent 0be4a2a commit 57996f8
Showing 1 changed file with 27 additions and 2 deletions.
29 changes: 27 additions & 2 deletions DSIGInfo/DSIGInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
// SOFTWARE.

using System;
using System.Reflection;
using System.Text;
using OTFontFile;
using System.IO;
Expand Down Expand Up @@ -262,7 +263,19 @@ void FurtherWork()
ASN1 oid = null;
ASN1 digest = null;
ASN1 obsolete = null;
if ( Type.GetType("Mono.Runtime") == null )

Type type = Type.GetType("Mono.Runtime");
String version = null;
if (type != null)
{
MethodInfo displayName = type.GetMethod("GetDisplayName", BindingFlags.NonPublic | BindingFlags.Static);
if (displayName != null)
{
version = (String) displayName.Invoke(null, null);
Console.WriteLine(displayName.Invoke(null, null));
}
}
if ( type == null || version.StartsWith("5.") || version.StartsWith("6."))
{
// DotNet is much saner!
playload_oid = spc[0][0];
Expand Down Expand Up @@ -473,7 +486,19 @@ static int Main( string[] args )
ASN1 oid = null;
ASN1 digest = null;
ASN1 obsolete = null;
if ( Type.GetType("Mono.Runtime") == null )

Type type = Type.GetType("Mono.Runtime");
String version = null;
if (type != null)
{
MethodInfo displayName = type.GetMethod("GetDisplayName", BindingFlags.NonPublic | BindingFlags.Static);
if (displayName != null)
{
version = (String) displayName.Invoke(null, null);
Console.WriteLine(displayName.Invoke(null, null));
}
}
if ( type == null || version.StartsWith("5.") || version.StartsWith("6.") )
{
// DotNet is much saner!
playload_oid = spc[0][0];
Expand Down

0 comments on commit 57996f8

Please sign in to comment.