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

Commit56f4478

Browse files
committed
Re-defines SHA2 symbols so that they would not conflict with certain
versions of OpenSSL. If your OpenSSL does not contain SHA2, then thereshould be no conflict. But ofcourse, if someone upgrades OpenSSL,server starts crashing.Backpatched to 8.1.X.Marko Kreen
1 parent39b031d commit56f4478

File tree

2 files changed

+20
-10
lines changed

2 files changed

+20
-10
lines changed

‎contrib/pgcrypto/sha2.c

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
*
3434
* $From: sha2.c,v 1.1 2001/11/08 00:01:51 adg Exp adg $
3535
*
36-
* $PostgreSQL: pgsql/contrib/pgcrypto/sha2.c,v 1.5 2005/10/15 02:49:06 momjian Exp $
36+
* $PostgreSQL: pgsql/contrib/pgcrypto/sha2.c,v 1.6 2006/05/30 12:56:45 momjian Exp $
3737
*/
3838

3939
#include"postgres.h"
@@ -163,9 +163,9 @@
163163
* library -- they are intended for private internal visibility/use
164164
* only.
165165
*/
166-
voidSHA512_Last(SHA512_CTX*);
167-
voidSHA256_Transform(SHA256_CTX*,constuint8*);
168-
voidSHA512_Transform(SHA512_CTX*,constuint8*);
166+
staticvoidSHA512_Last(SHA512_CTX*);
167+
staticvoidSHA256_Transform(SHA256_CTX*,constuint8*);
168+
staticvoidSHA512_Transform(SHA512_CTX*,constuint8*);
169169

170170

171171
/*** SHA-XYZ INITIAL HASH VALUES AND CONSTANTS ************************/
@@ -307,7 +307,7 @@ SHA256_Init(SHA256_CTX * context)
307307
j++;\
308308
} while(0)
309309

310-
void
310+
staticvoid
311311
SHA256_Transform(SHA256_CTX*context,constuint8*data)
312312
{
313313
uint32a,
@@ -378,7 +378,7 @@ SHA256_Transform(SHA256_CTX * context, const uint8 *data)
378378
}
379379
#else/* SHA2_UNROLL_TRANSFORM */
380380

381-
void
381+
staticvoid
382382
SHA256_Transform(SHA256_CTX*context,constuint8*data)
383383
{
384384
uint32a,
@@ -631,7 +631,7 @@ SHA512_Init(SHA512_CTX * context)
631631
j++;\
632632
} while(0)
633633

634-
void
634+
staticvoid
635635
SHA512_Transform(SHA512_CTX*context,constuint8*data)
636636
{
637637
uint64a,
@@ -699,7 +699,7 @@ SHA512_Transform(SHA512_CTX * context, const uint8 *data)
699699
}
700700
#else/* SHA2_UNROLL_TRANSFORM */
701701

702-
void
702+
staticvoid
703703
SHA512_Transform(SHA512_CTX*context,constuint8*data)
704704
{
705705
uint64a,
@@ -842,7 +842,7 @@ SHA512_Update(SHA512_CTX * context, const uint8 *data, size_t len)
842842
usedspace=freespace=0;
843843
}
844844

845-
void
845+
staticvoid
846846
SHA512_Last(SHA512_CTX*context)
847847
{
848848
unsignedintusedspace;

‎contrib/pgcrypto/sha2.h

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/*$PostgreSQL: pgsql/contrib/pgcrypto/sha2.h,v 1.2 2005/10/15 02:49:06 momjian Exp $ */
1+
/*$PostgreSQL: pgsql/contrib/pgcrypto/sha2.h,v 1.3 2006/05/30 12:56:45 momjian Exp $ */
22
/*$OpenBSD: sha2.h,v 1.2 2004/04/28 23:11:57 millert Exp $*/
33

44
/*
@@ -38,6 +38,16 @@
3838
#ifndef_SHA2_H
3939
#define_SHA2_H
4040

41+
/* avoid conflict with OpenSSL */
42+
#defineSHA256_Init pg_SHA256_Init
43+
#defineSHA256_Update pg_SHA256_Update
44+
#defineSHA256_Final pg_SHA256_Final
45+
#defineSHA384_Init pg_SHA384_Init
46+
#defineSHA384_Update pg_SHA384_Update
47+
#defineSHA384_Final pg_SHA384_Final
48+
#defineSHA512_Init pg_SHA512_Init
49+
#defineSHA512_Update pg_SHA512_Update
50+
#defineSHA512_Final pg_SHA512_Final
4151

4252
/*** SHA-256/384/512 Various Length Definitions ***********************/
4353
#defineSHA256_BLOCK_LENGTH64

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp