Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 22 Oct 2002 20:29:01 -0400
From:      Craig Rodrigues <rodrigc@attbi.com>
To:        freebsd-current@freebsd.org
Cc:        Poul-Henning Kamp <phk@critter.freebsd.dk>
Subject:   Re: sbin/gbde compilation problem
Message-ID:  <20021022202901.A24184@attbi.com>
In-Reply-To: <20021022174524.A23272@attbi.com>; from rodrigc@attbi.com on Tue, Oct 22, 2002 at 05:45:24PM -0400
References:  <20021022174524.A23272@attbi.com>

next in thread | previous in thread | raw e-mail | index | archive | help

--sdtB3X0nJg68CQEu
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

On Tue, Oct 22, 2002 at 05:45:24PM -0400, Craig Rodrigues wrote:
> Hi,
> 
> I just did a cvsup and am trying to do a buildworld and
> am having a problem:
> 
> =======================================================================================================================================================================
> ===> sbin/gbde
> /usr/src/sys/crypto/rijndael/rijndael-api-fst.c:67: `TRUE' undeclared (first use in this function)
> /usr/src/sys/crypto/rijndael/rijndael-api-fst.c: In function `rijndael_cipherInit':
> /usr/src/sys/crypto/rijndael/rijndael-api-fst.c:81: `TRUE' undeclared (first use in this function)
> cc1: warnings being treated as errors^M
> /usr/src/sys/crypto/rijndael/rijndael-api-fst.c: In function `rijndael_padEncrypt':
> /usr/src/sys/crypto/rijndael/rijndael-api-fst.c:223: warning: implicit declaration of function `panic'
> *** Error code 1^M
> =======================================================================================================================================================================

This patch worked for me.  Is it acceptable for commit?


-- 
Craig Rodrigues        
http://www.gis.net/~craigr    
rodrigc@attbi.com

--sdtB3X0nJg68CQEu
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="rijndael-api-fst.c-patch.txt"

--- sys/crypto/rijndael/rijndael-api-fst.c.orig	Tue Oct 22 20:16:28 2002
+++ sys/crypto/rijndael/rijndael-api-fst.c	Tue Oct 22 20:29:20 2002
@@ -22,6 +22,7 @@
 #include <sys/systm.h>
 #else
 #include <string.h>
+#include <err.h>
 #endif
 #include <crypto/rijndael/rijndael-alg-fst.h>
 #include <crypto/rijndael/rijndael-api-fst.h>
@@ -64,7 +65,11 @@
 		rijndaelKeyEncToDec(key->keySched, key->ROUNDS);
 	}
 
+#ifdef _KERNEL
 	return TRUE;
+#else
+	return 1;
+#endif
 }
 
 int rijndael_cipherInit(cipherInstance *cipher, BYTE mode, char *IV) {
@@ -78,7 +83,11 @@
 	} else {
 		bzero(cipher->IV, MAX_IV_SIZE);
 	}
+#ifdef _KERNEL
 	return TRUE;
+#else
+	return 1;
+#endif
 }
 
 int rijndael_blockEncrypt(cipherInstance *cipher, keyInstance *key,
@@ -219,8 +228,14 @@
 			outBuffer += 16;
 		}
 		padLen = 16 - (inputOctets - 16*numBlocks);
-		if (padLen > 0 && padLen <= 16)
+		if (padLen > 0 && padLen <= 16) {
+#ifdef _KERNEL
 			panic("rijndael_padEncrypt(ECB)");
+#else
+			errx(1, "rijndael_padEncrypt(ECB)");
+
+#endif
+		}
 		bcopy(input, block, 16 - padLen);
 		for (cp = block + 16 - padLen; cp < block + 16; cp++)
 			*cp = padLen;
@@ -240,8 +255,15 @@
 			outBuffer += 16;
 		}
 		padLen = 16 - (inputOctets - 16*numBlocks);
-		if (padLen > 0 && padLen <= 16)
+		if (padLen > 0 && padLen <= 16) {
+#ifdef _KERNEL
 			panic("rijndael_padEncrypt(CBC)");
+#else
+			errx(1, "rijndael_padEncrypt(CBC)");
+
+#endif
+		}
+
 		for (i = 0; i < 16 - padLen; i++) {
 			block[i] = input[i] ^ iv[i];
 		}

--sdtB3X0nJg68CQEu--

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20021022202901.A24184>