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

Commite997758

Browse files
committed
More pgcrypto fixes: avoid bogus alignment assumptions in sha2,
be more wary about having a value for BYTE_ORDER, clean up randomly-chosen ways of including Postgres core headers.Marko Kreen and Tom Lane
1 parent3c52d17 commite997758

29 files changed

+99
-90
lines changed

‎contrib/pgcrypto/blf.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@
3131
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
3232
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
3333
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
34+
*
35+
* $PostgreSQL: pgsql/contrib/pgcrypto/blf.c,v 1.7 2005/07/11 15:07:59 tgl Exp $
3436
*/
3537

3638
/*
@@ -40,9 +42,9 @@
4042
* Bruce Schneier.
4143
*/
4244

43-
#include<postgres.h>
44-
#include"px.h"
45+
#include"postgres.h"
4546

47+
#include"px.h"
4648
#include"blf.h"
4749

4850
/* Function for Feistel Networks */

‎contrib/pgcrypto/crypt-md5.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,11 @@
88
*
99
* $FreeBSD: src/lib/libcrypt/crypt-md5.c,v 1.5 1999/12/17 20:21:45 peter Exp $
1010
*
11+
* $PostgreSQL: pgsql/contrib/pgcrypto/crypt-md5.c,v 1.4 2005/07/11 15:07:59 tgl Exp $
1112
*/
12-
/* $PostgreSQL: pgsql/contrib/pgcrypto/crypt-md5.c,v 1.3 2003/11/29 22:39:28 pgsql Exp $ */
1313

14-
#include<postgres.h>
14+
#include"postgres.h"
15+
1516
#include"px.h"
1617
#include"px-crypt.h"
1718

‎contrib/pgcrypto/fortuna.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,16 +26,16 @@
2626
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
2727
* SUCH DAMAGE.
2828
*
29-
* $PostgreSQL: pgsql/contrib/pgcrypto/fortuna.c,v 1.1 2005/07/10 13:46:27 momjian Exp $
29+
* $PostgreSQL: pgsql/contrib/pgcrypto/fortuna.c,v 1.2 2005/07/11 15:07:59 tgl Exp $
3030
*/
3131

32-
#include<postgres.h>
32+
#include"postgres.h"
33+
3334
#include<sys/time.h>
3435
#include<time.h>
3536

3637
#include"rijndael.h"
3738
#include"sha2.h"
38-
3939
#include"fortuna.h"
4040

4141

‎contrib/pgcrypto/internal.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,14 @@
2626
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
2727
* SUCH DAMAGE.
2828
*
29-
* $PostgreSQL: pgsql/contrib/pgcrypto/internal.c,v 1.19 2005/07/10 17:22:54 tgl Exp $
29+
* $PostgreSQL: pgsql/contrib/pgcrypto/internal.c,v 1.20 2005/07/11 15:07:59 tgl Exp $
3030
*/
3131

32+
#include"postgres.h"
3233

33-
#include<postgres.h>
3434
#include<time.h>
3535

3636
#include"px.h"
37-
3837
#include"md5.h"
3938
#include"sha1.h"
4039
#include"sha2.h"

‎contrib/pgcrypto/mbuf.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,10 @@
2626
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
2727
* SUCH DAMAGE.
2828
*
29-
* $PostgreSQL: pgsql/contrib/pgcrypto/mbuf.c,v 1.1 2005/07/10 13:46:28 momjian Exp $
29+
* $PostgreSQL: pgsql/contrib/pgcrypto/mbuf.c,v 1.2 2005/07/11 15:07:59 tgl Exp $
3030
*/
3131

32-
#include<postgres.h>
32+
#include"postgres.h"
3333

3434
#include"px.h"
3535
#include"mbuf.h"

‎contrib/pgcrypto/md5.c

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
/*$PostgreSQL: pgsql/contrib/pgcrypto/md5.c,v 1.12 2004/08/29 16:43:05 tgl Exp $*/
21
/* $KAME: md5.c,v 1.3 2000/02/22 14:01:17 itojun Exp $ */
32

43
/*
@@ -28,13 +27,22 @@
2827
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
2928
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
3029
* SUCH DAMAGE.
30+
*
31+
* $PostgreSQL: pgsql/contrib/pgcrypto/md5.c,v 1.13 2005/07/11 15:07:59 tgl Exp $
3132
*/
3233

3334
#include"postgres.h"
34-
#include"px.h"
3535

36+
#include<sys/param.h>
37+
38+
#include"px.h"
3639
#include"md5.h"
3740

41+
/* sanity check */
42+
#if !defined(BYTE_ORDER)|| (BYTE_ORDER!=LITTLE_ENDIAN&&BYTE_ORDER!=BIG_ENDIAN)
43+
#error Define BYTE_ORDER to be equal to either LITTLE_ENDIAN or BIG_ENDIAN
44+
#endif
45+
3846
#defineSHIFT(X,s) (((X) << (s)) | ((X) >> (32 - (s))))
3947

4048
#defineF(X,Y,Z) (((X) & (Y)) | ((~X) & (Z)))

‎contrib/pgcrypto/openssl.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,10 @@
2626
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
2727
* SUCH DAMAGE.
2828
*
29-
* $PostgreSQL: pgsql/contrib/pgcrypto/openssl.c,v 1.23 2005/07/1114:38:05 tgl Exp $
29+
* $PostgreSQL: pgsql/contrib/pgcrypto/openssl.c,v 1.24 2005/07/1115:07:59 tgl Exp $
3030
*/
3131

32-
#include<postgres.h>
32+
#include"postgres.h"
3333

3434
#include"px.h"
3535

‎contrib/pgcrypto/pgp-armor.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,10 @@
2626
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
2727
* SUCH DAMAGE.
2828
*
29-
* $PostgreSQL: pgsql/contrib/pgcrypto/pgp-armor.c,v 1.1 2005/07/10 13:46:28 momjian Exp $
29+
* $PostgreSQL: pgsql/contrib/pgcrypto/pgp-armor.c,v 1.2 2005/07/11 15:07:59 tgl Exp $
3030
*/
3131

32-
#include<postgres.h>
33-
34-
#include<string.h>
32+
#include"postgres.h"
3533

3634
#include"px.h"
3735
#include"mbuf.h"

‎contrib/pgcrypto/pgp-cfb.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,11 @@
2626
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
2727
* SUCH DAMAGE.
2828
*
29-
* $PostgreSQL: pgsql/contrib/pgcrypto/pgp-cfb.c,v 1.1 2005/07/10 13:46:28 momjian Exp $
29+
* $PostgreSQL: pgsql/contrib/pgcrypto/pgp-cfb.c,v 1.2 2005/07/11 15:07:59 tgl Exp $
3030
*/
3131

32-
#include<postgres.h>
32+
#include"postgres.h"
33+
3334
#include"mbuf.h"
3435
#include"px.h"
3536
#include"pgp.h"

‎contrib/pgcrypto/pgp-compress.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,10 @@
2626
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
2727
* SUCH DAMAGE.
2828
*
29-
* $PostgreSQL: pgsql/contrib/pgcrypto/pgp-compress.c,v 1.1 2005/07/10 13:46:28 momjian Exp $
29+
* $PostgreSQL: pgsql/contrib/pgcrypto/pgp-compress.c,v 1.2 2005/07/11 15:07:59 tgl Exp $
3030
*/
3131

32-
#include<postgres.h>
32+
#include"postgres.h"
3333

3434
#include"mbuf.h"
3535
#include"px.h"
@@ -43,6 +43,7 @@
4343
#ifndefDISABLE_ZLIB
4444

4545
#include<zlib.h>
46+
4647
#defineZIP_OUT_BUF 8192
4748
#defineZIP_IN_BLOCK 8192
4849

‎contrib/pgcrypto/pgp-decrypt.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,10 @@
2626
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
2727
* SUCH DAMAGE.
2828
*
29-
* $PostgreSQL: pgsql/contrib/pgcrypto/pgp-decrypt.c,v 1.1 2005/07/10 13:46:28 momjian Exp $
29+
* $PostgreSQL: pgsql/contrib/pgcrypto/pgp-decrypt.c,v 1.2 2005/07/11 15:07:59 tgl Exp $
3030
*/
3131

32-
#include<postgres.h>
32+
#include"postgres.h"
3333

3434
#include"px.h"
3535
#include"mbuf.h"

‎contrib/pgcrypto/pgp-encrypt.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,11 @@
2626
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
2727
* SUCH DAMAGE.
2828
*
29-
* $PostgreSQL: pgsql/contrib/pgcrypto/pgp-encrypt.c,v 1.1 2005/07/10 13:46:28 momjian Exp $
29+
* $PostgreSQL: pgsql/contrib/pgcrypto/pgp-encrypt.c,v 1.2 2005/07/11 15:07:59 tgl Exp $
3030
*/
3131

32-
#include<postgres.h>
32+
#include"postgres.h"
33+
3334
#include<time.h>
3435

