pgp 5.0i. work by marc and myself.

This commit is contained in:
fgsch 1999-02-05 05:05:19 +00:00
parent 781562bb5c
commit 4154a61871
18 changed files with 479 additions and 0 deletions

91
security/pgp5/Makefile Normal file
View File

@ -0,0 +1,91 @@
# $OpenBSD: Makefile,v 1.1.1.1 1999/02/05 05:05:19 fgsch Exp $
DISTNAME= pgp50i-unix-src
PKGNAME= pgp-5.0i
CATEGORIES= security
NO_CDROM= "CRYPTO: Third party crypto not allowed."
RESTRICTED= "Crypto; export-controlled"
MIRROR_DISTFILE=no
MAINTAINER= fgsch@openbsd.org
MASTER_SITES= ftp://ftp.no.pgpi.com/pub/pgp/5.0/unix/ \
ftp://ftp.at.pgpi.com/pub/pgpi/5.0/unix/ \
ftp://ftp.cz.pgpi.com/pub/pgpi/5.0/unix/ \
ftp://ftp.dk.pgpi.com/pub/pgpi/5.0/unix/ \
ftp://ftp.fi.pgpi.com/pub/pgpi/5.0/unix/ \
ftp://ftp.de.pgpi.com/pub/pgpi/5.0/unix/ \
ftp://ftp.jp.pgpi.com/pub/pgpi/5.0/unix/ \
ftp://ftp.kr.pgpi.com/pub/security/pgp/5.0/unix/ \
ftp://ftp.nl.pgpi.com/pub/pgp/5.0/unix/ \
ftp://ftp.pl.pgpi.com/pub/pgpi/5.0/unix/ \
ftp://ftp.ru.pgpi.com/pub/pgp/5.0/unix/ \
ftp://ftp.es.pgpi.com/pub/pgp/5.0/unix/ \
ftp://ftp.se.pgpi.com/pub/pgp/5.0/unix/ \
ftp://ftp.ch.pgpi.com/pub/pgp/5.0/unix/
# Need to add rsaref for US residents
#
.if defined(NO_WARNINGS) || (defined(USA_RESIDENT) && ${USA_RESIDENT} == YES)
MASTER_SITES+= \
ftp://nic.funet.fi/pub/crypt/mirrors/ftp.dsi.unimi.it/applied-crypto/ \
ftp://idea.dsi.unimi.it/pub/security/crypt/math/
DISTFILES= \
${DISTNAME}${EXTRACT_SUFX} \
rsaref2.tar.gz
.endif
GNU_CONFIGURE= yes
NO_PACKAGE= yes
WRKSRC= ${WRKDIR}/pgp50i/src
.if !defined(NO_WARNINGS)
pre-fetch:
.if !defined(USA_RESIDENT) || ${USA_RESIDENT} != YES && ${USA_RESIDENT} != NO
@${ECHO} ""
@${ECHO} The variable USA_RESIDENT must be set to either YES or NO
@${ECHO} in order to build this package. USA residents that are
@${ECHO} not licensees of the RSA algorithm MUST set this variable
@${ECHO} to YES. Users outside the USA MUST set this variable to
@${ECHO} NO. Licensees may choose -- NO is faster.
@${ECHO} ""
@${ECHO} RSAREF2 will be automatically obtained and used to generate
@${ECHO} this program when given the command \"make USA_RESIDENT=YES\"
@${FALSE}
.endif
.endif
# RSAREF2 doesn't work as is when sizeof( long) != 4 -- fix it
#
pre-patch:
.if defined(USA_RESIDENT) && ${USA_RESIDENT} == YES
@${MKDIR} ${PATCHDIR}
@${CP} ${FILESDIR}/patch-rsaref2 ${PATCHDIR}
@${LN} -sf ${WRKDIR}/rsaref2 ${WRKDIR}/pgp50i/rsaref
.endif
post-patch:
@${MV} ${WRKSRC}/man/pgp.1 ${WRKSRC}/man/pgp5.1
.if defined(USA_RESIDENT) && ${USA_RESIDENT} == YES
@${RM} ${PATCHDIR}/patch-rsaref2
.endif
.if defined(USA_RESIDENT) && ${USA_RESIDENT} == YES
# Force RSAREF to be used by making sure that rsaref.a exists and
# that configure does not find lib/pgp/pubkey/pgpRSAGlue1.c.
#
pre-configure:
@(cd ${WRKDIR}/rsaref2/install/unix && \
${SETENV} ${MAKE_ENV} ${MAKE} -f makefile rsaref.a)
@${MV} ${WRKSRC}/lib/pgp/pubkey/pgpRSAGlue1.c \
${WRKSRC}/lib/pgp/pubkey/pgpRSAGlue1.c-
.endif
pre-install:
-${MKDIR} ${PREFIX}/lib/pgp5
@${INSTALL_DATA} ${WRKSRC}/language50.txt ${PREFIX}/lib/pgp
.include <bsd.port.mk>

