Re: sbin/gbde compilation problem

2002-10-22 Thread Poul-Henning Kamp
In message <[EMAIL PROTECTED]>, Craig Rodrigues writes:
>
>--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
>> 
>===
>

Somehow your rijndael-api-fst.c is not up to date, you should have
rev 1.4.


-- 
Poul-Henning Kamp   | UNIX since Zilog Zeus 3.20
[EMAIL PROTECTED] | TCP/IP since RFC 956
FreeBSD committer   | BSD since 4.3-tahoe
Never attribute to malice what can adequately be explained by incompetence.

To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message



Re: sbin/gbde compilation problem

2002-10-22 Thread Craig Rodrigues
On Tue, Oct 22, 2002 at 08:29:01PM -0400, Craig Rodrigues wrote:
> --- sys/crypto/rijndael/rijndael-api-fst.c.orig   Tue Oct 22 20:16:28 2002
> +++ sys/crypto/rijndael/rijndael-api-fst.cTue Oct 22 20:29:20 2002
> @@ -22,6 +22,7 @@


Hi,

I apologize.  I had version 1.3 of rijndael-api-fst.c and not
version 1.4 of this file, which corrected the problems.
Even though I was updating using cvsup, I was
not getting the src/sys/crypto updates because src-sys-crypto
was not in my cvsupfile.

The problem was that I was using cvsupit to create my cvsup file,
and cvsupit does not have an option for src-sys-crypto.
The fact that cvsupit did not give me this option was screwing up
my buildworld

Can someone involved with ports apply this patch? ;)

I don't know if a change like this justifies bumping up the
version number, but I did, just in case. :)
-- 
Craig Rodrigues
http://www.gis.net/~craigr
[EMAIL PROTECTED]

diff -urN net/cvsupit.orig/Makefile net/cvsupit/Makefile
--- net/cvsupit.orig/Makefile	Tue Oct 22 22:15:08 2002
+++ net/cvsupit/Makefile	Tue Oct 22 22:19:55 2002
@@ -6,7 +6,7 @@
 #
 
 PORTNAME=	cvsupit
-PORTVERSION=	3.1
+PORTVERSION=	3.2
 CATEGORIES=	net
 DISTFILES=	#empty
 
diff -urN net/cvsupit.orig/pkg-install net/cvsupit/pkg-install
--- net/cvsupit.orig/pkg-install	Tue Oct 22 22:15:08 2002
+++ net/cvsupit/pkg-install	Tue Oct 22 22:24:05 2002
@@ -89,6 +89,7 @@
 "src-sbin"		"Sources for things in /sbin" No \
 "src-share"		"Sources for things in /usr/share" No \
 "src-sys"		"Sources for the kernel (/usr/src/sys)" No \
+"src-sys-crypto"	"Sources for things in /usr/src/sys/crypto" No \
 "src-tools"		"Sources for miscellaneous tools" No \
 "src-usrbin"	"Sources for things in /usr/bin" No \
 "src-usrsbin"	"Sources for things in /usr/sbin" No \



Re: sbin/gbde compilation problem

2002-10-22 Thread Craig Rodrigues
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
[EMAIL PROTECTED]

--- 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 
 #else
 #include 
+#include 
 #endif
 #include 
 #include 
@@ -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];
}