@staticmethod
    def parse_request(request):
        if len(request) % 4 == 1:
            # strings of length 1, 5, 9.. has invalid base64 padding, so they
            # must be ascii usernames.
            return request, 0
        binary = ssh.base64url_decode(request)
        if len(binary) < 4:
            return request, 0
        if ord(binary[0]) > 4 or binary[1] != 'q':
            # This code handles version values up to 4. Should give plenty
            # of time to forget all about the unversioned version 0
            return request, 0
        b = ord(binary[2])
        if (b < 0xa1 or b > 0xbf) and b != 0xd9:
            # third byte does not indicate a string longer than 0 and shorter
            # than 256 octets long (According to UTF_8 rfc3629, a unicode
            # char can encode to at most 4 UTF-8 bytes, and username values
            # in crtauth is limited to 64 characters, thus the max number of
            # bytes a username can be is 64 * 4 == 256
            return request, 0
        if b == 0xd9:
            username_start = 4
            username_len = ord(binary[3])
        else:
            username_start = 3
            username_len = ord(binary[2]) & 0x1f

        if len(binary) - username_start < username_len:
            # decoded string is too short
            return request, 0

        return binary[username_start:username_start + username_len], 1
Regression for #12524
dataset/ETHPy150Open spotify/crtauth/crtauth/wsgi.py/CrtauthMiddleware.parse_request--crossover with--dataset/ETHPy150Open AppScale/appscale/AppServer/lib/django-1.3/tests/regressiontests/utils/datetime_safe.py/DatetimeTests.test_zero_padding