2
security/pgp5/files/md5 Normal file
View File

@ -0,0 +1,2 @@
MD5 (pgp50i-unix-src.tar.gz) = 7a01203f0053aa78a781367461d52187
MD5 (rsaref2.tar.gz) = 0b474c97bf1f1c0d27e5a95f1239c08d

View File

@ -0,0 +1,25 @@
--- ../rsaref/source/global.h.~1~ Fri Mar 25 12:01:46 1994
+++ ../rsaref/source/global.h Thu Apr 2 00:12:23 1998
@@ -7,6 +7,8 @@
#ifndef _GLOBAL_H_
#define _GLOBAL_H_ 1
+#include <limits.h>
+
/* PROTOTYPES should be set to one if and only if the compiler supports
function argument prototyping.
The following makes PROTOTYPES default to 1 if it has not already been
@@ -23,7 +25,13 @@
typedef unsigned short int UINT2;
/* UINT4 defines a four byte word */
+#if ( UINT_MAX == 0xffffffffU )
+typedef unsigned int UINT4;
+#elif ( ULONG_MAX == 0xffffffffU )
typedef unsigned long int UINT4;
+#else
+# error Unknown size for UINT4
+#endif
#ifndef NULL_PTR
#define NULL_PTR ((POINTER)0)

View File

@ -0,0 +1,28 @@
--- apps/pgp/Makefile.in.orig Sat Feb 7 16:54:56 1998
+++ apps/pgp/Makefile.in Sat Jan 23 01:54:35 1999
@@ -6,7 +6,7 @@
# $Id: patch-aa,v 1.1.1.1 1999/02/05 05:05:19 fgsch Exp $
#
-PROG = pgp
+PROG = pgp5
INSTALLPROGS = $(PROG)
COMMON=../common
@@ -21,11 +21,11 @@
install:: $(PROG)
( \
- $(INSTALL) -m 755 pgp $(DESTDIR)$(bindir); \
+ $(INSTALL) -m 755 pgp5 $(DESTDIR)$(bindir); \
cd $(DESTDIR)$(bindir); \
$(RM) pgpe pgps pgpv pgp_old; \
- $(LN_S) pgp pgpe; \
- $(LN_S) pgp pgps; \
- $(LN_S) pgp pgpv; \
- $(LN_S) pgp pgp_old \
+ $(LN_S) pgp5 pgpe; \
+ $(LN_S) pgp5 pgps; \
+ $(LN_S) pgp5 pgpv; \
+ $(LN_S) pgp5 pgp_old \
)

View File

@ -0,0 +1,11 @@
--- apps/pgp/pgp.c.orig Sat Feb 7 16:54:56 1998
+++ apps/pgp/pgp.c Tue Jan 26 00:48:55 1999
@@ -1094,7 +1094,7 @@
invoked_type = PGPkeys;
break;
- case 'p':
+ case '5':
invoked_type = PGPraw;
break;

View File

@ -0,0 +1,11 @@
--- man/Makefile.in.orig Sat Feb 7 16:54:57 1998
+++ man/Makefile.in Mon Jan 25 23:33:58 1999
@@ -6,7 +6,7 @@
# $Id: patch-ac,v 1.1.1.1 1999/02/05 05:05:19 fgsch Exp $
#
-MAN1=pgp.1 pgpe.1 pgpk.1 pgps.1 pgpv.1
+MAN1=pgp5.1 pgpe.1 pgpk.1 pgps.1 pgpv.1
MAN5=pgp.cfg.5
MAN7=pgp-integration.7 pgp-intro.7

