des encryption on netbsd crashes, and the compiler warns
/tmp/cch12003.s:5740: Warning: GOT relocation burb: `_des_keymap' should be global
the problem is des_keymap, in des.c:
static const uint32_t des_keymap[] = { #include "keymap.h" };
in desCode.h:
extern const uint32_t des_keymap[];
Assuming you want des_keymap to be private, the fix below works. If you want to make des_keymap public, simply removing the 'static' keyword works.
Thanks.
Index: des.c =================================================================== RCS file: /cvsroot/shishi/shishi/crypto/des.c,v retrieving revision 1.2 diff -u -p -r1.2 des.c --- des.c 15 Aug 2003 16:25:03 -0000 1.2 +++ des.c 17 Aug 2003 10:33:17 -0000 @@ -40,9 +40,6 @@
#include "desCode.h"
-static ENCRYPT(DesSmallFipsEncrypt,TEMPSMALL, LOADFIPS,KEYMAPSMALL,SAVEFIPS) -static DECRYPT(DesSmallFipsDecrypt,TEMPSMALL, LOADFIPS,KEYMAPSMALL,SAVEFIPS) - /* various tables */
static const uint32_t @@ -59,6 +56,9 @@ static const char parity[] = { #include "parity.h" }; + +static ENCRYPT(DesSmallFipsEncrypt,TEMPSMALL, LOADFIPS,KEYMAPSMALL,SAVEFIPS) +static DECRYPT(DesSmallFipsDecrypt,TEMPSMALL, LOADFIPS,KEYMAPSMALL,SAVEFIPS)
void des_fix_parity(unsigned length, uint8_t *dst, Index: desCode.h =================================================================== RCS file: /cvsroot/shishi/shishi/crypto/desCode.h,v retrieving revision 1.1 diff -u -p -r1.1 desCode.h --- desCode.h 9 Aug 2003 01:30:44 -0000 1.1 +++ desCode.h 17 Aug 2003 10:33:17 -0000 @@ -9,7 +9,6 @@
#include "des.h"
-extern const uint32_t des_keymap[]; extern const uint32_t des_bigmap[];
/* optional customization: