lkml.org 
[lkml]   [2014]   [Nov]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
SubjectRe: [Keyrings] [PATCH 2/5] X.509: Support X.509 lookup by Issuer+Serial form AuthorityKeyIdentifier
From
Date
Previous post was mangled.  Reposting ...
---

Don't assume that the issuer & serialNumber are specified.

Signed-off-by: Mimi Zohar <zohar@linux.vnet.ibm.com>
---
crypto/asymmetric_keys/x509_public_key.c | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/crypto/asymmetric_keys/x509_public_key.c b/crypto/asymmetric_keys/x509_public_key.c
index 9c1a3d6..510269f 100644
--- a/crypto/asymmetric_keys/x509_public_key.c
+++ b/crypto/asymmetric_keys/x509_public_key.c
@@ -9,6 +9,7 @@
* 2 of the Licence, or (at your option) any later version.
*/

+#define DEBUG 1
#define pr_fmt(fmt) "X.509: "fmt
#include <linux/module.h>
#include <linux/kernel.h>
@@ -68,12 +69,14 @@ struct key *x509_request_asymmetric_key(struct key *keyring,
{
struct key *key;
key_ref_t ref;
- const char *lookup;
+ const char *lookup = NULL;
char *req, *p;
- int len;
+ int len = 0;

- lookup = id->data;
- len = id->len;
+ if (id) {
+ lookup = id->data;
+ len = id->len;
+ }
if (!lookup) {
lookup = skid->data;
len = skid->len;
--
1.8.1.4




\
 
 \ /
  Last update: 2014-11-24 13:41    [W:0.095 / U:0.444 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site