Skip to content

Commit

Permalink
Fix SignatureValidation
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniele Giallonardo committed Jul 14, 2022
1 parent d88e109 commit 800db86
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<PackageTags>cie;aspnetcore;authentication</PackageTags>
<PackageProjectUrl>https://github.com/italia/cie-aspnetcore</PackageProjectUrl>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<PackageVersion>1.1.3-prerelease3</PackageVersion>
<PackageVersion>1.1.3-prerelease4</PackageVersion>
<Version>1.1.3</Version>
<AssemblyVersion>1.1.3</AssemblyVersion>
<FileVersion>1.1.3</FileVersion>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ public static void ValidateAuthnResponse(this ResponseType response, AuthnReques
BusinessValidation.ValidationCondition(() => response.GetAssertion()?.Signature == null, ErrorLocalization.AssertionSignatureNotFound);
BusinessValidation.ValidationCondition(() => response.GetAssertion().Signature.KeyInfo.GetX509Data().GetBase64X509Certificate() != response.Signature.KeyInfo.GetX509Data().GetBase64X509Certificate(), ErrorLocalization.AssertionSignatureDifferent);
//var metadataXmlDoc = metadataIdp.SerializeToXmlDoc();
BusinessValidation.ValidationCondition(() => XmlHelpers.VerifySignature(xmlDoc, metadataIdp), ErrorLocalization.InvalidSignature);
BusinessValidation.ValidationCondition(() => !XmlHelpers.VerifySignature(xmlDoc, metadataIdp), ErrorLocalization.InvalidSignature);

BusinessValidation.ValidationCondition(() => response.Version != SamlConst.Version, ErrorLocalization.VersionNotValid);
BusinessValidation.ValidationNotNullNotWhitespace(response.ID, nameof(response.ID));
Expand Down Expand Up @@ -421,7 +421,7 @@ public static LogoutRequestType GetLogoutRequest(string requestId, string consum
Value = subjectNameIdRemoveText == null ? subjectNameId : subjectNameId.Replace(subjectNameIdRemoveText, String.Empty)
},
NotOnOrAfterSpecified = true,
NotOnOrAfter = now.AddMinutes(10),
NotOnOrAfter = now.AddMinutes(ClockSkewInMinutes),
Reason = SamlConst.LogoutUserProtocol,
SessionIndex = new string[] { authnStatementSessionIndex }
};
Expand Down

0 comments on commit 800db86

Please sign in to comment.