1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
|
$NetBSD: patch-ag,v 1.2 2002/10/07 19:16:47 seb Exp $
--- plugins/cram.c.orig Sat Mar 10 06:56:44 2001
+++ plugins/cram.c
@@ -425,7 +425,7 @@ static int server_continue_step (void *c
HMAC_MD5_CTX tmphmac;
char *digest_str = NULL;
- UINT4 digest[4];
+ u_int32_t digest[4];
VL(("CRAM-MD5 Step 2\n"));
VL(("Clientin: %s\n",clientin));
@@ -572,7 +572,7 @@ static int mechanism_db_filled(char *mec
int result;
sasl_server_getsecret_t *getsecret;
void *getsecret_context;
- long version = -1;
+ int32_t version = -1;
/* get callback so we can request the secret */
result = utils->getcallback(utils->conn,
@@ -597,8 +597,8 @@ static int mechanism_db_filled(char *mec
/* check version */
if (sec != NULL) {
- if (sec->len >= 4) {
- memcpy(&version, sec->data, 4);
+ if (sec->len >= sizeof(int32_t)) {
+ memcpy(&version, sec->data, sizeof(int32_t));
version = ntohl(version);
}
free(sec);
@@ -633,7 +633,7 @@ static int mechanism_fill_db(char *mech_
sasl_server_putsecret_t *putsecret;
void *putsecret_context;
sasl_secret_t *sec = NULL;
- long version;
+ int32_t version;
/* don't do this again if it's already set */
if (mydb_initialized == 1)
@@ -652,18 +652,18 @@ static int mechanism_fill_db(char *mech_
/* allocate a secret structure that we're going to save to disk */
sec=(sasl_secret_t *) sparams->utils->malloc(sizeof(sasl_secret_t)+
- 4);
+ sizeof(int32_t));
if (sec == NULL) {
result = SASL_NOMEM;
return result;
}
/* set the size */
- sec->len = 4;
+ sec->len = sizeof(int32_t);
/* and insert the data */
version = htonl(CRAM_MD5_VERSION);
- memcpy(sec->data, &version, 4);
+ memcpy(sec->data, &version, sizeof(int32_t));
/* do the store */
result = putsecret(putsecret_context,
|