Skip to content

pspssh 2.0.0 — an SSH client for a games console

Choose a tag to compare

@cobanov cobanov released this 31 Jul 10:58
· 10 commits to main since this release
e96c82c

An SSH client for the PlayStation Portable that talks to a current OpenSSH server — and, as of this release, one you never need a computer to use.

 pspssh                                    v2.0.0  cobanov.dev

   pve                     bb@192.168.8.45:2222
 > macmini                 mert@192.168.1.20:22
   laptop                  mert@10.0.0.4:22

   +  add a host

 X connect  [] edit  /\ delete  SEL forget key  O quit

What it does

  • Modern cryptography, and only that. One algorithm per slot: curve25519-sha256, ssh-ed25519, aes256-ctr, hmac-sha2-256. A weak session cannot be negotiated because there is nothing weak to negotiate.
  • Servers managed on the console. Add, edit and delete hosts with the on-screen keyboard. The list is written through a temporary file, so a battery pull halfway through adding one server cannot cost you the others.
  • Host keys remembered. Trust on first use, then the same key every time. A change is refused with no override on that screen — getting past it means finding the host in the list and pressing SELECT, which is friction on purpose.
  • An 80-column terminal. Colours, cursor addressing, erase, insert and delete, scroll regions. Spleen 6×12, because at sixty columns the output of ls -l wrapped and stopped being columns.
  • Passwords are optional. Leave one out and it is asked for at connect time, then wiped.

Since 1.0.0

1.0.0 proved the handshake. Everything else is this release: the screen is drawn by the application rather than by pspDebugScreen, which is what made a keyboard and a terminal possible at all. Then the host list, the on-screen keyboard, the terminal, and the host key check.

Four hardware bugs were found and fixed along the way, each of which is a note in the source now:

  • The clear raced the keyboard's own drawing — a CPU-side clear against GE-side rendering, with nothing sequencing them. A black screen instead of a keyboard.
  • sceUtilityOskGetStatus returns pspUtilityDialogState, not the SceUtilityOskState that sits in the same header. Off by one from VISIBLE onward, so the keyboard was never refreshed while it was up.
  • Restricting the keyboard's input type is the least-travelled path in the dialog, and it is what made the port field refuse to open.
  • PARAM.SFO's key table has to be sorted, and APP_VER has to be XX.YY.

What stands behind it

122 assertions run without a PSP, over the four modules whose logic does not need one:

hosts.c 35 round trips, refusals, the legacy import, an interrupted save
knownhosts.c 28 matching, not matching, not matching a prefix, every way a file could load less than it claims
term.c 43 cursor addressing, erase modes, scroll regions, escape sequences split across reads, hostile parameters
console.c 16 wrapping, scrolling, tabs, a call larger than its own buffer

Plus six against a real OpenSSH server, which check the fingerprint the client computes against what ssh-keyscan reports for the same host.

tools/release.sh builds from a fresh clone before tagging, because v1.1.0 shipped unbuildable.

Installing

Download EBOOT.PBP and copy it to the memory card as PSP/GAME/pspssh/EBOOT.PBP — ef0: on a PSP Go. Launch it from the XMB under Game and add your servers from the list. Your saved hosts and remembered keys are separate files and survive an upgrade.

A PSP does WEP and WPA-TKIP. WPA2-AES needs the wpa2psp plugin on 6.61 PRO; on ARK CFW it is already there.

Known

  • Public key authentication is not implemented. Passwords only.
  • Typing is line at a time, because the keyboard is a modal dialog. That suits sh; it does not suit vim, and no amount of work on this client will change it.
  • The menu music has never played. It is in this build with the loop chunk Sony's encoder writes, which is untested — #51 records everything ruled out. Deleting assets/SND0.AT3 and rebuilding removes it and 199 KB.

Full changelog: v1.0.0...v2.0.0