Add custom QZ Tray fork with pairing key authentication
- Custom fork of QZ Tray 2.2.x with certificate validation bypassed - Implemented pairing key (HMAC) authentication as replacement - Modified files: PrintSocketClient.java (certificate check disabled) - New files: PairingAuth.java, PairingConfigDialog.java - Excluded build artifacts (out/, lib/javafx*) from repository - Library JARs included for dependency management
This commit is contained in:
43
tray/assets/signing/sign-message.node.js
Normal file
43
tray/assets/signing/sign-message.node.js
Normal file
@@ -0,0 +1,43 @@
|
||||
/*
|
||||
* Node.js signing example
|
||||
* Echoes the signed message and exits
|
||||
*/
|
||||
|
||||
// #########################################################
|
||||
// # WARNING WARNING WARNING #
|
||||
// #########################################################
|
||||
// # #
|
||||
// # This file is intended for demonstration purposes #
|
||||
// # only. #
|
||||
// # #
|
||||
// # It is the SOLE responsibility of YOU, the programmer #
|
||||
// # to prevent against unauthorized access to any signing #
|
||||
// # functions. #
|
||||
// # #
|
||||
// # Organizations that do not protect against un- #
|
||||
// # authorized signing will be black-listed to prevent #
|
||||
// # software piracy. #
|
||||
// # #
|
||||
// # -QZ Industries, LLC #
|
||||
// # #
|
||||
// #########################################################
|
||||
|
||||
var key = "private-key.pem";
|
||||
//var pass = "S3cur3P@ssw0rd";
|
||||
|
||||
app.get('/sign', function(req, res) {
|
||||
var crypto = require('crypto');
|
||||
var fs = require('fs');
|
||||
var path = require('path');
|
||||
var toSign = req.query.requestToSign;
|
||||
|
||||
fs.readFile(path.join(__dirname, '\\' + key), 'utf-8', function(err, privateKey) {
|
||||
var sign = crypto.createSign('SHA512'); // Use "SHA1" for QZ Tray 2.0 and older
|
||||
|
||||
sign.update(toSign);
|
||||
var signature = sign.sign({ key: privateKey/*, passphrase: pass */ }, 'base64');
|
||||
|
||||
res.set('Content-Type', 'text/plain');
|
||||
res.send(signature);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user