1
0

Renamed property

This commit is contained in:
Benjamin Höglinger-Stelzer 2018-11-04 01:08:39 +01:00
parent 9033065e39
commit f5d607120a
2 changed files with 42 additions and 41 deletions

View File

@ -69,10 +69,6 @@ namespace DerpingDrivers
{ {
get get
{ {
BcdHelper.DisableTestSigning();
var t = BcdHelper.IsTestSignEnabled;
#region TESTSIGNING mode #region TESTSIGNING mode
if (CodeIntegrityHelper.IsTestSignEnabled) if (CodeIntegrityHelper.IsTestSignEnabled)

View File

@ -6,7 +6,10 @@ namespace DerpingDrivers.Util
{ {
public static class BcdHelper public static class BcdHelper
{ {
public static bool IsTestSignEnabled /// <summary>
/// Gets or sets the current value if BCDE_LIBRARY_TYPE_ALLOW_PRERELEASE_SIGNATURES from the default boot entry.
/// </summary>
public static bool AllowPrereleaseSignatures
{ {
get get
{ {
@ -20,9 +23,10 @@ namespace DerpingDrivers.Util
return allowPrereleaseSignatures != null && int.Parse(allowPrereleaseSignatures[0].ToString()) > 0; return allowPrereleaseSignatures != null && int.Parse(allowPrereleaseSignatures[0].ToString()) > 0;
} }
}
public static void EnableTestSigning() set
{
if (value)
{ {
// NOTE: haven't found an API for this (yet), so system() we go! // NOTE: haven't found an API for this (yet), so system() we go!
var cmd = new Process var cmd = new Process
@ -42,8 +46,7 @@ namespace DerpingDrivers.Util
if (cmd.ExitCode != 0) if (cmd.ExitCode != 0)
throw new BcdAlterAllowPrereleaseSignaturesFailedException("Couldn't enable TESTSIGNING"); throw new BcdAlterAllowPrereleaseSignaturesFailedException("Couldn't enable TESTSIGNING");
} }
else
public static void DisableTestSigning()
{ {
// NOTE: haven't found an API for this (yet), so system() we go! // NOTE: haven't found an API for this (yet), so system() we go!
var cmd = new Process var cmd = new Process
@ -64,4 +67,6 @@ namespace DerpingDrivers.Util
throw new BcdAlterAllowPrereleaseSignaturesFailedException("Couldn't disable TESTSIGNING"); throw new BcdAlterAllowPrereleaseSignaturesFailedException("Couldn't disable TESTSIGNING");
} }
} }
}
}
} }