View File

@ -0,0 +1,57 @@
--- man/pgp.1.orig Sat Feb 7 17:08:26 1998
+++ man/pgp.1 Mon Jan 25 23:59:40 1999
@@ -1,38 +1,38 @@
.\"
-.\" pgp.1
+.\" pgp5.1
.\"
.\" Copyright (C) 1997 Pretty Good Privacy, Inc. All rights reserved.
.\"
.\" $Id: patch-ad,v 1.1.1.1 1999/02/05 05:05:19 fgsch Exp $
.\"
.\" Process this file with
.\" groff -man -Tascii pgp.1
.\"
-.TH PGP 1 "JULY 1997 (v5.0)" PGP "User Manual"
+.TH PGP5 1 "JULY 1997 (v5.0)" PGP "User Manual"
.SH NAME
-PGP \- A suite of tools for encrypting, decrypting and verifying
+PGP5 \- A suite of tools for encrypting, decrypting and verifying
messages.
.SH DESCRIPTION
There are two files in this package, but several additional modes of
operation are available via symbolic links:
.RS
-.BR pgp (1)
+.BR pgp5 (1)
is the main cryptographic engine of the PGP package. However,
invoking it as itself merely prints a usage summary.
.BR pgpe (1)
is executed to encrypt, or encrypt and sign, files. It is a link to
-.BR pgp (1).
+.BR pgp5 (1).
.BR pgps (1)
is executed to only sign files. It is a link to
-.BR pgp (1).
+.BR pgp5 (1).
.BR pgpv (1)
is executed to only verify or decrypt signed or encrypted files. It
is a link to
-.BR pgp (1).
+.BR pgp5 (1).
.BR pgpk (1)
is the key management application, which is used to generate,
@@ -167,7 +167,7 @@
There is currently no way to specify just a secret or public keyring
for an operation.
-.B pgp --version
+.B pgp5 --version
doesn't work. Use
.B pgpk --version
or one of the other commands, instead.

View File

@ -0,0 +1,15 @@
--- man/pgpe.1.orig Sat Feb 7 16:54:57 1998
+++ man/pgpe.1 Tue Jan 26 00:18:12 1999
@@ -108,10 +108,10 @@
.SH BUGS
.RS
See
-.BR pgp (1).
+.BR pgp5 (1).
.BE
.SH "SEE ALSO"
-.BR pgp (1),
+.BR pgp5 (1),
.BR pgpv (1),
.BR pgps (1),
.BR pgpk (1),

View File

@ -0,0 +1,15 @@
--- man/pgpk.1.orig Sat Feb 7 16:54:57 1998
+++ man/pgpk.1 Tue Jan 26 00:19:31 1999
@@ -242,10 +242,10 @@
.SH BUGS
.RS
See
-.BR pgp (1).
+.BR pgp5 (1).
.BE
.SH "SEE ALSO"
-.BR pgp (1),
+.BR pgp5 (1),
.BR pgpv (1),
.BR pgpe (1),
.BR pgps (1),

View File

@ -0,0 +1,15 @@
--- man/pgps.1.orig Sat Feb 7 16:54:57 1998
+++ man/pgps.1 Tue Jan 26 00:23:11 1999
@@ -96,10 +96,10 @@
.SH BUGS
.RS
See
-.BR pgp (1).
+.BR pgp5 (1).
.BE
.SH "SEE ALSO"
-.BR pgp (1),
+.BR pgp5 (1),
.BR pgpv (1),
.BR pgpe (1),
.BR pgpk (1),

View File

@ -0,0 +1,15 @@
--- man/pgpv.1.orig Sat Feb 7 16:54:57 1998
+++ man/pgpv.1 Tue Jan 26 00:24:08 1999
@@ -71,10 +71,10 @@
.SH BUGS
.RS
See
-.BR pgp (1).
+.BR pgp5 (1).
.BE
.SH "SEE ALSO"
-.BR pgp (1),
+.BR pgp5 (1),
.BR pgpv (1),
.BR pgpe (1),
.BR pgpk (1),

View File

