summarylogtreecommitdiffstats
path: root/sipsak-gcc14-check.patch
blob: 6d57b9974160f87e19556bbcd898d67da01587e3 (plain)
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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
diff --git a/src/auth.c b/src/auth.c
index 3812879..277d4dc 100644
--- a/src/auth.c
+++ b/src/auth.c
@@ -323,14 +323,14 @@ void insert_auth(char *message, char *authreq, char *username,
 			cvt_hex(&ha2[0], &ha2_hex[0], SIPSAK_HASHLEN_MD5);
 
 			MD5Init(&Md5Ctx);
-			MD5Update(&Md5Ctx, &ha1_hex, SIPSAK_HASHHEXLEN_MD5);
+			MD5Update(&Md5Ctx, ha1_hex, SIPSAK_HASHHEXLEN_MD5);
 			MD5Update(&Md5Ctx, ":", 1);
 			MD5Update(&Md5Ctx, nonce, (unsigned int)strlen(nonce));
 			MD5Update(&Md5Ctx, ":", 1);
 			if (qop_auth == 1) {
 				MD5Update(&Md5Ctx, qop_tmp, (unsigned int)strlen(qop_tmp));
 			}
-			MD5Update(&Md5Ctx, &ha2_hex, SIPSAK_HASHHEXLEN_MD5);
+			MD5Update(&Md5Ctx, ha2_hex, SIPSAK_HASHHEXLEN_MD5);
 			MD5Final(&resp[0], &Md5Ctx);
 			cvt_hex(&resp[0], &resp_hex[0], SIPSAK_HASHLEN_MD5);
 		}
diff --git a/src/md5.c b/src/md5.c
index 512b9f2..ff0aaba 100644
--- a/src/md5.c
+++ b/src/md5.c
@@ -65,13 +65,11 @@ documentation and/or software.
 #define S43 15
 #define S44 21
 
-static void MD5Transform PROTO_LIST ((UINT4 [4], unsigned char [64]));
-static void Encode PROTO_LIST
-  ((unsigned char *, UINT4 *, unsigned int));
-static void Decode PROTO_LIST
-  ((UINT4 *, unsigned char *, unsigned int));
-static void MD5_memcpy PROTO_LIST ((POINTER, POINTER, unsigned int));
-static void MD5_memset PROTO_LIST ((POINTER, int, unsigned int));
+static void MD5Transform (UINT4 state[4], unsigned char block[64]);
+static void Encode (unsigned char *output, UINT4 *input, unsigned int len);
+static void Decode (UINT4 *output, unsigned char *input, unsigned int len);
+static void MD5_memcpy (POINTER output, POINTER input, unsigned int len);
+static void MD5_memset (POINTER output, int value, unsigned int len);
 
 static unsigned char PADDING[64] = {
   0x80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
@@ -116,8 +114,7 @@ Rotation is separate from addition to prevent recomputation.
 
 /* MD5 initialization. Begins an MD5 operation, writing a new context.
  */
-void MD5Init (context)
-MD5_CTX *context;                                        /* context */
+void MD5Init (MD5_CTX *context)
 {
   context->count[0] = context->count[1] = 0;
   /* Load magic initialization constants.
@@ -132,10 +129,7 @@ MD5_CTX *context;                                        /* context */
   operation, processing another message block, and updating the
   context.
  */
-void MD5Update (context, input, inputLen)
-MD5_CTX *context;                                        /* context */
-unsigned char *input;                                /* input block */
-unsigned int inputLen;                     /* length of input block */
+void MD5Update (MD5_CTX *context, unsigned char *input, unsigned int inputLen)
 {
   unsigned int i, index, partLen;
 
@@ -175,9 +169,7 @@ unsigned int inputLen;                     /* length of input block */
 /* MD5 finalization. Ends an MD5 message-digest operation, writing the
   the message digest and zeroizing the context.
  */
-void MD5Final (digest, context)
-unsigned char digest[16];                         /* message digest */
-MD5_CTX *context;                                       /* context */
+void MD5Final (unsigned char digest[16], MD5_CTX *context)
 {
   unsigned char bits[8];
   unsigned int index, padLen;
@@ -204,9 +196,7 @@ MD5_CTX *context;                                       /* context */
 
 /* MD5 basic transformation. Transforms state based on block.
  */
-static void MD5Transform (state, block)
-UINT4 state[4];
-unsigned char block[64];
+static void MD5Transform (UINT4 state[4], unsigned char block[64])
 {
   UINT4 a = state[0], b = state[1], c = state[2], d = state[3], x[16];
 
@@ -297,10 +287,7 @@ unsigned char block[64];
 /* Encodes input (UINT4) into output (unsigned char). Assumes len is
   a multiple of 4.
  */
-static void Encode (output, input, len)
-unsigned char *output;
-UINT4 *input;
-unsigned int len;
+static void Encode (unsigned char *output, UINT4 *input, unsigned int len)
 {
   unsigned int i, j;
 
@@ -315,10 +302,7 @@ unsigned int len;
 /* Decodes input (unsigned char) into output (UINT4). Assumes len is
   a multiple of 4.
  */
-static void Decode (output, input, len)
-UINT4 *output;
-unsigned char *input;
-unsigned int len;
+static void Decode (UINT4 *output, unsigned char *input, unsigned int len)
 {
   unsigned int i, j;
 
@@ -330,10 +314,7 @@ unsigned int len;
 /* Note: Replace "for loop" with standard memcpy if possible.
  */
 
-static void MD5_memcpy (output, input, len)
-POINTER output;
-POINTER input;
-unsigned int len;
+static void MD5_memcpy (POINTER output, POINTER input, unsigned int len)
 {
 
 #ifndef USE_MEM
@@ -348,10 +329,7 @@ unsigned int len;
 
 /* Note: Replace "for loop" with standard memset if possible.
  */
-static void MD5_memset (output, value, len)
-POINTER output;
-int value;
-unsigned int len;
+static void MD5_memset (POINTER output, int value, unsigned int len)
 {
 
 #ifndef USE_MEM
diff --git a/src/md5global.h b/src/md5global.h
index a29df5c..65985cf 100644
--- a/src/md5global.h
+++ b/src/md5global.h
@@ -9,7 +9,7 @@ The following makes PROTOTYPES default to 0 if it has not already
   been defined with C compiler flags.
  */
 #ifndef PROTOTYPES
-#define PROTOTYPES 0
+#define PROTOTYPES 1
 #endif
 
 /* POINTER defines a generic pointer type */