Re: Limited usefulness of RSA set key function

2015-08-03 Thread Stephan Mueller
Am Montag, 3. August 2015, 00:14:28 schrieb Marcel Holtmann: Hi Marcel, It does not. The RSA Private Key has a different format. RSAPrivateKey ::= SEQUENCE { version Version, modulus INTEGER, -- n publicExponentINTEGER, -- e

Re: Limited usefulness of RSA set key function

2015-08-03 Thread Marcel Holtmann
Hi Stephan, It does not. The RSA Private Key has a different format. RSAPrivateKey ::= SEQUENCE { version Version, modulus INTEGER, -- n publicExponentINTEGER, -- e privateExponent INTEGER, -- d prime1

Re: Limited usefulness of RSA set key function

2015-08-03 Thread Stephan Mueller
Am Sonntag, 2. August 2015, 21:16:47 schrieb Marcel Holtmann: Hi Marcel, 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

Re: Limited usefulness of RSA set key function

2015-08-03 Thread Marcel Holtmann
Hi Stephan, 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

Re: Limited usefulness of RSA set key function

2015-08-03 Thread Tadeusz Struk
On 08/03/2015 10:39 AM, Marcel Holtmann wrote: I already have patches for that actually. The question is just which approach to take? My current proposal is to separate the current crypto_akcipher_setkey into two functions. Use the crypto_akcipher_setkey for loading combined private and

Re: Limited usefulness of RSA set key function

2015-08-03 Thread Marcel Holtmann
Hi Tadeusz, I already have patches for that actually. The question is just which approach to take? My current proposal is to separate the current crypto_akcipher_setkey into two functions. Use the crypto_akcipher_setkey for loading combined private and public key formats and

Re: Limited usefulness of RSA set key function

2015-08-03 Thread Tadeusz Struk
On 08/03/2015 11:20 AM, Marcel Holtmann wrote: actually I think this reasoning needs to be revisited. When I look at this, this makes no sense whatsoever. The end result is that we have keys in multiple formats in the kernel and have to convert between them or parse them again. If you do

Re: Limited usefulness of RSA set key function

2015-08-03 Thread Tadeusz Struk
Hi Marcel, On 08/03/2015 12:30 AM, Marcel Holtmann wrote: as you can clearly see. There are two formats defined here. There is no single ASN.1 structure that can decode both of these. It is what it is, RSA Public Key and RSA Private Key formats are two different key formats. And OpenSSL

Re: Limited usefulness of RSA set key function

2015-08-03 Thread Marcel Holtmann
Hi Tadeusz, as you can clearly see. There are two formats defined here. There is no single ASN.1 structure that can decode both of these. It is what it is, RSA Public Key and RSA Private Key formats are two different key formats. And OpenSSL also treats it like this. You can extract the

Re: Limited usefulness of RSA set key function

2015-08-03 Thread Marcel Holtmann
Hi Tadeusz, as you can clearly see. There are two formats defined here. There is no single ASN.1 structure that can decode both of these. It is what it is, RSA Public Key and RSA Private Key formats are two different key formats. And OpenSSL also treats it like this. You can extract the

Limited usefulness of RSA set key function

2015-08-02 Thread Marcel Holtmann
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 }),