22 #include <linux/list.h>
23 #include <linux/slab.h>
24 #include <linux/string.h>
34 cifs_spnego_key_instantiate(
struct key *
key,
struct key_preparsed_payload *prep)
45 memcpy(payload, prep->data, prep->datalen);
54 cifs_spnego_key_destroy(
struct key *key)
56 kfree(key->payload.data);
64 .name =
"cifs.spnego",
65 .instantiate = cifs_spnego_key_instantiate,
67 .destroy = cifs_spnego_key_destroy,
72 #define MAX_VER_STR_LEN 8
76 #define MAX_MECH_STR_LEN 13
79 #define HOST_KEY_LEN 5
88 #define CREDUID_KEY_LEN 11
91 #define USER_KEY_LEN 6
105 struct key *spnego_key;
106 const char *hostname = server->
hostname;
121 spnego_key = ERR_PTR(-
ENOMEM);
123 if (description ==
NULL)
128 spnego_key = ERR_PTR(-
EINVAL);
131 dp = description +
strlen(description);
137 sprintf(dp,
"ip6=%pI6", &sa6->sin6_addr);
141 dp = description +
strlen(description);
151 dp = description +
strlen(description);
154 dp = description +
strlen(description);
158 dp = description +
strlen(description);
162 dp = description +
strlen(description);
165 cFYI(1,
"key description = %s", description);
166 spnego_key =
request_key(&cifs_spnego_key_type, description,
"");
168 #ifdef CONFIG_CIFS_DEBUG2
169 if (
cifsFYI && !IS_ERR(spnego_key)) {