Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Strong-name sign assemblies #66

Merged
merged 2 commits into from
Mar 22, 2020

Conversation

ldennington
Copy link

Checking in private key files to strong-name sign all assemblies. For more information on the reasoning for strong-naming assemblies, see this article.

This submission is in response to Issue #65.

@@ -10,6 +10,8 @@
<CodeAnalysisRuleSet>..\stylecop.analyzers.ruleset</CodeAnalysisRuleSet>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<NoWarn>1591</NoWarn>
<SignAssembly>true</SignAssembly>
<AssemblyOriginatorKeyFile>SampleCommand.snk</AssemblyOriginatorKeyFile>
</PropertyGroup>
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why does SampleCommand need to be signed? I'd think that we could get away with just signing the non-test binaries.

@@ -9,6 +9,8 @@
<CodeAnalysisRuleSet>..\stylecop.analyzers.ruleset</CodeAnalysisRuleSet>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<NoWarn>1591</NoWarn>
<SignAssembly>true</SignAssembly>
<AssemblyOriginatorKeyFile>MedallionShell.Tests.snk</AssemblyOriginatorKeyFile>
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why does the tests project need to be signed?

@@ -8,6 +8,8 @@
<Nullable>enable</Nullable>
<GenerateDocumentationFile>True</GenerateDocumentationFile>
<CodeAnalysisRuleSet>..\stylecop.analyzers.ruleset</CodeAnalysisRuleSet>
<SignAssembly>true</SignAssembly>
<AssemblyOriginatorKeyFile>MedallionShell.ProcessSignaler.snk</AssemblyOriginatorKeyFile>
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it necessary to use distinct snk files for each assembly? I feel like with MSFT assemblies I always see the same public key used (in binding redirects), which is kind of nice for knowing you've copied it correctly.

@@ -1,3 +1,3 @@
using System.Runtime.CompilerServices;

[assembly: InternalsVisibleTo("MedallionShell.Tests")]
[assembly: InternalsVisibleTo("MedallionShell.Tests, PublicKey=00240000048000009400000006020000002400005253413100040000010001008d4e301e51cf90722627e9a77bdce4bf73c8d4d33d7ebe1058050002627cc9a68388dfe94aa944e98a928b61dd160eb31aca338033729248ecec0955bf0e02e12d7cfb90534ed602e1ec78905ccd0062cdcc23b4ae2017a98849a72bb3c7e07e0bebcf31a03df79c01fca07486e16133b5d7699781b7910e5f353e2601f7cfa8")]
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. For my understanding, how would one come up with this public key value?
  2. In binding redirects, it uses a much shorter value for the key. Is that available here?

@madelson madelson changed the base branch from master to strong-name March 22, 2020 01:06
@madelson madelson merged commit 5eec049 into madelson:strong-name Mar 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants