Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commite586026

Browse files
committed
The KAME files md5.* and sha1.* have the following changelog
entry:----------------------------revision 1.2date: 2000/12/04 01:20:38; author: tgl; state: Exp; lines:+18 -18Eliminate some of the more blatant platform-dependencies ... itbuilds here now, anyway ...----------------------------Which basically changes u_int*_t -> uint*_t, so now it does notcompile neither under Debian 2.2 nor under NetBSD 1.5 whichis platform independent<B8> all right. Also it replaces $KAME$with $Id$ which is Bad Thing. PostgreSQL Id should be added as aseparate line so the file history could be seen.So here is patch:* changes uint*_t -> uint*. I guess that was the original intention* adds uint64 type to include/c.h because its needed [somebody should check if I did it right]* adds back KAME Id, because KAME is the master repository* removes stupid c++ comments in pgcrypto.c* removes <sys/types.h> from the code, its not needed--markoMarko Kreen
1 parentf906597 commite586026

File tree

7 files changed

+51
-48
lines changed

7 files changed

+51
-48
lines changed

‎contrib/pgcrypto/md5.c

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
/*$Id: md5.c,v 1.2 2000/12/04 01:20:38 tgl Exp $*/
1+
/*$Id: md5.c,v 1.3 2001/01/09 16:07:13 momjian Exp $*/
2+
/* $KAME: md5.c,v 1.3 2000/02/22 14:01:17 itojun Exp $ */
23

34
/*
45
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -30,7 +31,6 @@
3031
*/
3132

3233
#include<postgres.h>
33-
#include"pgcrypto.h"
3434

3535
#include"md5.h"
3636

@@ -91,7 +91,7 @@
9191
#defineMD5_D00x10325476
9292

9393
/* Integer part of 4294967296 times abs(sin(i)), where i is in radians. */
94-
staticconstuint32_tT[65]= {
94+
staticconstuint32T[65]= {
9595
0,
9696
0xd76aa478,0xe8c7b756,0x242070db,0xc1bdceee,
9797
0xf57c0faf,0x4787c62a,0xa8304613,0xfd469501,
@@ -114,7 +114,7 @@ static const uint32_t T[65] = {
114114
0xf7537e82,0xbd3af235,0x2ad7d2bb,0xeb86d391,
115115
};
116116

117-
staticconstuint8_tmd5_paddat[MD5_BUFLEN]= {
117+
staticconstuint8md5_paddat[MD5_BUFLEN]= {
118118
0x80,0,0,0,0,0,0,0,
119119
0,0,0,0,0,0,0,0,
120120
0,0,0,0,0,0,0,0,
@@ -125,7 +125,7 @@ static const uint8_t md5_paddat[MD5_BUFLEN] = {
125125
0,0,0,0,0,0,0,0,
126126
};
127127

128-
staticvoidmd5_calc (uint8_t*,md5_ctxt*);
128+
staticvoidmd5_calc (uint8*,md5_ctxt*);
129129

130130
voidmd5_init(ctxt)
131131
md5_ctxt*ctxt;
@@ -141,7 +141,7 @@ void md5_init(ctxt)
141141

142142
voidmd5_loop(ctxt,input,len)
143143
md5_ctxt*ctxt;
144-
uint8_t*input;
144+
uint8*input;
145145
unsignedintlen;/* number of bytes */
146146
{
147147
unsignedintgap,i;
@@ -155,7 +155,7 @@ void md5_loop(ctxt, input, len)
155155
md5_calc(ctxt->md5_buf,ctxt);
156156

157157
for (i=gap;i+MD5_BUFLEN <=len;i+=MD5_BUFLEN) {
158-
md5_calc((uint8_t*)(input+i),ctxt);
158+
md5_calc((uint8*)(input+i),ctxt);
159159
}
160160

161161
ctxt->md5_i=len-i;
@@ -207,7 +207,7 @@ void md5_pad(ctxt)
207207
}
208208

209209
voidmd5_result(digest,ctxt)
210-
uint8_t*digest;
210+
uint8*digest;
211211
md5_ctxt*ctxt;
212212
{
213213
/* 4 byte words */
@@ -227,24 +227,24 @@ void md5_result(digest, ctxt)
227227
}
228228

229229
#ifBYTE_ORDER==BIG_ENDIAN
230-
uint32_tX[16];
230+
uint32X[16];
231231
#endif
232232

233233
staticvoidmd5_calc(b64,ctxt)
234-
uint8_t*b64;
234+
uint8*b64;
235235
md5_ctxt*ctxt;
236236
{
237-
uint32_tA=ctxt->md5_sta;
238-
uint32_tB=ctxt->md5_stb;
239-
uint32_tC=ctxt->md5_stc;
240-
uint32_tD=ctxt->md5_std;
237+
uint32A=ctxt->md5_sta;
238+
uint32B=ctxt->md5_stb;
239+
uint32C=ctxt->md5_stc;
240+
uint32D=ctxt->md5_std;
241241
#ifBYTE_ORDER==LITTLE_ENDIAN
242-
uint32_t*X= (uint32_t*)b64;
242+
uint32*X= (uint32*)b64;
243243
#endif
244244
#ifBYTE_ORDER==BIG_ENDIAN
245245
/* 4 byte words */
246246
/* what a brute force but fast! */
247-
uint8_t*y= (uint8_t*)X;
247+
uint8*y= (uint8*)X;
248248
y[0]=b64[3];y[1]=b64[2];y[2]=b64[1];y[3]=b64[0];
249249
y[4]=b64[7];y[5]=b64[6];y[6]=b64[5];y[7]=b64[4];
250250
y[8]=b64[11];y[9]=b64[10];y[10]=b64[9];y[11]=b64[8];

‎contrib/pgcrypto/md5.h

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
/*$Id: md5.h,v 1.2 2000/12/04 01:20:38 tgl Exp $*/
1+
/*$Id: md5.h,v 1.3 2001/01/09 16:07:13 momjian Exp $*/
2+
/* $KAME: md5.h,v 1.3 2000/02/22 14:01:18 itojun Exp $ */
23

34
/*
45
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -36,8 +37,8 @@
3637

3738
typedefstruct {
3839
union {
39-
uint32_tmd5_state32[4];
40-
uint8_tmd5_state8[16];
40+
uint32md5_state32[4];
41+
uint8md5_state8[16];
4142
}md5_st;
4243

4344
#definemd5_stamd5_st.md5_state32[0]
@@ -47,20 +48,20 @@ typedef struct {
4748
#definemd5_st8md5_st.md5_state8
4849

4950
union {
50-
uint64_tmd5_count64;
51-
uint8_tmd5_count8[8];
51+
uint64md5_count64;
52+
uint8md5_count8[8];
5253
}md5_count;
5354
#definemd5_nmd5_count.md5_count64
5455
#definemd5_n8md5_count.md5_count8
5556

5657
unsignedintmd5_i;
57-
uint8_tmd5_buf[MD5_BUFLEN];
58+
uint8md5_buf[MD5_BUFLEN];
5859
}md5_ctxt;
5960

6061
externvoidmd5_init (md5_ctxt*);
61-
externvoidmd5_loop (md5_ctxt*,uint8_t*,unsignedint);
62+
externvoidmd5_loop (md5_ctxt*,uint8*,unsignedint);
6263
externvoidmd5_pad (md5_ctxt*);
63-
externvoidmd5_result (uint8_t*,md5_ctxt*);
64+
externvoidmd5_result (uint8*,md5_ctxt*);
6465

6566
/* compatibility */
6667
#defineMD5_CTXmd5_ctxt

‎contrib/pgcrypto/pgcrypto.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
2727
* SUCH DAMAGE.
2828
*
29-
* $Id: pgcrypto.c,v 1.2 2000/11/20 20:36:56 tgl Exp $
29+
* $Id: pgcrypto.c,v 1.3 2001/01/09 16:07:13 momjian Exp $
3030
*/
3131

3232
#include<postgres.h>
@@ -91,7 +91,7 @@ digest(PG_FUNCTION_ARGS)
9191
to_hex(p,hlen,VARDATA(res));
9292

9393
PG_FREE_IF_COPY(arg,0);
94-
PG_FREE_IF_COPY(name,0);// unnecessary i guess
94+
PG_FREE_IF_COPY(name,0);
9595

9696
PG_RETURN_TEXT_P(res);
9797
}
@@ -112,7 +112,7 @@ digest_exists(PG_FUNCTION_ARGS)
112112

113113
res=find_digest(&_hbuf,name,1);
114114

115-
PG_FREE_IF_COPY(name,0);// unnecessary i guess
115+
PG_FREE_IF_COPY(name,0);
116116

117117
if (res!=NULL)
118118
PG_RETURN_BOOL(true);

‎contrib/pgcrypto/pgcrypto.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,12 @@
2626
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
2727
* SUCH DAMAGE.
2828
*
29-
* $Id: pgcrypto.h,v 1.1 2000/10/31 13:11:28 petere Exp $
29+
* $Id: pgcrypto.h,v 1.2 2001/01/09 16:07:13 momjian Exp $
3030
*/
3131

3232
#ifndef_PG_CRYPTO_H
3333
#define_PG_CRYPTO_H
3434

35-
#include<sys/types.h>
36-
3735
typedefstruct_pg_digestpg_digest;
3836
struct_pg_digest {
3937
char*name;

‎contrib/pgcrypto/sha1.c

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
/*$Id: sha1.c,v 1.2 2000/12/04 01:20:38 tgl Exp $*/
1+
/*$Id: sha1.c,v 1.3 2001/01/09 16:07:13 momjian Exp $*/
2+
/* $KAME: sha1.c,v 1.3 2000/02/22 14:01:18 itojun Exp $ */
23

34
/*
45
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -35,7 +36,6 @@
3536
*/
3637

3738
#include<postgres.h>
38-
#include"pgcrypto.h"
3939

4040
#include"sha1.h"
4141

@@ -49,7 +49,7 @@
4949
#ifndefunsupported
5050

5151
/* constant table */
52-
staticuint32_t_K[]= {0x5a827999,0x6ed9eba1,0x8f1bbcdc,0xca62c1d6 };
52+
staticuint32_K[]= {0x5a827999,0x6ed9eba1,0x8f1bbcdc,0xca62c1d6 };
5353
#defineK(t)_K[(t) / 20]
5454

5555
#defineF0(b,c,d)(((b) & (c)) | ((~(b)) & (d)))
@@ -87,9 +87,9 @@ static void
8787
sha1_step(ctxt)
8888
structsha1_ctxt*ctxt;
8989
{
90-
uint32_ta,b,c,d,e;
90+
uint32a,b,c,d,e;
9191
size_tt,s;
92-
uint32_ttmp;
92+
uint32tmp;
9393

9494
#ifBYTE_ORDER==LITTLE_ENDIAN
9595
structsha1_ctxttctxt;
@@ -221,13 +221,13 @@ sha1_loop(ctxt, input0, len)
221221
constcaddr_tinput0;
222222
size_tlen;
223223
{
224-
constuint8_t*input;
224+
constuint8*input;
225225
size_tgaplen;
226226
size_tgapstart;
227227
size_toff;
228228
size_tcopysiz;
229229

230-
input= (constuint8_t*)input0;
230+
input= (constuint8*)input0;
231231
off=0;
232232

233233
while (off<len) {
@@ -250,9 +250,9 @@ sha1_result(ctxt, digest0)
250250
structsha1_ctxt*ctxt;
251251
caddr_tdigest0;
252252
{
253-
uint8_t*digest;
253+
uint8*digest;
254254

255-
digest= (uint8_t*)digest0;
255+
digest= (uint8*)digest0;
256256
sha1_pad(ctxt);
257257
#ifBYTE_ORDER==BIG_ENDIAN
258258
bcopy(&ctxt->h.b8[0],digest,20);

‎contrib/pgcrypto/sha1.h

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
/*$Id: sha1.h,v 1.2 2000/12/04 01:20:38 tgl Exp $*/
1+
/*$Id: sha1.h,v 1.3 2001/01/09 16:07:13 momjian Exp $*/
2+
/* $KAME: sha1.h,v 1.4 2000/02/22 14:01:18 itojun Exp $ */
23

34
/*
45
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -39,18 +40,18 @@
3940

4041
structsha1_ctxt {
4142
union {
42-
uint8_tb8[20];
43-
uint32_tb32[5];
43+
uint8b8[20];
44+
uint32b32[5];
4445
}h;
4546
union {
46-
uint8_tb8[8];
47-
uint64_tb64[1];
47+
uint8b8[8];
48+
uint64b64[1];
4849
}c;
4950
union {
50-
uint8_tb8[64];
51-
uint32_tb32[16];
51+
uint8b8[64];
52+
uint32b32[16];
5253
}m;
53-
uint8_tcount;
54+
uint8count;
5455
};
5556

5657
externvoidsha1_init (structsha1_ctxt*);

‎src/include/c.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
* Portions Copyright (c) 1996-2000, PostgreSQL, Inc
99
* Portions Copyright (c) 1994, Regents of the University of California
1010
*
11-
* $Id: c.h,v 1.85 2000/11/03 18:43:52 petere Exp $
11+
* $Id: c.h,v 1.86 2001/01/09 16:07:14 momjian Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -277,13 +277,16 @@ typedef double float8;
277277
#ifdefHAVE_LONG_INT_64
278278
/* Plain "long int" fits, use it */
279279
typedeflongintint64;
280+
typedefunsigned longintuint64;
280281
#else
281282
#ifdefHAVE_LONG_LONG_INT_64
282283
/* We have working support for "long long int", use that */
283284
typedeflong longintint64;
285+
typedefunsigned long longintuint64;
284286
#else
285287
/* Won't actually work, but fall back to long int so that code compiles */
286288
typedeflongintint64;
289+
typedefunsigned longintuint64;
287290
#defineINT64_IS_BUSTED
288291
#endif
289292
#endif

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp