All of lore.kernel.org
 help / color / mirror / Atom feed
* Limited usefulness of RSA set key function
@ 2015-08-03  4:16 Marcel Holtmann
  2015-08-03  6:45 ` Stephan Mueller
  0 siblings, 1 reply; 11+ messages in thread
From: Marcel Holtmann @ 2015-08-03  4:16 UTC (permalink / raw)
  To: Tadeusz Struk, Stephan Mueller; +Cc: linux-crypto

Hi Tadeusz,

I have been working with the AF_ALG patches for akcipher lately and I find the RSA set key function way too limited. Especially the fact that it uses a format that I can not find a single reference / standard for worries me.

RsaKey ::= SEQUENCE {
        n INTEGER ({ rsa_get_n }),
        e INTEGER ({ rsa_get_e }),
        d INTEGER ({ rsa_get_d })
}

So where is this format coming from? I can find the RSA Public Key format which is a sequence of n and e. If you have a DER encoded RSA public key, then you can use it to encrypt and verify. So that is okay.

However if you have a standard Public Key that OpenSSL would create by default, then things do not work since that is actually a more complicated DER encoded format. However in the end, I would expect that we could also load such a key here. The RSA set key function should auto detect it and extract the right information if it is marked as rsaEncryption type.

My biggest concern however is that this does not reassemble the RSA Private Key at all. That key format is a sequence of 9 integers starting with a version. So logically I would expect that I can just set a RSA Private Key and then utilize the encrypt and decrypt features of the RSA cipher.

When it comes to exposing RSA via AF_ALG and akcipher, I really want standard format for the set key operation. Asking userspace to construct this Linux kernel only key format is not helpful. You want to be able to just load the RSA Private Key in DER format and be done with it.

Any ideas on how we can fix this to allow a sensible userspace API?

Regards

Marcel

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2015-08-03 18:33 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-08-03  4:16 Limited usefulness of RSA set key function Marcel Holtmann
2015-08-03  6:45 ` Stephan Mueller
2015-08-03  7:14   ` Marcel Holtmann
2015-08-03  7:18     ` Stephan Mueller
2015-08-03  7:30       ` Marcel Holtmann
2015-08-03 17:11         ` Tadeusz Struk
2015-08-03 17:39           ` Marcel Holtmann
2015-08-03 17:52             ` Tadeusz Struk
2015-08-03 18:20               ` Marcel Holtmann
2015-08-03 18:32                 ` Tadeusz Struk
2015-08-03 18:11             ` Marcel Holtmann

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.