diff options
| author | Kevin Coffman <kwc@citi.umich.edu> | 2010-03-17 13:02:59 -0400 |
|---|---|---|
| committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2010-05-14 15:09:18 -0400 |
| commit | de9c17eb4a912c9028f7b470eb80815144883b26 (patch) | |
| tree | 3e681897cff2db43f91c1e5e2f7dcad9598165c9 /include/linux/sunrpc | |
| parent | c43abaedaff92a7bcbfe04b593164bb5faba3078 (diff) | |
gss_krb5: add support for new token formats in rfc4121
This is a step toward support for AES encryption types which are
required to use the new token formats defined in rfc4121.
Signed-off-by: Kevin Coffman <kwc@citi.umich.edu>
[SteveD: Fixed a typo in gss_verify_mic_v2()]
Signed-off-by: Steve Dickson <steved@redhat.com>
[Trond: Got rid of the TEST_ROTATE/TEST_EXTRA_COUNT crap]
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'include/linux/sunrpc')
| -rw-r--r-- | include/linux/sunrpc/gss_krb5.h | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/include/linux/sunrpc/gss_krb5.h b/include/linux/sunrpc/gss_krb5.h index db0522b4c4c9..0085a30fd204 100644 --- a/include/linux/sunrpc/gss_krb5.h +++ b/include/linux/sunrpc/gss_krb5.h | |||
| @@ -53,6 +53,8 @@ | |||
| 53 | /* Maximum blocksize for the supported crypto algorithms */ | 53 | /* Maximum blocksize for the supported crypto algorithms */ |
| 54 | #define GSS_KRB5_MAX_BLOCKSIZE (16) | 54 | #define GSS_KRB5_MAX_BLOCKSIZE (16) |
| 55 | 55 | ||
| 56 | struct krb5_ctx; | ||
| 57 | |||
| 56 | struct gss_krb5_enctype { | 58 | struct gss_krb5_enctype { |
| 57 | const u32 etype; /* encryption (key) type */ | 59 | const u32 etype; /* encryption (key) type */ |
| 58 | const u32 ctype; /* checksum type */ | 60 | const u32 ctype; /* checksum type */ |
| @@ -75,6 +77,12 @@ struct gss_krb5_enctype { | |||
| 75 | u32 (*mk_key) (const struct gss_krb5_enctype *gk5e, | 77 | u32 (*mk_key) (const struct gss_krb5_enctype *gk5e, |
| 76 | struct xdr_netobj *in, | 78 | struct xdr_netobj *in, |
| 77 | struct xdr_netobj *out); /* complete key generation */ | 79 | struct xdr_netobj *out); /* complete key generation */ |
| 80 | u32 (*encrypt_v2) (struct krb5_ctx *kctx, u32 offset, | ||
| 81 | struct xdr_buf *buf, int ec, | ||
| 82 | struct page **pages); /* v2 encryption function */ | ||
| 83 | u32 (*decrypt_v2) (struct krb5_ctx *kctx, u32 offset, | ||
| 84 | struct xdr_buf *buf, u32 *headskip, | ||
| 85 | u32 *tailskip); /* v2 decryption function */ | ||
| 78 | }; | 86 | }; |
| 79 | 87 | ||
| 80 | /* krb5_ctx flags definitions */ | 88 | /* krb5_ctx flags definitions */ |
| @@ -112,6 +120,18 @@ extern spinlock_t krb5_seq_lock; | |||
| 112 | #define KG_TOK_MIC_MSG 0x0101 | 120 | #define KG_TOK_MIC_MSG 0x0101 |
| 113 | #define KG_TOK_WRAP_MSG 0x0201 | 121 | #define KG_TOK_WRAP_MSG 0x0201 |
| 114 | 122 | ||
| 123 | #define KG2_TOK_INITIAL 0x0101 | ||
| 124 | #define KG2_TOK_RESPONSE 0x0202 | ||
| 125 | #define KG2_TOK_MIC 0x0404 | ||
| 126 | #define KG2_TOK_WRAP 0x0504 | ||
| 127 | |||
| 128 | #define KG2_TOKEN_FLAG_SENTBYACCEPTOR 0x01 | ||
| 129 | #define KG2_TOKEN_FLAG_SEALED 0x02 | ||
| 130 | #define KG2_TOKEN_FLAG_ACCEPTORSUBKEY 0x04 | ||
| 131 | |||
| 132 | #define KG2_RESP_FLAG_ERROR 0x0001 | ||
| 133 | #define KG2_RESP_FLAG_DELEG_OK 0x0002 | ||
| 134 | |||
| 115 | enum sgn_alg { | 135 | enum sgn_alg { |
| 116 | SGN_ALG_DES_MAC_MD5 = 0x0000, | 136 | SGN_ALG_DES_MAC_MD5 = 0x0000, |
| 117 | SGN_ALG_MD2_5 = 0x0001, | 137 | SGN_ALG_MD2_5 = 0x0001, |
| @@ -136,6 +156,9 @@ enum seal_alg { | |||
| 136 | #define CKSUMTYPE_RSA_MD5_DES 0x0008 | 156 | #define CKSUMTYPE_RSA_MD5_DES 0x0008 |
| 137 | #define CKSUMTYPE_NIST_SHA 0x0009 | 157 | #define CKSUMTYPE_NIST_SHA 0x0009 |
| 138 | #define CKSUMTYPE_HMAC_SHA1_DES3 0x000c | 158 | #define CKSUMTYPE_HMAC_SHA1_DES3 0x000c |
| 159 | #define CKSUMTYPE_HMAC_SHA1_96_AES128 0x000f | ||
| 160 | #define CKSUMTYPE_HMAC_SHA1_96_AES256 0x0010 | ||
| 161 | #define CKSUMTYPE_HMAC_MD5_ARCFOUR -138 /* Microsoft md5 hmac cksumtype */ | ||
| 139 | 162 | ||
| 140 | /* from gssapi_err_krb5.h */ | 163 | /* from gssapi_err_krb5.h */ |
| 141 | #define KG_CCACHE_NOMATCH (39756032L) | 164 | #define KG_CCACHE_NOMATCH (39756032L) |
| @@ -212,6 +235,11 @@ make_checksum(struct krb5_ctx *kctx, char *header, int hdrlen, | |||
| 212 | struct xdr_buf *body, int body_offset, u8 *cksumkey, | 235 | struct xdr_buf *body, int body_offset, u8 *cksumkey, |
| 213 | struct xdr_netobj *cksumout); | 236 | struct xdr_netobj *cksumout); |
| 214 | 237 | ||
| 238 | u32 | ||
| 239 | make_checksum_v2(struct krb5_ctx *, char *header, int hdrlen, | ||
| 240 | struct xdr_buf *body, int body_offset, u8 *key, | ||
| 241 | struct xdr_netobj *cksum); | ||
| 242 | |||
| 215 | u32 gss_get_mic_kerberos(struct gss_ctx *, struct xdr_buf *, | 243 | u32 gss_get_mic_kerberos(struct gss_ctx *, struct xdr_buf *, |
| 216 | struct xdr_netobj *); | 244 | struct xdr_netobj *); |
| 217 | 245 | ||