3536
#include"mbuf.h"

‎contrib/pgcrypto/pgp-info.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@
2626
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
2727
* SUCH DAMAGE.
2828
*
29-
* $PostgreSQL: pgsql/contrib/pgcrypto/pgp-info.c,v 1.1 2005/07/10 13:46:28 momjian Exp $
29+
* $PostgreSQL: pgsql/contrib/pgcrypto/pgp-info.c,v 1.2 2005/07/11 15:07:59 tgl Exp $
3030
*/
31-
#include<postgres.h>
31+
#include"postgres.h"
3232

3333
#include"px.h"
3434
#include"mbuf.h"

‎contrib/pgcrypto/pgp-mpi-internal.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@
2626
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
2727
* SUCH DAMAGE.
2828
*
29-
* $PostgreSQL: pgsql/contrib/pgcrypto/pgp-mpi-internal.c,v 1.1 2005/07/10 13:46:28 momjian Exp $
29+
* $PostgreSQL: pgsql/contrib/pgcrypto/pgp-mpi-internal.c,v 1.2 2005/07/11 15:07:59 tgl Exp $
3030
*/
31-
#include<postgres.h>
31+
#include"postgres.h"
3232

3333
#include"px.h"
3434
#include"mbuf.h"

‎contrib/pgcrypto/pgp-mpi-openssl.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@
2626
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
2727
* SUCH DAMAGE.
2828
*
29-
* $PostgreSQL: pgsql/contrib/pgcrypto/pgp-mpi-openssl.c,v 1.1 2005/07/10 13:46:29 momjian Exp $
29+
* $PostgreSQL: pgsql/contrib/pgcrypto/pgp-mpi-openssl.c,v 1.2 2005/07/11 15:07:59 tgl Exp $
3030
*/
31-
#include<postgres.h>
31+
#include"postgres.h"
3232

3333
#include<openssl/bn.h>
3434

‎contrib/pgcrypto/pgp-mpi.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@
2626
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
2727
* SUCH DAMAGE.
2828
*
29-
* $PostgreSQL: pgsql/contrib/pgcrypto/pgp-mpi.c,v 1.1 2005/07/10 13:46:29 momjian Exp $
29+
* $PostgreSQL: pgsql/contrib/pgcrypto/pgp-mpi.c,v 1.2 2005/07/11 15:07:59 tgl Exp $
3030
*/
31-
#include<postgres.h>
31+
#include"postgres.h"
3232

3333
#include"px.h"
3434
#include"mbuf.h"

‎contrib/pgcrypto/pgp-pgsql.c

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,14 @@
2626
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
2727
* SUCH DAMAGE.
2828
*
29-
* $PostgreSQL: pgsql/contrib/pgcrypto/pgp-pgsql.c,v 1.1 2005/07/10 13:46:29 momjian Exp $
29+
* $PostgreSQL: pgsql/contrib/pgcrypto/pgp-pgsql.c,v 1.2 2005/07/11 15:07:59 tgl Exp $
3030
*/
3131

32-
#include<postgres.h>
33-
#include<fmgr.h>
34-
#include<parser/scansup.h>
35-
#include<mb/pg_wchar.h>
32+
#include"postgres.h"
33+
34+
#include"fmgr.h"
35+
#include"parser/scansup.h"
36+
#include"mb/pg_wchar.h"
3637

3738
#include"mbuf.h"
3839
#include"px.h"

‎contrib/pgcrypto/pgp-pubdec.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@
2626
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
2727
* SUCH DAMAGE.
2828
*
29-
* $PostgreSQL: pgsql/contrib/pgcrypto/pgp-pubdec.c,v 1.2 2005/07/10 15:37:03 momjian Exp $
29+
* $PostgreSQL: pgsql/contrib/pgcrypto/pgp-pubdec.c,v 1.3 2005/07/11 15:07:59 tgl Exp $
3030
*/
31-
#include<postgres.h>
31+
#include"postgres.h"
3232

3333
#include"px.h"
3434
#include"mbuf.h"

‎contrib/pgcrypto/pgp-pubenc.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@
2626
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
2727
* SUCH DAMAGE.
2828
*
29-
* $PostgreSQL: pgsql/contrib/pgcrypto/pgp-pubenc.c,v 1.1 2005/07/10 13:46:29 momjian Exp $
29+
* $PostgreSQL: pgsql/contrib/pgcrypto/pgp-pubenc.c,v 1.2 2005/07/11 15:07:59 tgl Exp $
3030
*/
31-
#include<postgres.h>
31+
#include"postgres.h"
3232

