[PATCH 08/28] gss_krb5: consistently use unsigned for seqnum

J. Bruce Fields bfields at fieldses.org
Mon Mar 31 16:41:49 EDT 2008


On Mon, Mar 31, 2008 at 10:31:33AM -0400, Kevin Coffman wrote:
> Consistently use unsigned (u32 vs. s32) for seqnum.
> 
> In get_mic function, send the local copy of seq_send,
> rather than the context version.

Thanks, applied.--b.

> 
> Signed-off-by: Kevin Coffman <kwc at citi.umich.edu>
> ---
> 
>  include/linux/sunrpc/gss_krb5.h       |    4 ++--
>  net/sunrpc/auth_gss/gss_krb5_seal.c   |    2 +-
>  net/sunrpc/auth_gss/gss_krb5_seqnum.c |    4 ++--
>  net/sunrpc/auth_gss/gss_krb5_unseal.c |    2 +-
>  4 files changed, 6 insertions(+), 6 deletions(-)
> 
> diff --git a/include/linux/sunrpc/gss_krb5.h b/include/linux/sunrpc/gss_krb5.h
> index 2167383..a10f1fb 100644
> --- a/include/linux/sunrpc/gss_krb5.h
> +++ b/include/linux/sunrpc/gss_krb5.h
> @@ -148,9 +148,9 @@ gss_decrypt_xdr_buf(struct crypto_blkcipher *tfm, struct xdr_buf *inbuf,
>  s32
>  krb5_make_seq_num(struct crypto_blkcipher *key,
>  		int direction,
> -		s32 seqnum, unsigned char *cksum, unsigned char *buf);
> +		u32 seqnum, unsigned char *cksum, unsigned char *buf);
>  
>  s32
>  krb5_get_seq_num(struct crypto_blkcipher *key,
>  	       unsigned char *cksum,
> -	       unsigned char *buf, int *direction, s32 * seqnum);
> +	       unsigned char *buf, int *direction, u32 *seqnum);
> diff --git a/net/sunrpc/auth_gss/gss_krb5_seal.c b/net/sunrpc/auth_gss/gss_krb5_seal.c
> index 39c08b7..8e3c87d 100644
> --- a/net/sunrpc/auth_gss/gss_krb5_seal.c
> +++ b/net/sunrpc/auth_gss/gss_krb5_seal.c
> @@ -116,7 +116,7 @@ gss_get_mic_kerberos(struct gss_ctx *gss_ctx, struct xdr_buf *text,
>  	spin_unlock(&krb5_seq_lock);
>  
>  	if (krb5_make_seq_num(ctx->seq, ctx->initiate ? 0 : 0xff,
> -			       ctx->seq_send, krb5_hdr + 16, krb5_hdr + 8))
> +			      seq_send, krb5_hdr + 16, krb5_hdr + 8))
>  		return GSS_S_FAILURE;
>  
>  	return (ctx->endtime < now) ? GSS_S_CONTEXT_EXPIRED : GSS_S_COMPLETE;
> diff --git a/net/sunrpc/auth_gss/gss_krb5_seqnum.c b/net/sunrpc/auth_gss/gss_krb5_seqnum.c
> index 43f3421..f160be6 100644
> --- a/net/sunrpc/auth_gss/gss_krb5_seqnum.c
> +++ b/net/sunrpc/auth_gss/gss_krb5_seqnum.c
> @@ -43,7 +43,7 @@
>  s32
>  krb5_make_seq_num(struct crypto_blkcipher *key,
>  		int direction,
> -		s32 seqnum,
> +		u32 seqnum,
>  		unsigned char *cksum, unsigned char *buf)
>  {
>  	unsigned char plain[8];
> @@ -65,7 +65,7 @@ s32
>  krb5_get_seq_num(struct crypto_blkcipher *key,
>  	       unsigned char *cksum,
>  	       unsigned char *buf,
> -	       int *direction, s32 * seqnum)
> +	       int *direction, u32 *seqnum)
>  {
>  	s32 code;
>  	unsigned char plain[8];
> diff --git a/net/sunrpc/auth_gss/gss_krb5_unseal.c b/net/sunrpc/auth_gss/gss_krb5_unseal.c
> index e30a993..d91a5d0 100644
> --- a/net/sunrpc/auth_gss/gss_krb5_unseal.c
> +++ b/net/sunrpc/auth_gss/gss_krb5_unseal.c
> @@ -82,7 +82,7 @@ gss_verify_mic_kerberos(struct gss_ctx *gss_ctx,
>  	struct xdr_netobj	md5cksum = {.len = 0, .data = cksumdata};
>  	s32			now;
>  	int			direction;
> -	s32			seqnum;
> +	u32			seqnum;
>  	unsigned char		*ptr = (unsigned char *)read_token->data;
>  	int			bodysize;
>  
> 


More information about the NFSv4 mailing list