Repositorio del curso CCOM4030 el semestre B91 del proyecto Artesanías con el Instituto de Cultura

constants.js 16KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460
  1. var i;
  2. var keys;
  3. var len;
  4. var eddsaSupported = (function() {
  5. var crypto = require('crypto');
  6. if (typeof crypto.sign === 'function'
  7. && typeof crypto.verify === 'function') {
  8. var key = '-----BEGIN PRIVATE KEY-----\r\nMC4CAQAwBQYDK2VwBCIEIHKj+sVa9WcD'
  9. + '/q2DJUJaf43Kptc8xYuUQA4bOFj9vC8T\r\n-----END PRIVATE KEY-----';
  10. var data = Buffer.from('a');
  11. var sig;
  12. var verified;
  13. try {
  14. sig = crypto.sign(null, data, key);
  15. verified = crypto.verify(null, data, key, sig);
  16. } catch (ex) {}
  17. return (Buffer.isBuffer(sig) && sig.length === 64 && verified === true);
  18. }
  19. return false;
  20. })();
  21. var MESSAGE = exports.MESSAGE = {
  22. // Transport layer protocol -- generic (1-19)
  23. DISCONNECT: 1,
  24. IGNORE: 2,
  25. UNIMPLEMENTED: 3,
  26. DEBUG: 4,
  27. SERVICE_REQUEST: 5,
  28. SERVICE_ACCEPT: 6,
  29. // Transport layer protocol -- algorithm negotiation (20-29)
  30. KEXINIT: 20,
  31. NEWKEYS: 21,
  32. // Transport layer protocol -- key exchange method-specific (30-49)
  33. // User auth protocol -- generic (50-59)
  34. USERAUTH_REQUEST: 50,
  35. USERAUTH_FAILURE: 51,
  36. USERAUTH_SUCCESS: 52,
  37. USERAUTH_BANNER: 53,
  38. // User auth protocol -- user auth method-specific (60-79)
  39. // Connection protocol -- generic (80-89)
  40. GLOBAL_REQUEST: 80,
  41. REQUEST_SUCCESS: 81,
  42. REQUEST_FAILURE: 82,
  43. // Connection protocol -- channel-related (90-127)
  44. CHANNEL_OPEN: 90,
  45. CHANNEL_OPEN_CONFIRMATION: 91,
  46. CHANNEL_OPEN_FAILURE: 92,
  47. CHANNEL_WINDOW_ADJUST: 93,
  48. CHANNEL_DATA: 94,
  49. CHANNEL_EXTENDED_DATA: 95,
  50. CHANNEL_EOF: 96,
  51. CHANNEL_CLOSE: 97,
  52. CHANNEL_REQUEST: 98,
  53. CHANNEL_SUCCESS: 99,
  54. CHANNEL_FAILURE: 100
  55. // Reserved for client protocols (128-191)
  56. // Local extensions (192-155)
  57. };
  58. for (i = 0, keys = Object.keys(MESSAGE), len = keys.length; i < len; ++i)
  59. MESSAGE[MESSAGE[keys[i]]] = keys[i];
  60. // context-specific message codes:
  61. MESSAGE.KEXDH_INIT = 30;
  62. MESSAGE.KEXDH_REPLY = 31;
  63. MESSAGE.KEXDH_GEX_REQUEST = 34;
  64. MESSAGE.KEXDH_GEX_GROUP = 31;
  65. MESSAGE.KEXDH_GEX_INIT = 32;
  66. MESSAGE.KEXDH_GEX_REPLY = 33;
  67. MESSAGE.KEXECDH_INIT = 30; // included here for completeness
  68. MESSAGE.KEXECDH_REPLY = 31; // included here for completeness
  69. MESSAGE.USERAUTH_PASSWD_CHANGEREQ = 60;
  70. MESSAGE.USERAUTH_PK_OK = 60;
  71. MESSAGE.USERAUTH_INFO_REQUEST = 60;
  72. MESSAGE.USERAUTH_INFO_RESPONSE = 61;
  73. var DYNAMIC_KEXDH_MESSAGE = exports.DYNAMIC_KEXDH_MESSAGE = {};
  74. DYNAMIC_KEXDH_MESSAGE[MESSAGE.KEXDH_GEX_GROUP] = 'KEXDH_GEX_GROUP';
  75. DYNAMIC_KEXDH_MESSAGE[MESSAGE.KEXDH_GEX_REPLY] = 'KEXDH_GEX_REPLY';
  76. var KEXDH_MESSAGE = exports.KEXDH_MESSAGE = {};
  77. KEXDH_MESSAGE[MESSAGE.KEXDH_INIT] = 'KEXDH_INIT';
  78. KEXDH_MESSAGE[MESSAGE.KEXDH_REPLY] = 'KEXDH_REPLY';
  79. var DISCONNECT_REASON = exports.DISCONNECT_REASON = {
  80. HOST_NOT_ALLOWED_TO_CONNECT: 1,
  81. PROTOCOL_ERROR: 2,
  82. KEY_EXCHANGE_FAILED: 3,
  83. RESERVED: 4,
  84. MAC_ERROR: 5,
  85. COMPRESSION_ERROR: 6,
  86. SERVICE_NOT_AVAILABLE: 7,
  87. PROTOCOL_VERSION_NOT_SUPPORTED: 8,
  88. HOST_KEY_NOT_VERIFIABLE: 9,
  89. CONNECTION_LOST: 10,
  90. BY_APPLICATION: 11,
  91. TOO_MANY_CONNECTIONS: 12,
  92. AUTH_CANCELED_BY_USER: 13,
  93. NO_MORE_AUTH_METHODS_AVAILABLE: 14,
  94. ILLEGAL_USER_NAME: 15
  95. };
  96. for (i = 0, keys = Object.keys(DISCONNECT_REASON), len = keys.length;
  97. i < len;
  98. ++i) {
  99. DISCONNECT_REASON[DISCONNECT_REASON[keys[i]]] = keys[i];
  100. }
  101. var CHANNEL_OPEN_FAILURE = exports.CHANNEL_OPEN_FAILURE = {
  102. ADMINISTRATIVELY_PROHIBITED: 1,
  103. CONNECT_FAILED: 2,
  104. UNKNOWN_CHANNEL_TYPE: 3,
  105. RESOURCE_SHORTAGE: 4
  106. };
  107. for (i = 0, keys = Object.keys(CHANNEL_OPEN_FAILURE), len = keys.length;
  108. i < len;
  109. ++i) {
  110. CHANNEL_OPEN_FAILURE[CHANNEL_OPEN_FAILURE[keys[i]]] = keys[i];
  111. }
  112. var TERMINAL_MODE = exports.TERMINAL_MODE = {
  113. TTY_OP_END: 0, // Indicates end of options.
  114. VINTR: 1, // Interrupt character; 255 if none. Similarly for the
  115. // other characters. Not all of these characters are
  116. // supported on all systems.
  117. VQUIT: 2, // The quit character (sends SIGQUIT signal on POSIX
  118. // systems).
  119. VERASE: 3, // Erase the character to left of the cursor.
  120. VKILL: 4, // Kill the current input line.
  121. VEOF: 5, // End-of-file character (sends EOF from the terminal).
  122. VEOL: 6, // End-of-line character in addition to carriage return
  123. // and/or linefeed.
  124. VEOL2: 7, // Additional end-of-line character.
  125. VSTART: 8, // Continues paused output (normally control-Q).
  126. VSTOP: 9, // Pauses output (normally control-S).
  127. VSUSP: 10, // Suspends the current program.
  128. VDSUSP: 11, // Another suspend character.
  129. VREPRINT: 12, // Reprints the current input line.
  130. VWERASE: 13, // Erases a word left of cursor.
  131. VLNEXT: 14, // Enter the next character typed literally, even if it
  132. // is a special character
  133. VFLUSH: 15, // Character to flush output.
  134. VSWTCH: 16, // Switch to a different shell layer.
  135. VSTATUS: 17, // Prints system status line (load, command, pid, etc).
  136. VDISCARD: 18, // Toggles the flushing of terminal output.
  137. IGNPAR: 30, // The ignore parity flag. The parameter SHOULD be 0
  138. // if this flag is FALSE, and 1 if it is TRUE.
  139. PARMRK: 31, // Mark parity and framing errors.
  140. INPCK: 32, // Enable checking of parity errors.
  141. ISTRIP: 33, // Strip 8th bit off characters.
  142. INLCR: 34, // Map NL into CR on input.
  143. IGNCR: 35, // Ignore CR on input.
  144. ICRNL: 36, // Map CR to NL on input.
  145. IUCLC: 37, // Translate uppercase characters to lowercase.
  146. IXON: 38, // Enable output flow control.
  147. IXANY: 39, // Any char will restart after stop.
  148. IXOFF: 40, // Enable input flow control.
  149. IMAXBEL: 41, // Ring bell on input queue full.
  150. ISIG: 50, // Enable signals INTR, QUIT, [D]SUSP.
  151. ICANON: 51, // Canonicalize input lines.
  152. XCASE: 52, // Enable input and output of uppercase characters by
  153. // preceding their lowercase equivalents with "\".
  154. ECHO: 53, // Enable echoing.
  155. ECHOE: 54, // Visually erase chars.
  156. ECHOK: 55, // Kill character discards current line.
  157. ECHONL: 56, // Echo NL even if ECHO is off.
  158. NOFLSH: 57, // Don't flush after interrupt.
  159. TOSTOP: 58, // Stop background jobs from output.
  160. IEXTEN: 59, // Enable extensions.
  161. ECHOCTL: 60, // Echo control characters as ^(Char).
  162. ECHOKE: 61, // Visual erase for line kill.
  163. PENDIN: 62, // Retype pending input.
  164. OPOST: 70, // Enable output processing.
  165. OLCUC: 71, // Convert lowercase to uppercase.
  166. ONLCR: 72, // Map NL to CR-NL.
  167. OCRNL: 73, // Translate carriage return to newline (output).
  168. ONOCR: 74, // Translate newline to carriage return-newline
  169. // (output).
  170. ONLRET: 75, // Newline performs a carriage return (output).
  171. CS7: 90, // 7 bit mode.
  172. CS8: 91, // 8 bit mode.
  173. PARENB: 92, // Parity enable.
  174. PARODD: 93, // Odd parity, else even.
  175. TTY_OP_ISPEED: 128, // Specifies the input baud rate in bits per second.
  176. TTY_OP_OSPEED: 129 // Specifies the output baud rate in bits per second.
  177. };
  178. for (i = 0, keys = Object.keys(TERMINAL_MODE), len = keys.length; i < len; ++i)
  179. TERMINAL_MODE[TERMINAL_MODE[keys[i]]] = keys[i];
  180. var CHANNEL_EXTENDED_DATATYPE = exports.CHANNEL_EXTENDED_DATATYPE = {
  181. STDERR: 1
  182. };
  183. for (i = 0, keys = Object.keys(CHANNEL_EXTENDED_DATATYPE), len = keys.length;
  184. i < len;
  185. ++i) {
  186. CHANNEL_EXTENDED_DATATYPE[CHANNEL_EXTENDED_DATATYPE[keys[i]]] = keys[i];
  187. }
  188. exports.SIGNALS = ['ABRT', 'ALRM', 'FPE', 'HUP', 'ILL', 'INT',
  189. 'QUIT', 'SEGV', 'TERM', 'USR1', 'USR2', 'KILL',
  190. 'PIPE'];
  191. var DEFAULT_KEX = [
  192. // https://tools.ietf.org/html/rfc5656#section-10.1
  193. 'ecdh-sha2-nistp256',
  194. 'ecdh-sha2-nistp384',
  195. 'ecdh-sha2-nistp521',
  196. // https://tools.ietf.org/html/rfc4419#section-4
  197. 'diffie-hellman-group-exchange-sha256',
  198. 'diffie-hellman-group14-sha1' // REQUIRED
  199. ];
  200. var SUPPORTED_KEX = [
  201. // https://tools.ietf.org/html/rfc4419#section-4
  202. 'diffie-hellman-group-exchange-sha1',
  203. 'diffie-hellman-group1-sha1' // REQUIRED
  204. ];
  205. var KEX_BUF = Buffer.from(DEFAULT_KEX.join(','), 'ascii');
  206. SUPPORTED_KEX = DEFAULT_KEX.concat(SUPPORTED_KEX);
  207. var DEFAULT_SERVER_HOST_KEY = [
  208. 'ssh-rsa',
  209. 'ecdsa-sha2-nistp256',
  210. 'ecdsa-sha2-nistp384',
  211. 'ecdsa-sha2-nistp521'
  212. ];
  213. if (eddsaSupported)
  214. DEFAULT_SERVER_HOST_KEY.unshift('ssh-ed25519');
  215. var SUPPORTED_SERVER_HOST_KEY = [
  216. 'ssh-dss'
  217. ];
  218. var SERVER_HOST_KEY_BUF = Buffer.from(DEFAULT_SERVER_HOST_KEY.join(','),
  219. 'ascii');
  220. SUPPORTED_SERVER_HOST_KEY = DEFAULT_SERVER_HOST_KEY.concat(
  221. SUPPORTED_SERVER_HOST_KEY
  222. );
  223. var DEFAULT_CIPHER = [
  224. // http://tools.ietf.org/html/rfc4344#section-4
  225. 'aes128-ctr',
  226. 'aes192-ctr',
  227. 'aes256-ctr',
  228. // http://tools.ietf.org/html/rfc5647
  229. 'aes128-gcm',
  230. 'aes128-gcm@openssh.com',
  231. 'aes256-gcm',
  232. 'aes256-gcm@openssh.com'
  233. ];
  234. var SUPPORTED_CIPHER = [
  235. 'aes256-cbc',
  236. 'aes192-cbc',
  237. 'aes128-cbc',
  238. 'blowfish-cbc',
  239. '3des-cbc',
  240. // http://tools.ietf.org/html/rfc4345#section-4:
  241. 'arcfour256',
  242. 'arcfour128',
  243. 'cast128-cbc',
  244. 'arcfour'
  245. ];
  246. var CIPHER_BUF = Buffer.from(DEFAULT_CIPHER.join(','), 'ascii');
  247. SUPPORTED_CIPHER = DEFAULT_CIPHER.concat(SUPPORTED_CIPHER);
  248. var DEFAULT_HMAC = [
  249. 'hmac-sha2-256',
  250. 'hmac-sha2-512',
  251. 'hmac-sha1',
  252. ];
  253. var SUPPORTED_HMAC = [
  254. 'hmac-md5',
  255. 'hmac-sha2-256-96', // first 96 bits of HMAC-SHA256
  256. 'hmac-sha2-512-96', // first 96 bits of HMAC-SHA512
  257. 'hmac-ripemd160',
  258. 'hmac-sha1-96', // first 96 bits of HMAC-SHA1
  259. 'hmac-md5-96' // first 96 bits of HMAC-MD5
  260. ];
  261. var HMAC_BUF = Buffer.from(DEFAULT_HMAC.join(','), 'ascii');
  262. SUPPORTED_HMAC = DEFAULT_HMAC.concat(SUPPORTED_HMAC);
  263. var DEFAULT_COMPRESS = [
  264. 'none',
  265. 'zlib@openssh.com', // ZLIB (LZ77) compression, except
  266. // compression/decompression does not start until after
  267. // successful user authentication
  268. 'zlib' // ZLIB (LZ77) compression
  269. ];
  270. var SUPPORTED_COMPRESS = [];
  271. var COMPRESS_BUF = Buffer.from(DEFAULT_COMPRESS.join(','), 'ascii');
  272. SUPPORTED_COMPRESS = DEFAULT_COMPRESS.concat(SUPPORTED_COMPRESS);
  273. function makeCipherInfo(blockLen, keyLen, ivLen, authLen, discardLen, stream) {
  274. return {
  275. blockLen: blockLen,
  276. keyLen: keyLen,
  277. ivLen: ivLen === 0 ? blockLen : ivLen,
  278. authLen: authLen,
  279. discardLen: discardLen,
  280. stream: stream,
  281. };
  282. }
  283. exports.CIPHER_INFO = {
  284. 'aes128-gcm': makeCipherInfo(16, 16, 12, 16, 0, false),
  285. 'aes256-gcm': makeCipherInfo(16, 32, 12, 16, 0, false),
  286. 'aes128-gcm@openssh.com': makeCipherInfo(16, 16, 12, 16, 0, false),
  287. 'aes256-gcm@openssh.com': makeCipherInfo(16, 32, 12, 16, 0, false),
  288. 'aes128-cbc': makeCipherInfo(16, 16, 0, 0, 0, false),
  289. 'aes192-cbc': makeCipherInfo(16, 24, 0, 0, 0, false),
  290. 'aes256-cbc': makeCipherInfo(16, 32, 0, 0, 0, false),
  291. 'rijndael-cbc@lysator.liu.se': makeCipherInfo(16, 32, 0, 0, 0, false),
  292. '3des-cbc': makeCipherInfo(8, 24, 0, 0, 0, false),
  293. 'blowfish-cbc': makeCipherInfo(8, 16, 0, 0, 0, false),
  294. 'idea-cbc': makeCipherInfo(8, 16, 0, 0, 0, false),
  295. 'cast128-cbc': makeCipherInfo(8, 16, 0, 0, 0, false),
  296. 'camellia128-cbc': makeCipherInfo(16, 16, 0, 0, 0, false),
  297. 'camellia192-cbc': makeCipherInfo(16, 24, 0, 0, 0, false),
  298. 'camellia256-cbc': makeCipherInfo(16, 32, 0, 0, 0, false),
  299. 'camellia128-cbc@openssh.com': makeCipherInfo(16, 16, 0, 0, 0, false),
  300. 'camellia192-cbc@openssh.com': makeCipherInfo(16, 24, 0, 0, 0, false),
  301. 'camellia256-cbc@openssh.com': makeCipherInfo(16, 32, 0, 0, 0, false),
  302. 'aes128-ctr': makeCipherInfo(16, 16, 0, 0, 0, false),
  303. 'aes192-ctr': makeCipherInfo(16, 24, 0, 0, 0, false),
  304. 'aes256-ctr': makeCipherInfo(16, 32, 0, 0, 0, false),
  305. '3des-ctr': makeCipherInfo(8, 24, 0, 0, 0, false),
  306. 'blowfish-ctr': makeCipherInfo(8, 16, 0, 0, 0, false),
  307. 'cast128-ctr': makeCipherInfo(8, 16, 0, 0, 0, false),
  308. 'camellia128-ctr': makeCipherInfo(16, 16, 0, 0, 0, false),
  309. 'camellia192-ctr': makeCipherInfo(16, 24, 0, 0, 0, false),
  310. 'camellia256-ctr': makeCipherInfo(16, 32, 0, 0, 0, false),
  311. 'camellia128-ctr@openssh.com': makeCipherInfo(16, 16, 0, 0, 0, false),
  312. 'camellia192-ctr@openssh.com': makeCipherInfo(16, 24, 0, 0, 0, false),
  313. 'camellia256-ctr@openssh.com': makeCipherInfo(16, 32, 0, 0, 0, false),
  314. /* The "arcfour128" algorithm is the RC4 cipher, as described in
  315. [SCHNEIER], using a 128-bit key. The first 1536 bytes of keystream
  316. generated by the cipher MUST be discarded, and the first byte of the
  317. first encrypted packet MUST be encrypted using the 1537th byte of
  318. keystream.
  319. -- http://tools.ietf.org/html/rfc4345#section-4 */
  320. 'arcfour': makeCipherInfo(8, 16, 0, 0, 1536, true),
  321. 'arcfour128': makeCipherInfo(8, 16, 0, 0, 1536, true),
  322. 'arcfour256': makeCipherInfo(8, 32, 0, 0, 1536, true),
  323. 'arcfour512': makeCipherInfo(8, 64, 0, 0, 1536, true),
  324. };
  325. function makeHMACInfo(len, actualLen) {
  326. return { len: len, actualLen: actualLen };
  327. }
  328. exports.HMAC_INFO = {
  329. 'hmac-md5': makeHMACInfo(16, 16),
  330. 'hmac-md5-96': makeHMACInfo(16, 12),
  331. 'hmac-ripemd160': makeHMACInfo(20, 20),
  332. 'hmac-sha1': makeHMACInfo(20, 20),
  333. 'hmac-sha1-96': makeHMACInfo(20, 12),
  334. 'hmac-sha2-256': makeHMACInfo(32, 32),
  335. 'hmac-sha2-256-96': makeHMACInfo(32, 12),
  336. 'hmac-sha2-512': makeHMACInfo(64, 64),
  337. 'hmac-sha2-512-96': makeHMACInfo(64, 12),
  338. };
  339. exports.ALGORITHMS = {
  340. KEX: DEFAULT_KEX,
  341. KEX_BUF: KEX_BUF,
  342. SUPPORTED_KEX: SUPPORTED_KEX,
  343. SERVER_HOST_KEY: DEFAULT_SERVER_HOST_KEY,
  344. SERVER_HOST_KEY_BUF: SERVER_HOST_KEY_BUF,
  345. SUPPORTED_SERVER_HOST_KEY: SUPPORTED_SERVER_HOST_KEY,
  346. CIPHER: DEFAULT_CIPHER,
  347. CIPHER_BUF: CIPHER_BUF,
  348. SUPPORTED_CIPHER: SUPPORTED_CIPHER,
  349. HMAC: DEFAULT_HMAC,
  350. HMAC_BUF: HMAC_BUF,
  351. SUPPORTED_HMAC: SUPPORTED_HMAC,
  352. COMPRESS: DEFAULT_COMPRESS,
  353. COMPRESS_BUF: COMPRESS_BUF,
  354. SUPPORTED_COMPRESS: SUPPORTED_COMPRESS
  355. };
  356. exports.SSH_TO_OPENSSL = {
  357. // ECDH key exchange
  358. 'ecdh-sha2-nistp256': 'prime256v1', // OpenSSL's name for 'secp256r1'
  359. 'ecdh-sha2-nistp384': 'secp384r1',
  360. 'ecdh-sha2-nistp521': 'secp521r1',
  361. // Ciphers
  362. 'aes128-gcm': 'aes-128-gcm',
  363. 'aes256-gcm': 'aes-256-gcm',
  364. 'aes128-gcm@openssh.com': 'aes-128-gcm',
  365. 'aes256-gcm@openssh.com': 'aes-256-gcm',
  366. '3des-cbc': 'des-ede3-cbc',
  367. 'blowfish-cbc': 'bf-cbc',
  368. 'aes256-cbc': 'aes-256-cbc',
  369. 'aes192-cbc': 'aes-192-cbc',
  370. 'aes128-cbc': 'aes-128-cbc',
  371. 'idea-cbc': 'idea-cbc',
  372. 'cast128-cbc': 'cast-cbc',
  373. 'rijndael-cbc@lysator.liu.se': 'aes-256-cbc',
  374. 'arcfour128': 'rc4',
  375. 'arcfour256': 'rc4',
  376. 'arcfour512': 'rc4',
  377. 'arcfour': 'rc4',
  378. 'camellia128-cbc': 'camellia-128-cbc',
  379. 'camellia192-cbc': 'camellia-192-cbc',
  380. 'camellia256-cbc': 'camellia-256-cbc',
  381. 'camellia128-cbc@openssh.com': 'camellia-128-cbc',
  382. 'camellia192-cbc@openssh.com': 'camellia-192-cbc',
  383. 'camellia256-cbc@openssh.com': 'camellia-256-cbc',
  384. '3des-ctr': 'des-ede3',
  385. 'blowfish-ctr': 'bf-ecb',
  386. 'aes256-ctr': 'aes-256-ctr',
  387. 'aes192-ctr': 'aes-192-ctr',
  388. 'aes128-ctr': 'aes-128-ctr',
  389. 'cast128-ctr': 'cast5-ecb',
  390. 'camellia128-ctr': 'camellia-128-ecb',
  391. 'camellia192-ctr': 'camellia-192-ecb',
  392. 'camellia256-ctr': 'camellia-256-ecb',
  393. 'camellia128-ctr@openssh.com': 'camellia-128-ecb',
  394. 'camellia192-ctr@openssh.com': 'camellia-192-ecb',
  395. 'camellia256-ctr@openssh.com': 'camellia-256-ecb',
  396. // HMAC
  397. 'hmac-sha1-96': 'sha1',
  398. 'hmac-sha1': 'sha1',
  399. 'hmac-sha2-256': 'sha256',
  400. 'hmac-sha2-256-96': 'sha256',
  401. 'hmac-sha2-512': 'sha512',
  402. 'hmac-sha2-512-96': 'sha512',
  403. 'hmac-md5-96': 'md5',
  404. 'hmac-md5': 'md5',
  405. 'hmac-ripemd160': 'ripemd160'
  406. };
  407. var BUGS = exports.BUGS = {
  408. BAD_DHGEX: 1,
  409. OLD_EXIT: 2,
  410. DYN_RPORT_BUG: 4
  411. };
  412. exports.BUGGY_IMPLS = [
  413. [ 'Cisco-1.25', BUGS.BAD_DHGEX ],
  414. [ /^[0-9.]+$/, BUGS.OLD_EXIT ], // old SSH.com implementations
  415. [ /^OpenSSH_5\.\d+/, BUGS.DYN_RPORT_BUG ]
  416. ];
  417. exports.EDDSA_SUPPORTED = eddsaSupported;