@ -0,0 +1,23 @@
--- man/pgp.cfg.5.orig Sat Feb 7 16:54:57 1998
+++ man/pgp.cfg.5 Tue Jan 26 00:09:25 1999
@@ -11,7 +11,7 @@
.TH PGP 5.0 "JULY 1997 (v5.0)" PGP "User Manual"
.SH NAME
pgp.cfg \- Format of the configuration file used by
-.BR pgp (1).
+.BR pgp5 (1).
.SH DESCRIPTION
The default location for this file is ~/.pgp. You may specify another
location by setting the environment variable
@@ -125,9 +125,9 @@
.SH BUGS
See
-.BR pgp (1).
+.BR pgp5 (1).
.SH "SEE ALSO"
-.BR pgp (1),
+.BR pgp5 (1),
.BR pgpe (1),
.BR pgpv (1),
.BR pgps (1),

View File

@ -0,0 +1,11 @@
--- man/pgp-integration.7.orig Sat Feb 7 17:08:45 1998
+++ man/pgp-integration.7 Tue Jan 26 11:11:48 1999
@@ -272,7 +272,7 @@
command line, including the public and private keyrings your
application wishes to use.
.SH "SEE ALSO"
-.BR pgp (1),
+.BR pgp5 (1),
.BR pgpe (1),
.BR pgpv (1),
.BR pgps (1),

View File

@ -0,0 +1,17 @@
# $OpenBSD: patch-ak,v 1.1.1.1 1999/02/05 05:05:19 fgsch Exp $
#
# This patch is benign when not using RSAREF and is required when using
# RSAREF to get pgp5 to link. Without the patch pgp5 fails to link
# as NN_ModExp is defined in two libraries.
#
--- config.h.in.~1~ Sat Feb 7 11:54:56 1998
+++ config.h.in Tue Feb 2 22:54:29 1999
@@ -69,7 +69,7 @@
#endif
#ifndef USE_MPI_LIB
-#define USE_MPI_LIB 1
+#define USE_MPI_LIB 0
#endif
/*The licensing level to include. 1 is Freeware, 2 is Beta, 3 is Full*/

View File

