Bug 1853 - sshd doesn't seem to be able to auth a user using an rsa key of 20000 bit
Summary: sshd doesn't seem to be able to auth a user using an rsa key of 20000 bit
Status: CLOSED INVALID
Alias: None
Product: Portable OpenSSH
Classification: Unclassified
Component: sshd (show other bugs)
Version: 5.7p1
Hardware: All All
: P2 normal
Assignee: Assigned to nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-02-05 00:28 AEDT by daveb
Modified: 2011-09-06 15:32 AEST (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description daveb 2011-02-05 00:28:11 AEDT
sshd doesn't seem to be able to auth a user using an rsa key of 20000 bit.

1. I generated an ssh rsa key like this:
    ssh-keygen  -t rsa -b 20000

2. I placed the public key into another users authorized_keys file

3. I tried to ssh that user.

What happens: 
   4. "Feb  4 23:35:50 ABOX sshd[17138]: error: RSA_public_decrypt failed: error:04067069:lib(4):func(103):reason(105)"

What should happen:
   4. Accepted publickey for .... 



------
Use cases:
1. having an ssh key over 9000. "00:18 < Kenny> Yes, so will I, for security-measures based on DragonBall Z memes. ;)"
Comment 1 Tomas Mraz 2011-02-05 04:38:37 AEDT
This is not blocked in ssh but in OpenSSL. RSA keys larger than 16384 bits are disallowed in it because of potential CPU resource overusage (effective DoS) on servers.
Comment 2 daveb 2011-02-05 11:44:44 AEDT
(In reply to comment #1)
> This is not blocked in ssh but in OpenSSL. RSA keys larger than 16384
> bits are disallowed in it because of potential CPU resource overusage
> (effective DoS) on servers.

Oh ok that's interesting. I didn't know that. I couldn't find a size
limitation anywhere (other than ssh-keygen when generating a cert).
Comment 3 Darren Tucker 2011-02-06 13:50:53 AEDT
The limitation is in OpenSSL's rsa.h (probably /usr/include/openssl/rsa.h or similar):

$ grep "define.*RSA_MAX" /usr/include/openssl/rsa.h 
# define OPENSSL_RSA_MAX_MODULUS_BITS	16384
# define OPENSSL_RSA_MAX_PUBEXP_BITS	64 /* exponent limit enforced for "large" modulus only */

If you want bigger keys, you'll need to change that and recompile OpenSSL then rebuild OpenSSH against it.
Comment 4 Damien Miller 2011-09-06 15:32:46 AEST
close resolved bugs now that openssh-5.9 has been released