A username cannot currently be longer than 128 characters as that is the size of the "username" field in struct logininfo. Under some circumstances this is not enough though. In our specific case, we log in using the common name from a certificate, which often surpasses 128 characters. Logging in using common names from an LDAP tree is another case where username can easily get very long. In a perfect world, the server could cope with any length, but at the very least the length should be extended. 256 bytes covers the cases we've seen, but 512 bytes might be prudent. Memory usage should not be an issue in these ranges.
Created attachment 1873 [details] /home/djm/sshd-loginrec-namelen-crank.diff crank name length to 512
patch applied - this will be in OpenSSH-5.6
Move resolved bugs to CLOSED after 5.7 release