dsh-remote-deck 0.0.0-stage → 1.46.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +227 -2
- package/README.zh-CN.md +201 -0
- package/client.js +8645 -0
- package/cordis.patch.yml +6 -0
- package/icon.svg +19 -0
- package/index.js +701 -0
- package/lib/api.js +1452 -0
- package/lib/bash-result.js +93 -0
- package/lib/connection.js +1133 -0
- package/lib/delete.js +199 -0
- package/lib/drafts.js +299 -0
- package/lib/encoding.js +247 -0
- package/lib/file-edit.js +339 -0
- package/lib/file-ops.js +402 -0
- package/lib/forwards.js +186 -0
- package/lib/fs-actions.js +235 -0
- package/lib/guide.js +162 -0
- package/lib/metrics.js +523 -0
- package/lib/remote-shells.js +320 -0
- package/lib/remote-terminal.js +427 -0
- package/lib/routing.js +695 -0
- package/lib/ssh-config.js +118 -0
- package/lib/terminal.js +123 -0
- package/lib/tool-forward.js +185 -0
- package/lib/transfer.js +235 -0
- package/lib/upload-chunks.js +306 -0
- package/lib/util.js +154 -0
- package/locale/README.md +160 -0
- package/locale/en-ui.json +477 -0
- package/locale/en.json +6 -0
- package/locale/zh.json +6 -0
- package/package.json +63 -4
- package/vendor/codemirror/LICENSE +21 -0
- package/vendor/codemirror/README.md +18 -0
- package/vendor/codemirror/addon/edit/closebrackets.min.js +8 -0
- package/vendor/codemirror/addon/edit/matchbrackets.min.js +8 -0
- package/vendor/codemirror/addon/search/search.min.js +8 -0
- package/vendor/codemirror/addon/search/searchcursor.min.js +8 -0
- package/vendor/codemirror/addon/selection/active-line.min.js +8 -0
- package/vendor/codemirror/lib/codemirror.css +344 -0
- package/vendor/codemirror/lib/codemirror.min.js +8 -0
- package/vendor/codemirror/mode/clike/clike.min.js +8 -0
- package/vendor/codemirror/mode/css/css.min.js +8 -0
- package/vendor/codemirror/mode/go/go.min.js +8 -0
- package/vendor/codemirror/mode/htmlmixed/htmlmixed.min.js +8 -0
- package/vendor/codemirror/mode/javascript/javascript.min.js +8 -0
- package/vendor/codemirror/mode/markdown/markdown.min.js +8 -0
- package/vendor/codemirror/mode/python/python.min.js +8 -0
- package/vendor/codemirror/mode/rust/rust.min.js +8 -0
- package/vendor/codemirror/mode/shell/shell.min.js +8 -0
- package/vendor/codemirror/mode/xml/xml.min.js +8 -0
- package/vendor/codemirror/mode/yaml/yaml.min.js +8 -0
- package/vendor/node_modules/asn1/Jenkinsfile +65 -0
- package/vendor/node_modules/asn1/LICENSE +19 -0
- package/vendor/node_modules/asn1/README.md +50 -0
- package/vendor/node_modules/asn1/lib/ber/errors.js +13 -0
- package/vendor/node_modules/asn1/lib/ber/index.js +27 -0
- package/vendor/node_modules/asn1/lib/ber/reader.js +262 -0
- package/vendor/node_modules/asn1/lib/ber/types.js +36 -0
- package/vendor/node_modules/asn1/lib/ber/writer.js +317 -0
- package/vendor/node_modules/asn1/lib/index.js +20 -0
- package/vendor/node_modules/asn1/package.json +31 -0
- package/vendor/node_modules/bcrypt-pbkdf/CONTRIBUTING.md +13 -0
- package/vendor/node_modules/bcrypt-pbkdf/LICENSE +66 -0
- package/vendor/node_modules/bcrypt-pbkdf/README.md +45 -0
- package/vendor/node_modules/bcrypt-pbkdf/index.js +556 -0
- package/vendor/node_modules/bcrypt-pbkdf/package.json +15 -0
- package/vendor/node_modules/safer-buffer/LICENSE +21 -0
- package/vendor/node_modules/safer-buffer/Porting-Buffer.md +268 -0
- package/vendor/node_modules/safer-buffer/Readme.md +156 -0
- package/vendor/node_modules/safer-buffer/dangerous.js +58 -0
- package/vendor/node_modules/safer-buffer/package.json +34 -0
- package/vendor/node_modules/safer-buffer/safer.js +77 -0
- package/vendor/node_modules/safer-buffer/tests.js +406 -0
- package/vendor/node_modules/ssh2/LICENSE +19 -0
- package/vendor/node_modules/ssh2/README.md +1529 -0
- package/vendor/node_modules/ssh2/SFTP.md +413 -0
- package/vendor/node_modules/ssh2/lib/Channel.js +295 -0
- package/vendor/node_modules/ssh2/lib/agent.js +1123 -0
- package/vendor/node_modules/ssh2/lib/client.js +2176 -0
- package/vendor/node_modules/ssh2/lib/http-agents.js +84 -0
- package/vendor/node_modules/ssh2/lib/index.js +44 -0
- package/vendor/node_modules/ssh2/lib/keygen.js +582 -0
- package/vendor/node_modules/ssh2/lib/protocol/Protocol.js +2136 -0
- package/vendor/node_modules/ssh2/lib/protocol/SFTP.js +4052 -0
- package/vendor/node_modules/ssh2/lib/protocol/constants.js +356 -0
- package/vendor/node_modules/ssh2/lib/protocol/crypto/binding.gyp +23 -0
- package/vendor/node_modules/ssh2/lib/protocol/crypto/poly1305.js +43 -0
- package/vendor/node_modules/ssh2/lib/protocol/crypto/src/binding.cc +2300 -0
- package/vendor/node_modules/ssh2/lib/protocol/crypto.js +1602 -0
- package/vendor/node_modules/ssh2/lib/protocol/handlers.js +16 -0
- package/vendor/node_modules/ssh2/lib/protocol/handlers.misc.js +1285 -0
- package/vendor/node_modules/ssh2/lib/protocol/kex.js +1908 -0
- package/vendor/node_modules/ssh2/lib/protocol/keyParser.js +1484 -0
- package/vendor/node_modules/ssh2/lib/protocol/node-fs-compat.js +115 -0
- package/vendor/node_modules/ssh2/lib/protocol/utils.js +356 -0
- package/vendor/node_modules/ssh2/lib/protocol/zlib.js +255 -0
- package/vendor/node_modules/ssh2/lib/server.js +1380 -0
- package/vendor/node_modules/ssh2/lib/utils.js +336 -0
- package/vendor/node_modules/ssh2/package.json +49 -0
- package/vendor/node_modules/tweetnacl/AUTHORS.md +28 -0
- package/vendor/node_modules/tweetnacl/CHANGELOG.md +221 -0
- package/vendor/node_modules/tweetnacl/LICENSE +24 -0
- package/vendor/node_modules/tweetnacl/PULL_REQUEST_TEMPLATE.md +20 -0
- package/vendor/node_modules/tweetnacl/README.md +459 -0
- package/vendor/node_modules/tweetnacl/nacl-fast.js +2388 -0
- package/vendor/node_modules/tweetnacl/nacl-fast.min.js +2 -0
- package/vendor/node_modules/tweetnacl/nacl.d.ts +98 -0
- package/vendor/node_modules/tweetnacl/nacl.js +1175 -0
- package/vendor/node_modules/tweetnacl/nacl.min.js +1 -0
- package/vendor/node_modules/tweetnacl/package.json +58 -0
- package/vendor/xterm/LICENSE.addon-fit +19 -0
- package/vendor/xterm/LICENSE.xterm +21 -0
- package/vendor/xterm/README.md +9 -0
- package/vendor/xterm/addon-fit.js +2 -0
- package/vendor/xterm/xterm.css +218 -0
- package/vendor/xterm/xterm.js +2 -0
|
@@ -0,0 +1,336 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const { SFTP } = require('./protocol/SFTP.js');
|
|
4
|
+
|
|
5
|
+
const MAX_CHANNEL = 2 ** 32 - 1;
|
|
6
|
+
|
|
7
|
+
function onChannelOpenFailure(self, recipient, info, cb) {
|
|
8
|
+
self._chanMgr.remove(recipient);
|
|
9
|
+
if (typeof cb !== 'function')
|
|
10
|
+
return;
|
|
11
|
+
|
|
12
|
+
let err;
|
|
13
|
+
if (info instanceof Error) {
|
|
14
|
+
err = info;
|
|
15
|
+
} else if (typeof info === 'object' && info !== null) {
|
|
16
|
+
err = new Error(`(SSH) Channel open failure: ${info.description}`);
|
|
17
|
+
err.reason = info.reason;
|
|
18
|
+
} else {
|
|
19
|
+
err = new Error(
|
|
20
|
+
'(SSH) Channel open failure: server closed channel unexpectedly'
|
|
21
|
+
);
|
|
22
|
+
err.reason = '';
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
cb(err);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
function onCHANNEL_CLOSE(self, recipient, channel, err, dead) {
|
|
29
|
+
if (typeof channel === 'function') {
|
|
30
|
+
// We got CHANNEL_CLOSE instead of CHANNEL_OPEN_FAILURE when
|
|
31
|
+
// requesting to open a channel
|
|
32
|
+
onChannelOpenFailure(self, recipient, err, channel);
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
if (typeof channel !== 'object' || channel === null)
|
|
37
|
+
return;
|
|
38
|
+
|
|
39
|
+
if (channel.incoming && channel.incoming.state === 'closed')
|
|
40
|
+
return;
|
|
41
|
+
|
|
42
|
+
self._chanMgr.remove(recipient);
|
|
43
|
+
|
|
44
|
+
if (channel.server && channel.constructor.name === 'Session')
|
|
45
|
+
return;
|
|
46
|
+
|
|
47
|
+
channel.incoming.state = 'closed';
|
|
48
|
+
|
|
49
|
+
if (channel.readable)
|
|
50
|
+
channel.push(null);
|
|
51
|
+
if (channel.server) {
|
|
52
|
+
if (channel.stderr.writable)
|
|
53
|
+
channel.stderr.end();
|
|
54
|
+
} else if (channel.stderr.readable) {
|
|
55
|
+
channel.stderr.push(null);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
if (channel.constructor !== SFTP
|
|
59
|
+
&& (channel.outgoing.state === 'open'
|
|
60
|
+
|| channel.outgoing.state === 'eof')
|
|
61
|
+
&& !dead) {
|
|
62
|
+
channel.close();
|
|
63
|
+
}
|
|
64
|
+
if (channel.outgoing.state === 'closing')
|
|
65
|
+
channel.outgoing.state = 'closed';
|
|
66
|
+
|
|
67
|
+
const readState = channel._readableState;
|
|
68
|
+
const writeState = channel._writableState;
|
|
69
|
+
if (writeState && !writeState.ending && !writeState.finished && !dead)
|
|
70
|
+
channel.end();
|
|
71
|
+
|
|
72
|
+
// Take care of any outstanding channel requests
|
|
73
|
+
const chanCallbacks = channel._callbacks;
|
|
74
|
+
channel._callbacks = [];
|
|
75
|
+
for (let i = 0; i < chanCallbacks.length; ++i)
|
|
76
|
+
chanCallbacks[i](true);
|
|
77
|
+
|
|
78
|
+
if (channel.server) {
|
|
79
|
+
if (!channel.readable
|
|
80
|
+
|| channel.destroyed
|
|
81
|
+
|| (readState && readState.endEmitted)) {
|
|
82
|
+
channel.emit('close');
|
|
83
|
+
} else {
|
|
84
|
+
channel.once('end', () => channel.emit('close'));
|
|
85
|
+
}
|
|
86
|
+
} else {
|
|
87
|
+
let doClose;
|
|
88
|
+
switch (channel.type) {
|
|
89
|
+
case 'direct-streamlocal@openssh.com':
|
|
90
|
+
case 'direct-tcpip':
|
|
91
|
+
doClose = () => channel.emit('close');
|
|
92
|
+
break;
|
|
93
|
+
default: {
|
|
94
|
+
// Align more with node child processes, where the close event gets
|
|
95
|
+
// the same arguments as the exit event
|
|
96
|
+
const exit = channel._exit;
|
|
97
|
+
doClose = () => {
|
|
98
|
+
if (exit.code === null)
|
|
99
|
+
channel.emit('close', exit.code, exit.signal, exit.dump, exit.desc);
|
|
100
|
+
else
|
|
101
|
+
channel.emit('close', exit.code);
|
|
102
|
+
};
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
if (!channel.readable
|
|
106
|
+
|| channel.destroyed
|
|
107
|
+
|| (readState && readState.endEmitted)) {
|
|
108
|
+
doClose();
|
|
109
|
+
} else {
|
|
110
|
+
channel.once('end', doClose);
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
const errReadState = channel.stderr._readableState;
|
|
114
|
+
if (!channel.stderr.readable
|
|
115
|
+
|| channel.stderr.destroyed
|
|
116
|
+
|| (errReadState && errReadState.endEmitted)) {
|
|
117
|
+
channel.stderr.emit('close');
|
|
118
|
+
} else {
|
|
119
|
+
channel.stderr.once('end', () => channel.stderr.emit('close'));
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
class ChannelManager {
|
|
125
|
+
constructor(client) {
|
|
126
|
+
this._client = client;
|
|
127
|
+
this._channels = {};
|
|
128
|
+
this._cur = -1;
|
|
129
|
+
this._count = 0;
|
|
130
|
+
}
|
|
131
|
+
add(val) {
|
|
132
|
+
// Attempt to reserve an id
|
|
133
|
+
|
|
134
|
+
let id;
|
|
135
|
+
// Optimized paths
|
|
136
|
+
if (this._cur < MAX_CHANNEL) {
|
|
137
|
+
id = ++this._cur;
|
|
138
|
+
} else if (this._count === 0) {
|
|
139
|
+
// Revert and reset back to fast path once we no longer have any channels
|
|
140
|
+
// open
|
|
141
|
+
this._cur = 0;
|
|
142
|
+
id = 0;
|
|
143
|
+
} else {
|
|
144
|
+
// Slower lookup path
|
|
145
|
+
|
|
146
|
+
// This path is triggered we have opened at least MAX_CHANNEL channels
|
|
147
|
+
// while having at least one channel open at any given time, so we have
|
|
148
|
+
// to search for a free id.
|
|
149
|
+
const channels = this._channels;
|
|
150
|
+
for (let i = 0; i < MAX_CHANNEL; ++i) {
|
|
151
|
+
if (channels[i] === undefined) {
|
|
152
|
+
id = i;
|
|
153
|
+
break;
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
if (id === undefined)
|
|
159
|
+
return -1;
|
|
160
|
+
|
|
161
|
+
this._channels[id] = (val || true);
|
|
162
|
+
++this._count;
|
|
163
|
+
|
|
164
|
+
return id;
|
|
165
|
+
}
|
|
166
|
+
update(id, val) {
|
|
167
|
+
if (typeof id !== 'number' || id < 0 || id >= MAX_CHANNEL || !isFinite(id))
|
|
168
|
+
throw new Error(`Invalid channel id: ${id}`);
|
|
169
|
+
|
|
170
|
+
if (val && this._channels[id])
|
|
171
|
+
this._channels[id] = val;
|
|
172
|
+
}
|
|
173
|
+
get(id) {
|
|
174
|
+
if (typeof id !== 'number' || id < 0 || id >= MAX_CHANNEL || !isFinite(id))
|
|
175
|
+
throw new Error(`Invalid channel id: ${id}`);
|
|
176
|
+
|
|
177
|
+
return this._channels[id];
|
|
178
|
+
}
|
|
179
|
+
remove(id) {
|
|
180
|
+
if (typeof id !== 'number' || id < 0 || id >= MAX_CHANNEL || !isFinite(id))
|
|
181
|
+
throw new Error(`Invalid channel id: ${id}`);
|
|
182
|
+
|
|
183
|
+
if (this._channels[id]) {
|
|
184
|
+
delete this._channels[id];
|
|
185
|
+
if (this._count)
|
|
186
|
+
--this._count;
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
cleanup(err) {
|
|
190
|
+
const channels = this._channels;
|
|
191
|
+
this._channels = {};
|
|
192
|
+
this._cur = -1;
|
|
193
|
+
this._count = 0;
|
|
194
|
+
|
|
195
|
+
const chanIDs = Object.keys(channels);
|
|
196
|
+
const client = this._client;
|
|
197
|
+
for (let i = 0; i < chanIDs.length; ++i) {
|
|
198
|
+
const id = +chanIDs[i];
|
|
199
|
+
const channel = channels[id];
|
|
200
|
+
onCHANNEL_CLOSE(client, id, channel._channel || channel, err, true);
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
const isRegExp = (() => {
|
|
206
|
+
const toString = Object.prototype.toString;
|
|
207
|
+
return (val) => toString.call(val) === '[object RegExp]';
|
|
208
|
+
})();
|
|
209
|
+
|
|
210
|
+
function generateAlgorithmList(algoList, defaultList, supportedList) {
|
|
211
|
+
if (Array.isArray(algoList) && algoList.length > 0) {
|
|
212
|
+
// Exact list
|
|
213
|
+
for (let i = 0; i < algoList.length; ++i) {
|
|
214
|
+
if (supportedList.indexOf(algoList[i]) === -1)
|
|
215
|
+
throw new Error(`Unsupported algorithm: ${algoList[i]}`);
|
|
216
|
+
}
|
|
217
|
+
return algoList;
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
if (typeof algoList === 'object' && algoList !== null) {
|
|
221
|
+
// Operations based on the default list
|
|
222
|
+
const keys = Object.keys(algoList);
|
|
223
|
+
let list = defaultList;
|
|
224
|
+
for (let i = 0; i < keys.length; ++i) {
|
|
225
|
+
const key = keys[i];
|
|
226
|
+
let val = algoList[key];
|
|
227
|
+
switch (key) {
|
|
228
|
+
case 'append':
|
|
229
|
+
if (!Array.isArray(val))
|
|
230
|
+
val = [val];
|
|
231
|
+
if (Array.isArray(val)) {
|
|
232
|
+
for (let j = 0; j < val.length; ++j) {
|
|
233
|
+
const append = val[j];
|
|
234
|
+
if (typeof append === 'string') {
|
|
235
|
+
if (!append || list.indexOf(append) !== -1)
|
|
236
|
+
continue;
|
|
237
|
+
if (supportedList.indexOf(append) === -1)
|
|
238
|
+
throw new Error(`Unsupported algorithm: ${append}`);
|
|
239
|
+
if (list === defaultList)
|
|
240
|
+
list = list.slice();
|
|
241
|
+
list.push(append);
|
|
242
|
+
} else if (isRegExp(append)) {
|
|
243
|
+
for (let k = 0; k < supportedList.length; ++k) {
|
|
244
|
+
const algo = supportedList[k];
|
|
245
|
+
if (append.test(algo)) {
|
|
246
|
+
if (list.indexOf(algo) !== -1)
|
|
247
|
+
continue;
|
|
248
|
+
if (list === defaultList)
|
|
249
|
+
list = list.slice();
|
|
250
|
+
list.push(algo);
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
break;
|
|
257
|
+
case 'prepend':
|
|
258
|
+
if (!Array.isArray(val))
|
|
259
|
+
val = [val];
|
|
260
|
+
if (Array.isArray(val)) {
|
|
261
|
+
for (let j = val.length; j >= 0; --j) {
|
|
262
|
+
const prepend = val[j];
|
|
263
|
+
if (typeof prepend === 'string') {
|
|
264
|
+
if (!prepend || list.indexOf(prepend) !== -1)
|
|
265
|
+
continue;
|
|
266
|
+
if (supportedList.indexOf(prepend) === -1)
|
|
267
|
+
throw new Error(`Unsupported algorithm: ${prepend}`);
|
|
268
|
+
if (list === defaultList)
|
|
269
|
+
list = list.slice();
|
|
270
|
+
list.unshift(prepend);
|
|
271
|
+
} else if (isRegExp(prepend)) {
|
|
272
|
+
for (let k = supportedList.length; k >= 0; --k) {
|
|
273
|
+
const algo = supportedList[k];
|
|
274
|
+
if (prepend.test(algo)) {
|
|
275
|
+
if (list.indexOf(algo) !== -1)
|
|
276
|
+
continue;
|
|
277
|
+
if (list === defaultList)
|
|
278
|
+
list = list.slice();
|
|
279
|
+
list.unshift(algo);
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
break;
|
|
286
|
+
case 'remove':
|
|
287
|
+
if (!Array.isArray(val))
|
|
288
|
+
val = [val];
|
|
289
|
+
if (Array.isArray(val)) {
|
|
290
|
+
for (let j = 0; j < val.length; ++j) {
|
|
291
|
+
const search = val[j];
|
|
292
|
+
if (typeof search === 'string') {
|
|
293
|
+
if (!search)
|
|
294
|
+
continue;
|
|
295
|
+
const idx = list.indexOf(search);
|
|
296
|
+
if (idx === -1)
|
|
297
|
+
continue;
|
|
298
|
+
if (list === defaultList)
|
|
299
|
+
list = list.slice();
|
|
300
|
+
list.splice(idx, 1);
|
|
301
|
+
} else if (isRegExp(search)) {
|
|
302
|
+
for (let k = 0; k < list.length; ++k) {
|
|
303
|
+
if (search.test(list[k])) {
|
|
304
|
+
if (list === defaultList)
|
|
305
|
+
list = list.slice();
|
|
306
|
+
list.splice(k, 1);
|
|
307
|
+
--k;
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
}
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
break;
|
|
314
|
+
}
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
return list;
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
return defaultList;
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
module.exports = {
|
|
324
|
+
ChannelManager,
|
|
325
|
+
generateAlgorithmList,
|
|
326
|
+
onChannelOpenFailure,
|
|
327
|
+
onCHANNEL_CLOSE,
|
|
328
|
+
isWritable: (stream) => {
|
|
329
|
+
// XXX: hack to workaround regression in node
|
|
330
|
+
// See: https://github.com/nodejs/node/issues/36029
|
|
331
|
+
return (stream
|
|
332
|
+
&& stream.writable
|
|
333
|
+
&& stream._readableState
|
|
334
|
+
&& stream._readableState.ended === false);
|
|
335
|
+
},
|
|
336
|
+
};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "ssh2",
|
|
3
|
+
"version": "1.17.0",
|
|
4
|
+
"author": "Brian White <mscdex@mscdex.net>",
|
|
5
|
+
"description": "SSH2 client and server modules written in pure JavaScript for node.js",
|
|
6
|
+
"main": "./lib/index.js",
|
|
7
|
+
"engines": {
|
|
8
|
+
"node": ">=10.16.0"
|
|
9
|
+
},
|
|
10
|
+
"dependencies": {
|
|
11
|
+
"asn1": "^0.2.6",
|
|
12
|
+
"bcrypt-pbkdf": "^1.0.2"
|
|
13
|
+
},
|
|
14
|
+
"devDependencies": {
|
|
15
|
+
"@mscdex/eslint-config": "^1.1.0",
|
|
16
|
+
"eslint": "^7.32.0"
|
|
17
|
+
},
|
|
18
|
+
"optionalDependencies": {
|
|
19
|
+
"cpu-features": "~0.0.10",
|
|
20
|
+
"nan": "^2.23.0"
|
|
21
|
+
},
|
|
22
|
+
"scripts": {
|
|
23
|
+
"install": "node install.js",
|
|
24
|
+
"rebuild": "node install.js",
|
|
25
|
+
"test": "node test/test.js",
|
|
26
|
+
"lint": "eslint --cache --report-unused-disable-directives --ext=.js .eslintrc.js examples lib test",
|
|
27
|
+
"lint:fix": "npm run lint -- --fix"
|
|
28
|
+
},
|
|
29
|
+
"keywords": [
|
|
30
|
+
"ssh",
|
|
31
|
+
"ssh2",
|
|
32
|
+
"sftp",
|
|
33
|
+
"secure",
|
|
34
|
+
"shell",
|
|
35
|
+
"exec",
|
|
36
|
+
"remote",
|
|
37
|
+
"client"
|
|
38
|
+
],
|
|
39
|
+
"licenses": [
|
|
40
|
+
{
|
|
41
|
+
"type": "MIT",
|
|
42
|
+
"url": "http://github.com/mscdex/ssh2/raw/master/LICENSE"
|
|
43
|
+
}
|
|
44
|
+
],
|
|
45
|
+
"repository": {
|
|
46
|
+
"type": "git",
|
|
47
|
+
"url": "http://github.com/mscdex/ssh2.git"
|
|
48
|
+
}
|
|
49
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
List of TweetNaCl.js authors
|
|
2
|
+
============================
|
|
3
|
+
|
|
4
|
+
Alphabetical order by first name.
|
|
5
|
+
Format: Name (GitHub username or URL)
|
|
6
|
+
|
|
7
|
+
* AndSDev (@AndSDev)
|
|
8
|
+
* Devi Mandiri (@devi)
|
|
9
|
+
* Dmitry Chestnykh (@dchest)
|
|
10
|
+
|
|
11
|
+
List of authors of third-party public domain code from which TweetNaCl.js code was derived
|
|
12
|
+
==========================================================================================
|
|
13
|
+
|
|
14
|
+
[TweetNaCl](http://tweetnacl.cr.yp.to/)
|
|
15
|
+
--------------------------------------
|
|
16
|
+
|
|
17
|
+
* Bernard van Gastel
|
|
18
|
+
* Daniel J. Bernstein <http://cr.yp.to/djb.html>
|
|
19
|
+
* Peter Schwabe <http://www.cryptojedi.org/users/peter/>
|
|
20
|
+
* Sjaak Smetsers <http://www.cs.ru.nl/~sjakie/>
|
|
21
|
+
* Tanja Lange <http://hyperelliptic.org/tanja>
|
|
22
|
+
* Wesley Janssen
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
[Poly1305-donna](https://github.com/floodyberry/poly1305-donna)
|
|
26
|
+
--------------------------------------------------------------
|
|
27
|
+
|
|
28
|
+
* Andrew Moon (@floodyberry)
|
|
@@ -0,0 +1,221 @@
|
|
|
1
|
+
TweetNaCl.js Changelog
|
|
2
|
+
======================
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
v0.14.5
|
|
6
|
+
-------
|
|
7
|
+
|
|
8
|
+
* Fixed incomplete return types in TypeScript typings.
|
|
9
|
+
* Replaced COPYING.txt with LICENSE file, which now has public domain dedication
|
|
10
|
+
text from The Unlicense. License fields in package.json and bower.json have
|
|
11
|
+
been set to "Unlicense". The project was and will be in the public domain --
|
|
12
|
+
this change just makes it easier for automated tools to know about this fact by
|
|
13
|
+
using the widely recognized and SPDX-compatible template for public domain
|
|
14
|
+
dedication.
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
v0.14.4
|
|
18
|
+
-------
|
|
19
|
+
|
|
20
|
+
* Added TypeScript type definitions (contributed by @AndSDev).
|
|
21
|
+
* Improved benchmarking code.
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
v0.14.3
|
|
25
|
+
-------
|
|
26
|
+
|
|
27
|
+
Fixed a bug in the fast version of Poly1305 and brought it back.
|
|
28
|
+
|
|
29
|
+
Thanks to @floodyberry for promptly responding and fixing the original C code:
|
|
30
|
+
|
|
31
|
+
> "The issue was not properly detecting if st->h was >= 2^130 - 5, coupled with
|
|
32
|
+
> [testing mistake] not catching the failure. The chance of the bug affecting
|
|
33
|
+
> anything in the real world is essentially zero luckily, but it's good to have
|
|
34
|
+
> it fixed."
|
|
35
|
+
|
|
36
|
+
https://github.com/floodyberry/poly1305-donna/issues/2#issuecomment-202698577
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
v0.14.2
|
|
40
|
+
-------
|
|
41
|
+
|
|
42
|
+
Switched Poly1305 fast version back to original (slow) version due to a bug.
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
v0.14.1
|
|
46
|
+
-------
|
|
47
|
+
|
|
48
|
+
No code changes, just tweaked packaging and added COPYING.txt.
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
v0.14.0
|
|
52
|
+
-------
|
|
53
|
+
|
|
54
|
+
* **Breaking change!** All functions from `nacl.util` have been removed. These
|
|
55
|
+
functions are no longer available:
|
|
56
|
+
|
|
57
|
+
nacl.util.decodeUTF8
|
|
58
|
+
nacl.util.encodeUTF8
|
|
59
|
+
nacl.util.decodeBase64
|
|
60
|
+
nacl.util.encodeBase64
|
|
61
|
+
|
|
62
|
+
If want to continue using them, you can include
|
|
63
|
+
<https://github.com/dchest/tweetnacl-util-js> package:
|
|
64
|
+
|
|
65
|
+
<script src="nacl.min.js"></script>
|
|
66
|
+
<script src="nacl-util.min.js"></script>
|
|
67
|
+
|
|
68
|
+
or
|
|
69
|
+
|
|
70
|
+
var nacl = require('tweetnacl');
|
|
71
|
+
nacl.util = require('tweetnacl-util');
|
|
72
|
+
|
|
73
|
+
However it is recommended to use better packages that have wider
|
|
74
|
+
compatibility and better performance. Functions from `nacl.util` were never
|
|
75
|
+
intended to be robust solution for string conversion and were included for
|
|
76
|
+
convenience: cryptography library is not the right place for them.
|
|
77
|
+
|
|
78
|
+
Currently calling these functions will throw error pointing to
|
|
79
|
+
`tweetnacl-util-js` (in the next version this error message will be removed).
|
|
80
|
+
|
|
81
|
+
* Improved detection of available random number generators, making it possible
|
|
82
|
+
to use `nacl.randomBytes` and related functions in Web Workers without
|
|
83
|
+
changes.
|
|
84
|
+
|
|
85
|
+
* Changes to testing (see README).
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
v0.13.3
|
|
89
|
+
-------
|
|
90
|
+
|
|
91
|
+
No code changes.
|
|
92
|
+
|
|
93
|
+
* Reverted license field in package.json to "Public domain".
|
|
94
|
+
|
|
95
|
+
* Fixed typo in README.
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
v0.13.2
|
|
99
|
+
-------
|
|
100
|
+
|
|
101
|
+
* Fixed undefined variable bug in fast version of Poly1305. No worries, this
|
|
102
|
+
bug was *never* triggered.
|
|
103
|
+
|
|
104
|
+
* Specified CC0 public domain dedication.
|
|
105
|
+
|
|
106
|
+
* Updated development dependencies.
|
|
107
|
+
|
|
108
|
+
|
|
109
|
+
v0.13.1
|
|
110
|
+
-------
|
|
111
|
+
|
|
112
|
+
* Exclude `crypto` and `buffer` modules from browserify builds.
|
|
113
|
+
|
|
114
|
+
|
|
115
|
+
v0.13.0
|
|
116
|
+
-------
|
|
117
|
+
|
|
118
|
+
* Made `nacl-fast` the default version in NPM package. Now
|
|
119
|
+
`require("tweetnacl")` will use fast version; to get the original version,
|
|
120
|
+
use `require("tweetnacl/nacl.js")`.
|
|
121
|
+
|
|
122
|
+
* Cleanup temporary array after generating random bytes.
|
|
123
|
+
|
|
124
|
+
|
|
125
|
+
v0.12.2
|
|
126
|
+
-------
|
|
127
|
+
|
|
128
|
+
* Improved performance of curve operations, making `nacl.scalarMult`, `nacl.box`,
|
|
129
|
+
`nacl.sign` and related functions up to 3x faster in `nacl-fast` version.
|
|
130
|
+
|
|
131
|
+
|
|
132
|
+
v0.12.1
|
|
133
|
+
-------
|
|
134
|
+
|
|
135
|
+
* Significantly improved performance of Salsa20 (~1.5x faster) and
|
|
136
|
+
Poly1305 (~3.5x faster) in `nacl-fast` version.
|
|
137
|
+
|
|
138
|
+
|
|
139
|
+
v0.12.0
|
|
140
|
+
-------
|
|
141
|
+
|
|
142
|
+
* Instead of using the given secret key directly, TweetNaCl.js now copies it to
|
|
143
|
+
a new array in `nacl.box.keyPair.fromSecretKey` and
|
|
144
|
+
`nacl.sign.keyPair.fromSecretKey`.
|
|
145
|
+
|
|
146
|
+
|
|
147
|
+
v0.11.2
|
|
148
|
+
-------
|
|
149
|
+
|
|
150
|
+
* Added new constant: `nacl.sign.seedLength`.
|
|
151
|
+
|
|
152
|
+
|
|
153
|
+
v0.11.1
|
|
154
|
+
-------
|
|
155
|
+
|
|
156
|
+
* Even faster hash for both short and long inputs (in `nacl-fast`).
|
|
157
|
+
|
|
158
|
+
|
|
159
|
+
v0.11.0
|
|
160
|
+
-------
|
|
161
|
+
|
|
162
|
+
* Implement `nacl.sign.keyPair.fromSeed` to enable creation of sign key pairs
|
|
163
|
+
deterministically from a 32-byte seed. (It behaves like
|
|
164
|
+
[libsodium's](http://doc.libsodium.org/public-key_cryptography/public-key_signatures.html)
|
|
165
|
+
`crypto_sign_seed_keypair`: the seed becomes a secret part of the secret key.)
|
|
166
|
+
|
|
167
|
+
* Fast version now has an improved hash implementation that is 2x-5x faster.
|
|
168
|
+
|
|
169
|
+
* Fixed benchmarks, which may have produced incorrect measurements.
|
|
170
|
+
|
|
171
|
+
|
|
172
|
+
v0.10.1
|
|
173
|
+
-------
|
|
174
|
+
|
|
175
|
+
* Exported undocumented `nacl.lowlevel.crypto_core_hsalsa20`.
|
|
176
|
+
|
|
177
|
+
|
|
178
|
+
v0.10.0
|
|
179
|
+
-------
|
|
180
|
+
|
|
181
|
+
* **Signature API breaking change!** `nacl.sign` and `nacl.sign.open` now deal
|
|
182
|
+
with signed messages, and new `nacl.sign.detached` and
|
|
183
|
+
`nacl.sign.detached.verify` are available.
|
|
184
|
+
|
|
185
|
+
Previously, `nacl.sign` returned a signature, and `nacl.sign.open` accepted a
|
|
186
|
+
message and "detached" signature. This was unlike NaCl's API, which dealt with
|
|
187
|
+
signed messages (concatenation of signature and message).
|
|
188
|
+
|
|
189
|
+
The new API is:
|
|
190
|
+
|
|
191
|
+
nacl.sign(message, secretKey) -> signedMessage
|
|
192
|
+
nacl.sign.open(signedMessage, publicKey) -> message | null
|
|
193
|
+
|
|
194
|
+
Since detached signatures are common, two new API functions were introduced:
|
|
195
|
+
|
|
196
|
+
nacl.sign.detached(message, secretKey) -> signature
|
|
197
|
+
nacl.sign.detached.verify(message, signature, publicKey) -> true | false
|
|
198
|
+
|
|
199
|
+
(Note that it's `verify`, not `open`, and it returns a boolean value, unlike
|
|
200
|
+
`open`, which returns an "unsigned" message.)
|
|
201
|
+
|
|
202
|
+
* NPM package now comes without `test` directory to keep it small.
|
|
203
|
+
|
|
204
|
+
|
|
205
|
+
v0.9.2
|
|
206
|
+
------
|
|
207
|
+
|
|
208
|
+
* Improved documentation.
|
|
209
|
+
* Fast version: increased theoretical message size limit from 2^32-1 to 2^52
|
|
210
|
+
bytes in Poly1305 (and thus, secretbox and box). However this has no impact
|
|
211
|
+
in practice since JavaScript arrays or ArrayBuffers are limited to 32-bit
|
|
212
|
+
indexes, and most implementations won't allocate more than a gigabyte or so.
|
|
213
|
+
(Obviously, there are no tests for the correctness of implementation.) Also,
|
|
214
|
+
it's not recommended to use messages that large without splitting them into
|
|
215
|
+
smaller packets anyway.
|
|
216
|
+
|
|
217
|
+
|
|
218
|
+
v0.9.1
|
|
219
|
+
------
|
|
220
|
+
|
|
221
|
+
* Initial release
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
This is free and unencumbered software released into the public domain.
|
|
2
|
+
|
|
3
|
+
Anyone is free to copy, modify, publish, use, compile, sell, or
|
|
4
|
+
distribute this software, either in source code form or as a compiled
|
|
5
|
+
binary, for any purpose, commercial or non-commercial, and by any
|
|
6
|
+
means.
|
|
7
|
+
|
|
8
|
+
In jurisdictions that recognize copyright laws, the author or authors
|
|
9
|
+
of this software dedicate any and all copyright interest in the
|
|
10
|
+
software to the public domain. We make this dedication for the benefit
|
|
11
|
+
of the public at large and to the detriment of our heirs and
|
|
12
|
+
successors. We intend this dedication to be an overt act of
|
|
13
|
+
relinquishment in perpetuity of all present and future rights to this
|
|
14
|
+
software under copyright law.
|
|
15
|
+
|
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
|
19
|
+
IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
|
|
20
|
+
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
|
21
|
+
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
|
22
|
+
OTHER DEALINGS IN THE SOFTWARE.
|
|
23
|
+
|
|
24
|
+
For more information, please refer to <http://unlicense.org>
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# Important!
|
|
2
|
+
|
|
3
|
+
If your contribution is not trivial (not a typo fix, etc.), we can only accept
|
|
4
|
+
it if you dedicate your copyright for the contribution to the public domain.
|
|
5
|
+
Make sure you understand what it means (see http://unlicense.org/)! If you
|
|
6
|
+
agree, please add yourself to AUTHORS.md file, and include the following text
|
|
7
|
+
to your pull request description or a comment in it:
|
|
8
|
+
|
|
9
|
+
------------------------------------------------------------------------------
|
|
10
|
+
|
|
11
|
+
I dedicate any and all copyright interest in this software to the
|
|
12
|
+
public domain. I make this dedication for the benefit of the public at
|
|
13
|
+
large and to the detriment of my heirs and successors. I intend this
|
|
14
|
+
dedication to be an overt act of relinquishment in perpetuity of all
|
|
15
|
+
present and future rights to this software under copyright law.
|
|
16
|
+
|
|
17
|
+
Anyone is free to copy, modify, publish, use, compile, sell, or
|
|
18
|
+
distribute this software, either in source code form or as a compiled
|
|
19
|
+
binary, for any purpose, commercial or non-commercial, and by any
|
|
20
|
+
means.
|