Skip to content

Add notes on creating a self signed build#13987

Merged
seanbudd merged 6 commits into
masterfrom
addSelfSignedNotes
Aug 10, 2022
Merged

Add notes on creating a self signed build#13987
seanbudd merged 6 commits into
masterfrom
addSelfSignedNotes

Conversation

@seanbudd

@seanbudd seanbudd commented Aug 5, 2022

Copy link
Copy Markdown
Member

After this PR, update https://github.com/nvaccess/nvda/wiki/UsingASelfSignedCertificate to refer to this document

Link to issue number:

None

Summary of the issue:

Without a signed NVDA build, certain features cannot be tested.
Only NV Access have the ability to sign a build with the NV Access certificate.
Other developers who wish to create a signed build to test NVDA must sign the build with their own certificate.
There is no documentation on creating a self-signed build.

Description of user facing changes

Added notes on creating and testing a self-signed build.

Description of development approach

Add notes, tested creating a self-signed build.

Based on these instructions: https://docs.microsoft.com/en-us/windows/msix/package/create-certificate-package-signing

Testing strategy:

N/A

Known issues with pull request:

N/a

Change log entries:

N/a

Code Review Checklist:

  • Pull Request description:
    • description is up to date
    • change log entries
  • Testing:
    • Unit tests
    • System (end to end) tests
    • Manual testing
  • API is compatible with existing add-ons.
  • Documentation:
    • User Documentation
    • Developer / Technical Documentation
    • Context sensitive help for GUI changes
  • UX of all users considered:
    • Speech
    • Braille
    • Low Vision
    • Different web browsers
    • Localization in other languages / culture than English

@seanbudd seanbudd requested a review from a team as a code owner August 5, 2022 03:23
@seanbudd seanbudd requested a review from feerrenrut August 5, 2022 03:23

@lukaszgo1 lukaszgo1 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The documentation here seems to be much more complex than the one on our wiki. The additional advantage of the tutorial I've linked to is that it does not require installation of the additional PowerShell modules and relies on the tools which comes with Visual Studio by default.

@seanbudd

seanbudd commented Aug 8, 2022

Copy link
Copy Markdown
Member Author

@lukaszgo1 - I would argue that the steps in that wiki are out of date.
The steps in this PR are from recent Microsoft documentation.
The only change is that it may be worth using a simpler way of adding the certificate.
I'm going to simplify these steps to use Import-PfxCertificate.

Comment thread devDocs/selfSignedBuild.md
@seanbudd seanbudd marked this pull request as draft August 8, 2022 01:01
@seanbudd seanbudd self-assigned this Aug 8, 2022
@seanbudd seanbudd marked this pull request as ready for review August 8, 2022 04:08
Comment thread devDocs/selfSignedBuild.md Outdated
Comment thread devDocs/selfSignedBuild.md Outdated
Comment thread devDocs/selfSignedBuild.md
Comment thread devDocs/selfSignedBuild.md
Comment thread devDocs/selfSignedBuild.md Outdated
Comment thread devDocs/selfSignedBuild.md
@feerrenrut

Copy link
Copy Markdown
Contributor

Additionally, I think it would be worth taking the warning intro paragraph from the wiki page:

You can also generate a self-signed certificate. However, copies of NVDA signed by a self-signed certificate will not function on systems where it is not installed as a trusted root certificate, so this is only suitable for personal use.

Following are instructions on how to generate and install a self-signed certificate. This is not supported and should only be attempted by developers who know what they are doing and are aware of the risks. If the private key is compromised, this poses a serious security risk to your system. You have been warned. Please do not ask further questions on this topic.

It might be helpful to extend this with why you might want to do this. E.G. for testing NVDA in situations that require a signed, trusted install:

  • Accessing processes running as administrator
  • ...

Ideally this will link to another document that explains that need in more detail. This self signed cert doc is a "how-to guide", the other doc would be an "explainer".

Comment thread devDocs/selfSignedBuild.md
Comment thread devDocs/selfSignedBuild.md Outdated
```ps1
cd <nvdaSourceDirectory>
$password = ConvertTo-SecureString -String <Password> -Force -AsPlainText
Import-PfxCertificate -Password $password -CertStoreLocation "Cert:\LocalMachine\TrustedPublisher" -FilePath local.pfx

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The same not found issue occurs for me with Import-PfxCertificate. After some googling it turns out that availability of these functions depends on the version of Windows in use rather than version of PowerShell. While for generating certificates it is reasonable to assume developers are on an uptodate OS, the same cannot be said about importing certificate - it is sometimes necessary to test something with a self signed build on older versions of Windows which are still supported by NVDA, where this way of importing would fail. That was IMO the main advantage of the old method described on the wiki - it is OS agnostic and still works.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

As asked in #13987 (comment), have you installed the prerequisites? They may require a Windows restart to become available.

According to PKI:

This module can run on any of the specified operating system:

  • Windows Server 2008 R2*/2012*/2012 R2*/2016*
  • Windows 7/8/8.1/10

Note that building NVDA is only supported on Windows 10+.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

After some googling it turns out that availability of these functions depends on the version of Windows in use rather than version of PowerShell.

Can you provide a reference for this?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

it is sometimes necessary to test something with a self signed build on older versions of Windows which are still supported by NVDA, where this way of importing would fail.

Perhaps I can reintroduce the steps for importing certificates via the Windows UI as an alternative. This is a fail safe method across OSs.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

According to this TechNet question (see the second answer) these PowerShell functions are available on Windows 8 and above. Adding the gui method of importing the certificate would indeed make sure that there is a consistent method to use regardless of the version of Windows on which the certificate has to be imported.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I've added a passing reference for Windows 7. The NVDA docs do not need to cover how to use certificate manager (or similar) in detail. The intended destination store location of the certificate is provided.

@seanbudd

seanbudd commented Aug 9, 2022

Copy link
Copy Markdown
Member Author

@feerrenrut - I've added a warning pre-amble.

It might be helpful to extend this with why you might want to do this. E.G. for testing NVDA in situations that require a signed, trusted install:

  • Accessing processes running as administrator
  • ...

Ideally this will link to another document that explains that need in more detail. This self signed cert doc is a "how-to guide", the other doc would be an "explainer".

I think this task is blocked by these documents.

@seanbudd seanbudd requested a review from feerrenrut August 9, 2022 02:37
@AppVeyorBot

Copy link
Copy Markdown

See test results for failed build of commit d8502f0089

@AppVeyorBot

Copy link
Copy Markdown

See test results for failed build of commit 52e6f54f04

@AppVeyorBot

Copy link
Copy Markdown

See test results for failed build of commit 52e6f54f04

@AppVeyorBot

Copy link
Copy Markdown

See test results for failed build of commit 0355db3b11

@AppVeyorBot

Copy link
Copy Markdown

See test results for failed build of commit 0355db3b11

@seanbudd seanbudd merged commit 6de241b into master Aug 10, 2022
@seanbudd seanbudd deleted the addSelfSignedNotes branch August 10, 2022 23:50
@nvaccessAuto nvaccessAuto added this to the 2022.4 milestone Aug 10, 2022
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.

5 participants