Skip to content
cobanovPublic

About

SSH client for the Nokia E72 (Symbian S60 3rd Ed): plain MIDP/CLDC, sharing berryssh's protocol and crypto.

Resources

Stars

4 stars

Watchers

0 watching

Forks

Latest commit

 

History

4 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

nokia-ssh

An SSH client for the Nokia E72, written as a plain MIDP 2.1 / CLDC 1.1 MIDlet.

It speaks curve25519-sha256, ssh-ed25519 and chacha20-poly1305@openssh.com — the algorithms a current OpenSSH offers by default — so a handset from 2009 can reach a modern server without that server being weakened to meet it.

The E72 has a full QWERTY keyboard, Wi-Fi, and a 320×240 screen. That is enough for a real terminal, which is the entire point.

Install

On the phone's own browser, over plain HTTP:

http://nokiassh.cobanov.run/

Plain HTTP is not laziness. The E72 is a 2009 device and its trust store predates every currently issued certificate authority, so a modern HTTPS endpoint cannot serve it at all; cobanov.run is the host precisely because it does not redirect.

Bluetooth and the memory card work too, and are faster while a build is changing every few minutes. See tools/deploy.md.

What the device actually gives you

Measured, not assumed — full results:

Platform NokiaE72-1, MIDP 2.1 over CLDC 1.1
Canvas 320×198 windowed (320×240 less the title and softkey bars)
Terminal at 6×9 53×22 windowed
Locale tr-TR
Default encoding ISO-8859-1
Colour 24-bit, double buffered, no touchscreen
Optional APIs JSR-75, JSR-82, JSR-177, RMS all present

Three of those decide things:

The system fonts cannot make a terminal. MIDP offers three sizes and the smallest monospace is 11×19, which gives ten rows. So text is drawn from a bitmap font atlas instead, and that is a requirement rather than a refinement.

tr-TR is a hazard, not a detail. "I".toLowerCase() is a dotless ı in Turkish, so any protocol code that case-folds an algorithm name silently stops matching and nothing raises an error. All ASCII conversion is hand-rolled and the test suite runs under a Turkish locale on purpose.

JSR-75 means a private key can come from a file. Reading an Ed25519 key off the memory card beats typing one into a phone.

Design

No protected APIs. Everything is standard MIDP and CLDC. An unsigned MIDlet gets a permission prompt rather than a refusal, so this is not strictly forced here — but the code satisfies it anyway, and it keeps the build free of any Nokia or Symbian tooling.

Crypto from scratch. CLDC 1.1 has no java.security, no javax.crypto and no BigInteger, so the primitives are implemented in the shared core. The modern algorithm choices make that tractable rather than harder: curve25519 is fixed 32-byte field arithmetic with no big integers anywhere, and chacha20-poly1305 is add/xor/rotate on 32-bit words with no lookup tables and no separate MAC. The 2011 stack's 2048-bit modular exponentiation would need exactly what CLDC lacks.

Streams, not sockets. The SSH core takes an InputStream and an OutputStream and never learns where they came from. That is what lets the whole protocol run on a desktop JVM against a real OpenSSH server, and it is why a Bluetooth RFCOMM transport — JSR-82 is present — would cost almost nothing if Wi-Fi is ever unavailable.

The shared SSH core

The protocol, crypto and terminal packages come from berryssh and are used here as a dependency, pinned by commit. About 8,000 lines: transport, key exchange, userauth, channels, known hosts, the cryptographic primitives, and VT320 emulation with a bitmap font renderer. They are plain java.io with no MIDP anywhere, and they arrive already covered by 230 offline vectors and 41 tests against a live OpenSSH server.

One copy, so a fix lands here by bumping a commit rather than being applied twice and forgotten once. What is written in this repository is the device layer: the canvas, the keyboard, the connection list, and opening a socket.

Building

lib/fetch.sh          # MIDP/CLDC stubs and ProGuard, from Maven Central
probe/build.sh        # the capability probe

Needs Docker (or OrbStack) and a host JDK. CLDC 1.1 wants class file version 47 and no modern JDK can emit it, so compilation runs in a JDK 8 container at -source 1.3 -target 1.3 against the real CLDC stubs — which is also what makes the compiler reject anything the device does not have.

Preverification is mandatory. A normally-compiled jar installs and then fails at runtime with a missing stack map, long after the build said it was fine. ProGuard's -microedition mode emits the StackMap attributes CLDC's verifier wants.

Measure first

The first deliverable here was a probe, not a client, and it earned that: it is what caught the system fonts being unusable, the Turkish locale being live, and a memory figure that looked like a catastrophe and was a mislabelled measurement. Nothing gets designed around a number until it is clear what the number is a number of.

probe/ has four screens — the report above, a Keys screen showing every key's raw code and what getGameAction claims it is, a Socket test, and a Heap test that finds the real ceiling by taking it.

Status

  • Repository, toolchain, plan
  • Capability probe, installable from nokiassh.cobanov.run
  • Probe run on an E72 — results
  • Heap ceiling, full-screen size, socket permissions and key codes measured
  • The SSH core pinned and the portable packages compiling
  • Canvas, keyboard and connection list for 320×240
  • A session against a real OpenSSH server

Licence

GPL-2.0-or-later.

About

SSH client for the Nokia E72 (Symbian S60 3rd Ed): plain MIDP/CLDC, sharing berryssh's protocol and crypto.

Resources

Stars

4 stars

Watchers

0 watching

Forks

Releases

Sponsor this project

Packages

Contributors

Languages

⌂ 换网址