|
21 | 21 | #include <linux/sunrpc/xdr.h> |
22 | 22 | #include <linux/sunrpc/gss_krb5_enctypes.h> |
23 | 23 |
|
| 24 | +#include "auth_gss_internal.h" |
| 25 | + |
24 | 26 | #if IS_ENABLED(CONFIG_SUNRPC_DEBUG) |
25 | 27 | # define RPCDBG_FACILITY RPCDBG_AUTH |
26 | 28 | #endif |
@@ -143,35 +145,6 @@ get_gss_krb5_enctype(int etype) |
143 | 145 | return NULL; |
144 | 146 | } |
145 | 147 |
|
146 | | -static const void * |
147 | | -simple_get_bytes(const void *p, const void *end, void *res, int len) |
148 | | -{ |
149 | | - const void *q = (const void *)((const char *)p + len); |
150 | | - if (unlikely(q > end || q < p)) |
151 | | - return ERR_PTR(-EFAULT); |
152 | | - memcpy(res, p, len); |
153 | | - return q; |
154 | | -} |
155 | | - |
156 | | -static const void * |
157 | | -simple_get_netobj(const void *p, const void *end, struct xdr_netobj *res) |
158 | | -{ |
159 | | - const void *q; |
160 | | - unsigned int len; |
161 | | - |
162 | | - p = simple_get_bytes(p, end, &len, sizeof(len)); |
163 | | - if (IS_ERR(p)) |
164 | | - return p; |
165 | | - q = (const void *)((const char *)p + len); |
166 | | - if (unlikely(q > end || q < p)) |
167 | | - return ERR_PTR(-EFAULT); |
168 | | - res->data = kmemdup(p, len, GFP_NOFS); |
169 | | - if (unlikely(res->data == NULL)) |
170 | | - return ERR_PTR(-ENOMEM); |
171 | | - res->len = len; |
172 | | - return q; |
173 | | -} |
174 | | - |
175 | 148 | static inline const void * |
176 | 149 | get_key(const void *p, const void *end, |
177 | 150 | struct krb5_ctx *ctx, struct crypto_sync_skcipher **res) |
|
0 commit comments