Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | /* |
| 2 | * linux/net/sunrpc/gss_krb5_mech.c |
| 3 | * |
Kevin Coffman | 81d4a43 | 2010-03-17 13:02:51 -0400 | [diff] [blame] | 4 | * Copyright (c) 2001-2008 The Regents of the University of Michigan. |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 5 | * All rights reserved. |
| 6 | * |
| 7 | * Andy Adamson <andros@umich.edu> |
| 8 | * J. Bruce Fields <bfields@umich.edu> |
| 9 | * |
| 10 | * Redistribution and use in source and binary forms, with or without |
| 11 | * modification, are permitted provided that the following conditions |
| 12 | * are met: |
| 13 | * |
| 14 | * 1. Redistributions of source code must retain the above copyright |
| 15 | * notice, this list of conditions and the following disclaimer. |
| 16 | * 2. Redistributions in binary form must reproduce the above copyright |
| 17 | * notice, this list of conditions and the following disclaimer in the |
| 18 | * documentation and/or other materials provided with the distribution. |
| 19 | * 3. Neither the name of the University nor the names of its |
| 20 | * contributors may be used to endorse or promote products derived |
| 21 | * from this software without specific prior written permission. |
| 22 | * |
| 23 | * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED |
| 24 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF |
| 25 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
| 26 | * DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE |
| 27 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
| 28 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
| 29 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR |
| 30 | * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF |
| 31 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING |
| 32 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS |
| 33 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 34 | * |
| 35 | */ |
| 36 | |
Herbert Xu | 378c669 | 2006-08-22 20:33:54 +1000 | [diff] [blame] | 37 | #include <linux/err.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 38 | #include <linux/module.h> |
| 39 | #include <linux/init.h> |
| 40 | #include <linux/types.h> |
| 41 | #include <linux/slab.h> |
| 42 | #include <linux/sunrpc/auth.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 43 | #include <linux/sunrpc/gss_krb5.h> |
| 44 | #include <linux/sunrpc/xdr.h> |
| 45 | #include <linux/crypto.h> |
| 46 | |
| 47 | #ifdef RPC_DEBUG |
| 48 | # define RPCDBG_FACILITY RPCDBG_AUTH |
| 49 | #endif |
| 50 | |
Kevin Coffman | 81d4a43 | 2010-03-17 13:02:51 -0400 | [diff] [blame] | 51 | static const struct gss_krb5_enctype supported_gss_krb5_enctypes[] = { |
| 52 | /* |
| 53 | * DES (All DES enctypes are mapped to the same gss functionality) |
| 54 | */ |
| 55 | { |
| 56 | .etype = ENCTYPE_DES_CBC_RAW, |
| 57 | .ctype = CKSUMTYPE_RSA_MD5, |
| 58 | .name = "des-cbc-crc", |
| 59 | .encrypt_name = "cbc(des)", |
| 60 | .cksum_name = "md5", |
| 61 | .encrypt = krb5_encrypt, |
| 62 | .decrypt = krb5_decrypt, |
Kevin Coffman | 4891f2d | 2010-03-17 13:02:53 -0400 | [diff] [blame^] | 63 | .mk_key = NULL, |
Kevin Coffman | 81d4a43 | 2010-03-17 13:02:51 -0400 | [diff] [blame] | 64 | .signalg = SGN_ALG_DES_MAC_MD5, |
| 65 | .sealalg = SEAL_ALG_DES, |
| 66 | .keybytes = 7, |
| 67 | .keylength = 8, |
| 68 | .blocksize = 8, |
| 69 | .cksumlength = 8, |
Kevin Coffman | e1f6c07 | 2010-03-17 13:02:52 -0400 | [diff] [blame] | 70 | .keyed_cksum = 0, |
Kevin Coffman | 81d4a43 | 2010-03-17 13:02:51 -0400 | [diff] [blame] | 71 | }, |
| 72 | }; |
| 73 | |
| 74 | static const int num_supported_enctypes = |
| 75 | ARRAY_SIZE(supported_gss_krb5_enctypes); |
| 76 | |
| 77 | static int |
| 78 | supported_gss_krb5_enctype(int etype) |
| 79 | { |
| 80 | int i; |
| 81 | for (i = 0; i < num_supported_enctypes; i++) |
| 82 | if (supported_gss_krb5_enctypes[i].etype == etype) |
| 83 | return 1; |
| 84 | return 0; |
| 85 | } |
| 86 | |
| 87 | static const struct gss_krb5_enctype * |
| 88 | get_gss_krb5_enctype(int etype) |
| 89 | { |
| 90 | int i; |
| 91 | for (i = 0; i < num_supported_enctypes; i++) |
| 92 | if (supported_gss_krb5_enctypes[i].etype == etype) |
| 93 | return &supported_gss_krb5_enctypes[i]; |
| 94 | return NULL; |
| 95 | } |
| 96 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 97 | static const void * |
| 98 | simple_get_bytes(const void *p, const void *end, void *res, int len) |
| 99 | { |
| 100 | const void *q = (const void *)((const char *)p + len); |
| 101 | if (unlikely(q > end || q < p)) |
| 102 | return ERR_PTR(-EFAULT); |
| 103 | memcpy(res, p, len); |
| 104 | return q; |
| 105 | } |
| 106 | |
| 107 | static const void * |
| 108 | simple_get_netobj(const void *p, const void *end, struct xdr_netobj *res) |
| 109 | { |
| 110 | const void *q; |
| 111 | unsigned int len; |
| 112 | |
| 113 | p = simple_get_bytes(p, end, &len, sizeof(len)); |
| 114 | if (IS_ERR(p)) |
| 115 | return p; |
| 116 | q = (const void *)((const char *)p + len); |
| 117 | if (unlikely(q > end || q < p)) |
| 118 | return ERR_PTR(-EFAULT); |
Trond Myklebust | 0f38b87 | 2008-06-10 18:31:01 -0400 | [diff] [blame] | 119 | res->data = kmemdup(p, len, GFP_NOFS); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 120 | if (unlikely(res->data == NULL)) |
| 121 | return ERR_PTR(-ENOMEM); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 122 | res->len = len; |
| 123 | return q; |
| 124 | } |
| 125 | |
| 126 | static inline const void * |
Kevin Coffman | 81d4a43 | 2010-03-17 13:02:51 -0400 | [diff] [blame] | 127 | get_key(const void *p, const void *end, |
| 128 | struct krb5_ctx *ctx, struct crypto_blkcipher **res) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 129 | { |
| 130 | struct xdr_netobj key; |
Herbert Xu | 378c669 | 2006-08-22 20:33:54 +1000 | [diff] [blame] | 131 | int alg; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 132 | |
| 133 | p = simple_get_bytes(p, end, &alg, sizeof(alg)); |
| 134 | if (IS_ERR(p)) |
| 135 | goto out_err; |
Kevin Coffman | 81d4a43 | 2010-03-17 13:02:51 -0400 | [diff] [blame] | 136 | |
| 137 | switch (alg) { |
| 138 | case ENCTYPE_DES_CBC_CRC: |
| 139 | case ENCTYPE_DES_CBC_MD4: |
| 140 | case ENCTYPE_DES_CBC_MD5: |
| 141 | /* Map all these key types to ENCTYPE_DES_CBC_RAW */ |
| 142 | alg = ENCTYPE_DES_CBC_RAW; |
| 143 | break; |
| 144 | } |
| 145 | |
| 146 | if (!supported_gss_krb5_enctype(alg)) { |
| 147 | printk(KERN_WARNING "gss_kerberos_mech: unsupported " |
| 148 | "encryption key algorithm %d\n", alg); |
| 149 | goto out_err; |
| 150 | } |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 151 | p = simple_get_netobj(p, end, &key); |
| 152 | if (IS_ERR(p)) |
| 153 | goto out_err; |
| 154 | |
Kevin Coffman | 81d4a43 | 2010-03-17 13:02:51 -0400 | [diff] [blame] | 155 | *res = crypto_alloc_blkcipher(ctx->gk5e->encrypt_name, 0, |
| 156 | CRYPTO_ALG_ASYNC); |
Herbert Xu | 378c669 | 2006-08-22 20:33:54 +1000 | [diff] [blame] | 157 | if (IS_ERR(*res)) { |
Kevin Coffman | 81d4a43 | 2010-03-17 13:02:51 -0400 | [diff] [blame] | 158 | printk(KERN_WARNING "gss_kerberos_mech: unable to initialize " |
| 159 | "crypto algorithm %s\n", ctx->gk5e->encrypt_name); |
Herbert Xu | 378c669 | 2006-08-22 20:33:54 +1000 | [diff] [blame] | 160 | *res = NULL; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 161 | goto out_err_free_key; |
J. Bruce Fields | 9e56904 | 2006-01-03 09:56:01 +0100 | [diff] [blame] | 162 | } |
Herbert Xu | 378c669 | 2006-08-22 20:33:54 +1000 | [diff] [blame] | 163 | if (crypto_blkcipher_setkey(*res, key.data, key.len)) { |
Kevin Coffman | 81d4a43 | 2010-03-17 13:02:51 -0400 | [diff] [blame] | 164 | printk(KERN_WARNING "gss_kerberos_mech: error setting key for " |
| 165 | "crypto algorithm %s\n", ctx->gk5e->encrypt_name); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 166 | goto out_err_free_tfm; |
J. Bruce Fields | 9e56904 | 2006-01-03 09:56:01 +0100 | [diff] [blame] | 167 | } |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 168 | |
| 169 | kfree(key.data); |
| 170 | return p; |
| 171 | |
| 172 | out_err_free_tfm: |
Herbert Xu | 378c669 | 2006-08-22 20:33:54 +1000 | [diff] [blame] | 173 | crypto_free_blkcipher(*res); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 174 | out_err_free_key: |
| 175 | kfree(key.data); |
| 176 | p = ERR_PTR(-EINVAL); |
| 177 | out_err: |
| 178 | return p; |
| 179 | } |
| 180 | |
| 181 | static int |
Kevin Coffman | a8cc1cb | 2010-03-17 13:02:50 -0400 | [diff] [blame] | 182 | gss_import_v1_context(const void *p, const void *end, struct krb5_ctx *ctx) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 183 | { |
J. Bruce Fields | e678e06 | 2006-12-04 20:22:35 -0500 | [diff] [blame] | 184 | int tmp; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 185 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 186 | p = simple_get_bytes(p, end, &ctx->initiate, sizeof(ctx->initiate)); |
| 187 | if (IS_ERR(p)) |
Kevin Coffman | a8cc1cb | 2010-03-17 13:02:50 -0400 | [diff] [blame] | 188 | goto out_err; |
| 189 | |
| 190 | /* Old format supports only DES! Any other enctype uses new format */ |
Kevin Coffman | 1ac3719 | 2010-03-17 13:02:49 -0400 | [diff] [blame] | 191 | ctx->enctype = ENCTYPE_DES_CBC_RAW; |
Kevin Coffman | a8cc1cb | 2010-03-17 13:02:50 -0400 | [diff] [blame] | 192 | |
Kevin Coffman | 81d4a43 | 2010-03-17 13:02:51 -0400 | [diff] [blame] | 193 | ctx->gk5e = get_gss_krb5_enctype(ctx->enctype); |
| 194 | if (ctx->gk5e == NULL) |
| 195 | goto out_err; |
| 196 | |
J. Bruce Fields | 717757a | 2006-12-04 20:22:41 -0500 | [diff] [blame] | 197 | /* The downcall format was designed before we completely understood |
| 198 | * the uses of the context fields; so it includes some stuff we |
| 199 | * just give some minimal sanity-checking, and some we ignore |
| 200 | * completely (like the next twenty bytes): */ |
| 201 | if (unlikely(p + 20 > end || p + 20 < p)) |
Kevin Coffman | a8cc1cb | 2010-03-17 13:02:50 -0400 | [diff] [blame] | 202 | goto out_err; |
J. Bruce Fields | 717757a | 2006-12-04 20:22:41 -0500 | [diff] [blame] | 203 | p += 20; |
J. Bruce Fields | e678e06 | 2006-12-04 20:22:35 -0500 | [diff] [blame] | 204 | p = simple_get_bytes(p, end, &tmp, sizeof(tmp)); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 205 | if (IS_ERR(p)) |
Kevin Coffman | a8cc1cb | 2010-03-17 13:02:50 -0400 | [diff] [blame] | 206 | goto out_err; |
Kevin Coffman | ef338be | 2007-11-09 18:42:09 -0500 | [diff] [blame] | 207 | if (tmp != SGN_ALG_DES_MAC_MD5) { |
| 208 | p = ERR_PTR(-ENOSYS); |
Kevin Coffman | a8cc1cb | 2010-03-17 13:02:50 -0400 | [diff] [blame] | 209 | goto out_err; |
Kevin Coffman | ef338be | 2007-11-09 18:42:09 -0500 | [diff] [blame] | 210 | } |
J. Bruce Fields | d922a84 | 2006-12-04 20:22:40 -0500 | [diff] [blame] | 211 | p = simple_get_bytes(p, end, &tmp, sizeof(tmp)); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 212 | if (IS_ERR(p)) |
Kevin Coffman | a8cc1cb | 2010-03-17 13:02:50 -0400 | [diff] [blame] | 213 | goto out_err; |
Kevin Coffman | ef338be | 2007-11-09 18:42:09 -0500 | [diff] [blame] | 214 | if (tmp != SEAL_ALG_DES) { |
| 215 | p = ERR_PTR(-ENOSYS); |
Kevin Coffman | a8cc1cb | 2010-03-17 13:02:50 -0400 | [diff] [blame] | 216 | goto out_err; |
Kevin Coffman | ef338be | 2007-11-09 18:42:09 -0500 | [diff] [blame] | 217 | } |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 218 | p = simple_get_bytes(p, end, &ctx->endtime, sizeof(ctx->endtime)); |
| 219 | if (IS_ERR(p)) |
Kevin Coffman | a8cc1cb | 2010-03-17 13:02:50 -0400 | [diff] [blame] | 220 | goto out_err; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 221 | p = simple_get_bytes(p, end, &ctx->seq_send, sizeof(ctx->seq_send)); |
| 222 | if (IS_ERR(p)) |
Kevin Coffman | a8cc1cb | 2010-03-17 13:02:50 -0400 | [diff] [blame] | 223 | goto out_err; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 224 | p = simple_get_netobj(p, end, &ctx->mech_used); |
| 225 | if (IS_ERR(p)) |
Kevin Coffman | a8cc1cb | 2010-03-17 13:02:50 -0400 | [diff] [blame] | 226 | goto out_err; |
Kevin Coffman | 81d4a43 | 2010-03-17 13:02:51 -0400 | [diff] [blame] | 227 | p = get_key(p, end, ctx, &ctx->enc); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 228 | if (IS_ERR(p)) |
| 229 | goto out_err_free_mech; |
Kevin Coffman | 81d4a43 | 2010-03-17 13:02:51 -0400 | [diff] [blame] | 230 | p = get_key(p, end, ctx, &ctx->seq); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 231 | if (IS_ERR(p)) |
| 232 | goto out_err_free_key1; |
| 233 | if (p != end) { |
| 234 | p = ERR_PTR(-EFAULT); |
| 235 | goto out_err_free_key2; |
| 236 | } |
| 237 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 238 | return 0; |
| 239 | |
| 240 | out_err_free_key2: |
Herbert Xu | 378c669 | 2006-08-22 20:33:54 +1000 | [diff] [blame] | 241 | crypto_free_blkcipher(ctx->seq); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 242 | out_err_free_key1: |
Herbert Xu | 378c669 | 2006-08-22 20:33:54 +1000 | [diff] [blame] | 243 | crypto_free_blkcipher(ctx->enc); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 244 | out_err_free_mech: |
| 245 | kfree(ctx->mech_used.data); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 246 | out_err: |
| 247 | return PTR_ERR(p); |
| 248 | } |
| 249 | |
Kevin Coffman | a8cc1cb | 2010-03-17 13:02:50 -0400 | [diff] [blame] | 250 | static int |
| 251 | gss_import_sec_context_kerberos(const void *p, size_t len, |
| 252 | struct gss_ctx *ctx_id) |
| 253 | { |
| 254 | const void *end = (const void *)((const char *)p + len); |
| 255 | struct krb5_ctx *ctx; |
| 256 | int ret; |
| 257 | |
| 258 | ctx = kzalloc(sizeof(*ctx), GFP_KERNEL); |
| 259 | if (ctx == NULL) |
| 260 | return -ENOMEM; |
| 261 | |
| 262 | if (len == 85) |
| 263 | ret = gss_import_v1_context(p, end, ctx); |
| 264 | else |
| 265 | ret = -EINVAL; |
| 266 | |
| 267 | if (ret == 0) |
| 268 | ctx_id->internal_ctx_id = ctx; |
| 269 | else |
| 270 | kfree(ctx); |
| 271 | |
| 272 | dprintk("RPC: %s: returning %d\n", __func__, ret); |
| 273 | return ret; |
| 274 | } |
| 275 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 276 | static void |
| 277 | gss_delete_sec_context_kerberos(void *internal_ctx) { |
| 278 | struct krb5_ctx *kctx = internal_ctx; |
| 279 | |
Herbert Xu | 378c669 | 2006-08-22 20:33:54 +1000 | [diff] [blame] | 280 | crypto_free_blkcipher(kctx->seq); |
| 281 | crypto_free_blkcipher(kctx->enc); |
Jesper Juhl | 573dbd9 | 2005-09-01 17:44:29 -0700 | [diff] [blame] | 282 | kfree(kctx->mech_used.data); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 283 | kfree(kctx); |
| 284 | } |
| 285 | |
Trond Myklebust | f1c0a86 | 2007-06-23 20:17:58 -0400 | [diff] [blame] | 286 | static const struct gss_api_ops gss_kerberos_ops = { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 287 | .gss_import_sec_context = gss_import_sec_context_kerberos, |
| 288 | .gss_get_mic = gss_get_mic_kerberos, |
| 289 | .gss_verify_mic = gss_verify_mic_kerberos, |
J. Bruce Fields | 14ae162 | 2005-10-13 16:55:13 -0400 | [diff] [blame] | 290 | .gss_wrap = gss_wrap_kerberos, |
| 291 | .gss_unwrap = gss_unwrap_kerberos, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 292 | .gss_delete_sec_context = gss_delete_sec_context_kerberos, |
| 293 | }; |
| 294 | |
| 295 | static struct pf_desc gss_kerberos_pfs[] = { |
| 296 | [0] = { |
| 297 | .pseudoflavor = RPC_AUTH_GSS_KRB5, |
| 298 | .service = RPC_GSS_SVC_NONE, |
| 299 | .name = "krb5", |
| 300 | }, |
| 301 | [1] = { |
| 302 | .pseudoflavor = RPC_AUTH_GSS_KRB5I, |
| 303 | .service = RPC_GSS_SVC_INTEGRITY, |
| 304 | .name = "krb5i", |
| 305 | }, |
J. Bruce Fields | 14ae162 | 2005-10-13 16:55:13 -0400 | [diff] [blame] | 306 | [2] = { |
| 307 | .pseudoflavor = RPC_AUTH_GSS_KRB5P, |
| 308 | .service = RPC_GSS_SVC_PRIVACY, |
| 309 | .name = "krb5p", |
| 310 | }, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 311 | }; |
| 312 | |
| 313 | static struct gss_api_mech gss_kerberos_mech = { |
| 314 | .gm_name = "krb5", |
| 315 | .gm_owner = THIS_MODULE, |
Usha Ketineni | ae4c40b | 2007-07-17 04:04:50 -0700 | [diff] [blame] | 316 | .gm_oid = {9, (void *)"\x2a\x86\x48\x86\xf7\x12\x01\x02\x02"}, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 317 | .gm_ops = &gss_kerberos_ops, |
| 318 | .gm_pf_num = ARRAY_SIZE(gss_kerberos_pfs), |
| 319 | .gm_pfs = gss_kerberos_pfs, |
| 320 | }; |
| 321 | |
| 322 | static int __init init_kerberos_module(void) |
| 323 | { |
| 324 | int status; |
| 325 | |
| 326 | status = gss_mech_register(&gss_kerberos_mech); |
| 327 | if (status) |
| 328 | printk("Failed to register kerberos gss mechanism!\n"); |
| 329 | return status; |
| 330 | } |
| 331 | |
| 332 | static void __exit cleanup_kerberos_module(void) |
| 333 | { |
| 334 | gss_mech_unregister(&gss_kerberos_mech); |
| 335 | } |
| 336 | |
| 337 | MODULE_LICENSE("GPL"); |
| 338 | module_init(init_kerberos_module); |
| 339 | module_exit(cleanup_kerberos_module); |