38 #define SASL_INTEGRITY_PREFIX_LENGTH 4
39 #define MAC_DATA_LEN 4
40 #define MAC_HMAC_LEN 10
41 #define MAC_MSG_TYPE "\x00\x01"
42 #define MAC_MSG_TYPE_LEN 2
43 #define MAC_SEQNUM_LEN 4
47 char **output,
size_t *output_len,
60 char hash[GC_MD5_DIGEST_SIZE];
67 seqnumin[0] = (sendseqnum >> 24) & 0xFF;
68 seqnumin[1] = (sendseqnum >> 16) & 0xFF;
69 seqnumin[2] = (sendseqnum >> 8) & 0xFF;
70 seqnumin[3] = sendseqnum & 0xFF;
73 res = gc_hmac_md5 (key,
MD5LEN,
81 *output = malloc (*output_len);
86 memcpy (*output + len, input, input_len);
92 (*output + len)[0] = (sendseqnum >> 24) & 0xFF;
93 (*output + len)[1] = (sendseqnum >> 16) & 0xFF;
94 (*output + len)[2] = (sendseqnum >> 8) & 0xFF;
95 (*output + len)[3] = sendseqnum & 0xFF;
104 *output_len = input_len;
105 *output = malloc (input_len);
108 memcpy (*output, input, input_len);
114 #define C2I(buf) ((buf[3] & 0xFF) | \
115 ((buf[2] & 0xFF) << 8) | \
116 ((buf[1] & 0xFF) << 16) | \
117 ((buf[0] & 0xFF) << 24))
121 char **output,
size_t *output_len,
132 char hash[GC_MD5_DIGEST_SIZE];
148 if (seqnumin == NULL)
151 tmpbuf[0] = (readseqnum >> 24) & 0xFF;
152 tmpbuf[1] = (readseqnum >> 16) & 0xFF;
153 tmpbuf[2] = (readseqnum >> 8) & 0xFF;
154 tmpbuf[3] = readseqnum & 0xFF;
176 *output = malloc (*output_len);
186 *output_len = input_len;
187 *output = malloc (input_len);
190 memcpy (*output, input, input_len);
@ DIGEST_MD5_QOP_AUTH_INT
@ DIGEST_MD5_QOP_AUTH_CONF
#define DIGEST_MD5_LENGTH
int digest_md5_decode(const char *input, size_t input_len, char **output, size_t *output_len, digest_md5_qop qop, unsigned long readseqnum, char key[DIGEST_MD5_LENGTH])
#define SASL_INTEGRITY_PREFIX_LENGTH
int digest_md5_encode(const char *input, size_t input_len, char **output, size_t *output_len, digest_md5_qop qop, unsigned long sendseqnum, char key[DIGEST_MD5_LENGTH])