head	1.4;
access;
symbols
	RELEASE_4_9_0:1.3
	RELEASE_5_1_0:1.3
	RELEASE_4_8_0:1.3
	RELEASE_5_0_0:1.3
	RELEASE_4_7_0:1.3
	RELEASE_4_6_2:1.3
	RELEASE_4_6_1:1.3
	RELEASE_4_6_0:1.3
	RELEASE_5_0_DP1:1.3
	RELEASE_4_5_0:1.3
	RELEASE_4_4_0:1.3
	RELEASE_4_3_0:1.3
	RELEASE_4_2_0:1.3
	RELEASE_4_1_1:1.3
	RELEASE_4_1_0:1.3
	RELEASE_3_5_0:1.3
	RELEASE_4_0_0:1.3
	RELEASE_3_4_0:1.3;
locks; strict;
comment	@# @;


1.4
date	2003.10.05.03.58.53;	author kris;	state dead;
branches;
next	1.3;

1.3
date	99.12.14.22.53.27;	author asami;	state Exp;
branches;
next	1.2;

1.2
date	99.12.13.07.02.03;	author asami;	state Exp;
branches;
next	1.1;

1.1
date	99.12.02.07.49.03;	author cpiazza;	state Exp;
branches;
next	;


desc
@@


1.4
log
@Remove the rsaref port, which fulfilled its usefulness a long time ago.
@
text
@--- rsa.c.orig	Fri Mar 25 14:01:48 1994
+++ rsa.c	Mon Dec 13 13:10:28 1999
@@@@ -33,6 +33,9 @@@@
   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 +81,9 @@@@
   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);
@@@@ -128,6 +134,9 @@@@
   int status;
   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)
@@@@ -168,6 +177,9 @@@@
   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);
@


1.3
log
@Fix whitespace problem.

Submitted by:	jedgar@@fxp.org
@
text
@@


1.2
log
@Fix buffer overflow problem properly.

Submitted by:	kris
Obtained from:	bugtraq list (I believe)
@
text
@d1 8
a8 10
*** rsa.original.c Fri Mar 26 14:01:48 1994
--- rsa.c Fri Dec 10 12:56:34 1999
***************
*** 33,38 ****
--- 33,41 ----
    unsigned char byte, pkcsBlock[MAX_RSA_MODULUS_LEN];
    unsigned int i, modulusLen;

+   if (publicKey->bits > MAX_RSA_MODULUS_BITS)
+     return (RE_LEN);
d10 9
a18 11
    modulusLen = (publicKey->bits + 7) / 8;
    if (inputLen + 11 > modulusLen)
      return (RE_LEN);
***************
*** 78,83 ****
--- 81,89 ----
    unsigned char pkcsBlock[MAX_RSA_MODULUS_LEN];
    unsigned int i, modulusLen, pkcsBlockLen;

+   if (publicKey->bits > MAX_RSA_MODULUS_BITS)
+     return (RE_LEN);
d20 7
a26 9
    modulusLen = (publicKey->bits + 7) / 8;
    if (inputLen > modulusLen)
      return (RE_LEN);
***************
*** 128,133 ****
--- 134,142 ----
    int status;
    unsigned char pkcsBlock[MAX_RSA_MODULUS_LEN];
    unsigned int i, modulusLen;
d28 11
a38 13
+   if (privateKey->bits > MAX_RSA_MODULUS_BITS)
+     return (RE_LEN);

    modulusLen = (privateKey->bits + 7) / 8;
    if (inputLen + 11 > modulusLen)
***************
*** 168,173 ****
--- 177,185 ----
    unsigned char pkcsBlock[MAX_RSA_MODULUS_LEN];
    unsigned int i, modulusLen, pkcsBlockLen;

+   if (privateKey->bits > MAX_RSA_MODULUS_BITS)
+     return (RE_LEN);
d40 3
a42 3
    modulusLen = (privateKey->bits + 7) / 8;
    if (inputLen > modulusLen)
      return (RE_LEN);
@


1.1
log
@fix buffer overflow in RSA{Public,Private}Decrypt. from CORE SDI.
@
text
@d1 10
a10 8
--- rsa.c.orig	Fri Mar 25 14:01:48 1994
+++ rsa.c	Wed Dec  1 23:01:22 1999
@@@@ -33,6 +33,9 @@@@
   unsigned char byte, pkcsBlock[MAX_RSA_MODULUS_LEN];
   unsigned int i, modulusLen;
   
+  if (inputLen + 3 > MAX_RSA_MODULUS_LEN)
+    return (RE_LEN);
d12 11
a22 9
   modulusLen = (publicKey->bits + 7) / 8;
   if (inputLen + 11 > modulusLen)
     return (RE_LEN);
@@@@ -78,6 +81,9 @@@@
   unsigned char pkcsBlock[MAX_RSA_MODULUS_LEN];
   unsigned int i, modulusLen, pkcsBlockLen;
   
+  if (inputLen > MAX_RSA_MODULUS_LEN)
+    return (RE_LEN);
d24 9
a32 9
   modulusLen = (publicKey->bits + 7) / 8;
   if (inputLen > modulusLen)
     return (RE_LEN);
@@@@ -129,6 +135,9 @@@@
   unsigned char pkcsBlock[MAX_RSA_MODULUS_LEN];
   unsigned int i, modulusLen;
   
+  if (inputLen + 3 > MAX_RSA_MODULUS_LEN)
+    return (RE_LEN);
d34 13
a46 9
   modulusLen = (privateKey->bits + 7) / 8;
   if (inputLen + 11 > modulusLen)
     return (RE_LEN);
@@@@ -168,6 +177,9 @@@@
   unsigned char pkcsBlock[MAX_RSA_MODULUS_LEN];
   unsigned int i, modulusLen, pkcsBlockLen;
   
+  if (inputLen > MAX_RSA_MODULUS_LEN)
+    return (RE_LEN);
d48 3
a50 3
   modulusLen = (privateKey->bits + 7) / 8;
   if (inputLen > modulusLen)
     return (RE_LEN);
@

