randombit/botan

Support ssh-rsa public key format (RFC 4253)

Open

#2602 aperta il 23 gen 2021

Vedi su GitHub
 (2 commenti) (1 reazione) (0 assegnatari)C++ (654 fork)auto 404
enhancementhelp wanted

Metriche repository

Star
 (3283 star)
Metriche merge PR
 (Metriche PR in attesa)

Descrizione

Currently the RSA class only supports the PKCS#1 (RFC 3447) standard. This is perfect for almost all cases except for when interfacing with SSH. RFC 4253 reverses the two public key parameters which makes using Botan with SSH keys impossible (without extensive workarounds).

This could be solved in a couple ways:

  1. Create a special SSHRSA_PublicKey class that extends the RSA_PublicKey classes. Invert the n and e reading and writing as necessary, including the fingerprint.
  2. Add provisions to the existing RSA_PublicKey class to handle an algorithm identifier of "ssh-rsa" differently than "rsa".
  3. Create stand-alone helper functions that use existing RSA_PublicKey but ensure the n and e are read/wrote in the correct order.

I am willing to do the legwork to make this possible, which is preferred by @randombit?

Guida contributor