@ -0,0 +1,91 @@
$NetBSD: patch-ag,v 1.1 1999/01/05 14:31:01 frueauf Exp $
From Julian Coleman <J.D.Coleman@newcastle.ac.uk> posted to
netbsd-bugs@netbsd.org:
The memory alignment strategy for PGP 5.0i causes bus errors on NetBSD/Sparc
because 8 byte variables are not aligned on an 8 byte boundary.
In src/lib/pgp/helper/pgpMem.c:PGP_INTERNAL_ALLOC(), a header is added to
all malloc()'ed memory and the pointer returned is incremented by the size
of the header. However, there are no constraints to see if this increment
is correctly aligned.
The problem might also occur on other OS's running on the Sparc. A patch
is appended (based on one used for the Chimera web browser).
J
PS. The exact problem is that 'off_t' is an 8 byte value, but the header
length is only a mulitple of 4. Pgpe crashes at pgpFileMod.c:333, when it
tries to modify 'context->filesize'.
PPS. Maybe 'long long' should also be in the union (e.g. for Solaris 2).
--- lib/pgp/helper/pgpMem.c.orig Mon Aug 11 02:05:32 1997
+++ lib/pgp/helper/pgpMem.c Tue Jan 5 15:03:27 1999
@@ -19,6 +19,20 @@
#include "pgpDebug.h"
#include "pgpLeaks.h"
+/*
+ * Make sure any memory chunks are correctly aligned.
+ * This can be forced by defining ALIGNSIZE (in bytes).
+ */
+#ifndef ALIGNSIZE
+typedef struct Alignment
+{
+ union { int a; char *b; size_t c; off_t d; long e; } Align;
+} Alignment;
+#define MEMALIGN(x) ((x / sizeof(Alignment) + 1) * sizeof(Alignment))
+#else
+#define MEMALIGN(x) ((x / ALIGNSIZE + 1) * ALIGNSIZE)
+#endif
+
/* Fills allocated/deallocated memory with 0xDD's */
#ifndef DEBUG_FILL_MEM
#define DEBUG_FILL_MEM DEBUG
@@ -69,11 +83,11 @@
};
#define UserPtrToMemHeader(userPtr) \
- ((MemHeader *)((char *)(userPtr) - sizeof(MemHeader)))
+ ((MemHeader *)((char *)(userPtr) - MEMALIGN(sizeof(MemHeader))))
#define MemHeaderToUserPtr(hdrPtr) \
- ((void *)((char *)(hdrPtr) + sizeof(MemHeader)))
+ ((void *)((char *)(hdrPtr) + MEMALIGN(sizeof(MemHeader))))
#define FullBlockSize(userSize) \
- (sizeof(MemHeader) + (userSize) + DEBUG_MEM_TAIL_MAGIC)
+ (MEMALIGN(sizeof(MemHeader)) + (userSize) + DEBUG_MEM_TAIL_MAGIC)
/*
* Defines the sequence of tail magic bytes. We want every byte to be
@@ -269,7 +283,7 @@
MemHeader * header)
{
#if DEBUG_MEM_TAIL_MAGIC
- char * tailMagic = (char *)header + sizeof(MemHeader) + header->size;
+ char * tailMagic = (char *)header + MEMALIGN(sizeof(MemHeader)) + header->size;
int i;
for (i = 0; i < DEBUG_MEM_TAIL_MAGIC; i++)
@@ -287,8 +301,9 @@
MemHeader * header;
void * userPtr;
+ size += (MEMALIGN(sizeof(MemHeader)) - (sizeof(MemHeader)));
header = (MemHeader *)pgpPlatformAlloc(FullBlockSize(size));
-if (header == NULL)
+ if (header == NULL)
return NULL;
MaybeFillMem(header, FullBlockSize(size));
@@ -352,7 +367,7 @@
if (newHeader == NULL)
return PGPERR_NOMEM;
pgpCopyMemory((void *)oldHeader, (void *)newHeader,
- sizeof(MemHeader) + oldSize);
+ MEMALIGN(sizeof(MemHeader)) + oldSize);
MaybeFillMem(oldHeader, FullBlockSize(oldSize));
pgpPlatformFree(oldHeader);
}

View File

@ -0,0 +1 @@
Pretty Good Privacy 5.0i (international)

31
security/pgp5/pkg/DESCR Normal file
View File

@ -0,0 +1,31 @@
PGP International Freeware, Version 5.0 (Source Code Version)
Copyright (c) 1990-1997 Pretty Good Privacy, Inc. All Rights Reserved.
For Non-Commercial Distribution and Use Only
READ the file LICENSE in the source distribution for complete
Terms and Conditions
This special freeware version of the source code ("Source Code Package") of
PGP 5.0 ("Software Product"), including the software, its source code, and
its related user and development documentation, is owned by Pretty Good
Privacy, Inc. (or "PGP") and is protected by copyright laws and international
copyright treaties, as well as other intellectual property laws and treaties.
The makers of PGP, however, are committed to making freely available to
individuals around the world a trusted means to secure their personal
information and communications from unwanted invasions of privacy. In keeping
with the traditions of PGP, the source code of PGP 5.0 has been published for
the purpose of facilitating peer review. Pretty Good Privacy, Inc. published
the source code in a set of printed books; a printed book or other printed
material setting forth encryption source code is not itself subject to the
U.S. export regulations (see U.S. EAR Sec. 734.3(b)(2)). The scanning in and
review of the source code by independent cryptographers, unrelated to PGP,
assures that the cryptography employed in the PGP software may be trusted --
i.e., it is truly strong and that the software contains no hidden back doors
allowing third party access to encrypted messages. In addition, it is
important that the Software Product be available in as many languages,
operate on as many operating system and hardware platforms, and be as solid
and secure as possible.

20
security/pgp5/pkg/PLIST Normal file
View File

@ -0,0 +1,20 @@
bin/pgp5
bin/pgpe
bin/pgps
bin/pgpv
bin/pgp_old
bin/pgpk
man/man1/pgp5.1
man/man1/pgpe.1
man/man1/pgps.1
man/man1/pgpv.1
man/man1/pgpk.1
man/man5/pgp.cfg.5
man/man7/pgp-intro.7
man/man7/pgp-integration.7
lib/libbn.a
lib/libpgp.a
lib/libpgptty.a
lib/libsimple.a
lib/pgp5/language50.txt
@dirrm lib/pgp5