use rsaref port

This commit is contained in:
dugsong 1999-12-12 22:26:59 +00:00
parent fc56e5a836
commit 86118ac3f7
4 changed files with 4 additions and 91 deletions

View File

@ -1,4 +1,4 @@
# $OpenBSD: Makefile,v 1.4 1999/12/09 03:50:57 brad Exp $
# $OpenBSD: Makefile,v 1.5 1999/12/12 22:26:59 dugsong Exp $
DISTNAME= pgp50i-unix-src
PKGNAME= pgp-5.0i
@ -17,9 +17,6 @@ MASTER_SITES= ftp://ftp.no.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/
MASTER_SITES0= http://the.wiretapped.net/security/cryptography/libs/rsa/ \
ftp://idea.dsi.unimi.it/pub/security/crypt/math/ \
ftp://ftp.it.net.au/mirrors/crypto/misc/
NO_CDROM= "CRYPTO: Third party crypto not allowed."
RESTRICTED= "Crypto; export-controlled"
@ -28,11 +25,7 @@ NEED_VERSION= 1.121
MAINTAINER= fgsch@openbsd.org
.if defined(USA_RESIDENT) && ${USA_RESIDENT:U} == YES
DISTFILES= ${DISTNAME}${EXTRACT_SUFX} rsaref2.tar.gz:0
.endif
GNU_CONFIGURE= yes
USE_AUTOCONF= yes
NO_PACKAGE= yes
WRKSRC= ${WRKDIR}/pgp50i/src
@ -53,25 +46,12 @@ pre-fetch:
.endif
.endif
pre-patch:
.if defined(USA_RESIDENT) && ${USA_RESIDENT:U} == YES
@cp ${FILESDIR}/patch-rsaref2 ${PATCHDIR}
@cp ${FILESDIR}/patch-rsaref2-2 ${PATCHDIR}
@ln -fs ${WRKDIR}/rsaref2 ${WRKDIR}/pgp50i/rsaref
.endif
post-patch:
@mv ${WRKSRC}/man/pgp.1 ${WRKSRC}/man/pgp5.1
.if defined(USA_RESIDENT) && ${USA_RESIDENT:U} == YES
@rm -f ${PATCHDIR}/patch-rsaref2
@rm -f ${PATCHDIR}/patch-rsaref2-2
.endif
pre-configure:
.if defined(USA_RESIDENT) && ${USA_RESIDENT:U} == YES
@(cd ${WRKDIR}/rsaref2/install/unix && \
env ${MAKE_ENV} make -f makefile rsaref.a)
@mv ${WRKSRC}/lib/pgp/pubkey/pgpRSAGlue1.c \
pre-configure:
@${MV} ${WRKSRC}/lib/pgp/pubkey/pgpRSAGlue1.c \
${WRKSRC}/lib/pgp/pubkey/pgpRSAGlue1.c-
.endif

View File

@ -1,25 +0,0 @@
--- ../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

@ -1,38 +0,0 @@
--- ../rsaref/source/rsa.c.orig Fri Mar 25 14:01:48 1994
+++ ../rsaref/source/rsa.c Sun Dec 12 14:00:08 1999
@@ -33,6 +33,8 @@
unsigned char byte, pkcsBlock[MAX_RSA_MODULUS_LEN];
unsigned int i, modulusLen;
+ if (publicKey->bits > MAX_RSA_MODULUS_BITS)
+ return (RE_LEN);
modulusLen = (publicKey->bits + 7) / 8;
if (inputLen + 11 > modulusLen)
return (RE_LEN);
@@ -78,6 +80,8 @@
unsigned char pkcsBlock[MAX_RSA_MODULUS_LEN];
unsigned int i, modulusLen, pkcsBlockLen;
+ if (publicKey->bits > MAX_RSA_MODULUS_BITS)
+ return (RE_LEN);
modulusLen = (publicKey->bits + 7) / 8;
if (inputLen > modulusLen)
return (RE_LEN);
@@ -129,6 +133,8 @@
unsigned char pkcsBlock[MAX_RSA_MODULUS_LEN];
unsigned int i, modulusLen;
+ if (privateKey->bits > MAX_RSA_MODULUS_BITS)
+ return (RE_LEN);
modulusLen = (privateKey->bits + 7) / 8;
if (inputLen + 11 > modulusLen)
return (RE_LEN);
@@ -168,6 +174,8 @@
unsigned char pkcsBlock[MAX_RSA_MODULUS_LEN];
unsigned int i, modulusLen, pkcsBlockLen;
+ if (privateKey->bits > MAX_RSA_MODULUS_BITS)
+ return (RE_LEN);
modulusLen = (privateKey->bits + 7) / 8;
if (inputLen > modulusLen)
return (RE_LEN);

View File

@ -1,4 +0,0 @@
patch-rsaref2-2 fixes the buffer overflow in RSA{Private,Public}{De,En}crypt(),
as published by CORE SDI in their advisory of Dec. 1, 1999.