Live data from Hacker News

TinySSH is a small SSH server using NaCl, TweetNaCl

tinyssh.org

11–20 of 64 posts

Re: TinySSH is a small SSH server using NaCl, TweetNaCl

#11
How is code like below "easily auditable"?

  keydir = *++argv; if (!keydir) die_usage();
or

  if (*x == 'v') { if (flagverbose >= 2) flagverbose = 3; else flagverbose = 2; continue; }
why put multiple statements on the same line if you have nothing to hide?[1]

[1] https://www.kernel.org/doc/Documentation/CodingStyle

Re: TinySSH is a small SSH server using NaCl, TweetNaCl

#13
post #6
post #3

Is TweetNaCl deliberately 32-bit or LLP64 only? One of the first lines is typedef unsigned long u32; but on 64-bit LP64 systems (like Linux), long is 64-bits. See http://tweetnacl.cr.yp.to/20140427/tweetnacl.c

Yes, TweetNaCl is. TweetNaCl's goal is to be auditable, not to be portable. On the other hand, TinySSH actually includes a configuration mechanism to detect integer sizes, and modifies TweetNaCl accordingly, so TinySSH is not 32-bit/LLP64 only.

I wonder why not just use stdint.h, it's got what you need. ..

Re: TinySSH is a small SSH server using NaCl, TweetNaCl

#14
post #8

I find use of TweetNaCl curious. For curve25519, why wouldn't one use http://code.google.com/p/curve25519-donna/ instead? djb's cryptography is great, but djb's implementations leave something to be desired.

What do they leave to be desired? Style is a personal preference, of course - but merit? Every single djb implementation I've seen (a lot of them) is fast, efficient, secure, and clear, once you get his style.

Re: TinySSH is a small SSH server using NaCl, TweetNaCl

#15
post #8

I find use of TweetNaCl curious. For curve25519, why wouldn't one use http://code.google.com/p/curve25519-donna/ instead? djb's cryptography is great, but djb's implementations leave something to be desired.

The usual problem with DJB's implementations is not that they're incorrect or slow or insecure -- far from it! -- but that they're awkward to integrate with the rest of the world, may require weird build configurations, and are hard for anybody else to modify. Well, TweetNaCl is really easy to integrate with the rest of the world, since it's just a single portable .c file, and the speed is surprisingly good, and its functionality and API are stable enough that you probably don't need to modify it.

So, I don't see the problem here. If these guys had tried to cobble together a replacement for NaCl out of pieces like the curve25519-donna code, that would be a problem, because there's more potential to screw that up.

Re: TinySSH is a small SSH server using NaCl, TweetNaCl

#17

Which ssh clients can connect to this? For example, can putty connect to this?

Only 6.5/6.6 versions of the OpenSSH client can connect to this server. 6.5 is the first (and as far as I know only) ssh client that introduced chacha20 and ed25519 support.

Re: TinySSH is a small SSH server using NaCl, TweetNaCl

#18
post #5

Curious as to whether something like this would be good for embedded work, as I'm working on a "modern" HP 200LX[0] running RetroBSD[1] possibly, all off a PIC micro controller (!) and want to work out how to get some form of SSH into it. Will be interesting to attempt to port it regardless of what happens though! ---- [0] http://en.wikipedia.org/wiki/HP_200LX [1] http://retrobsd.org/wiki/doku.php

Dropbear is usually the ssh-server of choice for small systems:

https://matt.ucc.asn.au/dropbear/dropbear.html

Quick check shows that both compile to about 220K without any tuning on x86_64. While I wouldn't use that figure as serious comparison, it shows that they are in the same ballpark in size.

Re: TinySSH is a small SSH server using NaCl, TweetNaCl

#19
What use is an sshd that doesn't support SCP? I think to most people that is a core feature, I'd be surprised if it wasn't a requirement for git for example.

It sounds like it's small enough perhaps for a direct port to a safe language like rust, that would be interesting (to me at least).

Re: TinySSH is a small SSH server using NaCl, TweetNaCl

#20

How is code like below "easily auditable"? keydir = *++argv; if (!keydir) die_usage(); or if (*x == 'v') { if (flagverbose >= 2) flagverbose = 3; else flagverbose = 2; continue; } why put multiple statements on the same line if you have nothing to hide?[1] [1] https://www.kernel.org/doc/Documentation/CodingStyle

It's an SSH server. If dealing with simple cases of more than one statement on the same line is the worst bit of auditing it, it is indeed an easily auditable SSH server.

(Not that I would have written either line that way, mind you. But there's no real challenge understanding them.)

Post reply on HN