mirror of
https://github.com/openstf/stf
synced 2025-10-05 10:39:25 +02:00
Remove unused VNC authentication utilities.
This commit is contained in:
parent
e68d8564f4
commit
5216eac5ce
2 changed files with 4 additions and 18 deletions
|
@ -28,7 +28,10 @@ module.exports = syrup.serial()
|
||||||
var log = logger.createLogger('device:plugins:vnc')
|
var log = logger.createLogger('device:plugins:vnc')
|
||||||
|
|
||||||
function vncAuthHandler(data) {
|
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()
|
var resolver = Promise.defer()
|
||||||
|
|
||||||
|
|
|
@ -36,23 +36,6 @@ function encrypt(challenge, password) {
|
||||||
|
|
||||||
module.exports.encrypt = encrypt
|
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) {
|
function verify(response, challenge, password) {
|
||||||
return encrypt(challenge, password).equals(response)
|
return encrypt(challenge, password).equals(response)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue