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 <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];
                }

Reply via email to