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

Commit

Permalink
fix for SameSite cookies and other security relevant updates
Browse files Browse the repository at this point in the history
  • Loading branch information
leastprivilege committed Sep 15, 2021
1 parent e6024dd commit 5456fe2
Show file tree
Hide file tree
Showing 50 changed files with 76,977 additions and 25 deletions.
25 changes: 25 additions & 0 deletions SameSite Fix/sample/IdentityServerHost/IdentityServerHost.sln
@@ -0,0 +1,25 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.29613.14
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "IdentityServerHost", "IdentityServerHost\IdentityServerHost.csproj", "{03D49418-1F96-4211-A798-064AB9405D36}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{03D49418-1F96-4211-A798-064AB9405D36}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{03D49418-1F96-4211-A798-064AB9405D36}.Debug|Any CPU.Build.0 = Debug|Any CPU
{03D49418-1F96-4211-A798-064AB9405D36}.Release|Any CPU.ActiveCfg = Release|Any CPU
{03D49418-1F96-4211-A798-064AB9405D36}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {FD779A39-D070-453F-956C-EEA0BCAD29A1}
EndGlobalSection
EndGlobal
@@ -0,0 +1,47 @@
/*
* Copyright 2014 Dominick Baier, Brock Allen
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

using System.IO;
using System.Security.Cryptography.X509Certificates;

namespace IdentityServerHost.Config
{
public class Cert
{
public static X509Certificate2 Load()
{
var assembly = typeof(Cert).Assembly;
using (var stream = assembly.GetManifestResourceStream("IdentityServerHost.Config.idsrv3test.pfx"))
{
return new X509Certificate2(ReadStream(stream), "idsrv3test");
}
}

private static byte[] ReadStream(Stream input)
{
var buffer = new byte[16 * 1024];
using (var ms = new MemoryStream())
{
int read;
while ((read = input.Read(buffer, 0, buffer.Length)) > 0)
{
ms.Write(buffer, 0, read);
}
return ms.ToArray();
}
}
}
}

0 comments on commit 5456fe2

Please sign in to comment.