34 #include <linux/types.h>
39 # define RPCDBG_FACILITY RPCDBG_AUTH
44 unsigned char *
cksum,
unsigned char *
buf)
47 unsigned char plain[8];
50 dprintk(
"RPC: %s:\n", __func__);
51 cipher = crypto_alloc_blkcipher(kctx->
gk5e->encrypt_name, 0,
54 return PTR_ERR(cipher);
56 plain[0] = (
unsigned char) ((seqnum >> 24) & 0xff);
57 plain[1] = (
unsigned char) ((seqnum >> 16) & 0xff);
58 plain[2] = (
unsigned char) ((seqnum >> 8) & 0xff);
59 plain[3] = (
unsigned char) ((seqnum >> 0) & 0xff);
71 crypto_free_blkcipher(cipher);
79 unsigned char *cksum,
unsigned char *buf)
81 unsigned char plain[8];
84 return krb5_make_rc4_seq_num(kctx, direction, seqnum,
87 plain[0] = (
unsigned char) (seqnum & 0xff);
88 plain[1] = (
unsigned char) ((seqnum >> 8) & 0xff);
89 plain[2] = (
unsigned char) ((seqnum >> 16) & 0xff);
90 plain[3] = (
unsigned char) ((seqnum >> 24) & 0xff);
101 krb5_get_rc4_seq_num(
struct krb5_ctx *kctx,
unsigned char *cksum,
102 unsigned char *buf,
int *direction,
s32 *seqnum)
105 unsigned char plain[8];
108 dprintk(
"RPC: %s:\n", __func__);
109 cipher = crypto_alloc_blkcipher(kctx->
gk5e->encrypt_name, 0,
112 return PTR_ERR(cipher);
122 if ((plain[4] != plain[5]) || (plain[4] != plain[6])
123 || (plain[4] != plain[7])) {
128 *direction = plain[4];
130 *seqnum = ((plain[0] << 24) | (plain[1] << 16) |
131 (plain[2] << 8) | (plain[3]));
133 crypto_free_blkcipher(cipher);
139 unsigned char *cksum,
141 int *direction,
u32 *seqnum)
144 unsigned char plain[8];
147 dprintk(
"RPC: krb5_get_seq_num:\n");
150 return krb5_get_rc4_seq_num(kctx, cksum, buf,
156 if ((plain[4] != plain[5]) || (plain[4] != plain[6]) ||
157 (plain[4] != plain[7]))
160 *direction = plain[4];
162 *seqnum = ((plain[0]) |
163 (plain[1] << 8) | (plain[2] << 16) | (plain[3] << 24));