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

Commit8aa538c

Browse files
committed
* When postgres.h does not define BYTE_ENDIAN pgcrypto
produces garbage.I learned the hard way that #if UNDEFINED_1 == UNDEFINED_2 #error "gcc is idiot" #endifprints "gcc is idiot" ...Affected are MD5/SHA1 in internal library, and also HMAC-MD5/HMAC-SHA1/crypt-md5 which use them. Blowfish is ok, also Rijndael on atleast x86.Big thanks to Daniel Holtzman who send me a build log whichcontained warning: md5.c:246: warning: `X' defined but not usedYes, gcc is that helpful...Please apply this.--marko
1 parent0556f7c commit8aa538c

File tree

8 files changed

+21
-3
lines changed

8 files changed

+21
-3
lines changed

‎contrib/pgcrypto/blf.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@
4141
*/
4242

4343
#include<postgres.h>
44+
#include"px.h"
45+
4446
#include"blf.h"
4547

4648
#undef inline

‎contrib/pgcrypto/crypt-blowfish.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,9 @@
3232

3333
#include"postgres.h"
3434

35+
#include"px.h"
3536
#include"px-crypt.h"
37+
3638
#define__set_errno(v)
3739

3840
#ifndef__set_errno

‎contrib/pgcrypto/crypt-des.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@
6060

6161
#include"postgres.h"
6262

63+
#include"px.h"
6364
#include"px-crypt.h"
6465

6566
/* for ntohl/htonl */

‎contrib/pgcrypto/crypt-gensalt.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212

1313
#include"postgres.h"
1414

15+
#include"px.h"
1516
#include"px-crypt.h"
1617

1718
#include<errno.h>

‎contrib/pgcrypto/md5.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/*$Id: md5.c,v 1.8 2001/10/25 05:49:19 momjian Exp $*/
1+
/*$Id: md5.c,v 1.9 2001/11/29 19:40:37 momjian Exp $*/
22
/* $KAME: md5.c,v 1.3 2000/02/22 14:01:17 itojun Exp $ */
33

44
/*
@@ -31,6 +31,7 @@
3131
*/
3232

3333
#include"postgres.h"
34+
#include"px.h"
3435

3536
#include"md5.h"
3637

‎contrib/pgcrypto/px.h

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,21 @@
2626
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
2727
* SUCH DAMAGE.
2828
*
29-
* $Id: px.h,v 1.5 2001/11/20 15:50:53 momjian Exp $
29+
* $Id: px.h,v 1.6 2001/11/29 19:40:37 momjian Exp $
3030
*/
3131

3232
#ifndef__PX_H
3333
#define__PX_H
3434

35+
#ifdefHAVE_ENDIAN_H
36+
#include<endian.h>
37+
#endif
38+
39+
#ifndefBYTE_ORDER
40+
#error BYTE_ORDER must be defined as LITTLE_ENDIAN or BIG_ENDIAN
41+
#endif
42+
43+
3544
#if1
3645

3746
#definepx_alloc(s) palloc(s)

‎contrib/pgcrypto/rijndael.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ Mean: 500 cycles = 51.2 mbits/sec
3939
*/
4040

4141
#include<postgres.h>
42+
#include"px.h"
4243

4344
#include"rijndael.h"
4445

‎contrib/pgcrypto/sha1.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/*$Id: sha1.c,v 1.10 2001/11/05 17:46:23 momjian Exp $ */
1+
/*$Id: sha1.c,v 1.11 2001/11/29 19:40:37 momjian Exp $ */
22
/* $KAME: sha1.c,v 1.3 2000/02/22 14:01:18 itojun Exp $ */
33

44
/*
@@ -36,6 +36,7 @@
3636
*/
3737

3838
#include"postgres.h"
39+
#include"px.h"
3940

4041
#include"sha1.h"
4142

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp