Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5743d65c authored by Kevin Coffman's avatar Kevin Coffman Committed by J. Bruce Fields
Browse files

gss_krb5: consistently use unsigned for seqnum



Consistently use unsigned (u32 vs. s32) for seqnum.

In get_mic function, send the local copy of seq_send,
rather than the context version.

Signed-off-by: default avatarKevin Coffman <kwc@citi.umich.edu>
Signed-off-by: default avatarJ. Bruce Fields <bfields@citi.umich.edu>
parent 1a448fdb
Loading
Loading
Loading
Loading
+2 −2
Original line number Original line Diff line number Diff line
@@ -148,9 +148,9 @@ gss_decrypt_xdr_buf(struct crypto_blkcipher *tfm, struct xdr_buf *inbuf,
s32
s32
krb5_make_seq_num(struct crypto_blkcipher *key,
krb5_make_seq_num(struct crypto_blkcipher *key,
		int direction,
		int direction,
		s32 seqnum, unsigned char *cksum, unsigned char *buf);
		u32 seqnum, unsigned char *cksum, unsigned char *buf);


s32
s32
krb5_get_seq_num(struct crypto_blkcipher *key,
krb5_get_seq_num(struct crypto_blkcipher *key,
	       unsigned char *cksum,
	       unsigned char *cksum,
	       unsigned char *buf, int *direction, s32 * seqnum);
	       unsigned char *buf, int *direction, u32 *seqnum);
+1 −1
Original line number Original line Diff line number Diff line
@@ -116,7 +116,7 @@ gss_get_mic_kerberos(struct gss_ctx *gss_ctx, struct xdr_buf *text,
	spin_unlock(&krb5_seq_lock);
	spin_unlock(&krb5_seq_lock);


	if (krb5_make_seq_num(ctx->seq, ctx->initiate ? 0 : 0xff,
	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 GSS_S_FAILURE;


	return (ctx->endtime < now) ? GSS_S_CONTEXT_EXPIRED : GSS_S_COMPLETE;
	return (ctx->endtime < now) ? GSS_S_CONTEXT_EXPIRED : GSS_S_COMPLETE;
+2 −2
Original line number Original line Diff line number Diff line
@@ -43,7 +43,7 @@
s32
s32
krb5_make_seq_num(struct crypto_blkcipher *key,
krb5_make_seq_num(struct crypto_blkcipher *key,
		int direction,
		int direction,
		s32 seqnum,
		u32 seqnum,
		unsigned char *cksum, unsigned char *buf)
		unsigned char *cksum, unsigned char *buf)
{
{
	unsigned char plain[8];
	unsigned char plain[8];
@@ -65,7 +65,7 @@ s32
krb5_get_seq_num(struct crypto_blkcipher *key,
krb5_get_seq_num(struct crypto_blkcipher *key,
	       unsigned char *cksum,
	       unsigned char *cksum,
	       unsigned char *buf,
	       unsigned char *buf,
	       int *direction, s32 * seqnum)
	       int *direction, u32 *seqnum)
{
{
	s32 code;
	s32 code;
	unsigned char plain[8];
	unsigned char plain[8];
+1 −1
Original line number Original line Diff line number Diff line
@@ -82,7 +82,7 @@ gss_verify_mic_kerberos(struct gss_ctx *gss_ctx,
	struct xdr_netobj	md5cksum = {.len = 0, .data = cksumdata};
	struct xdr_netobj	md5cksum = {.len = 0, .data = cksumdata};
	s32			now;
	s32			now;
	int			direction;
	int			direction;
	s32			seqnum;
	u32			seqnum;
	unsigned char		*ptr = (unsigned char *)read_token->data;
	unsigned char		*ptr = (unsigned char *)read_token->data;
	int			bodysize;
	int			bodysize;