Re: [RFC PATCH 1/4] X.509: Parse public key parameters from x509 for akcipher

2019-03-01 Thread Vitaly Chikunov
Herbert, On Thu, Feb 28, 2019 at 06:37:15PM +0800, Herbert Xu wrote: > On Thu, Feb 28, 2019 at 01:33:37PM +0300, Vitaly Chikunov wrote: > > > > To make the same for set_{pub,priv}_key it will require patching RSA > > drivers anyway, since length of the key is stored just once as keylen > > argumen

Re: [RFC PATCH 1/4] X.509: Parse public key parameters from x509 for akcipher

2019-02-28 Thread Herbert Xu
On Thu, Feb 28, 2019 at 01:33:37PM +0300, Vitaly Chikunov wrote: > > To make the same for set_{pub,priv}_key it will require patching RSA > drivers anyway, since length of the key is stored just once as keylen > argument. No we don't need to use the same format for different algorithms. RSA should

Re: [RFC PATCH 1/4] X.509: Parse public key parameters from x509 for akcipher

2019-02-28 Thread Vitaly Chikunov
On Thu, Feb 28, 2019 at 05:01:25PM +0800, Herbert Xu wrote: > On Thu, Feb 28, 2019 at 11:28:01AM +0300, Vitaly Chikunov wrote: > > On Thu, Feb 28, 2019 at 03:51:41PM +0800, Herbert Xu wrote: > > > On Thu, Feb 28, 2019 at 10:04:49AM +0300, Vitaly Chikunov wrote: > > > > > > > > It seems that you in

Re: [RFC PATCH 1/4] X.509: Parse public key parameters from x509 for akcipher

2019-02-28 Thread Herbert Xu
On Thu, Feb 28, 2019 at 11:28:01AM +0300, Vitaly Chikunov wrote: > On Thu, Feb 28, 2019 at 03:51:41PM +0800, Herbert Xu wrote: > > On Thu, Feb 28, 2019 at 10:04:49AM +0300, Vitaly Chikunov wrote: > > > > > > It seems that you insist on set_params to be removed and both key and > > > params to be p

Re: [RFC PATCH 1/4] X.509: Parse public key parameters from x509 for akcipher

2019-02-28 Thread Vitaly Chikunov
On Thu, Feb 28, 2019 at 03:51:41PM +0800, Herbert Xu wrote: > On Thu, Feb 28, 2019 at 10:04:49AM +0300, Vitaly Chikunov wrote: > > > > It seems that you insist on set_params to be removed and both key and > > params to be passed into set_{pub,priv}_key. This means reworking all > > existing RSA dr

Re: [RFC PATCH 1/4] X.509: Parse public key parameters from x509 for akcipher

2019-02-27 Thread Herbert Xu
On Thu, Feb 28, 2019 at 10:04:49AM +0300, Vitaly Chikunov wrote: > > It seems that you insist on set_params to be removed and both key and > params to be passed into set_{pub,priv}_key. This means reworking all > existing RSA drivers and callers, right? Can you please confirm that > huge rework to

Re: [RFC PATCH 1/4] X.509: Parse public key parameters from x509 for akcipher

2019-02-27 Thread Vitaly Chikunov
On Thu, Feb 28, 2019 at 10:04:49AM +0300, Vitaly Chikunov wrote: > Herbert, > > On Thu, Feb 28, 2019 at 02:14:44PM +0800, Herbert Xu wrote: > > On Sun, Feb 24, 2019 at 09:48:40AM +0300, Vitaly Chikunov wrote: > > > > > > If we pass SubjectPublicKeyInfo into set_pub_key itself (making > > > set_pa

Re: [RFC PATCH 1/4] X.509: Parse public key parameters from x509 for akcipher

2019-02-27 Thread Vitaly Chikunov
Herbert, On Thu, Feb 28, 2019 at 02:14:44PM +0800, Herbert Xu wrote: > On Sun, Feb 24, 2019 at 09:48:40AM +0300, Vitaly Chikunov wrote: > > > > If we pass SubjectPublicKeyInfo into set_pub_key itself (making > > set_params not needed) we will break ABI and compatibility with RSA > > drivers, beca

Re: [RFC PATCH 1/4] X.509: Parse public key parameters from x509 for akcipher

2019-02-27 Thread Herbert Xu
On Sun, Feb 24, 2019 at 09:48:40AM +0300, Vitaly Chikunov wrote: > > If we pass SubjectPublicKeyInfo into set_pub_key itself (making > set_params not needed) we will break ABI and compatibility with RSA > drivers, because whole SubjectPublicKeyInfo is not expected by the This compatibility does n

Re: [RFC PATCH 1/4] X.509: Parse public key parameters from x509 for akcipher

2019-02-23 Thread Vitaly Chikunov
Herbert, On Tue, Feb 19, 2019 at 12:37:32PM +0800, Herbert Xu wrote: > On Sun, Feb 10, 2019 at 09:46:28PM +0300, Vitaly Chikunov wrote: > > > > >From the other point of view, set_params may never be called or > > implemented. So, making it called first and move memory zeroing > > into set_params m

Re: [RFC PATCH 1/4] X.509: Parse public key parameters from x509 for akcipher

2019-02-18 Thread Herbert Xu
On Sun, Feb 10, 2019 at 09:46:28PM +0300, Vitaly Chikunov wrote: > > >From the other point of view, set_params may never be called or > implemented. So, making it called first and move memory zeroing > into set_params may create more complications than simplicity. > > Making both callbacks callabl

Re: [RFC PATCH 1/4] X.509: Parse public key parameters from x509 for akcipher

2019-02-10 Thread Vitaly Chikunov
On Sun, Feb 10, 2019 at 12:42:40AM +0300, Vitaly Chikunov wrote: > On Sun, Jan 06, 2019 at 04:36:05PM +0300, Vitaly Chikunov wrote: > > Some public key algorithms (like ECDSA) keep in parameters field > > important data such as digest and curve OIDs (possibly more for > > different ECDSA variants).

Re: [RFC PATCH 1/4] X.509: Parse public key parameters from x509 for akcipher

2019-02-09 Thread Vitaly Chikunov
On Sun, Jan 06, 2019 at 04:36:05PM +0300, Vitaly Chikunov wrote: > Some public key algorithms (like ECDSA) keep in parameters field > important data such as digest and curve OIDs (possibly more for > different ECDSA variants). Thus, just setting a public key (as > for RSA) is not enough. > > Intro

[RFC PATCH 1/4] X.509: Parse public key parameters from x509 for akcipher

2019-01-06 Thread Vitaly Chikunov
Some public key algorithms (like ECDSA) keep in parameters field important data such as digest and curve OIDs (possibly more for different ECDSA variants). Thus, just setting a public key (as for RSA) is not enough. Introduce set_params() callback for akcipher which will be used to pass DER encode