News for hackers. Stuff that matters.
Re:TinySSH is a small SSH server using NaCl, TweetNaCl by sanxiyn on Sunday May 11, 2014 @03:25AM (#7728057)
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.

Re:TinySSH is a small SSH server using NaCl, TweetNaCl by bluetech on Sunday May 11, 2014 @03:28AM (#7728060)
Are you sure? The TweetNaCl paper says u32 is an unsigned >= 32-bit (see towards the end): http://tweetnacl.cr.yp.to/papers.html
Re:TinySSH is a small SSH server using NaCl, TweetNaCl by Nursie on Sunday May 11, 2014 @05:22AM (#7728223)
I wonder why not just use stdint.h, it's got what you need. ..
[deleted]
Re:TinySSH is a small SSH server using NaCl, TweetNaCl by Nursie on Sunday May 11, 2014 @08:01AM (#7728463)
Yes, I did see that post. The multiple statements per line thing is really fishy for a security critical piece of infrastructure.
Re:TinySSH is a small SSH server using NaCl, TweetNaCl by friendlypedant on Sunday May 11, 2014 @03:52PM (#7729713)
This is essentially just a bikeshed.

"Wait, this code is hard to understand and requires deep domain knowledge. Better nitpick the code style instead. Also, bikesheds should clearly be orange. Green is way too fishy."

Re:TinySSH is a small SSH server using NaCl, TweetNaCl by Nursie on Sunday May 11, 2014 @04:19PM (#7729834)
I have domain knowledge and I've read a lot of code in my time. The style in use there is peculiar. That doesn't mean it is malicious or incorrect but it might make it easier to hide if it was.

Sorry you don't see that.

Re:TinySSH is a small SSH server using NaCl, TweetNaCl by edwintorok on Sunday May 11, 2014 @09:04AM (#7728599)
stdint.h is C99 and while I'd love to believe that every C compiler is C99 capable by now, I don't know if that is actually the case. Does stdint.h exist on Win32 these days?
Re:TinySSH is a small SSH server using NaCl, TweetNaCl by Nursie on Sunday May 11, 2014 @09:31AM (#7728657)
Microsoft's poor support for standard C is no excuse not to use these types everywhere else and either define them yourself on windows or get stdint from boost, from one of the stdint.h replacements or <cstdint> from MSVC 2012.

IMHO, of course.

Re:TinySSH is a small SSH server using NaCl, TweetNaCl by friendlypedant on Sunday May 11, 2014 @03:46PM (#7729697)
I hate Microsoft as much as the next guy, but FYI, MSVC 2013 supports most of C99.
Re:TinySSH is a small SSH server using NaCl, TweetNaCl by krbbltr on Sunday May 11, 2014 @07:59PM (#7730526)
Maybe by Microsoft's definition of 'most'.

* no variable-length arrays

* no qualifiers in parameter array declarators (`int x[static 10]`, etc.)

* no `restrict` keyword

* no compound literals

* no designated initializers

There's probably more.

On the web you'll find the same quote copy & pasted over and over saying that support for compound literals and designated initializers was supposedly added in VS2013, but it does not appear to be true. Either that, or I haven't found the hidden switch to enable it. By the way, C code still needs to be compiled as C++ to get anything beyond C89 to work, which should give you a clue as to how serious Microsoft is about C99.

What's true though is that stdbool.h was added. It's a start, I guess...

Re:TinySSH is a small SSH server using NaCl, TweetNaCl by Nursie on Sunday May 11, 2014 @04:17PM (#7729826)
That's good to hear, and maybe we can finally move on to more universal use of a 14 year old standard!