From 5216eac5ce2e5b787b55b361125f24fba9dca062 Mon Sep 17 00:00:00 2001 From: Simo Kinnunen Date: Tue, 13 Oct 2015 03:59:58 +0900 Subject: [PATCH] Remove unused VNC authentication utilities. --- lib/units/device/plugins/vnc/index.js | 5 ++++- lib/util/vncauth.js | 17 ----------------- 2 files changed, 4 insertions(+), 18 deletions(-) diff --git a/lib/units/device/plugins/vnc/index.js b/lib/units/device/plugins/vnc/index.js index 3591983d..ca3d671a 100644 --- a/lib/units/device/plugins/vnc/index.js +++ b/lib/units/device/plugins/vnc/index.js @@ -28,7 +28,10 @@ module.exports = syrup.serial() var log = logger.createLogger('device:plugins:vnc') function vncAuthHandler(data) { - log.info('VNC authentication attempt using "%s"', data.fingerprint) + log.info( + 'VNC authentication attempt using "%s"' + , data.response.toString('hex') + ) var resolver = Promise.defer() diff --git a/lib/util/vncauth.js b/lib/util/vncauth.js index 16641e02..9a1376aa 100644 --- a/lib/util/vncauth.js +++ b/lib/util/vncauth.js @@ -36,23 +36,6 @@ function encrypt(challenge, password) { module.exports.encrypt = encrypt -function decrypt(challenge, password) { - var key = normalizePassword(password) - , iv = new Buffer(0).fill(0) - - // Note: do not call .final(), .update() is the one that gives us the - // desired result. - return crypto.createDecipheriv('des-ecb', key, iv).update(challenge) -} - -module.exports.decrypt = decrypt - -function format(fingerprint) { - return fingerprint.toString('hex').match(/\w{4}/g).join(':') -} - -module.exports.format = format - function verify(response, challenge, password) { return encrypt(challenge, password).equals(response) }