summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlec Warner <antarus@gentoo.org>2006-11-14 03:02:05 +0000
committerAlec Warner <antarus@gentoo.org>2006-11-14 03:02:05 +0000
commitb00e3da0e11222ac0ac6cb8519eb666f4b06c62b (patch)
tree614db08b9446a997b8abf3c7091fb9494f9ad623 /net-nds/nis-utils/files
parentPush out accumulated fixes. (diff)
downloadgentoo-2-b00e3da0e11222ac0ac6cb8519eb666f4b06c62b.tar.gz
gentoo-2-b00e3da0e11222ac0ac6cb8519eb666f4b06c62b.tar.bz2
gentoo-2-b00e3da0e11222ac0ac6cb8519eb666f4b06c62b.zip
Add patch and bump ebuild for it such that users get the patch for bug # 130056
(Portage version: 2.1.2_pre3-r9)
Diffstat (limited to 'net-nds/nis-utils/files')
-rw-r--r--net-nds/nis-utils/files/digest-nis-utils-1.4.1-r23
-rw-r--r--net-nds/nis-utils/files/nis-utils-gmp-fixes.patch297
2 files changed, 300 insertions, 0 deletions
diff --git a/net-nds/nis-utils/files/digest-nis-utils-1.4.1-r2 b/net-nds/nis-utils/files/digest-nis-utils-1.4.1-r2
new file mode 100644
index 000000000000..06db85fa6478
--- /dev/null
+++ b/net-nds/nis-utils/files/digest-nis-utils-1.4.1-r2
@@ -0,0 +1,3 @@
+MD5 b4b38d8b006d5ed6cb3e72ce0f354dba nis-utils-1.4.1.tar.bz2 387397
+RMD160 c7cd0d289080efb7a08ae2e668163a0158ddfcb5 nis-utils-1.4.1.tar.bz2 387397
+SHA256 bf559b3c48c4521fe79bf86efa9e20ab65ec9d85966a6a9268040af2f00ff6d1 nis-utils-1.4.1.tar.bz2 387397
diff --git a/net-nds/nis-utils/files/nis-utils-gmp-fixes.patch b/net-nds/nis-utils/files/nis-utils-gmp-fixes.patch
new file mode 100644
index 000000000000..ed522d9e2eda
--- /dev/null
+++ b/net-nds/nis-utils/files/nis-utils-gmp-fixes.patch
@@ -0,0 +1,297 @@
+diff -uNr nis-utils-1.4.1/lib/key_common/generic.c nis-utils-1.4.1-patch/lib/key_common/generic.c
+--- nis-utils-1.4.1/lib/key_common/generic.c 1998-10-11 12:19:44.000000000 -0400
++++ nis-utils-1.4.1-patch/lib/key_common/generic.c 2006-08-22 20:40:02.156181000 -0400
+@@ -27,7 +27,7 @@
+ * Mountain View, California 94043
+ */
+
+-#include <mp.h>
++#include <gmp.h>
+ #include <stdlib.h>
+ #include <rpc/key_prot.h>
+
+@@ -76,12 +76,20 @@
+ #define BASEBITS (8*sizeof(short) - 1)
+ #define BASE (1 << BASEBITS)
+
+- MINT *pk = itom (0);
+- MINT *sk = itom (0);
+- MINT *tmp;
+- MINT *base = itom (BASE);
+- MINT *root = itom (PROOT);
+- MINT *modulus = xtom (HEXMODULUS);
++ mpz_t pk;
++ mpz_t sk;
++ mpz_t tmp;
++ mpz_t base;
++ mpz_t root;
++ mpz_t modulus;
++
++ mpz_init_set_ui( pk, 0 );
++ mpz_init_set_ui( sk, 0 );
++ mpz_init( tmp );
++ mpz_init_set_ui( base, BASE );
++ mpz_init_set_ui( root, PROOT );
++ mpz_set_str( modulus, HEXMODULUS, 8 ); // init from null string, base 8
++
+ unsigned short r;
+ unsigned short seed[KEYSIZE / BASEBITS + 1];
+ char *xkey;
+@@ -90,22 +98,32 @@
+ for (i = 0; i < KEYSIZE / BASEBITS + 1; ++i)
+ {
+ r = seed[i] % ((unsigned short) BASE);
+- tmp = itom (r);
+- mult (sk, base, sk);
+- madd (sk, tmp, sk);
+- mfree (tmp);
++ mpz_set_ui( tmp, r );
++ mpz_mul( sk, base, sk );
++ mpz_add( sk, tmp, sk );
++ mpz_clear( tmp );
++
+ }
+- tmp = itom (0);
+- mdiv (sk, modulus, tmp, sk);
+- mfree (tmp);
+- pow (root, sk, modulus, pk);
+- xkey = mtox (sk);
++ mpz_init_set_ui( tmp, 0 );
++
++ mpz_tdiv_qr( tmp, sk, sk, modulus );
++ mpz_clear( tmp );
++ mpz_powm( pk, root, sk, modulus );
++
++ gmp_asprintf( &xkey, "%Zx", sk );
++
++// xkey = mtox (sk);
++
+ adjust (secret, xkey);
+- xkey = mtox (pk);
++
++ gmp_asprintf( &xkey, "%Zx", pk );
++// xkey = mtox (pk);
++
+ adjust (public, xkey);
+- mfree (sk);
+- mfree (base);
+- mfree (pk);
+- mfree (root);
+- mfree (modulus);
++
++ mpz_clear( sk );
++ mpz_clear( base );
++ mpz_clear( pk );
++ mpz_clear( root );
++ mpz_clear( modulus );
+ }
+diff -uNr nis-utils-1.4.1/lib/key_common/key_common.c nis-utils-1.4.1-patch/lib/key_common/key_common.c
+--- nis-utils-1.4.1/lib/key_common/key_common.c 1998-11-27 17:02:09.000000000 -0500
++++ nis-utils-1.4.1-patch/lib/key_common/key_common.c 2006-08-22 20:39:34.678463750 -0400
+@@ -35,7 +35,7 @@
+ #include <shadow.h>
+ #include <netdb.h>
+ #include <malloc.h>
+-#include <mp.h>
++#include <gmp.h>
+ #include <rpcsvc/nis.h>
+ #include <rpc/key_prot.h>
+ #include <locale.h>
+diff -uNr nis-utils-1.4.1/src/chkey/Makefile.in nis-utils-1.4.1-patch/src/chkey/Makefile.in
+--- nis-utils-1.4.1/src/chkey/Makefile.in 2001-04-24 01:29:55.000000000 -0400
++++ nis-utils-1.4.1-patch/src/chkey/Makefile.in 2006-08-22 20:40:02.156181000 -0400
+@@ -121,7 +121,7 @@
+
+ bin_PROGRAMS = chkey
+
+-chkey_LDADD = $(LDADD) $(top_builddir)/lib/key_common/libkey_common.a $(top_builddir)/lib/compat/libcompat.a -lmp
++chkey_LDADD = $(LDADD) $(top_builddir)/lib/key_common/libkey_common.a $(top_builddir)/lib/compat/libcompat.a -lgmp
+
+ mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
+ CONFIG_HEADER = ../../config.h
+diff -uNr nis-utils-1.4.1/src/keyserv/Makefile.in nis-utils-1.4.1-patch/src/keyserv/Makefile.in
+--- nis-utils-1.4.1/src/keyserv/Makefile.in 2001-04-24 01:29:59.000000000 -0400
++++ nis-utils-1.4.1-patch/src/keyserv/Makefile.in 2006-08-22 20:40:02.156181000 -0400
+@@ -106,7 +106,7 @@
+ INSTALL_PROGRAM = @INSTALL_PROGRAM@ -s -m 555
+
+ CFLAGS = @EXTRA_CFLAGS@ @CFLAGS@
+-LDADD = @INTLLIBS@ -lmp @LIBDOOR@
++LDADD = @INTLLIBS@ -lgmp @LIBDOOR@
+
+ localedir = $(datadir)/locale
+ INCLUDES = -DLOCALEDIR=\"$(localedir)\" -I$(top_srcdir)/intl -I$(srcdir)
+diff -uNr nis-utils-1.4.1/src/keyserv/setkey.c nis-utils-1.4.1-patch/src/keyserv/setkey.c
+--- nis-utils-1.4.1/src/keyserv/setkey.c 1998-11-28 16:53:15.000000000 -0500
++++ nis-utils-1.4.1-patch/src/keyserv/setkey.c 2006-08-22 20:44:45.717902500 -0400
+@@ -42,7 +42,7 @@
+ * Cache the common keys, so the expensive computation is avoided.
+ */
+ #include <stdio.h>
+-#include <mp.h>
++#include <gmp.h>
+ #include <rpc/rpc.h>
+ #include <rpc/key_prot.h>
+ #include <rpc/des_crypt.h>
+@@ -55,7 +55,7 @@
+
+ extern keystatus pk_get_conv_key (uid_t, keybuf, cryptkeyres *);
+
+-static MINT *MODULUS;
++static mpz_t *MODULUS;
+ static char *fetchsecretkey (uid_t);
+ static keystatus pk_crypt (uid_t, char *, netobj *, des_block *, int);
+ static int nodefaultkeys = 0;
+@@ -80,7 +80,7 @@
+ void
+ setmodulus (const char *modx)
+ {
+- MODULUS = xtom (modx);
++ mpz_init_set_str( MODULUS, modx, 16 );
+ }
+
+ /*
+@@ -138,26 +138,31 @@
+ * overwriting the lower order bits by setting parity.
+ */
+ static void
+-extractdeskey (MINT *ck, des_block *deskey)
++extractdeskey (mpz_t *ck, des_block *deskey)
+ {
+- MINT *a;
++ mpz_t a;
++
+ short r;
+ int i;
+ short base = (1 << 8);
+ char *k;
+
+- a = itom (0);
+- move (ck, a);
++ mpz_init_set_ui( a, 0 );
++ mpz_set( a, ck );
++
+ for (i = 0; i < ((KEYSIZE - 64) / 2) / 8; i++)
+- sdiv (a, base, a, &r);
++ mpz_tdiv_qr_ui( a, &r, a, base );
++
++// sdiv (a, base, a, &r);
+
+ k = deskey->c;
+ for (i = 0; i < 8; i++)
+ {
+- sdiv (a, base, a, &r);
++ mpz_tdiv_qr_ui( a, &r, a, base );
++// sdiv (a, base, a, &r);
+ *k++ = r;
+ }
+- mfree (a);
++ mpz_clear(a);
+ des_setparity ((char *) deskey);
+ }
+
+@@ -173,9 +178,8 @@
+ char xsecret_hold[1024];
+ des_block deskey;
+ int err;
+- MINT *public;
+- MINT *secret;
+- MINT *common;
++
++ mpz_t public, secret, common;
+ char zero[8];
+
+ xsecret = fetchsecretkey (uid);
+@@ -203,19 +207,20 @@
+
+ if (!readcache (xpublic, xsecret, &deskey))
+ {
+- public = xtom (xpublic);
+- secret = xtom (xsecret);
++ mpz_init_set_str( public, xpublic, 16 );
++ mpz_init_set_str( secret, xsecret, 16 );
++
+ /* Sanity Check on public and private keys */
+ if ((public == NULL) || (secret == NULL))
+ return (KEY_SYSTEMERR);
+
+- common = itom (0);
+- pow (public, secret, MODULUS, common);
++ mpz_init_set_ui( common, 0 );
++ mpz_powm( common, public, secret, MODULUS );
+ extractdeskey (common, &deskey);
+ writecache (xpublic, xsecret, &deskey);
+- mfree (secret);
+- mfree (public);
+- mfree (common);
++ mpz_clear( secret );
++ mpz_clear( public );
++ mpz_clear( common );
+ }
+ err = ecb_crypt ((char *) &deskey, (char *) key, sizeof (des_block),
+ DES_HW | mode);
+@@ -229,9 +234,9 @@
+ {
+ char *xsecret;
+ char xsecret_hold[1024];
+- MINT *public;
+- MINT *secret;
+- MINT *common;
++
++ mpz_t public, secret, common;
++
+ char zero[8];
+
+ xsecret = fetchsecretkey (uid);
+@@ -250,19 +255,20 @@
+
+ if (!readcache (xpublic, xsecret, &result->cryptkeyres_u.deskey))
+ {
+- public = xtom (xpublic);
+- secret = xtom (xsecret);
++ mpz_init_set_str( public, xpublic, 16 );
++ mpz_init_set_str( secret, xsecret, 16 );
++
+ /* Sanity Check on public and private keys */
+ if ((public == NULL) || (secret == NULL))
+ return (KEY_SYSTEMERR);
+
+- common = itom (0);
+- pow (public, secret, MODULUS, common);
++ mpz_init_set_ui( common, 0 );
++ mpz_powm( common, public, secret, MODULUS );
+ extractdeskey (common, &result->cryptkeyres_u.deskey);
+ writecache (xpublic, xsecret, &result->cryptkeyres_u.deskey);
+- mfree (secret);
+- mfree (public);
+- mfree (common);
++ mpz_clear( secret );
++ mpz_clear( public );
++ mpz_clear( common );
+ }
+
+ return (KEY_SUCCESS);
+diff -uNr nis-utils-1.4.1/src/newkey/Makefile.in nis-utils-1.4.1-patch/src/newkey/Makefile.in
+--- nis-utils-1.4.1/src/newkey/Makefile.in 2001-04-24 01:30:00.000000000 -0400
++++ nis-utils-1.4.1-patch/src/newkey/Makefile.in 2006-08-22 20:40:02.156181000 -0400
+@@ -119,7 +119,7 @@
+
+ bin_PROGRAMS = newkey
+
+-newkey_LDADD = $(LDADD) $(top_builddir)/lib/key_common/libkey_common.a -lmp
++newkey_LDADD = $(LDADD) $(top_builddir)/lib/key_common/libkey_common.a -lgmp
+ mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
+ CONFIG_HEADER = ../../config.h
+ CONFIG_CLEAN_FILES =
+diff -uNr nis-utils-1.4.1/src/nisaddcred/Makefile.in nis-utils-1.4.1-patch/src/nisaddcred/Makefile.in
+--- nis-utils-1.4.1/src/nisaddcred/Makefile.in 2001-04-24 01:30:03.000000000 -0400
++++ nis-utils-1.4.1-patch/src/nisaddcred/Makefile.in 2006-08-22 20:40:02.156181000 -0400
+@@ -122,7 +122,7 @@
+
+ bin_PROGRAMS = nisaddcred
+
+-nisaddcred_LDADD = $(LDADD) $(top_builddir)/lib/key_common/libkey_common.a -lmp
++nisaddcred_LDADD = $(LDADD) $(top_builddir)/lib/key_common/libkey_common.a -lgmp
+ mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
+ CONFIG_HEADER = ../../config.h
+ CONFIG_CLEAN_FILES =