diff options
| author | Kevin Coffman <kwc@citi.umich.edu> | 2010-03-17 13:02:51 -0400 |
|---|---|---|
| committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2010-05-14 15:09:16 -0400 |
| commit | 81d4a4333a1dfd6070f046265d928bb4c79aff88 (patch) | |
| tree | 652fce6cd75be7388f0cd5c45aec653814710791 /include/linux | |
| parent | a8cc1cb7d7a12b0e2855832d10cfbfaffebfad6c (diff) | |
gss_krb5: introduce encryption type framework
Add enctype framework and change functions to use the generic
values from it rather than the values hard-coded for des.
Signed-off-by: Kevin Coffman <kwc@citi.umich.edu>
Signed-off-by: Steve Dickson <steved@redhat.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/sunrpc/gss_krb5.h | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/include/linux/sunrpc/gss_krb5.h b/include/linux/sunrpc/gss_krb5.h index 5378e455482c..f94935599d13 100644 --- a/include/linux/sunrpc/gss_krb5.h +++ b/include/linux/sunrpc/gss_krb5.h | |||
| @@ -4,7 +4,7 @@ | |||
| 4 | * Adapted from MIT Kerberos 5-1.2.1 lib/include/krb5.h, | 4 | * Adapted from MIT Kerberos 5-1.2.1 lib/include/krb5.h, |
| 5 | * lib/gssapi/krb5/gssapiP_krb5.h, and others | 5 | * lib/gssapi/krb5/gssapiP_krb5.h, and others |
| 6 | * | 6 | * |
| 7 | * Copyright (c) 2000 The Regents of the University of Michigan. | 7 | * Copyright (c) 2000-2008 The Regents of the University of Michigan. |
| 8 | * All rights reserved. | 8 | * All rights reserved. |
| 9 | * | 9 | * |
| 10 | * Andy Adamson <andros@umich.edu> | 10 | * Andy Adamson <andros@umich.edu> |
| @@ -36,6 +36,7 @@ | |||
| 36 | * | 36 | * |
| 37 | */ | 37 | */ |
| 38 | 38 | ||
| 39 | #include <linux/crypto.h> | ||
| 39 | #include <linux/sunrpc/auth_gss.h> | 40 | #include <linux/sunrpc/auth_gss.h> |
| 40 | #include <linux/sunrpc/gss_err.h> | 41 | #include <linux/sunrpc/gss_err.h> |
| 41 | #include <linux/sunrpc/gss_asn1.h> | 42 | #include <linux/sunrpc/gss_asn1.h> |
| @@ -46,9 +47,31 @@ | |||
| 46 | /* Maximum blocksize for the supported crypto algorithms */ | 47 | /* Maximum blocksize for the supported crypto algorithms */ |
| 47 | #define GSS_KRB5_MAX_BLOCKSIZE (16) | 48 | #define GSS_KRB5_MAX_BLOCKSIZE (16) |
| 48 | 49 | ||
| 50 | struct gss_krb5_enctype { | ||
| 51 | const u32 etype; /* encryption (key) type */ | ||
| 52 | const u32 ctype; /* checksum type */ | ||
| 53 | const char *name; /* "friendly" name */ | ||
| 54 | const char *encrypt_name; /* crypto encrypt name */ | ||
| 55 | const char *cksum_name; /* crypto checksum name */ | ||
| 56 | const u16 signalg; /* signing algorithm */ | ||
| 57 | const u16 sealalg; /* sealing algorithm */ | ||
| 58 | const u32 blocksize; /* encryption blocksize */ | ||
| 59 | const u32 cksumlength; /* checksum length */ | ||
| 60 | const u32 keyed_cksum; /* is it a keyed cksum? */ | ||
| 61 | const u32 keybytes; /* raw key len, in bytes */ | ||
| 62 | const u32 keylength; /* final key len, in bytes */ | ||
| 63 | u32 (*encrypt) (struct crypto_blkcipher *tfm, | ||
| 64 | void *iv, void *in, void *out, | ||
| 65 | int length); /* encryption function */ | ||
| 66 | u32 (*decrypt) (struct crypto_blkcipher *tfm, | ||
| 67 | void *iv, void *in, void *out, | ||
| 68 | int length); /* decryption function */ | ||
| 69 | }; | ||
| 70 | |||
| 49 | struct krb5_ctx { | 71 | struct krb5_ctx { |
| 50 | int initiate; /* 1 = initiating, 0 = accepting */ | 72 | int initiate; /* 1 = initiating, 0 = accepting */ |
| 51 | u32 enctype; | 73 | u32 enctype; |
| 74 | const struct gss_krb5_enctype *gk5e; /* enctype-specific info */ | ||
| 52 | struct crypto_blkcipher *enc; | 75 | struct crypto_blkcipher *enc; |
| 53 | struct crypto_blkcipher *seq; | 76 | struct crypto_blkcipher *seq; |
| 54 | s32 endtime; | 77 | s32 endtime; |
