From f56538941d30ead19cd0712ef6ab2c26d4447d0c Mon Sep 17 00:00:00 2001 From: Alvaro Sedano Date: Fri, 13 Sep 2019 19:51:18 +0200 Subject: [PATCH] Update pfSenseCertViewer.ps1 --- pfSenseCertViewer.ps1 | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/pfSenseCertViewer.ps1 b/pfSenseCertViewer.ps1 index 0a4fe9d..e3732c5 100644 --- a/pfSenseCertViewer.ps1 +++ b/pfSenseCertViewer.ps1 @@ -2,10 +2,12 @@ ### pfSense Certificate Viewer (without private key) ### Version 1.0.6 #### -# Redefine the $cfg string variable to point to a valid unecrypted pfSense Configuration XML file. -# You can also use the command line FilePath parameter as path to the input XML cfg file - -# This script will return the CA certificates, Server certificates, User certificates (used or not) and duplicated Serial Number Certificates +# Redefine the $cfg string variable to point to a valid pfSense Configuration XML file. +# You can also use the command line FilePath parameter as path to the input XML cfg file. +# +# This script will return the CA certificates, Server certificates, User certificates (used or not) +# and duplicated Serial Number Certificates. If as result of errors generating serialnumber certificates, +# duplicated serialnumber certs (from the same CA) will be reported. # # Tested on PowerShell 5.0 and avobe # Created by Alvaro Sedano Galindo. al_sedano@hotmail.com @@ -20,15 +22,14 @@ [Alias("File")] [string]$FilePath) - Function Get-BeginEndWO { Param([Parameter(Mandatory=$true, Position=0)][string]$path ` ,[Parameter(Mandatory=$true, Position=1)][ref]$osslDec) - #OPNsense saves on the xml encrypted file information about how to decrypt it. + #OPNsense saves information on how to decrypt it in the xml encrypted file. #pfSense does'nt. - #First line is #0 + #First line is #0. #Check if "^Version: OPNsense" exists in #line 1 [string[]]$text = Get-Content $path -Encoding UTF8 if ($text[1] -match '^Version: OPNsense') { @@ -117,7 +118,7 @@ Function Decrypt { [string]$rutaREG = "Registry::HKEY_LOCAL_MACHINE\SOFTWARE\OpenVPN" if (-not (Test-Path($rutaREG))) { Write-Host 'No openvpn installation found. openssl.exe is part of the openVPN installation. ' + ` - 'If you have another openssl.exe available path, you can redefine the $openSSL variable at line 114.' -BackgroundColor DarkRed + 'If you have another openssl.exe available path, you can redefine the $openSSL variable at line 115.' -BackgroundColor DarkRed Exit 3 }