]> git.tuebingen.mpg.de Git - paraslash.git/commit
Add support for ssh-rsa keys.
authorAndre Noll <maan@systemlinux.org>
Thu, 25 Nov 2010 07:33:20 +0000 (08:33 +0100)
committerAndre Noll <maan@systemlinux.org>
Tue, 26 Apr 2011 20:34:22 +0000 (22:34 +0200)
commit6c23fdee5292a8bf55dc963cfc3d0711b0f7424b
tree91efa0ca5b005def898c8999fa11c96065abf1c6
parent8acdfc3d6d124581d0b624e61e0047f576eb4748
Add support for ssh-rsa keys.

This allows to use standard ssh keys (that is, keys generated with
ssh-keygen) for the challenge/response authentication method of
paraslash. Only RSA keys without password protection are supported
at the moment.

Since we want that both openssl and ssh keys just work, we introduce
the helper function is_ssh_rsa_key(). It looks at the first few bytes
of the key to decide which type of public key we have. For openssl
keys, we just call openssl's EVP_PKEY_get1_RSA() and be done. Private
keys generated by ssh-keygen do not differ from keys generated by
"openssl rsa" and need no special treatment either.

However, public ssh rsa keys are stored differently, as an uuencoded
byte stream. So this patch adds functions that decode a given buffer
via base64 or uudecode. The two rsa public parameters (modulus and
exponent) are then read from the decoded buffer using BN_bin2bn().
crypt.c
error.h