mirror of
https://github.com/UNITRONIX/BetterDesk.git
synced 2026-09-10 17:45:42 +00:00
647a3221f9
Hash RustDesk access tokens at rest (phase 1), add SSRF guards for admin network tools with LAN monitoring support, run dedicated console service user on Linux, and hook post-update verification plus service patching into both betterdesk.sh and the in-app updater.
15 lines
451 B
JavaScript
15 lines
451 B
JavaScript
'use strict';
|
|
|
|
const crypto = require('crypto');
|
|
|
|
/**
|
|
* SHA-256 hash of a RustDesk client access token for at-rest storage.
|
|
* Plaintext token is returned to the client once at issuance; DB stores hash only
|
|
* (Phase 1: dual-write with legacy `token` column for backward compatibility).
|
|
*/
|
|
function hashAccessToken(token) {
|
|
return crypto.createHash('sha256').update(String(token), 'utf8').digest('hex');
|
|
}
|
|
|
|
module.exports = { hashAccessToken };
|