algorithms.ts 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. import * as russh from 'russh'
  2. import { SSHAlgorithmType } from './api'
  3. export const supportedAlgorithms = {
  4. [SSHAlgorithmType.KEX]: russh.getSupportedKexAlgorithms().filter(x => x !== 'none'),
  5. [SSHAlgorithmType.HOSTKEY]: russh.getSupportedKeyTypes().filter(x => x !== 'none'),
  6. [SSHAlgorithmType.CIPHER]: russh.getSupportedCiphers().filter(x => x !== 'clear'),
  7. [SSHAlgorithmType.HMAC]: russh.getSupportedMACs().filter(x => x !== 'none'),
  8. }
  9. export const defaultAlgorithms = {
  10. [SSHAlgorithmType.KEX]: [
  11. 'curve25519-sha256',
  12. '[email protected]',
  13. 'diffie-hellman-group16-sha512',
  14. 'diffie-hellman-group14-sha256',
  15. 'ext-info-c',
  16. 'ext-info-s',
  17. '[email protected]',
  18. '[email protected]',
  19. ],
  20. [SSHAlgorithmType.HOSTKEY]: [
  21. 'ssh-ed25519',
  22. 'ecdsa-sha2-nistp256',
  23. 'ecdsa-sha2-nistp521',
  24. 'rsa-sha2-256',
  25. 'rsa-sha2-512',
  26. 'ssh-rsa',
  27. ],
  28. [SSHAlgorithmType.CIPHER]: [
  29. '[email protected]',
  30. '[email protected]',
  31. 'aes256-ctr',
  32. 'aes192-ctr',
  33. 'aes128-ctr',
  34. ],
  35. [SSHAlgorithmType.HMAC]: [
  36. '[email protected]',
  37. '[email protected]',
  38. 'hmac-sha2-512',
  39. 'hmac-sha2-256',
  40. '[email protected]',
  41. 'hmac-sha1',
  42. ],
  43. }