Skip to content

Commit 5e26d66

Browse files
committed
Setup for signing with v 0.2
1 parent 1c74e6e commit 5e26d66

File tree

3 files changed

+14
-6
lines changed

3 files changed

+14
-6
lines changed

OpenSafetyInstall.ps1

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,13 @@ try {
2424
$signature = Get-AuthenticodeSignature $tmpfile.FullName
2525
if ( $signature.Status -ne 'Valid') {
2626
Write-Output "Warning: Downloaded file is not signed"
27-
# Commented out until issues with Sectigo issuing cert are resolved
28-
#Remove-Item $tmpfile.FullName
29-
#exit
27+
Remove-Item $tmpfile.FullName
28+
exit
3029
}
3130

3231
Move-Item $tmpfile.FullName -Destination "$($installpath)\open_safety.exe" -Force
3332
Unblock-File "$($installpath)\open_safety.exe"
33+
Write-Output "Verified signature and installed binary. Setting up mappings"
3434

3535
# List from application: allowed_extensions = ["js", "jse", "vbs", "wsf", "wsh", "hta"];
3636
# Obtained existing names with: cmd /c assoc .ext

README.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,4 +35,10 @@ This application currently uses only one external crate (base64). It's designed
3535
- [X] Installation Powershell to fetch executable from Github releases
3636
- [X] Implement CI with Github actions
3737
- [X] Blog post on why this is useful
38-
- [ ] Obtain a code signing cert
38+
- [ ] Obtain a code signing cert
39+
40+
### Release guide
41+
42+
cargo build --release
43+
$codeCertificate = Get-ChildItem Cert:\CurrentUser\My
44+
Set-AuthenticodeSignature -FilePath .\target\release\open_safety.exe -Certificate $codeCertificate -TimeStampServer "http://timestamp.digicert.com"

src/main.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#![deny(unsafe_code)]
2+
13
use std::env;
24
use std::ffi::OsStr;
35
use std::fs;
@@ -51,10 +53,10 @@ fn process_malware(filename: &std::path::Path) {
5153
}
5254

5355
fn main() {
54-
println!("open_safety: https://lolware.net");
56+
println!("open_safety: https://lolware.net/blog/neutralising-script-ransomware/");
5557
let args: Vec<String> = env::args().collect();
5658
if args.len() < 2 {
57-
println!("This program should be called with a parameter");
59+
println!("This application must be provided a filename in order to take action - closing.");
5860
return;
5961
}
6062

0 commit comments

Comments
 (0)