forked from openzfs/zfs
-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Default test sign certificates (#105)
* Script for creating certificates A powershell script that creates a new code signing certificate and exports it to the current directory, with and without a password. * Add pre-generated signing certificates Signing certificates to enable development builds to be used with less hassle. This should not be considered a secret, and it puts at risk any computer that trusts the certificate. * Use the new repository test cert Change the CMake defaults to use the new test certificate that is included in the repository for signing the driver and command line utilities. * Instructions to install test certs Added instructions to install the test signing certificates on the development and target computers.
- Loading branch information
Showing
5 changed files
with
45 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
### Development | ||
- Install OpenZFS test certificate | ||
- Install `test_sign_cert_nopass.pfx` (password: ) | ||
- Certificate should be installed into | ||
1. "Personal" in "Current User" | ||
|
||
### Target | ||
- Install OpenZFS test certificate | ||
- Install `test_sign_cert_nopass.pfx` (password: ) | ||
- Certificate should be installed into | ||
1. "Trusted Root Certification Authority" in "Local Computer" (not current user) *and* | ||
2. "Trusted Publishers" in "Local Computer" (not current user) | ||
- Enable test signing | ||
- `> bcdedit.exe /set TESTSIGNING ON` | ||
- reboot the system to apply |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#cert stores | ||
#cert:\localmachine\my | ||
#Cert:\CurrentUser\My | ||
|
||
#config | ||
$plaintextpwd = 'password1234' | ||
$subject = "OpenZFS Test Signing Certificate" | ||
$filename = 'test_sign_cert' | ||
#$dirname = 'c:\' | ||
$dirname = '' | ||
$yearsvalid = 3 | ||
|
||
#generate | ||
$date_now = Get-Date | ||
$extended_date = $date_now.AddYears($yearsvalid) | ||
$cert = New-SelfSignedCertificate -CertStoreLocation Cert:\CurrentUser\My -Type CodeSigningCert -Subject $subject -notafter $extended_date | ||
|
||
#export with password | ||
$filepathpass = $dirname + $filename + '_pass.pfx' | ||
$pwd = ConvertTo-SecureString -String $plaintextpwd -Force -AsPlainText | ||
$path = 'cert:\CurrentUser\My\' + $cert.thumbprint | ||
Export-PfxCertificate -cert $path -FilePath $filepathpass -Password $pwd | ||
|
||
#export "without" password | ||
$filepathnopass = $dirname + $filename + '_nopass.pfx' | ||
$passin = 'pass:' + $plaintextpwd | ||
&"C:\Program Files\OpenSSL-Win64\bin\openssl.exe" pkcs12 -in $filepathpass -nodes -noenc -passin $passin | &"C:\Program Files\OpenSSL-Win64\bin\openssl.exe" pkcs12 -export -keypbe NONE -certpbe NONE -noenc -nomaciter -noiter -nomac -passout pass: -out $filepathnopass | ||
|
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters