Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1367379
| From | David Howells <dhowells@redhat.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH v3 7/7] crypto: AF_ALG - add support for key_id |
| Date | 2016-03-30 18:40 +0200 |
| Message-ID | <rirjY-87s-3@gated-at.bofh.it> (permalink) |
| References | <ricNX-6eI-1@gated-at.bofh.it> <ricNX-6eI-3@gated-at.bofh.it> <ricNX-6eI-1@gated-at.bofh.it> |
| Organization | Red Hat UK Ltd. Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SI4 1TE, United Kingdom. Registered in England and Wales under Company Registration No. 3798903 |
Tadeusz Struk <tadeusz.struk@intel.com> wrote: > + keyring = request_key(&key_type_asymmetric, key_name, NULL); > + > + err = -ENOKEY; > + if (IS_ERR(keyring)) > + goto out; > + > + pkey = keyring->payload.data[asym_crypto]; NAK. This is liable to crash in future. You may not assume that you know what keyring->payload.data[asym_crypto] points to. You may not use struct public_key outside of crypto/asymmetric_key/. It's the internal data of the software subtype. I'll move it out of the global header to remove the temptation;-). You must use accessor functions such as verify_signature(). Feel free to add further accessor functions such as query_asym_capabilities(), create_signature(), encrypt_blob() and decrypt_blob() or something like that. David
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH v3 7/7] crypto: AF_ALG - add support for key_id Tadeusz Struk <tadeusz.struk@intel.com> - 2016-03-30 03:10 +0200
Re: [PATCH v3 7/7] crypto: AF_ALG - add support for key_id kbuild test robot <lkp@intel.com> - 2016-03-30 04:00 +0200
Re: [PATCH v3 7/7] crypto: AF_ALG - add support for key_id Tadeusz Struk <tadeusz.struk@intel.com> - 2016-03-30 05:00 +0200
Re: [PATCH v3 7/7] crypto: AF_ALG - add support for key_id kbuild test robot <lkp@intel.com> - 2016-03-30 04:30 +0200
Re: [PATCH v3 7/7] crypto: AF_ALG - add support for key_id David Howells <dhowells@redhat.com> - 2016-03-30 18:40 +0200
Re: [PATCH v3 7/7] crypto: AF_ALG - add support for key_id "David Woodhouse" <dwmw2@infradead.org> - 2016-03-30 18:50 +0200
Re: [PATCH v3 7/7] crypto: AF_ALG - add support for key_id "David Woodhouse" <dwmw2@infradead.org> - 2016-03-30 18:50 +0200
Re: [PATCH v3 7/7] crypto: AF_ALG - add support for key_id Tadeusz Struk <tadeusz.struk@intel.com> - 2016-03-30 19:30 +0200
csiph-web