Skip to content

Commit

Permalink
Rename PESecurityDirectory to PESecurityCertificateDirectory
Browse files Browse the repository at this point in the history
  • Loading branch information
xoofx committed Sep 25, 2024
1 parent a84775b commit 90c901d
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 14 deletions.
4 changes: 2 additions & 2 deletions src/LibObjectFile/PE/DataDirectory/PEDataDirectoryKind.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ public enum PEDataDirectoryKind : ushort
/// </summary>
Exception = 3,
/// <summary>
/// Security Directory
/// Security/Certificate Directory
/// </summary>
Security = 4,
SecurityCertificate = 4,
/// <summary>
/// Base Relocation Table
/// </summary>
Expand Down
8 changes: 4 additions & 4 deletions src/LibObjectFile/PE/DataDirectory/PEDirectoryTable.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,9 @@ internal PEDirectoryTable()
public PEExceptionDirectory? Exception => (PEExceptionDirectory?)this[PEDataDirectoryKind.Exception];

/// <summary>
/// Gets the security directory information from the PE file.
/// Gets the certificate/security directory information from the PE file.
/// </summary>
public PESecurityDirectory? Security => (PESecurityDirectory?)this[PEDataDirectoryKind.Security];
public PESecurityCertificateDirectory? Certificate => (PESecurityCertificateDirectory?)this[PEDataDirectoryKind.SecurityCertificate];

/// <summary>
/// Gets the base relocation directory information from the PE file.
Expand Down Expand Up @@ -112,9 +112,9 @@ internal PEDirectoryTable()
[EditorBrowsable(EditorBrowsableState.Never)]
public Enumerator GetEnumerator() => new(this);

internal void Set(PESecurityDirectory? directory)
internal void Set(PESecurityCertificateDirectory? directory)
{
var kind = PEDataDirectoryKind.Security;
var kind = PEDataDirectoryKind.SecurityCertificate;
ref var entry = ref _entries[(int)kind];
var previousEntry = entry;
entry = directory;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
namespace LibObjectFile.PE;

/// <summary>
/// Represents a security certificate used in a Portable Executable (PE) file available in <see cref="PESecurityDirectory.Certificates"/>.
/// Represents a security certificate used in a Portable Executable (PE) file available in <see cref="PECPESecurityCertificateDirectoryrtificates"/>.
/// </summary>
public sealed class PESecurityCertificate
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ namespace LibObjectFile.PE;
/// <summary>
/// Represents the security directory in a PE file.
/// </summary>
public sealed class PESecurityDirectory : PEExtraData
public sealed class PESecurityCertificateDirectory : PEExtraData
{
/// <summary>
/// Initializes a new instance of the <see cref="PESecurityDirectory"/> class.
/// Initializes a new instance of the <see cref="PESecurityCertificateDirectory"/> class.
/// </summary>
public PESecurityDirectory()
public PESecurityCertificateDirectory()
{
Certificates = new();
}
Expand Down
6 changes: 3 additions & 3 deletions src/LibObjectFile/PE/PEFile.Read.cs
Original file line number Diff line number Diff line change
Expand Up @@ -265,9 +265,9 @@ private void ReadSectionsAndDirectories(PEImageReader reader, ReadOnlySpan<RawIm
}

var kind = (PEDataDirectoryKind)i;
if (kind == PEDataDirectoryKind.Security)
if (kind == PEDataDirectoryKind.SecurityCertificate)
{
var directory = new PESecurityDirectory();
var directory = new PESecurityCertificateDirectory();

// The PE certificate directory is a special case as it is not a standard directory. It doesn't use RVA but the position in the file
directory.Position = (uint)directoryEntry.RVA;
Expand Down Expand Up @@ -447,7 +447,7 @@ private void ReadSectionsAndDirectories(PEImageReader reader, ReadOnlySpan<RawIm
reader.Diagnostics.Error(DiagnosticId.PE_ERR_InvalidInternalState, $"Invalid virtual address for directory {peDataDirectory.Kind} at {peDataDirectory.RVA} != {directoryEntry.RVA}");
}
}
else if (directory is PESecurityDirectory peSecurityDirectory)
else if (directory is PESecurityCertificateDirectory peSecurityDirectory)
{
if (peSecurityDirectory.Position != directoryEntry.RVA)
{
Expand Down
2 changes: 1 addition & 1 deletion src/LibObjectFile/PE/PEFile.cs
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ public Stream? DosStubExtra
public ObjectList<PESection> Sections => _sections;

/// <summary>
/// Gets the data present after the sections in the file (e.g <see cref="PESecurityDirectory"/>)
/// Gets the data present after the sections in the file (e.g <see cref="PESecurityCertificateDirectory"/>)
/// </summary>
public ObjectList<PEExtraData> ExtraDataAfterSections { get; }

Expand Down

0 comments on commit 90c901d

Please sign in to comment.