diff options
| author | Kevin Coffman <kwc@citi.umich.edu> | 2010-03-17 13:02:52 -0400 |
|---|---|---|
| committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2010-05-14 15:09:16 -0400 |
| commit | e1f6c07b1160ef28e8754d12e6c03288dd9d5ca8 (patch) | |
| tree | 5be1f97a1a51feaed4bed2b4a83a568c94921faf /include | |
| parent | 81d4a4333a1dfd6070f046265d928bb4c79aff88 (diff) | |
gss_krb5: add ability to have a keyed checksum (hmac)
Encryption types besides DES may use a keyed checksum (hmac).
Modify the make_checksum() function to allow for a key
and take care of enctype-specific processing such as truncating
the resulting hash.
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')
| -rw-r--r-- | include/linux/sunrpc/gss_krb5.h | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/include/linux/sunrpc/gss_krb5.h b/include/linux/sunrpc/gss_krb5.h index f94935599d13..abf26efd44ac 100644 --- a/include/linux/sunrpc/gss_krb5.h +++ b/include/linux/sunrpc/gss_krb5.h | |||
| @@ -41,6 +41,9 @@ | |||
| 41 | #include <linux/sunrpc/gss_err.h> | 41 | #include <linux/sunrpc/gss_err.h> |
| 42 | #include <linux/sunrpc/gss_asn1.h> | 42 | #include <linux/sunrpc/gss_asn1.h> |
| 43 | 43 | ||
| 44 | /* Maximum key length (in bytes) for the supported crypto algorithms*/ | ||
| 45 | #define GSS_KRB5_MAX_KEYLEN (32) | ||
| 46 | |||
| 44 | /* Maximum checksum function output for the supported crypto algorithms */ | 47 | /* Maximum checksum function output for the supported crypto algorithms */ |
| 45 | #define GSS_KRB5_MAX_CKSUM_LEN (20) | 48 | #define GSS_KRB5_MAX_CKSUM_LEN (20) |
| 46 | 49 | ||
| @@ -74,6 +77,7 @@ struct krb5_ctx { | |||
| 74 | const struct gss_krb5_enctype *gk5e; /* enctype-specific info */ | 77 | const struct gss_krb5_enctype *gk5e; /* enctype-specific info */ |
| 75 | struct crypto_blkcipher *enc; | 78 | struct crypto_blkcipher *enc; |
| 76 | struct crypto_blkcipher *seq; | 79 | struct crypto_blkcipher *seq; |
| 80 | u8 cksum[GSS_KRB5_MAX_KEYLEN]; | ||
| 77 | s32 endtime; | 81 | s32 endtime; |
| 78 | u32 seq_send; | 82 | u32 seq_send; |
| 79 | struct xdr_netobj mech_used; | 83 | struct xdr_netobj mech_used; |
| @@ -159,9 +163,10 @@ enum seal_alg { | |||
| 159 | + GSS_KRB5_TOK_HDR_LEN \ | 163 | + GSS_KRB5_TOK_HDR_LEN \ |
| 160 | + GSS_KRB5_MAX_CKSUM_LEN) | 164 | + GSS_KRB5_MAX_CKSUM_LEN) |
| 161 | 165 | ||
| 162 | s32 | 166 | u32 |
| 163 | make_checksum(char *, char *header, int hdrlen, struct xdr_buf *body, | 167 | make_checksum(struct krb5_ctx *kctx, char *header, int hdrlen, |
| 164 | int body_offset, struct xdr_netobj *cksum); | 168 | struct xdr_buf *body, int body_offset, u8 *cksumkey, |
| 169 | struct xdr_netobj *cksumout); | ||
| 165 | 170 | ||
| 166 | u32 gss_get_mic_kerberos(struct gss_ctx *, struct xdr_buf *, | 171 | u32 gss_get_mic_kerberos(struct gss_ctx *, struct xdr_buf *, |
| 167 | struct xdr_netobj *); | 172 | struct xdr_netobj *); |