3333
#include"px.h"
3434
#include"mbuf.h"

‎contrib/pgcrypto/pgp-pubkey.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@
2626
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
2727
* SUCH DAMAGE.
2828
*
29-
* $PostgreSQL: pgsql/contrib/pgcrypto/pgp-pubkey.c,v 1.1 2005/07/10 13:46:29 momjian Exp $
29+
* $PostgreSQL: pgsql/contrib/pgcrypto/pgp-pubkey.c,v 1.2 2005/07/11 15:07:59 tgl Exp $
3030
*/
31-
#include<postgres.h>
31+
#include"postgres.h"
3232

3333
#include"px.h"
3434
#include"mbuf.h"

‎contrib/pgcrypto/pgp-s2k.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,10 @@
2626
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
2727
* SUCH DAMAGE.
2828
*
29-
* $PostgreSQL: pgsql/contrib/pgcrypto/pgp-s2k.c,v 1.1 2005/07/10 13:46:29 momjian Exp $
29+
* $PostgreSQL: pgsql/contrib/pgcrypto/pgp-s2k.c,v 1.2 2005/07/11 15:07:59 tgl Exp $
3030
*/
3131

32-
#include<postgres.h>
32+
#include"postgres.h"
3333

3434
#include"px.h"
3535
#include"mbuf.h"

‎contrib/pgcrypto/pgp.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,10 @@
2626
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
2727
* SUCH DAMAGE.
2828
*
29-
* $PostgreSQL: pgsql/contrib/pgcrypto/pgp.c,v 1.1 2005/07/10 13:46:29 momjian Exp $
29+
* $PostgreSQL: pgsql/contrib/pgcrypto/pgp.c,v 1.2 2005/07/11 15:07:59 tgl Exp $
3030
*/
3131

32-
#include<postgres.h>
32+
#include"postgres.h"
3333

3434
#include"px.h"
3535
#include"mbuf.h"

‎contrib/pgcrypto/px-crypt.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,11 @@
2626
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
2727
* SUCH DAMAGE.
2828
*
29-
* $PostgreSQL: pgsql/contrib/pgcrypto/px-crypt.c,v 1.11 2005/03/21 05:22:14 neilc Exp $
29+
* $PostgreSQL: pgsql/contrib/pgcrypto/px-crypt.c,v 1.12 2005/07/11 15:07:59 tgl Exp $
3030
*/
3131

32-
#include<postgres.h>
32+
#include"postgres.h"
33+
3334
#include"px.h"
3435
#include"px-crypt.h"
3536

‎contrib/pgcrypto/px-hmac.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,10 @@
2626
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
2727
* SUCH DAMAGE.
2828
*
29-
* $PostgreSQL: pgsql/contrib/pgcrypto/px-hmac.c,v 1.6 2005/03/21 05:19:55 neilc Exp $
29+
* $PostgreSQL: pgsql/contrib/pgcrypto/px-hmac.c,v 1.7 2005/07/11 15:07:59 tgl Exp $
3030
*/
3131

32-
33-
#include<postgres.h>
32+
#include"postgres.h"
3433

3534
#include"px.h"
3635

‎contrib/pgcrypto/px.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,10 @@
2626
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
2727
* SUCH DAMAGE.
2828
*
29-
* $PostgreSQL: pgsql/contrib/pgcrypto/px.c,v 1.12 2005/07/10 03:57:55 momjian Exp $
29+
* $PostgreSQL: pgsql/contrib/pgcrypto/px.c,v 1.13 2005/07/11 15:07:59 tgl Exp $
3030
*/
3131

32-
#include<postgres.h>
32+
#include"postgres.h"
3333

3434
#include"px.h"
3535

‎contrib/pgcrypto/random.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,10 @@
2626
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
2727
* SUCH DAMAGE.
2828
*
29-
* $PostgreSQL: pgsql/contrib/pgcrypto/random.c,v 1.11 2005/07/10 03:55:28 momjian Exp $
29+
* $PostgreSQL: pgsql/contrib/pgcrypto/random.c,v 1.12 2005/07/11 15:07:59 tgl Exp $
3030
*/
3131

32-
33-
#include<postgres.h>
32+
#include"postgres.h"
3433

3534
#include"px.h"
3635

@@ -49,7 +48,6 @@
4948

5049
#defineTRY_DEV_RANDOM
5150

52-
#include<errno.h>
5351
#include<fcntl.h>
5452
#include<unistd.h>
5553

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp