sshwot-format.text 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. Please note that all text insire quotes in the EBNF here is to be taken to
  2. mean bytes that would decode as that using the ASCII. character encoding.
  3. "\n" refers specifically to the byte 0x0a, and no alternative newlines are
  4. acceptable.
  5. The file has a header like:
  6. magic = "SSHWOT" ;
  7. version = "0" ;
  8. comment = ? General comment about the file. Valid utf-8, no '\n'. ? ;
  9. header = magic, " ", version, [" ", comment], "\n" ;
  10. Examples of valid headers would be "SSHWOT 0\n" and "SSHWOT 0 Emma G. 2018\n".
  11. "SSHWOT 0 \n" is not valid, since a space marks that there will be a comment.
  12. After the header the entries are laid out as:
  13. salt = ? base64(salt) ? ;
  14. hashed host = ? base64(sha256(host concat salt)) ? ;
  15. fingerprint = ? base64(sha256-fingerprint) ? ;
  16. comment = ? Comment about the host/key. Valid utf-8, no '\n'. ? ;
  17. entry = salt, " ", hashed host, " ", fingerprint, [" ", comment], "\n" ;
  18. The version of base64 used uses + for 62 and / for 63, doesn't use = for
  19. padding, and contains no breaks.
  20. Examples of valid entries are
  21. "Yixx+B6zrFoubPhBddgyx0nXHmbqMW1Wzneo4JqJv0U yPUACFC/zPt/ENoIluOuWiTXor3r7oHhac63qej637E QUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVpbXF1eX2A\n"
  22. and
  23. "bd/MfFs+DMVqNQQoZGGCvpTopeS0/Jt6GS5vg7J+638 cbbdTnuIh0ZwnM+/r3sAu4iHgaN3mpkcP9kJND4vBUo YWJjZGVmZ2hpamtsbW5vcHFyc3R1dnd4eXp7fH1+f4A The old one\n"
  24. Again, if there is a space following the necessary parts, there must also be
  25. a comment or else the entry is malformed.
  26. If port is not 22, the host is [domain]:port. This is in accordance with how
  27. OpenSSH stores it in .ssh/known_hosts. Internationalized domain names are
  28. punycoded and all domain names are converted into lower case. This differs
  29. from OpenSSH, which is not IDN-aware.
  30. Sha256 is used instead of a password hash since we want checking for whether
  31. a host is present to be reasonably fast.