openbsd-ports/security/rsaref/patches/patch-ac

39 lines
1.2 KiB
Plaintext
Raw Normal View History

1999-12-12 13:38:51 -05:00
--- rsa.c.orig Sun Dec 12 13:31:52 1999
+++ rsa.c Sun Dec 12 13:35:12 1999
@@ -33,6 +33,8 @@
unsigned char byte, pkcsBlock[MAX_RSA_MODULUS_LEN];
unsigned int i, modulusLen;
1999-12-12 13:38:51 -05:00
+ if (publicKey->bits > MAX_RSA_MODULUS_BITS)
+ return (RE_LEN);
modulusLen = (publicKey->bits + 7) / 8;
if (inputLen + 11 > modulusLen)
return (RE_LEN);
1999-12-12 13:38:51 -05:00
@@ -78,6 +80,8 @@
unsigned char pkcsBlock[MAX_RSA_MODULUS_LEN];
unsigned int i, modulusLen, pkcsBlockLen;
1999-12-12 13:38:51 -05:00
+ if (publicKey->bits > MAX_RSA_MODULUS_BITS)
+ return (RE_LEN);
modulusLen = (publicKey->bits + 7) / 8;
if (inputLen > modulusLen)
return (RE_LEN);
1999-12-12 13:38:51 -05:00
@@ -129,6 +133,8 @@
unsigned char pkcsBlock[MAX_RSA_MODULUS_LEN];
unsigned int i, modulusLen;
1999-12-12 13:38:51 -05:00
+ if (privateKey->bits > MAX_RSA_MODULUS_BITS)
+ return (RE_LEN);
modulusLen = (privateKey->bits + 7) / 8;
if (inputLen + 11 > modulusLen)
return (RE_LEN);
1999-12-12 13:38:51 -05:00
@@ -168,6 +174,8 @@
unsigned char pkcsBlock[MAX_RSA_MODULUS_LEN];
unsigned int i, modulusLen, pkcsBlockLen;
1999-12-12 13:38:51 -05:00
+ if (privateKey->bits > MAX_RSA_MODULUS_BITS)
+ return (RE_LEN);
modulusLen = (privateKey->bits + 7) / 8;
if (inputLen > modulusLen)
return (RE_LEN);