mirror of
https://github.com/pbatard/Fido.git
synced 2025-09-16 22:28:02 +02:00
Compare commits
10 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
8cf4a279ff | ||
![]() |
84f833b067 | ||
![]() |
c34a41fe3f | ||
![]() |
6593585ff3 | ||
![]() |
fac4c49262 | ||
![]() |
f8aacf0703 | ||
![]() |
24a7a04d78 | ||
![]() |
eefc2453c4 | ||
![]() |
ed1a6b31a6 | ||
![]() |
9beb231b78 |
124
Fido.ps1
124
Fido.ps1
@@ -1,6 +1,6 @@
|
|||||||
#
|
#
|
||||||
# Fido v1.32 - Feature ISO Downloader, for retail Windows images and UEFI Shell
|
# Fido v1.39 - Feature ISO Downloader, for retail Windows images and UEFI Shell
|
||||||
# Copyright © 2019-2022 Pete Batard <pete@akeo.ie>
|
# Copyright © 2019-2023 Pete Batard <pete@akeo.ie>
|
||||||
# Command line support: Copyright © 2021 flx5
|
# Command line support: Copyright © 2021 flx5
|
||||||
# ConvertTo-ImageSource: Copyright © 2016 Chris Carter
|
# ConvertTo-ImageSource: Copyright © 2016 Chris Carter
|
||||||
#
|
#
|
||||||
@@ -45,7 +45,9 @@ param(
|
|||||||
# (Optional) Only display the download URL [Toggles commandline mode]
|
# (Optional) Only display the download URL [Toggles commandline mode]
|
||||||
[switch]$GetUrl = $False,
|
[switch]$GetUrl = $False,
|
||||||
# (Optional) Increase verbosity
|
# (Optional) Increase verbosity
|
||||||
[switch]$Verbose = $False
|
[switch]$Verbose = $False,
|
||||||
|
# (Optional) Disable the progress bar
|
||||||
|
[switch]$DisableProgress = $False
|
||||||
)
|
)
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
@@ -80,11 +82,12 @@ $code = @"
|
|||||||
|
|
||||||
if (!$Cmd) {
|
if (!$Cmd) {
|
||||||
Write-Host Please Wait...
|
Write-Host Please Wait...
|
||||||
|
$Drawing_Assembly = "System.Drawing"
|
||||||
|
# PowerShell 7 altered the name of the Drawing assembly...
|
||||||
if ($host.version -ge "7.0") {
|
if ($host.version -ge "7.0") {
|
||||||
Add-Type -WarningAction Ignore -IgnoreWarnings -MemberDefinition $code -Namespace Gui -UsingNamespace System.Runtime, System.IO, System.Text, System.Drawing, System.Globalization -ReferencedAssemblies System.Drawing.Common -Name Utils -ErrorAction Stop
|
$Drawing_Assembly += ".Common"
|
||||||
} else {
|
|
||||||
Add-Type -MemberDefinition $code -Namespace Gui -UsingNamespace System.IO, System.Text, System.Drawing, System.Globalization -ReferencedAssemblies System.Drawing -Name Utils -ErrorAction Stop
|
|
||||||
}
|
}
|
||||||
|
Add-Type -ErrorAction Stop -WarningAction Ignore -IgnoreWarnings -MemberDefinition $code -Namespace Gui -UsingNamespace System.Runtime, System.IO, System.Text, System.Drawing, System.Globalization -ReferencedAssemblies $Drawing_Assembly -Name Utils
|
||||||
Add-Type -AssemblyName PresentationFramework
|
Add-Type -AssemblyName PresentationFramework
|
||||||
# Hide the powershell window: https://stackoverflow.com/a/27992426/1069307
|
# Hide the powershell window: https://stackoverflow.com/a/27992426/1069307
|
||||||
[Gui.Utils]::ShowWindow(([System.Diagnostics.Process]::GetCurrentProcess() | Get-Process).MainWindowHandle, 0) | Out-Null
|
[Gui.Utils]::ShowWindow(([System.Diagnostics.Process]::GetCurrentProcess() | Get-Process).MainWindowHandle, 0) | Out-Null
|
||||||
@@ -98,9 +101,9 @@ $WindowsVersions = @(
|
|||||||
@(
|
@(
|
||||||
@("Windows 11", "windows11"),
|
@("Windows 11", "windows11"),
|
||||||
@(
|
@(
|
||||||
"22H2 (Build 22621.521 - 2022.09)",
|
"22H2 v1 (Build 22621.525 - 2022.10)",
|
||||||
@("Windows 11 Home/Pro/Edu", 2360),
|
@("Windows 11 Home/Pro/Edu", 2370),
|
||||||
@("Windows 11 Home China ", ($zh + 2361))
|
@("Windows 11 Home China ", ($zh + 2371))
|
||||||
),
|
),
|
||||||
@(
|
@(
|
||||||
"21H2 v1 (Build 22000.318 - 2021.11)",
|
"21H2 v1 (Build 22000.318 - 2021.11)",
|
||||||
@@ -115,6 +118,11 @@ $WindowsVersions = @(
|
|||||||
),
|
),
|
||||||
@(
|
@(
|
||||||
@("Windows 10", "Windows10ISO"),
|
@("Windows 10", "Windows10ISO"),
|
||||||
|
@(
|
||||||
|
"22H2 (Build 19045.2006 - 2022.10)",
|
||||||
|
@("Windows 10 Home/Pro/Edu", 2377),
|
||||||
|
@("Windows 10 Home China ", ($zh + 2378))
|
||||||
|
),
|
||||||
@(
|
@(
|
||||||
"21H2 (Build 19044.1288 - 2021.11)",
|
"21H2 (Build 19044.1288 - 2021.11)",
|
||||||
@("Windows 10 Home/Pro/Edu", 2084),
|
@("Windows 10 Home/Pro/Edu", 2084),
|
||||||
@@ -278,6 +286,11 @@ $WindowsVersions = @(
|
|||||||
),
|
),
|
||||||
@(
|
@(
|
||||||
@("UEFI Shell 2.2", "UEFI_SHELL 2.2"),
|
@("UEFI Shell 2.2", "UEFI_SHELL 2.2"),
|
||||||
|
@(
|
||||||
|
"22H2 (edk2-stable202211)",
|
||||||
|
@("Release", 0),
|
||||||
|
@("Debug", 1)
|
||||||
|
),
|
||||||
@(
|
@(
|
||||||
"22H1 (edk2-stable202205)",
|
"22H1 (edk2-stable202205)",
|
||||||
@("Release", 0),
|
@("Release", 0),
|
||||||
@@ -486,7 +499,7 @@ function ConvertTo-ImageSource
|
|||||||
|
|
||||||
function Throw-Error([object]$Req, [string]$Alt)
|
function Throw-Error([object]$Req, [string]$Alt)
|
||||||
{
|
{
|
||||||
$Err = $(GetElementById -Request $r -Id "errorModalMessage").innerText
|
$Err = $(GetElementById -Request $Req -Id "errorModalMessage").innerText -replace "<[^>]+>" -replace "\s+", " "
|
||||||
if (-not $Err) {
|
if (-not $Err) {
|
||||||
$Err = $Alt
|
$Err = $Alt
|
||||||
} else {
|
} else {
|
||||||
@@ -589,7 +602,7 @@ $RequestData["GetLangs"] = @("a8f8f489-4c7f-463a-9ca6-5cff94d8d041", "getskuinfo
|
|||||||
# This GUID applies to visitors of the en-US download page. Other locales may get a different GUID.
|
# This GUID applies to visitors of the en-US download page. Other locales may get a different GUID.
|
||||||
$RequestData["GetLinks"] = @("6e2a1789-ef16-4f27-a296-74ef7ef5d96b", "GetProductDownloadLinksBySku" )
|
$RequestData["GetLinks"] = @("6e2a1789-ef16-4f27-a296-74ef7ef5d96b", "GetProductDownloadLinksBySku" )
|
||||||
# Create a semi-random Linux User-Agent string
|
# Create a semi-random Linux User-Agent string
|
||||||
$FirefoxVersion = Get-Random -Minimum 50 -Maximum 90
|
$FirefoxVersion = Get-Random -Minimum 90 -Maximum 110
|
||||||
$FirefoxDate = Get-RandomDate
|
$FirefoxDate = Get-RandomDate
|
||||||
$UserAgent = "Mozilla/5.0 (X11; Linux i586; rv:$FirefoxVersion.0) Gecko/$FirefoxDate Firefox/$FirefoxVersion.0"
|
$UserAgent = "Mozilla/5.0 (X11; Linux i586; rv:$FirefoxVersion.0) Gecko/$FirefoxDate Firefox/$FirefoxVersion.0"
|
||||||
$Verbosity = 2
|
$Verbosity = 2
|
||||||
@@ -697,6 +710,9 @@ function Get-Windows-Languages([int]$SelectedVersion, [int]$SelectedEdition)
|
|||||||
} elseif ($WindowsVersions[$SelectedVersion][0][1].StartsWith("UEFI_SHELL")) {
|
} elseif ($WindowsVersions[$SelectedVersion][0][1].StartsWith("UEFI_SHELL")) {
|
||||||
$languages += @(New-Object PsObject -Property @{ DisplayLanguage = "English (US)"; Language = "en-us"; Id = 0 })
|
$languages += @(New-Object PsObject -Property @{ DisplayLanguage = "English (US)"; Language = "en-us"; Id = 0 })
|
||||||
} else {
|
} else {
|
||||||
|
# Microsoft download protection now requires the sessionId to be whitelisted through vlscppe.microsoft.com/tags
|
||||||
|
$url = "https://vlscppe.microsoft.com/tags?org_id=y6jn8c31&session_id=" + $SessionId
|
||||||
|
Invoke-WebRequest -UseBasicParsing -MaximumRedirection 0 -UserAgent $UserAgent $url | Out-Null
|
||||||
$url = "https://www.microsoft.com/" + $QueryLocale + "/api/controls/contentinclude/html"
|
$url = "https://www.microsoft.com/" + $QueryLocale + "/api/controls/contentinclude/html"
|
||||||
$url += "?pageId=" + $RequestData["GetLangs"][0]
|
$url += "?pageId=" + $RequestData["GetLangs"][0]
|
||||||
$url += "&host=www.microsoft.com"
|
$url += "&host=www.microsoft.com"
|
||||||
@@ -711,7 +727,7 @@ function Get-Windows-Languages([int]$SelectedVersion, [int]$SelectedEdition)
|
|||||||
|
|
||||||
$script:SelectedIndex = 0
|
$script:SelectedIndex = 0
|
||||||
try {
|
try {
|
||||||
$r = Invoke-WebRequest -UseBasicParsing -UserAgent $UserAgent -SessionVariable "Session" $url
|
$r = Invoke-WebRequest -Method Post -UseBasicParsing -UserAgent $UserAgent -SessionVariable "Session" $url
|
||||||
if ($r -match "errorModalMessage") {
|
if ($r -match "errorModalMessage") {
|
||||||
Throw-Error -Req $r -Alt "Could not retrieve languages from server"
|
Throw-Error -Req $r -Alt "Could not retrieve languages from server"
|
||||||
}
|
}
|
||||||
@@ -800,9 +816,26 @@ function Get-Windows-Download-Links([int]$SelectedVersion, [int]$SelectedRelease
|
|||||||
$Is64 = [Environment]::Is64BitOperatingSystem
|
$Is64 = [Environment]::Is64BitOperatingSystem
|
||||||
# Must add a referer for POST requests, else Microsoft's servers will deny them
|
# Must add a referer for POST requests, else Microsoft's servers will deny them
|
||||||
$ref = "https://www.microsoft.com/software-download/windows11"
|
$ref = "https://www.microsoft.com/software-download/windows11"
|
||||||
$r = Invoke-WebRequest -Method Post -Headers @{"Referer" = $ref} -UseBasicParsing -UserAgent $UserAgent -WebSession $Session $url
|
$wr = [System.Net.WebRequest]::Create($url)
|
||||||
|
# Windows 7 PowerShell doesn't support 'Invoke-WebRequest -Headers @{"Referer" = $ref}'
|
||||||
|
# (produces "The 'Referer' header must be modified using the appropriate property or method")
|
||||||
|
# so we use StreamReader() with GetResponseStream() and do this whole gymkhana instead...
|
||||||
|
$wr.Method = "POST"
|
||||||
|
$wr.Referer = $ref
|
||||||
|
$wr.UserAgent = $UserAgent
|
||||||
|
$wr.ContentLength = 0
|
||||||
|
$sr = New-Object System.IO.StreamReader($wr.GetResponse().GetResponseStream())
|
||||||
|
$r = $sr.ReadToEnd()
|
||||||
if ($r -match "errorModalMessage") {
|
if ($r -match "errorModalMessage") {
|
||||||
Throw-Error -Req $r -Alt "Could not retrieve architectures from server"
|
$regex = New-Object Text.RegularExpressions.Regex '<p id="errorModalMessage">(.+?)<\/p>'
|
||||||
|
$m = $regex.Match($r)
|
||||||
|
# Make the typical error message returned by Microsoft's servers more presentable
|
||||||
|
$Alt = $m.Groups[1] -replace "<[^>]+>" -replace "\s+", " "
|
||||||
|
$Alt += " " + $SessionId
|
||||||
|
if (-not $Alt) {
|
||||||
|
$Alt = "Could not retrieve architectures from server"
|
||||||
|
}
|
||||||
|
Throw-Error -Req $r -Alt $Alt
|
||||||
}
|
}
|
||||||
$pattern = '(?s)(<input.*?></input>)'
|
$pattern = '(?s)(<input.*?></input>)'
|
||||||
ForEach-Object { [regex]::Matches($r, $pattern) } | ForEach-Object { $html += $_.Groups[1].value }
|
ForEach-Object { [regex]::Matches($r, $pattern) } | ForEach-Object { $html += $_.Groups[1].value }
|
||||||
@@ -850,6 +883,9 @@ function Process-Download-Link([string]$Url)
|
|||||||
$tmp_size = [uint64]::Parse($str_size)
|
$tmp_size = [uint64]::Parse($str_size)
|
||||||
$Size = Size-To-Human-Readable $tmp_size
|
$Size = Size-To-Human-Readable $tmp_size
|
||||||
Write-Host "Downloading '$File' ($Size)..."
|
Write-Host "Downloading '$File' ($Size)..."
|
||||||
|
if ($DisableProgress) {
|
||||||
|
$ProgressPreference = 'SilentlyContinue'
|
||||||
|
}
|
||||||
Invoke-WebRequest -UseBasicParsing -Uri $Url -OutFile $File
|
Invoke-WebRequest -UseBasicParsing -Uri $Url -OutFile $File
|
||||||
} else {
|
} else {
|
||||||
Write-Host Download Link: $Url
|
Write-Host Download Link: $Url
|
||||||
@@ -931,7 +967,7 @@ if ($Cmd) {
|
|||||||
if (!$Ed -and $Verbosity -ge 1) {
|
if (!$Ed -and $Verbosity -ge 1) {
|
||||||
Write-Host "No edition specified (-Ed). Defaulting to '$($edition.Edition)'."
|
Write-Host "No edition specified (-Ed). Defaulting to '$($edition.Edition)'."
|
||||||
}
|
}
|
||||||
$Selected += "," + $edition.Edition -replace "Windows [0-9\.]*", ""
|
$Selected += "," + $edition.Edition -replace "Windows [0-9\.]*"
|
||||||
$winEditionId = $edition.Id
|
$winEditionId = $edition.Id
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -951,6 +987,10 @@ if ($Cmd) {
|
|||||||
}
|
}
|
||||||
if ($Lang -eq "List") {
|
if ($Lang -eq "List") {
|
||||||
Write-Host "Please select a Language (-Lang) for ${Selected}:"
|
Write-Host "Please select a Language (-Lang) for ${Selected}:"
|
||||||
|
} elseif ($Lang) {
|
||||||
|
# Escape parentheses so that they aren't interpreted as regex
|
||||||
|
$Lang = $Lang.replace('(', '\(')
|
||||||
|
$Lang = $Lang.replace(')', '\)')
|
||||||
}
|
}
|
||||||
$i = 0
|
$i = 0
|
||||||
foreach ($language in $languages) {
|
foreach ($language in $languages) {
|
||||||
@@ -967,7 +1007,7 @@ if ($Cmd) {
|
|||||||
}
|
}
|
||||||
$i++
|
$i++
|
||||||
}
|
}
|
||||||
if ($winLanguageId -eq $null -or $winLanguageName -eq $null) {
|
if (!$winLanguageId -or !$winLanguageName) {
|
||||||
if ($Lang -ne "List") {
|
if ($Lang -ne "List") {
|
||||||
Write-Host "Invalid Windows language provided."
|
Write-Host "Invalid Windows language provided."
|
||||||
Write-Host "Use '-Lang List' for a list of available languages or remove the option to use system default."
|
Write-Host "Use '-Lang List' for a list of available languages or remove the option to use system default."
|
||||||
@@ -1163,8 +1203,8 @@ exit $ExitCode
|
|||||||
# SIG # Begin signature block
|
# SIG # Begin signature block
|
||||||
# MIIkWQYJKoZIhvcNAQcCoIIkSjCCJEYCAQExDzANBglghkgBZQMEAgEFADB5Bgor
|
# MIIkWQYJKoZIhvcNAQ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6
|
||||||
# fLXDzzJ1UK6d8o0ESEQI6/HKi/CQ052Ikt2q0gbhsvp3tb2OlLDu5hWz0+yIf+ru
|
# qQAcgkTT0KyXTkT6MwjBor1nRG5IY/20NXtXIOfN3KmRQnZy+lLH3rXguxEEFObw
|
||||||
# rP/lGpjwRImXpTdlQEfZ9nxOj+pEowaV7KyS/ukMOWygQn8pS42McNW2JV1WXAPT
|
# DNHTB3sAAxaJdJQhKKqw1cuExubwLEzKbU+HFvNavyd3iTf3Free1eYQYmO5LliK
|
||||||
# MJ+bLdHy7W9jQIK8xZ6yqS7H9YYKRvCNz28zYBWrRl+Lgr5vsM+WJ6+1042pnd4G
|
# SYWJ4CbawK2qu0U/e5xznALGZ5NdJ3tZAFK3w0ZF0W9m6CfNW0TmjG6ae8RF4J+4
|
||||||
# 5NiyWHvp4kd5EiuKAIyc+8kb4yGATNf08utpKxNQ/0e58ibNaChRS3UyI/fO
|
# SWGCh2KrY4PVhyKxKiB3z5rCHYGkCrNJJdlOkoaUVBa/MQ+SildBrHvnhZZ1
|
||||||
# SIG # End signature block
|
# SIG # End signature block
|
||||||
|
25
README.md
25
README.md
@@ -1,5 +1,5 @@
|
|||||||
Fido: A PowerShell download script for Windows ISOs and UEFI Shell
|
Fido: A PowerShell download script for Microsoft Windows and UEFI Shell ISOs
|
||||||
==================================================================
|
============================================================================
|
||||||
|
|
||||||
[](https://www.gnu.org/licenses/gpl-3.0.en.html)
|
[](https://www.gnu.org/licenses/gpl-3.0.en.html)
|
||||||
[](https://github.com/pbatard/Fido/releases)
|
[](https://github.com/pbatard/Fido/releases)
|
||||||
@@ -9,12 +9,12 @@ Description
|
|||||||
|
|
||||||
Fido is a PowerShell script that is primarily designed to be used in [Rufus](https://github.com/pbatard/rufus), but that
|
Fido is a PowerShell script that is primarily designed to be used in [Rufus](https://github.com/pbatard/rufus), but that
|
||||||
can also be used in standalone fashion, and whose purpose is to automate access to the official Microsoft Windows retail
|
can also be used in standalone fashion, and whose purpose is to automate access to the official Microsoft Windows retail
|
||||||
ISO download links as well as provide convenient access to bootable UEFI Shell images.
|
ISO download links as well as provide convenient access to [bootable UEFI Shell images](https://github.com/pbatard/UEFI-Shell).
|
||||||
|
|
||||||
This script exists because, while Microsoft does make retail ISO download links freely and publicly available (at least
|
This script exists because, while Microsoft does make retail ISO download links freely and publicly available (at least
|
||||||
for Windows 8 and Windows 10), it only does so after actively forcing users to jump through a lot of unwarranted hoops,
|
for Windows 8 through Windows 11), up until recent releases, most of these links were only available after forcing users
|
||||||
that create an exceedingly counterproductive, if not downright unfriendly, consumer experience and that greatly detract
|
to jump through a lot of unwarranted hoops that created an exceedingly counterproductive, if not downright unfriendly,
|
||||||
from what people really want (direct access to ISO downloads).
|
consumer experience, that greatly detracted from what people really want (direct access to ISO downloads).
|
||||||
|
|
||||||
As to the reason one might want to download Windows __retail__ ISOs, as opposed to the ISOs that are generated by
|
As to the reason one might want to download Windows __retail__ ISOs, as opposed to the ISOs that are generated by
|
||||||
Microsoft's own Media Creation Tool (MCT), this is because using official retail ISOs is currently the only way to
|
Microsoft's own Media Creation Tool (MCT), this is because using official retail ISOs is currently the only way to
|
||||||
@@ -42,16 +42,16 @@ License
|
|||||||
How it works
|
How it works
|
||||||
------------
|
------------
|
||||||
|
|
||||||
The script basically performs the same operation as one might perform when visiting either of the following URLs (that
|
The script basically performs the same operation as one might perform when visiting the following URL (that is, in the
|
||||||
is, provided that you have also changed your `User-Agent` browser string, since, when they detect that you are using a
|
case of Windows 10, provided that you have also changed your `User-Agent` browser string, since, the Microsoft web
|
||||||
version of Windows that is the same as the one you are trying to download, the Microsoft web servers at these addresses
|
servers detect that you are using a version of Windows that is the same as the one you are trying to download, they
|
||||||
redirect you __away__ from the pages that allow you to download retail ISOs):
|
may redirect you __away__ from the page that allows you to obtain a direct ISO download link):
|
||||||
|
|
||||||
https://www.microsoft.com/en-us/software-download
|
https://www.microsoft.com/en-us/software-download
|
||||||
|
|
||||||
After checking access to these URLs, to confirm that they are accessible, the script first queries the web API from the
|
After checking basic access to the Microsoft software downloads website the script first queries the web API from the
|
||||||
Microsoft servers, to request the language selection available for the version of Windows selected, and then requests
|
Microsoft servers, to request the language selection available for the version of Windows selected, and then requests
|
||||||
the actual download links for all the architectures available for that language + version.
|
the actual download links, for all the architectures available for that language + version.
|
||||||
|
|
||||||
Requirements
|
Requirements
|
||||||
------------
|
------------
|
||||||
@@ -87,6 +87,7 @@ The options are:
|
|||||||
architecture as the one from the current system.
|
architecture as the one from the current system.
|
||||||
- `GetUrl`: By default, the script attempts to automatically launch the download. But when using the `-GetUrl` switch,
|
- `GetUrl`: By default, the script attempts to automatically launch the download. But when using the `-GetUrl` switch,
|
||||||
the script only displays the download URL, which can then be piped into another command or into a file.
|
the script only displays the download URL, which can then be piped into another command or into a file.
|
||||||
|
- `DisableProgress`: Disable progress report. This may speed up downloads when using the command line.
|
||||||
|
|
||||||
Examples of a commandline download:
|
Examples of a commandline download:
|
||||||
|
|
||||||
|
2
sign.sh
2
sign.sh
@@ -21,7 +21,7 @@ sign_file() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
# Update the Authenticode signature
|
# Update the Authenticode signature
|
||||||
cmd.exe /c '"C:\Program Files (x86)\Windows Kits\10\bin\10.0.22000.0\x64\signtool" sign /v /sha1 3dbc3a2a0e9ce8803b422cfdbc60acd33164965d /fd SHA256 /tr http://sha256timestamp.ws.symantec.com/sha256/timestamp /td SHA256 Fido.ps1'
|
MSYS2_ARG_CONV_EXCL='*' "C:\Program Files (x86)\Windows Kits\10\bin\10.0.22000.0\x64\signtool" sign /v /sha1 3dbc3a2a0e9ce8803b422cfdbc60acd33164965d /fd SHA256 /tr http://sha256timestamp.ws.symantec.com/sha256/timestamp /td SHA256 Fido.ps1
|
||||||
read -s -p "Enter pass phrase for `realpath $PRIVATE_KEY`: " PASSWORD
|
read -s -p "Enter pass phrase for `realpath $PRIVATE_KEY`: " PASSWORD
|
||||||
echo
|
echo
|
||||||
# Confirm that the pass phrase is valid by trying to sign a dummy file
|
# Confirm that the pass phrase is valid by trying to sign a dummy file
|
||||||
|
Reference in New Issue
Block a user