Ugochukwu Mmaduekwe пре 2 недеља
родитељ
комит
3f3c49af43

+ 1 - 1
CryptoLib.Tests/Delphi.Tests/CryptoLib.Tests.dpr

@@ -465,7 +465,6 @@ uses
   ClpX509DefaultEntryConverter in '..\..\CryptoLib\src\Asn1\X509\ClpX509DefaultEntryConverter.pas',
   ClpX509Extension in '..\..\CryptoLib\src\Asn1\X509\ClpX509Extension.pas',
   ClpX509Asn1Generators in '..\..\CryptoLib\src\Asn1\X509\ClpX509Asn1Generators.pas',
-  ClpX509ExtensionUtilities in '..\..\CryptoLib\src\Asn1\X509\ClpX509ExtensionUtilities.pas',
   ClpX509NameEntryConverter in '..\..\CryptoLib\src\Asn1\X509\ClpX509NameEntryConverter.pas',
   ClpX509NameTokenizer in '..\..\CryptoLib\src\Asn1\X509\ClpX509NameTokenizer.pas',
   ClpX509ObjectIdentifiers in '..\..\CryptoLib\src\Asn1\X509\ClpX509ObjectIdentifiers.pas',
@@ -513,6 +512,7 @@ uses
   ClpX509ExtensionBase in '..\..\CryptoLib\src\X509\ClpX509ExtensionBase.pas',
   ClpX509Generators in '..\..\CryptoLib\src\X509\ClpX509Generators.pas',
   ClpX509Utilities in '..\..\CryptoLib\src\X509\ClpX509Utilities.pas',
+  ClpX509ExtensionUtilities in '..\..\CryptoLib\src\X509\Extension\ClpX509ExtensionUtilities.pas',
   ClpX509V2AttributeCertificate in '..\..\CryptoLib\src\X509\ClpX509V2AttributeCertificate.pas',
   ClpIX509Certificate in '..\..\CryptoLib\src\Interfaces\X509\ClpIX509Certificate.pas',
   ClpIX509CertificateParser in '..\..\CryptoLib\src\Interfaces\X509\ClpIX509CertificateParser.pas',

+ 3 - 10
CryptoLib/src/Asn1/X509/ClpX509Extension.pas

@@ -56,7 +56,7 @@ type
     constructor Create(ACritical: Boolean; const AValue: IAsn1OctetString); overload;
 
     function GetHashCode: Int32;
-    function Equals(AObj: TObject): Boolean; reintroduce;
+    function Equals(AObj: IX509Extension): Boolean; reintroduce;
 
     property IsCritical: Boolean read GetIsCritical;
     property Value: IAsn1OctetString read GetValue;
@@ -123,16 +123,9 @@ begin
     Result := not LVH;
 end;
 
-function TX509Extension.Equals(AObj: TObject): Boolean;
-var
-  LThat: IX509Extension;
+function TX509Extension.Equals(AObj: IX509Extension): Boolean;
 begin
-  if not Supports(AObj, IX509Extension, LThat) then
-  begin
-    Result := False;
-    Exit;
-  end;
-  Result := FValue.Equals(LThat.Value) and (FCritical = LThat.IsCritical);
+  Result := FValue.Equals(AObj.Value) and (FCritical = AObj.IsCritical);
 end;
 
 end.

+ 0 - 1
CryptoLib/src/X509/ClpX509Utilities.pas

@@ -217,7 +217,6 @@ begin
     Exit;
   end;
 
-  // TODO Java has a property to control whether absent parameters can match NULL parameters
   if HasAbsentParameters(AId1) and HasAbsentParameters(AId2) then
   begin
     Result := True;

+ 0 - 0
CryptoLib/src/Asn1/X509/ClpX509ExtensionUtilities.pas → CryptoLib/src/X509/Extension/ClpX509ExtensionUtilities.pas