| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | /* | 
 | 2 |  *  linux/include/linux/sunrpc/gss_spkm3.h | 
 | 3 |  * | 
 | 4 |  *  Copyright (c) 2000 The Regents of the University of Michigan. | 
 | 5 |  *  All rights reserved. | 
 | 6 |  * | 
 | 7 |  *  Andy Adamson   <andros@umich.edu> | 
 | 8 |  */ | 
 | 9 |  | 
 | 10 | #include <linux/sunrpc/auth_gss.h> | 
 | 11 | #include <linux/sunrpc/gss_err.h> | 
 | 12 | #include <linux/sunrpc/gss_asn1.h> | 
 | 13 |  | 
 | 14 | struct spkm3_ctx { | 
| Olga Kornievskaia | adeb813 | 2006-12-04 20:22:34 -0500 | [diff] [blame] | 15 | 	struct xdr_netobj	ctx_id;  /* per message context id */ | 
 | 16 | 	int			endtime; /* endtime of the context */ | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 17 | 	struct xdr_netobj	mech_used; | 
 | 18 | 	unsigned int		ret_flags ; | 
| Olga Kornievskaia | adeb813 | 2006-12-04 20:22:34 -0500 | [diff] [blame] | 19 | 	struct xdr_netobj	conf_alg; | 
 | 20 | 	struct xdr_netobj	derived_conf_key; | 
 | 21 | 	struct xdr_netobj	intg_alg; | 
 | 22 | 	struct xdr_netobj 	derived_integ_key; | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 23 | }; | 
 | 24 |  | 
| Olga Kornievskaia | adeb813 | 2006-12-04 20:22:34 -0500 | [diff] [blame] | 25 | /* OIDs declarations for K-ALG, I-ALG, C-ALG, and OWF-ALG */ | 
 | 26 | extern const struct xdr_netobj hmac_md5_oid; | 
 | 27 | extern const struct xdr_netobj cast5_cbc_oid; | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 28 |  | 
 | 29 | /* SPKM InnerContext Token types */ | 
 | 30 |  | 
 | 31 | #define SPKM_ERROR_TOK	3 | 
 | 32 | #define SPKM_MIC_TOK	4 | 
 | 33 | #define SPKM_WRAP_TOK	5 | 
 | 34 | #define SPKM_DEL_TOK	6 | 
 | 35 |  | 
| J. Bruce Fields | 00fd6e1 | 2005-10-13 16:55:18 -0400 | [diff] [blame] | 36 | u32 spkm3_make_token(struct spkm3_ctx *ctx, struct xdr_buf * text, struct xdr_netobj * token, int toktype); | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 37 |  | 
| J. Bruce Fields | 00fd6e1 | 2005-10-13 16:55:18 -0400 | [diff] [blame] | 38 | u32 spkm3_read_token(struct spkm3_ctx *ctx, struct xdr_netobj *read_token, struct xdr_buf *message_buffer, int toktype); | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 39 |  | 
 | 40 | #define CKSUMTYPE_RSA_MD5            0x0007 | 
| Olga Kornievskaia | adeb813 | 2006-12-04 20:22:34 -0500 | [diff] [blame] | 41 | #define CKSUMTYPE_HMAC_MD5           0x0008 | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 42 |  | 
| Olga Kornievskaia | adeb813 | 2006-12-04 20:22:34 -0500 | [diff] [blame] | 43 | s32 make_spkm3_checksum(s32 cksumtype, struct xdr_netobj *key, char *header, | 
 | 44 | 		unsigned int hdrlen, struct xdr_buf *body, | 
 | 45 | 		unsigned int body_offset, struct xdr_netobj *cksum); | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 46 | void asn1_bitstring_len(struct xdr_netobj *in, int *enclen, int *zerobits); | 
| Olga Kornievskaia | adeb813 | 2006-12-04 20:22:34 -0500 | [diff] [blame] | 47 | int decode_asn1_bitstring(struct xdr_netobj *out, char *in, int enclen, | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 48 |                    int explen); | 
 | 49 | void spkm3_mic_header(unsigned char **hdrbuf, unsigned int *hdrlen,  | 
 | 50 |                    unsigned char *ctxhdr, int elen, int zbit); | 
 | 51 | void spkm3_make_mic_token(unsigned  char **tokp, int toklen,  | 
 | 52 |                    struct xdr_netobj *mic_hdr, | 
 | 53 |                    struct xdr_netobj *md5cksum, int md5elen, int md5zbit); | 
 | 54 | u32 spkm3_verify_mic_token(unsigned char **tokp, int *mic_hdrlen,  | 
 | 55 |                    unsigned char **cksum); |