Skip to content

Commit

Permalink
Connection: misc code rearranging
Browse files Browse the repository at this point in the history
  • Loading branch information
mscdex committed Jul 17, 2013
1 parent 6018e0f commit 38816b2
Showing 1 changed file with 6 additions and 12 deletions.
18 changes: 6 additions & 12 deletions lib/Connection.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
var Socket = require('net').Socket,
zlib = require('zlib'),
crypto = require('crypto');

var inherits = require('util').inherits,
crypto = require('crypto'),
inherits = require('util').inherits,
EventEmitter = require('events').EventEmitter,
inspect = require('util').inspect;

Expand All @@ -14,16 +13,15 @@ var Parser = require('./Parser'),
SFTPv3 = require('./SFTP/SFTPv3');

var MODULE_VER = require('../package.json').version,
SSH_IDENT = 'SSH-2.0-ssh2js' + MODULE_VER;

var MAX_CHANNEL = Math.pow(2, 32) - 1,
SSH_IDENT = 'SSH-2.0-ssh2js' + MODULE_VER,
MAX_CHANNEL = Math.pow(2, 32) - 1,
EMPTY_BUFFER = new Buffer(0),
PING_PACKET = new Buffer([MESSAGE.IGNORE, 0, 0, 0, 0]),
ALGORITHMS = consts.ALGORITHMS,
MESSAGE = consts.MESSAGE,
SSH_TO_OPENSSL = consts.SSH_TO_OPENSSL,
DISCONNECT_REASON = consts.DISCONNECT_REASON,
CHANNEL_OPEN_FAILURE = consts.CHANNEL_OPEN_FAILURE,
PING_PACKET = new Buffer([MESSAGE.IGNORE, 0, 0, 0, 0]);
CHANNEL_OPEN_FAILURE = consts.CHANNEL_OPEN_FAILURE;

function isStreamCipher(cipher) {
return (cipher.substr(0, 7) === 'arcfour');
Expand Down Expand Up @@ -83,10 +81,6 @@ function Connection(opts) {
sendKEXInit();
});

//this._parser.on('DEBUG', function(msg, lang) {
// self._debug&&self._debug('Server debug: ' + msg);
//});

function sendKEXInit(cb) {
crypto.randomBytes(16, function(err, my_cookie) {
/*
Expand Down

0 comments on commit 38816b2

Please sign in to comment.