On 21/04/14 09:21, Kurt Roeckx wrote: > OpenBSD also replaced RC4 with ChaCha20, while Linux probably still > uses RC4. We should stop using RC4.
I figured OpenSSH must be already using arc4random, and sure enough it seems to bundle an implementation of ChaCha already: http://sources.debian.net/src/openssh/1:6.6p1-3/openbsd-compat/arc4random.c?hl=192#L192 There's an strlcpy implementation there too: http://sources.debian.net/src/openssh/1:6.5p1-6/openbsd-compat/strlcpy.c?hl=33#L33 The description of OpenSSL's PRNG[0] sounds similar to what /dev/random on FreeBSD already provides with Yarrow, and the kernel has access to more potential sources of entropy than userland, including hardware entropy generators (instead of OpenSSL engines having to reimplement support for those). [0]: https://www.openssl.org/docs/crypto/rand.html > So this might be a good thing on OpenBSD, but it's not a good > thing for something that needs to be portable. I'd say the code still looks quite 'portable' in that it is ANSI C and isn't using kernel-specific features. arc4random is just a library routine from their libc and I see no reason it can't be borrowed. OTOH some OpenSSL code tries to be 'portable' - but in really bad ways - trying to implement its own snprintf, bzero, malloc/free, etc., still having workarounds for bugs in ancient/obscure compilers (Visual C++ 5.0, Cray T3E), going out of its way to support big endian x86 and x86_64 systems that don't exist... Regards, -- Steven Chamberlain ste...@pyro.eu.org -- To UNSUBSCRIBE, email to debian-devel-requ...@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org Archive: https://lists.debian.org/53555b57.9090...@pyro.eu.org