svn rev #24104: branches/plugins/src/ include/ lib/ lib/crypto/ lib/crypto/crypto_tests/ ...

tsitkova@MIT.EDU tsitkova at MIT.EDU
Wed May 26 13:54:37 EDT 2010


http://src.mit.edu/fisheye/changelog/krb5/?cs=24104
Commit By: tsitkova
Log Message:
Implementation of yarrow prng as a plugin requires the vast majority of the routines in crypto lib to have a krb5_context as an argument. (This is needed to pass ref to pl_handle.) Unfortunately, it is not the case for the current state of crypto lib. Introducing krb5_context is a very invasive change and might be unsuitable for 1.9 release. So, yarrow is moved from plugins to crypto/krb and is treated as built-in functionality again. 




Changed Files:
U   branches/plugins/src/Makefile.in
U   branches/plugins/src/configure.in
U   branches/plugins/src/include/k5-int.h
U   branches/plugins/src/lib/Makefile.in
U   branches/plugins/src/lib/crypto/Makefile.in
U   branches/plugins/src/lib/crypto/crypto_tests/Makefile.in
U   branches/plugins/src/lib/crypto/crypto_tests/t_cksum.c
U   branches/plugins/src/lib/crypto/crypto_tests/t_encrypt.c
U   branches/plugins/src/lib/crypto/crypto_tests/t_kperf.c
U   branches/plugins/src/lib/crypto/crypto_tests/t_prng.c
U   branches/plugins/src/lib/crypto/crypto_tests/t_short.c
U   branches/plugins/src/lib/crypto/krb/Makefile.in
U   branches/plugins/src/lib/crypto/krb/aead.c
U   branches/plugins/src/lib/crypto/krb/aead.h
U   branches/plugins/src/lib/crypto/krb/cksumtypes.h
U   branches/plugins/src/lib/crypto/krb/combine_keys.c
U   branches/plugins/src/lib/crypto/krb/crypto_libinit.c
U   branches/plugins/src/lib/crypto/krb/decrypt.c
U   branches/plugins/src/lib/crypto/krb/decrypt_iov.c
U   branches/plugins/src/lib/crypto/krb/deps
U   branches/plugins/src/lib/crypto/krb/dk/checksum.c
U   branches/plugins/src/lib/crypto/krb/dk/derive.c
U   branches/plugins/src/lib/crypto/krb/dk/dk.h
U   branches/plugins/src/lib/crypto/krb/dk/dk_aead.c
U   branches/plugins/src/lib/crypto/krb/dk/stringtokey.c
U   branches/plugins/src/lib/crypto/krb/encrypt.c
U   branches/plugins/src/lib/crypto/krb/encrypt_iov.c
U   branches/plugins/src/lib/crypto/krb/etypes.h
U   branches/plugins/src/lib/crypto/krb/make_checksum.c
U   branches/plugins/src/lib/crypto/krb/make_checksum_iov.c
U   branches/plugins/src/lib/crypto/krb/old_api_glue.c
U   branches/plugins/src/lib/crypto/krb/prf/dk_prf.c
U   branches/plugins/src/lib/crypto/krb/prf/prf_int.h
U   branches/plugins/src/lib/crypto/krb/prng.c
U   branches/plugins/src/lib/crypto/krb/verify_checksum.c
U   branches/plugins/src/lib/crypto/krb/verify_checksum_iov.c
A   branches/plugins/src/lib/crypto/krb/yarrow/
U   branches/plugins/src/lib/crypto/krb/yarrow/Makefile.in
U   branches/plugins/src/lib/crypto/krb/yarrow/deps
D   branches/plugins/src/lib/crypto/krb/yarrow/plugin_prng_impl.c
D   branches/plugins/src/lib/crypto/krb/yarrow/plugin_prng_impl.h
U   branches/plugins/src/lib/krb5/Makefile.in
U   branches/plugins/src/lib/krb5/krb/Makefile.in
U   branches/plugins/src/plugin_core/impl/Makefile.in
U   branches/plugins/src/plugin_core/impl/deps
U   branches/plugins/src/plugin_core/impl/plugin_default_factory.c
U   branches/plugins/src/plugin_core/impl/plugin_default_factory.h
U   branches/plugins/src/plugins/pa/plugin_pa.h
D   branches/plugins/src/plugins/prng/plugin_yarrow/
Modified: branches/plugins/src/Makefile.in
===================================================================
--- branches/plugins/src/Makefile.in	2010-05-25 15:36:40 UTC (rev 24103)
+++ branches/plugins/src/Makefile.in	2010-05-26 17:54:37 UTC (rev 24104)
@@ -7,7 +7,7 @@
 #	plugins/preauth/wpse
 #	plugins/preauth/cksum_body
 #	plugins/authdata/greet
-SUBDIRS=util include plugin_core   plugins/prng \
+SUBDIRS=util include plugin_core plugin_core/impl   plugins/prng \
 	plugins/pa plugins/pa/encrypted_challenge \
 	lib \
 	@ldap_plugin_dir@ \
@@ -202,6 +202,7 @@
 	lib\crypto\@CRYPTO_IMPL@\hash_provider\Makefile \
 	lib\crypto\krb\keyhash_provider\Makefile \
 	lib\crypto\krb\prf\Makefile lib\crypto\krb\rand2key\Makefile \
+	lib\crypto\krb\yarrow\Makefile \
 	lib\crypto\krb\raw\Makefile lib\crypto\krb\old\Makefile \
 	lib\crypto\@CRYPTO_IMPL@\sha1\Makefile lib\crypto\@CRYPTO_IMPL@\arcfour\Makefile \
 	lib\crypto\@CRYPTO_IMPL@\md4\Makefile lib\crypto\@CRYPTO_IMPL@\md5\Makefile \

Modified: branches/plugins/src/configure.in
===================================================================
--- branches/plugins/src/configure.in	2010-05-25 15:36:40 UTC (rev 24103)
+++ branches/plugins/src/configure.in	2010-05-26 17:54:37 UTC (rev 24104)
@@ -1076,6 +1076,7 @@
 	lib/crypto/krb/dk lib/crypto/$CRYPTO_IMPL/enc_provider
 	lib/crypto/$CRYPTO_IMPL/hash_provider lib/crypto/krb/checksum
 	lib/crypto/krb/prf lib/crypto/krb/rand2key
+	lib/crypto/krb/yarrow
 	lib/crypto/$CRYPTO_IMPL lib/crypto/$CRYPTO_IMPL/md4 lib/crypto/$CRYPTO_IMPL/md5
 	lib/crypto/krb/old lib/crypto/krb/raw lib/crypto/$CRYPTO_IMPL/sha1
 	lib/crypto/krb/arcfour lib/crypto/$CRYPTO_IMPL/aes
@@ -1117,7 +1118,6 @@
 
 	plugins/prng
 	plugin_core/impl
-	plugins/prng/plugin_yarrow
 	plugins/pa
 	plugins/pa/encrypted_challenge
 	plugin_core

Modified: branches/plugins/src/include/k5-int.h
===================================================================
--- branches/plugins/src/include/k5-int.h	2010-05-25 15:36:40 UTC (rev 24103)
+++ branches/plugins/src/include/k5-int.h	2010-05-26 17:54:37 UTC (rev 24104)
@@ -813,7 +813,7 @@
 /*
  * Internal - for cleanup.
  */
-extern void krb5int_prng_cleanup(krb5_context context);
+extern void krb5int_prng_cleanup(void);
 
 
 #ifdef KRB5_OLD_CRYPTO
@@ -2554,8 +2554,8 @@
 extern krb5_error_code
 krb5int_c_mandatory_cksumtype(krb5_context, krb5_enctype, krb5_cksumtype *);
 
-extern int krb5int_crypto_init (krb5_context);
-extern int krb5int_prng_init(krb5_context context);
+extern int krb5int_crypto_init (void);
+extern int krb5int_prng_init(void);
 
 /*
  * Referral definitions, debugging hooks, and subfunctions.

Modified: branches/plugins/src/lib/Makefile.in
===================================================================
--- branches/plugins/src/lib/Makefile.in	2010-05-25 15:36:40 UTC (rev 24103)
+++ branches/plugins/src/lib/Makefile.in	2010-05-26 17:54:37 UTC (rev 24104)
@@ -1,5 +1,5 @@
 mydir=lib
-SUBDIRS=crypto ../plugins/prng/plugin_yarrow ../plugin_core/impl krb5 gssapi rpc kdb kadm5 apputils
+SUBDIRS=crypto  ../plugin_core/impl krb5 gssapi rpc kdb kadm5 apputils
 BUILDTOP=$(REL)..
 
 all-unix::

Modified: branches/plugins/src/lib/crypto/Makefile.in
===================================================================
--- branches/plugins/src/lib/crypto/Makefile.in	2010-05-25 15:36:40 UTC (rev 24103)
+++ branches/plugins/src/lib/crypto/Makefile.in	2010-05-26 17:54:37 UTC (rev 24104)
@@ -18,27 +18,35 @@
 LIBFINIFUNC=cryptoint_cleanup_library
 RELDIR=crypto
 
-STOBJLISTS=krb/crc32/OBJS.ST krb/dk/OBJS.ST @CRYPTO_IMPL@/enc_provider/OBJS.ST	\
-	@CRYPTO_IMPL@/hash_provider/OBJS.ST krb/checksum/OBJS.ST  		\
-	krb/prf/OBJS.ST krb/rand2key/OBJS.ST 		 			\
-	krb/old/OBJS.ST krb/raw/OBJS.ST  			\
-	@CRYPTO_IMPL@/md4/OBJS.ST @CRYPTO_IMPL@/md5/OBJS.ST @CRYPTO_IMPL@/sha1/OBJS.ST 		\
-	krb/arcfour/OBJS.ST  @CRYPTO_IMPL@/aes/OBJS.ST @CRYPTO_IMPL@/des/OBJS.ST	\
-	krb/OBJS.ST  @CRYPTO_IMPL@/OBJS.ST
+STOBJLISTS=krb/crc32/OBJS.ST krb/dk/OBJS.ST				\
+	@CRYPTO_IMPL@/enc_provider/OBJS.ST				\
+	@CRYPTO_IMPL@/hash_provider/OBJS.ST				\
+	krb/checksum/OBJS.ST krb/prf/OBJS.ST krb/rand2key/OBJS.ST	\
+	krb/old/OBJS.ST krb/raw/OBJS.ST krb/yarrow/OBJS.ST		\
+	@CRYPTO_IMPL@/md4/OBJS.ST @CRYPTO_IMPL@/md5/OBJS.ST		\
+	@CRYPTO_IMPL@/sha1/OBJS.ST					\
+	krb/arcfour/OBJS.ST						\
+	@CRYPTO_IMPL@/aes/OBJS.ST @CRYPTO_IMPL@/des/OBJS.ST		\
+	krb/OBJS.ST							\
+	@CRYPTO_IMPL@/OBJS.ST
 
-SUBDIROBJLISTS=krb/crc32/OBJS.ST krb/dk/OBJS.ST @CRYPTO_IMPL@/enc_provider/OBJS.ST 	\
-	@CRYPTO_IMPL@/hash_provider/OBJS.ST krb/checksum/OBJS.ST 		\
-	krb/prf/OBJS.ST krb/rand2key/OBJS.ST 		 			\
-	krb/old/OBJS.ST krb/raw/OBJS.ST   			\
-	@CRYPTO_IMPL@/md4/OBJS.ST @CRYPTO_IMPL@/md5/OBJS.ST	@CRYPTO_IMPL@/sha1/OBJS.ST 		\
-	krb/arcfour/OBJS.ST @CRYPTO_IMPL@/aes/OBJS.ST @CRYPTO_IMPL@/des/OBJS.ST		\
-	krb/OBJS.ST @CRYPTO_IMPL@/OBJS.ST
+SUBDIROBJLISTS=krb/crc32/OBJS.ST krb/dk/OBJS.ST				\
+	@CRYPTO_IMPL@/enc_provider/OBJS.ST				\
+	@CRYPTO_IMPL@/hash_provider/OBJS.ST				\
+	krb/checksum/OBJS.ST krb/prf/OBJS.ST krb/rand2key/OBJS.ST	\
+	krb/old/OBJS.ST krb/raw/OBJS.ST krb/yarrow/OBJS.ST		\
+	@CRYPTO_IMPL@/md4/OBJS.ST @CRYPTO_IMPL@/md5/OBJS.ST		\
+	@CRYPTO_IMPL@/sha1/OBJS.ST					\
+	krb/arcfour/OBJS.ST						\
+	@CRYPTO_IMPL@/aes/OBJS.ST @CRYPTO_IMPL@/des/OBJS.ST		\
+	krb/OBJS.ST							\
+	@CRYPTO_IMPL@/OBJS.ST
 
 # No dependencies.  Record places to find this shared object if the target
 # link editor and loader support it.
 DEPLIBS=
 SHLIB_DIRS=-L$(TOPLIBD)
-SHLIB_EXPLIBS= $(SUPPORT_LIB) @CRYPTO_LIBS@ $(LIBS) -lyaml  $(PLUGIN_CORE_DEPLIB)  $(PLUGIN_PRNG_DEPLIB) 
+SHLIB_EXPLIBS= $(SUPPORT_LIB) @CRYPTO_LIBS@ $(LIBS)
 SHLIB_EXPDEPLIBS= $(SUPPORT_DEPLIB)
 SHLIB_LDFLAGS= $(LDFLAGS) @SHLIB_RPATH_DIRS@
 SHLIB_LIBDIRS= @SHLIB_LIBDIRS@

Modified: branches/plugins/src/lib/crypto/crypto_tests/Makefile.in
===================================================================
--- branches/plugins/src/lib/crypto/crypto_tests/Makefile.in	2010-05-25 15:36:40 UTC (rev 24103)
+++ branches/plugins/src/lib/crypto/crypto_tests/Makefile.in	2010-05-26 17:54:37 UTC (rev 24104)
@@ -15,7 +15,7 @@
 DEFS=
 
 PLUGINS_LIBS = -lkrb5 	\
-	$(srcdir)/../../libplugin_impl.a $(srcdir)/../../libplugin_yarrow.a $(srcdir)/../../libencrypted_challenge.a \
+	$(srcdir)/../../libplugin_impl.a  $(srcdir)/../../libencrypted_challenge.a \
 	$(LIBS_PROFILE) $(PLUGIN_CORE_DEPLIB) 
 
 EXTRADEPSRCS=\

Modified: branches/plugins/src/lib/crypto/crypto_tests/t_cksum.c
===================================================================
--- branches/plugins/src/lib/crypto/crypto_tests/t_cksum.c	2010-05-25 15:36:40 UTC (rev 24103)
+++ branches/plugins/src/lib/crypto/crypto_tests/t_cksum.c	2010-05-26 17:54:37 UTC (rev 24104)
@@ -31,10 +31,7 @@
  */
 
 #include "k5-int.h"
-#include <plugin_default_manager.h>
-#include <plugin_prng.h>
 
-
 #define MD5_K5BETA_COMPAT
 #define MD4_K5BETA_COMPAT
 
@@ -99,34 +96,29 @@
     krb5_error_code       kret=0;
     krb5_data             plaintext;
     krb5_checksum         checksum, knowncksum;
-    plugin_manager* default_manager;
-    const char conf_path[] = "plugin_conf.yml";
 
-    default_manager = plugin_default_manager_get_instance();
-    set_plugin_manager_instance(default_manager);
+    krb5_context context;
+    krb5_init_context(&context);
 
-    plugin_manager_configure(conf_path);
-    plugin_manager_start();
-
     /* this is a terrible seed, but that's ok for the test. */
 
     plaintext.length = 8;
     plaintext.data = (char *) testkey;
 
-    krb5_c_random_seed(/* XXX */ 0, &plaintext);
+    krb5_c_random_seed(context, &plaintext);
 
     keyblock.enctype = ENCTYPE_DES_CBC_CRC;
     keyblock.length = sizeof(testkey);
     keyblock.contents = testkey;
 
-    krb5_k_create_key(NULL, &keyblock, &key);
+    krb5_k_create_key(context, &keyblock, &key);
 
     for (msgindex = 1; msgindex + 1 < argc; msgindex += 2) {
         plaintext.length = strlen(argv[msgindex]);
         plaintext.data = argv[msgindex];
 
         /* Create a checksum. */
-        kret = krb5_k_make_checksum(NULL, CKTYPE, key, 0, &plaintext,
+        kret = krb5_k_make_checksum(context, CKTYPE, key, 0, &plaintext,
                                     &checksum);
         if (kret != 0) {
             printf("krb5_calculate_checksum choked with %d\n", kret);
@@ -135,7 +127,7 @@
         print_checksum("correct", MD, argv[msgindex], &checksum);
 
         /* Verify it. */
-        kret = krb5_k_verify_checksum(NULL, key, 0, &plaintext, &checksum,
+        kret = krb5_k_verify_checksum(context, key, 0, &plaintext, &checksum,
                                       &valid);
         if (kret != 0) {
             printf("verify on new checksum choked with %d\n", kret);
@@ -150,7 +142,7 @@
 
         /* Corrupt the checksum and see if it still verifies. */
         checksum.contents[0]++;
-        kret = krb5_k_verify_checksum(NULL, key, 0, &plaintext, &checksum,
+        kret = krb5_k_verify_checksum(context, key, 0, &plaintext, &checksum,
                                       &valid);
         if (kret != 0) {
             printf("verify on new checksum choked with %d\n", kret);
@@ -171,7 +163,7 @@
             kret = 1;
             break;
         }
-        kret = krb5_k_verify_checksum(NULL, key, 0, &plaintext, &knowncksum,
+        kret = krb5_k_verify_checksum(context, key, 0, &plaintext, &knowncksum,
                                       &valid);
         if (kret != 0) {
             printf("verify on known checksum choked with %d\n", kret);
@@ -188,7 +180,8 @@
     if (!kret)
         printf("%d tests passed successfully for MD%d checksum\n", (argc-1)/2, MD);
 
-    krb5_k_free_key(NULL, key);
+    krb5_k_free_key(context, key);
 
     return(kret);
 }
+

Modified: branches/plugins/src/lib/crypto/crypto_tests/t_encrypt.c
===================================================================
--- branches/plugins/src/lib/crypto/crypto_tests/t_encrypt.c	2010-05-25 15:36:40 UTC (rev 24103)
+++ branches/plugins/src/lib/crypto/crypto_tests/t_encrypt.c	2010-05-26 17:54:37 UTC (rev 24104)
@@ -34,8 +34,6 @@
 #include "k5-int.h"
 #include "etypes.h"
 #include <stdio.h>
-#include <plugin_default_manager.h>
-#include <plugin_prng.h>
 
 
 /* What enctypes should we test?*/
@@ -101,15 +99,8 @@
     krb5_enc_data enc_out, enc_out2;
     krb5_keyblock *keyblock;
     krb5_key key;
-    plugin_manager* default_manager;
-    const char conf_path[] = "plugin_conf.yml";
+    krb5_init_context(&context);
 
-        default_manager = plugin_default_manager_get_instance();
-        set_plugin_manager_instance(default_manager);
-
-        plugin_manager_configure(conf_path);
-        plugin_manager_start();
-
     memset(iov, 0, sizeof(iov));
 
     in.data = "This is a test.\n";

Modified: branches/plugins/src/lib/crypto/crypto_tests/t_kperf.c
===================================================================
--- branches/plugins/src/lib/crypto/crypto_tests/t_kperf.c	2010-05-25 15:36:40 UTC (rev 24103)
+++ branches/plugins/src/lib/crypto/crypto_tests/t_kperf.c	2010-05-26 17:54:37 UTC (rev 24104)
@@ -57,7 +57,10 @@
     krb5_enc_data outblock;
     krb5_checksum sum;
     krb5_boolean val;
+    krb5_context ctx;
 
+    krb5_init_context ctx;
+
     if (argc != 5) {
         fprintf(stderr, "Usage: t_kperf {c|k}{e|d|m|v} type size nblocks\n");
         exit(1);
@@ -76,9 +79,9 @@
 
     block.data = "notrandom";
     block.length = 9;
-    krb5_c_random_seed(NULL, &block);
+    krb5_c_random_seed(ctx, &block);
 
-    krb5_c_make_random_key(NULL, enctype, &kblock);
+    krb5_c_make_random_key(ctx, enctype, &kblock);
     krb5_k_create_key(NULL, &kblock, &key);
 
     block.length = blocksize;

Modified: branches/plugins/src/lib/crypto/crypto_tests/t_prng.c
===================================================================
--- branches/plugins/src/lib/crypto/crypto_tests/t_prng.c	2010-05-25 15:36:40 UTC (rev 24103)
+++ branches/plugins/src/lib/crypto/crypto_tests/t_prng.c	2010-05-26 17:54:37 UTC (rev 24104)
@@ -49,14 +49,30 @@
     unsigned int source_id, seed_length;
     unsigned int i;
 //#if 0
+    krb5_context ctx;
     plugin_manager* default_manager;
-    const char conf_path[] = "plugin_conf.yml";
+    static plugin_manager* plugin_mngr_instance = NULL;
 
+//    ret = krb5int_initialize_library();
+    //if (ret) return ret;
+
+    ctx = calloc(1, sizeof(struct _krb5_context));
+    if (!ctx) return ENOMEM;
+
+    /* Plugin initialization */
+    plugin_default_manager_get_instance(&plugin_mngr_instance);
+    set_plugin_manager_instance(&ctx->pl_handle,  plugin_mngr_instance);
+    plugin_manager_configure(ctx->pl_handle, "");
+    plugin_manager_start(ctx->pl_handle);
+/*
+
         default_manager = plugin_default_manager_get_instance();
         set_plugin_manager_instance(default_manager);
 
-        plugin_manager_configure(conf_path);
+        plugin_manager_configure("");
         plugin_manager_start();
+*/
+
 //#endif
     while (1) {
         /* Read source*/
@@ -73,7 +89,7 @@
                 input.data[seed_length-lc] = (unsigned) (i&0xff);
             }
             input.length = seed_length;
-            assert (krb5_c_random_add_entropy (0, source_id, &input) == 0);
+            assert (krb5_c_random_add_entropy (ctx, source_id, &input) == 0);
             free (input.data);
             input.data = NULL;
         }
@@ -82,7 +98,7 @@
         if (i) {
             assert ((output.data = malloc (i)) != NULL);
             output.length = i;
-            ret = krb5_c_random_make_octets (0, &output);
+            ret = krb5_c_random_make_octets (ctx, &output);
             if (ret)
                 printf ("failed\n");
             else {

Modified: branches/plugins/src/lib/crypto/crypto_tests/t_short.c
===================================================================
--- branches/plugins/src/lib/crypto/crypto_tests/t_short.c	2010-05-25 15:36:40 UTC (rev 24103)
+++ branches/plugins/src/lib/crypto/crypto_tests/t_short.c	2010-05-26 17:54:37 UTC (rev 24104)
@@ -31,8 +31,6 @@
  */
 
 #include "k5-int.h"
-#include <plugin_default_manager.h>
-#include <plugin_prng.h>
 
 
 krb5_enctype interesting_enctypes[] = {
@@ -71,7 +69,7 @@
 }
 
 static void
-test_enctype(krb5_enctype enctype)
+test_enctype(krb5_context context, krb5_enctype enctype)
 {
     krb5_error_code ret;
     krb5_keyblock keyblock;
@@ -83,7 +81,7 @@
 
     printf("Testing enctype %d\n", (int) enctype);
     x(krb5_c_encrypt_length(NULL, enctype, 0, &min_len));
-    x(krb5_c_make_random_key(NULL, enctype, &keyblock));
+    x(krb5_c_make_random_key(context, enctype, &keyblock));
     input.enctype = enctype;
 
     /* Try each length up to the minimum length. */
@@ -119,19 +117,14 @@
 {
     int i;
     krb5_data notrandom;
-    plugin_manager* default_manager;
-    const char conf_path[] = "plugin_conf.yml";
+    krb5_context context;
 
-        default_manager = plugin_default_manager_get_instance();
-        set_plugin_manager_instance(default_manager);
+    krb5_init_context(&context);
 
-        plugin_manager_configure(conf_path);
-        plugin_manager_start();
-
     notrandom.data = "notrandom";
     notrandom.length = 9;
-    krb5_c_random_seed(NULL, &notrandom);
+    krb5_c_random_seed(context, &notrandom);
     for (i = 0; interesting_enctypes[i]; i++)
-        test_enctype(interesting_enctypes[i]);
+        test_enctype(context, interesting_enctypes[i]);
     return 0;
 }

Modified: branches/plugins/src/lib/crypto/krb/Makefile.in
===================================================================
--- branches/plugins/src/lib/crypto/krb/Makefile.in	2010-05-25 15:36:40 UTC (rev 24103)
+++ branches/plugins/src/lib/crypto/krb/Makefile.in	2010-05-26 17:54:37 UTC (rev 24104)
@@ -1,15 +1,14 @@
 mydir=lib/crypto/krb
 BUILDTOP=$(REL)..$(S)..$(S)..
 SUBDIRS= arcfour checksum crc32 dk \
-	prf rand2key old raw 
+	prf rand2key old raw yarrow 
 LOCALINCLUDES = -I$(srcdir) -I$(srcdir)/../@CRYPTO_IMPL@/enc_provider -I$(srcdir)/dk	\
 		-I$(srcdir)/../@CRYPTO_IMPL@/hash_provider				\
 		-I$(srcdir)/prf -I$(srcdir)/rand2key		 			\
-		-I$(srcdir)/old -I$(srcdir)/raw  			\
+		-I$(srcdir)/old -I$(srcdir)/raw -I$(srcdir)/yarrow 			\
 		-I$(srcdir)/../@CRYPTO_IMPL@/ -I$(srcdir)/../@CRYPTO_IMPL@/des		\
 		-I$(srcdir)/../@CRYPTO_IMPL@/aes -I$(srcdir)/arcfour 	\
-		-I$(srcdir)/../@CRYPTO_IMPL@/sha1 -I$(srcdir)/../@CRYPTO_IMPL@	\
-		-I$(BUILDTOP)/plugins/prng -I$(BUILDTOP)/plugin_core
+		-I$(srcdir)/../@CRYPTO_IMPL@/sha1 -I$(srcdir)/../@CRYPTO_IMPL@
 PROG_LIBPATH=-L$(TOPLIBD)
 PROG_RPATH=$(KRB5_LIBDIR)
 DEFS=
@@ -144,11 +143,11 @@
 
 STOBJLISTS=arcfour/OBJS.ST checksum/OBJS.ST crc32/OBJS.ST	\
 	dk/OBJS.ST prf/OBJS.ST rand2key/OBJS.ST			\
-	old/OBJS.ST raw/OBJS.ST  OBJS.ST
+	old/OBJS.ST raw/OBJS.ST  yarrow/OBJS.ST  OBJS.ST
 
 SUBDIROBJLISTS=arcfour/OBJS.ST checksum/OBJS.ST crc32/OBJS.ST	\
 	dk/OBJS.ST prf/OBJS.ST rand2key/OBJS.ST			\
-	old/OBJS.ST raw/OBJS.ST  
+	old/OBJS.ST raw/OBJS.ST  yarrow/OBJS.ST 
 
 ##DOS##LIBOBJS = $(OBJS)
 
@@ -184,6 +183,9 @@
 	cd ..\raw
 	@echo Making in crypto\raw
 	$(MAKE) -$(MFLAGS)
+	cd ..\yarrow
+	@echo Making in crypto\yarrow
+	$(MAKE) -$(MFLAGS)
 	cd ..
 
 clean-windows::
@@ -211,6 +213,9 @@
 	cd ..\raw
 	@echo Making clean in crypto\raw
 	$(MAKE) -$(MFLAGS) clean
+	cd ..\yarrow
+	@echo Making clean in crypto\yarrow
+	$(MAKE) -$(MFLAGS) clean
 	cd ..
 
 check-windows::
@@ -238,6 +243,9 @@
 	cd ..\raw
 	@echo Making check in crypto\raw
 	$(MAKE) -$(MFLAGS) check
+	cd ..\yarrow
+	@echo Making check in crypto\yarrow
+	$(MAKE) -$(MFLAGS) check
 	cd ..
 
 

Modified: branches/plugins/src/lib/crypto/krb/aead.c
===================================================================
--- branches/plugins/src/lib/crypto/krb/aead.c	2010-05-25 15:36:40 UTC (rev 24103)
+++ branches/plugins/src/lib/crypto/krb/aead.c	2010-05-26 17:54:37 UTC (rev 24104)
@@ -232,7 +232,7 @@
 }
 
 krb5_error_code
-krb5int_c_iov_decrypt_stream(krb5_context ctx, const struct krb5_keytypes *ktp, krb5_key key,
+krb5int_c_iov_decrypt_stream(const struct krb5_keytypes *ktp, krb5_key key,
                              krb5_keyusage keyusage, const krb5_data *ivec,
                              krb5_crypto_iov *data, size_t num_data)
 {
@@ -292,7 +292,7 @@
 
     assert(i <= num_data + 2);
 
-    ret = ktp->decrypt(ctx, ktp, key, keyusage, ivec, iov, i);
+    ret = ktp->decrypt(ktp, key, keyusage, ivec, iov, i);
     free(iov);
     return ret;
 }

Modified: branches/plugins/src/lib/crypto/krb/aead.h
===================================================================
--- branches/plugins/src/lib/crypto/krb/aead.h	2010-05-25 15:36:40 UTC (rev 24103)
+++ branches/plugins/src/lib/crypto/krb/aead.h	2010-05-26 17:54:37 UTC (rev 24104)
@@ -75,7 +75,7 @@
                         struct iov_block_state *iov_state);
 
 krb5_error_code
-krb5int_c_iov_decrypt_stream(krb5_context, const struct krb5_keytypes *ktp, krb5_key key,
+krb5int_c_iov_decrypt_stream(const struct krb5_keytypes *ktp, krb5_key key,
                              krb5_keyusage keyusage, const krb5_data *ivec,
                              krb5_crypto_iov *data, size_t num_data);
 

Modified: branches/plugins/src/lib/crypto/krb/cksumtypes.h
===================================================================
--- branches/plugins/src/lib/crypto/krb/cksumtypes.h	2010-05-25 15:36:40 UTC (rev 24103)
+++ branches/plugins/src/lib/crypto/krb/cksumtypes.h	2010-05-26 17:54:37 UTC (rev 24104)
@@ -39,7 +39,7 @@
  * fill in the contents.  If ctp->enc is not NULL, the handler can assume that
  * key is a valid-length key of an enctype which uses that enc provider.
  */
-typedef krb5_error_code (*checksum_func)(krb5_context, const struct krb5_cksumtypes *ctp,
+typedef krb5_error_code (*checksum_func)(const struct krb5_cksumtypes *ctp,
                                          krb5_key key, krb5_keyusage usage,
                                          const krb5_crypto_iov *data,
                                          size_t num_data,
@@ -52,7 +52,7 @@
  * ctp->enc is not NULL, the handler can assume that key a valid-length key of
  * an enctype which uses that enc provider.
  */
-typedef krb5_error_code (*verify_func)(krb5_context, const struct krb5_cksumtypes *ctp,
+typedef krb5_error_code (*verify_func)(const struct krb5_cksumtypes *ctp,
                                        krb5_key key, krb5_keyusage usage,
                                        const krb5_crypto_iov *data,
                                        size_t num_data,

Modified: branches/plugins/src/lib/crypto/krb/combine_keys.c
===================================================================
--- branches/plugins/src/lib/crypto/krb/combine_keys.c	2010-05-25 15:36:40 UTC (rev 24103)
+++ branches/plugins/src/lib/crypto/krb/combine_keys.c	2010-05-26 17:54:37 UTC (rev 24104)
@@ -47,7 +47,7 @@
 #include "etypes.h"
 #include "dk.h"
 
-static krb5_error_code dr(krb5_context ctx, const struct krb5_enc_provider *enc,
+static krb5_error_code dr(const struct krb5_enc_provider *enc,
                           const krb5_keyblock *inkey, unsigned char *outdata,
                           const krb5_data *in_constant);
 
@@ -125,13 +125,13 @@
 
     input.length = key2->length;
     input.data = (char *) key2->contents;
-    ret = dr(context, enc, key1, r1, &input);
+    ret = dr(enc, key1, r1, &input);
     if (ret)
         goto cleanup;
 
     input.length = key1->length;
     input.data = (char *) key1->contents;
-    ret = dr(context, enc, key2, r2, &input);
+    ret = dr(enc, key2, r2, &input);
     if (ret)
         goto cleanup;
 
@@ -191,7 +191,7 @@
         myalloc = TRUE;
     }
 
-    ret = krb5int_derive_keyblock(context, enc, tkey, outkey, &input);
+    ret = krb5int_derive_keyblock(enc, tkey, outkey, &input);
     if (ret) {
         if (myalloc) {
             free(outkey->contents);
@@ -212,7 +212,7 @@
 
 /* Our DR function, a simple wrapper around krb5int_derive_random(). */
 static krb5_error_code
-dr(krb5_context ctx, const struct krb5_enc_provider *enc, const krb5_keyblock *inkey,
+dr(const struct krb5_enc_provider *enc, const krb5_keyblock *inkey,
    unsigned char *out, const krb5_data *in_constant)
 {
     krb5_data outdata = make_data(out, enc->keybytes);
@@ -222,7 +222,7 @@
     ret = krb5_k_create_key(NULL, inkey, &key);
     if (ret != 0)
         return ret;
-    ret = krb5int_derive_random(ctx, enc, key, &outdata, in_constant);
+    ret = krb5int_derive_random(enc, key, &outdata, in_constant);
     krb5_k_free_key(NULL, key);
     return ret;
 }

Modified: branches/plugins/src/lib/crypto/krb/crypto_libinit.c
===================================================================
--- branches/plugins/src/lib/crypto/krb/crypto_libinit.c	2010-05-25 15:36:40 UTC (rev 24103)
+++ branches/plugins/src/lib/crypto/krb/crypto_libinit.c	2010-05-26 17:54:37 UTC (rev 24104)
@@ -2,34 +2,33 @@
 #include <assert.h>
 #include "k5-int.h"
 
-// MAKE_INIT_FUNCTION(cryptoint_initialize_library);
-// MAKE_FINI_FUNCTION(cryptoint_cleanup_library);
+MAKE_INIT_FUNCTION(cryptoint_initialize_library);
+MAKE_FINI_FUNCTION(cryptoint_cleanup_library);
 
-extern int krb5int_prng_init(krb5_context);
-extern void krb5int_prng_cleanup (krb5_context);
+extern int krb5int_prng_init(void);
+extern void krb5int_prng_cleanup (void);
 
 /*
  * Initialize the crypto library.
  */
 
-int cryptoint_initialize_library (krb5_context ctx)
+int cryptoint_initialize_library (void)
 {
-    return krb5int_prng_init(ctx);
+    return krb5int_prng_init();
 }
 
-int krb5int_crypto_init(krb5_context ctx)
+int krb5int_crypto_init(void)
 {
-  //  return CALL_INIT_FUNCTION(cryptoint_initialize_library);
-return  cryptoint_initialize_library ( ctx);
+    return CALL_INIT_FUNCTION(cryptoint_initialize_library);
 }
 
 /*
  * Clean up the crypto library state
  */
 
-void cryptoint_cleanup_library (krb5_context ctx)
+void cryptoint_cleanup_library (void)
 {
-// ??? temp ???    if (!INITIALIZER_RAN(cryptoint_initialize_library))
-//        return;
-    krb5int_prng_cleanup (ctx);
+    if (!INITIALIZER_RAN(cryptoint_initialize_library))
+        return;
+    krb5int_prng_cleanup ();
 }

Modified: branches/plugins/src/lib/crypto/krb/decrypt.c
===================================================================
--- branches/plugins/src/lib/crypto/krb/decrypt.c	2010-05-25 15:36:40 UTC (rev 24103)
+++ branches/plugins/src/lib/crypto/krb/decrypt.c	2010-05-26 17:54:37 UTC (rev 24104)
@@ -77,7 +77,7 @@
     memcpy(iov[3].data.data, input->ciphertext.data + header_len + plain_len,
            trailer_len);
 
-    ret = ktp->decrypt(context, ktp, key, usage, ivec, iov, 4);
+    ret = ktp->decrypt(ktp, key, usage, ivec, iov, 4);
     if (ret != 0)
         zap(output->data, plain_len);
     else

Modified: branches/plugins/src/lib/crypto/krb/decrypt_iov.c
===================================================================
--- branches/plugins/src/lib/crypto/krb/decrypt_iov.c	2010-05-25 15:36:40 UTC (rev 24103)
+++ branches/plugins/src/lib/crypto/krb/decrypt_iov.c	2010-05-26 17:54:37 UTC (rev 24104)
@@ -42,11 +42,11 @@
 
     if (krb5int_c_locate_iov(data, num_data,
                              KRB5_CRYPTO_TYPE_STREAM) != NULL) {
-        return krb5int_c_iov_decrypt_stream(context, ktp, key, usage, cipher_state,
+        return krb5int_c_iov_decrypt_stream(ktp, key, usage, cipher_state,
                                             data, num_data);
     }
 
-    return ktp->decrypt(context, ktp, key, usage, cipher_state, data, num_data);
+    return ktp->decrypt(ktp, key, usage, cipher_state, data, num_data);
 }
 
 krb5_error_code KRB5_CALLCONV

Modified: branches/plugins/src/lib/crypto/krb/deps
===================================================================
--- branches/plugins/src/lib/crypto/krb/deps	2010-05-25 15:36:40 UTC (rev 24103)
+++ branches/plugins/src/lib/crypto/krb/deps	2010-05-26 17:54:37 UTC (rev 24104)
@@ -338,7 +338,8 @@
   $(BUILDTOP)/include/krb5/krb5.h $(BUILDTOP)/include/osconf.h \
   $(BUILDTOP)/include/profile.h $(COM_ERR_DEPS) $(srcdir)/../builtin/enc_provider/enc_provider.h \
   $(srcdir)/../builtin/sha1/shs.h $(srcdir)/../builtin/yhash.h \
-  $(top_srcdir)/include/k5-buf.h \
+  $(srcdir)/yarrow/yarrow.h $(srcdir)/yarrow/ycipher.h \
+  $(srcdir)/yarrow/ytypes.h $(top_srcdir)/include/k5-buf.h \
   $(top_srcdir)/include/k5-err.h $(top_srcdir)/include/k5-gmt_mktime.h \
   $(top_srcdir)/include/k5-int-pkinit.h $(top_srcdir)/include/k5-int.h \
   $(top_srcdir)/include/k5-platform.h $(top_srcdir)/include/k5-plugin.h \

Modified: branches/plugins/src/lib/crypto/krb/dk/checksum.c
===================================================================
--- branches/plugins/src/lib/crypto/krb/dk/checksum.c	2010-05-25 15:36:40 UTC (rev 24103)
+++ branches/plugins/src/lib/crypto/krb/dk/checksum.c	2010-05-26 17:54:37 UTC (rev 24104)
@@ -33,7 +33,7 @@
 #define K5CLENGTH 5 /* 32 bit net byte order integer + one byte seed */
 
 krb5_error_code
-krb5int_dk_checksum(krb5_context context, const struct krb5_cksumtypes *ctp,
+krb5int_dk_checksum(const struct krb5_cksumtypes *ctp,
                     krb5_key key, krb5_keyusage usage,
                     const krb5_crypto_iov *data, size_t num_data,
                     krb5_data *output)
@@ -57,7 +57,7 @@
     datain = make_data(constantdata, K5CLENGTH);
     store_32_be(usage, constantdata);
     constantdata[4] = (char) 0x99;
-    ret = krb5int_derive_key(context, enc, key, &kc, &datain);
+    ret = krb5int_derive_key(enc, key, &kc, &datain);
     if (ret)
         return ret;
 

Modified: branches/plugins/src/lib/crypto/krb/dk/derive.c
===================================================================
--- branches/plugins/src/lib/crypto/krb/dk/derive.c	2010-05-25 15:36:40 UTC (rev 24103)
+++ branches/plugins/src/lib/crypto/krb/dk/derive.c	2010-05-26 17:54:37 UTC (rev 24104)
@@ -80,7 +80,7 @@
 }
 
 krb5_error_code
-krb5int_derive_random(krb5_context context, const struct krb5_enc_provider *enc,
+krb5int_derive_random(const struct krb5_enc_provider *enc,
                       krb5_key inkey, krb5_data *outrnd,
                       const krb5_data *in_constant)
 {
@@ -137,7 +137,7 @@
  * the same inkey and constant.
  */
 krb5_error_code
-krb5int_derive_keyblock(krb5_context context, const struct krb5_enc_provider *enc,
+krb5int_derive_keyblock(const struct krb5_enc_provider *enc,
                         krb5_key inkey, krb5_keyblock *outkey,
                         const krb5_data *in_constant)
 {
@@ -150,7 +150,7 @@
         goto cleanup;
 
     /* Derive pseudo-random data for the key bytes. */
-    ret = krb5int_derive_random(context, enc, inkey, &rawkey, in_constant);
+    ret = krb5int_derive_random(enc, inkey, &rawkey, in_constant);
     if (ret)
         goto cleanup;
 
@@ -163,7 +163,7 @@
 }
 
 krb5_error_code
-krb5int_derive_key(krb5_context context, const struct krb5_enc_provider *enc,
+krb5int_derive_key(const struct krb5_enc_provider *enc,
                    krb5_key inkey, krb5_key *outkey,
                    const krb5_data *in_constant)
 {
@@ -189,7 +189,7 @@
     keyblock.enctype = inkey->keyblock.enctype;
     if (keyblock.contents == NULL)
         return ENOMEM;
-    ret = krb5int_derive_keyblock(context, enc, inkey, &keyblock, in_constant);
+    ret = krb5int_derive_keyblock(enc, inkey, &keyblock, in_constant);
     if (ret)
         goto cleanup;
 

Modified: branches/plugins/src/lib/crypto/krb/dk/dk.h
===================================================================
--- branches/plugins/src/lib/crypto/krb/dk/dk.h	2010-05-25 15:36:40 UTC (rev 24103)
+++ branches/plugins/src/lib/crypto/krb/dk/dk.h	2010-05-26 17:54:37 UTC (rev 24104)
@@ -38,44 +38,44 @@
                           krb5_cryptotype type);
 
 krb5_error_code
-krb5int_dk_encrypt(krb5_context, const struct krb5_keytypes *ktp, krb5_key key,
+krb5int_dk_encrypt(const struct krb5_keytypes *ktp, krb5_key key,
                    krb5_keyusage usage, const krb5_data *ivec,
                    krb5_crypto_iov *data, size_t num_data);
 
 krb5_error_code
-krb5int_dk_decrypt(krb5_context, const struct krb5_keytypes *ktp, krb5_key key,
+krb5int_dk_decrypt(const struct krb5_keytypes *ktp, krb5_key key,
                    krb5_keyusage usage, const krb5_data *ivec,
                    krb5_crypto_iov *data, size_t num_data);
 
 krb5_error_code
-krb5int_dk_string_to_key(krb5_context ctx, const struct krb5_keytypes *enc,
+krb5int_dk_string_to_key(const struct krb5_keytypes *enc,
                          const krb5_data *string, const krb5_data *salt,
                          const krb5_data *params, krb5_keyblock *key);
 
 krb5_error_code
-krb5int_aes_string_to_key(krb5_context ctx, const struct krb5_keytypes *enc,
+krb5int_aes_string_to_key(const struct krb5_keytypes *enc,
                           const krb5_data *string, const krb5_data *salt,
                           const krb5_data *params, krb5_keyblock *key);
 
 krb5_error_code
-krb5int_derive_keyblock(krb5_context, const struct krb5_enc_provider *enc,
+krb5int_derive_keyblock(const struct krb5_enc_provider *enc,
                         krb5_key inkey,
                         krb5_keyblock *outkey,
                         const krb5_data *in_constant);
 
 krb5_error_code
-krb5int_derive_key(krb5_context, const struct krb5_enc_provider *enc,
+krb5int_derive_key(const struct krb5_enc_provider *enc,
                    krb5_key inkey,
                    krb5_key *outkey,
                    const krb5_data *in_constant);
 
 krb5_error_code
-krb5int_dk_checksum(krb5_context, const struct krb5_cksumtypes *ctp,
+krb5int_dk_checksum(const struct krb5_cksumtypes *ctp,
                     krb5_key key, krb5_keyusage usage,
                     const krb5_crypto_iov *data, size_t num_data,
                     krb5_data *output);
 
 krb5_error_code
-krb5int_derive_random(krb5_context, const struct krb5_enc_provider *enc,
+krb5int_derive_random(const struct krb5_enc_provider *enc,
                       krb5_key inkey, krb5_data *outrnd,
                       const krb5_data *in_constant);

Modified: branches/plugins/src/lib/crypto/krb/dk/dk_aead.c
===================================================================
--- branches/plugins/src/lib/crypto/krb/dk/dk_aead.c	2010-05-25 15:36:40 UTC (rev 24103)
+++ branches/plugins/src/lib/crypto/krb/dk/dk_aead.c	2010-05-26 17:54:37 UTC (rev 24104)
@@ -69,7 +69,7 @@
 }
 
 krb5_error_code
-krb5int_dk_encrypt(krb5_context context, const struct krb5_keytypes *ktp, krb5_key key,
+krb5int_dk_encrypt(const struct krb5_keytypes *ktp, krb5_key key,
                    krb5_keyusage usage, const krb5_data *ivec,
                    krb5_crypto_iov *data, size_t num_data)
 {
@@ -134,13 +134,13 @@
 
     d1.data[4] = 0xAA;
 
-    ret = krb5int_derive_key(context, enc, key, &ke, &d1);
+    ret = krb5int_derive_key(enc, key, &ke, &d1);
     if (ret != 0)
         goto cleanup;
 
     d1.data[4] = 0x55;
 
-    ret = krb5int_derive_key(context, enc, key, &ki, &d1);
+    ret = krb5int_derive_key(enc, key, &ki, &d1);
     if (ret != 0)
         goto cleanup;
 
@@ -148,7 +148,7 @@
 
     header->data.length = enc->block_size;
 
-    ret = krb5_c_random_make_octets(/* XXX */ context, &header->data);
+    ret = krb5_c_random_make_octets(/* XXX */ NULL, &header->data);
     if (ret != 0)
         goto cleanup;
 
@@ -161,7 +161,7 @@
         goto cleanup;
 
     /* Encrypt the plaintext (header | data | padding) */
-    ret = enc->encrypt(/*context,*/ ke, ivec, data, num_data);
+    ret = enc->encrypt(ke, ivec, data, num_data);
     if (ret != 0)
         goto cleanup;
 
@@ -179,7 +179,7 @@
 }
 
 krb5_error_code
-krb5int_dk_decrypt(krb5_context context, const struct krb5_keytypes *ktp, krb5_key key,
+krb5int_dk_decrypt(const struct krb5_keytypes *ktp, krb5_key key,
                    krb5_keyusage usage, const krb5_data *ivec,
                    krb5_crypto_iov *data, size_t num_data)
 {
@@ -235,13 +235,13 @@
 
     d1.data[4] = 0xAA;
 
-    ret = krb5int_derive_key(context, enc, key, &ke, &d1);
+    ret = krb5int_derive_key(enc, key, &ke, &d1);
     if (ret != 0)
         goto cleanup;
 
     d1.data[4] = 0x55;
 
-    ret = krb5int_derive_key(context, enc, key, &ki, &d1);
+    ret = krb5int_derive_key(enc, key, &ki, &d1);
     if (ret != 0)
         goto cleanup;
 

Modified: branches/plugins/src/lib/crypto/krb/dk/stringtokey.c
===================================================================
--- branches/plugins/src/lib/crypto/krb/dk/stringtokey.c	2010-05-25 15:36:40 UTC (rev 24103)
+++ branches/plugins/src/lib/crypto/krb/dk/stringtokey.c	2010-05-26 17:54:37 UTC (rev 24104)
@@ -31,7 +31,7 @@
 #define kerberos_len (sizeof(kerberos)-1)
 
 krb5_error_code
-krb5int_dk_string_to_key(krb5_context ctx, const struct krb5_keytypes *ktp,
+krb5int_dk_string_to_key(const struct krb5_keytypes *ktp,
                          const krb5_data *string, const krb5_data *salt,
                          const krb5_data *parms, krb5_keyblock *keyblock)
 {
@@ -87,7 +87,7 @@
     indata.length = kerberos_len;
     indata.data = (char *) kerberos;
 
-    ret = krb5int_derive_keyblock(ctx, enc, foldkey, keyblock, &indata);
+    ret = krb5int_derive_keyblock(enc, foldkey, keyblock, &indata);
     if (ret != 0)
         memset(keyblock->contents, 0, keyblock->length);
 
@@ -104,7 +104,7 @@
 #define MAX_ITERATION_COUNT             0x1000000L
 
 krb5_error_code
-krb5int_aes_string_to_key(krb5_context ctx, const struct krb5_keytypes *ktp,
+krb5int_aes_string_to_key(const struct krb5_keytypes *ktp,
                           const krb5_data *string,
                           const krb5_data *salt,
                           const krb5_data *params,
@@ -150,7 +150,7 @@
     if (err)
         goto cleanup;
 
-    err = krb5int_derive_keyblock(ctx, ktp->enc, tempkey, key, &usage);
+    err = krb5int_derive_keyblock(ktp->enc, tempkey, key, &usage);
 
 cleanup:
     if (err)

Modified: branches/plugins/src/lib/crypto/krb/encrypt.c
===================================================================
--- branches/plugins/src/lib/crypto/krb/encrypt.c	2010-05-25 15:36:40 UTC (rev 24103)
+++ branches/plugins/src/lib/crypto/krb/encrypt.c	2010-05-26 17:54:37 UTC (rev 24104)
@@ -70,7 +70,7 @@
     iov[3].flags = KRB5_CRYPTO_TYPE_TRAILER;
     iov[3].data = make_data(iov[2].data.data + padding_len, trailer_len);
 
-    ret = ktp->encrypt(context, ktp, key, usage, ivec, iov, 4);
+    ret = ktp->encrypt(ktp, key, usage, ivec, iov, 4);
     if (ret != 0)
         zap(iov[1].data.data, iov[1].data.length);
     else

Modified: branches/plugins/src/lib/crypto/krb/encrypt_iov.c
===================================================================
--- branches/plugins/src/lib/crypto/krb/encrypt_iov.c	2010-05-25 15:36:40 UTC (rev 24103)
+++ branches/plugins/src/lib/crypto/krb/encrypt_iov.c	2010-05-26 17:54:37 UTC (rev 24104)
@@ -39,7 +39,7 @@
     if (ktp == NULL)
         return KRB5_BAD_ENCTYPE;
 
-    return ktp->encrypt(context, ktp, key, usage, cipher_state, data, num_data);
+    return ktp->encrypt(ktp, key, usage, cipher_state, data, num_data);
 }
 
 krb5_error_code KRB5_CALLCONV

Modified: branches/plugins/src/lib/crypto/krb/etypes.h
===================================================================
--- branches/plugins/src/lib/crypto/krb/etypes.h	2010-05-25 15:36:40 UTC (rev 24103)
+++ branches/plugins/src/lib/crypto/krb/etypes.h	2010-05-26 17:54:37 UTC (rev 24104)
@@ -35,7 +35,7 @@
 typedef unsigned int (*crypto_length_func)(const struct krb5_keytypes *ktp,
                                            krb5_cryptotype type);
 
-typedef krb5_error_code (*crypt_func)(krb5_context ctx, const struct krb5_keytypes *ktp,
+typedef krb5_error_code (*crypt_func)(const struct krb5_keytypes *ktp,
                                       krb5_key key, krb5_keyusage keyusage,
                                       const krb5_data *ivec,
                                       krb5_crypto_iov *data, size_t num_data);

Modified: branches/plugins/src/lib/crypto/krb/make_checksum.c
===================================================================
--- branches/plugins/src/lib/crypto/krb/make_checksum.c	2010-05-25 15:36:40 UTC (rev 24103)
+++ branches/plugins/src/lib/crypto/krb/make_checksum.c	2010-05-26 17:54:37 UTC (rev 24104)
@@ -63,7 +63,7 @@
 
     iov.flags = KRB5_CRYPTO_TYPE_DATA;
     iov.data = *input;
-    ret = ctp->checksum(context, ctp, key, usage, &iov, 1, &cksum_data);
+    ret = ctp->checksum(ctp, key, usage, &iov, 1, &cksum_data);
     if (ret != 0)
         goto cleanup;
 

Modified: branches/plugins/src/lib/crypto/krb/make_checksum_iov.c
===================================================================
--- branches/plugins/src/lib/crypto/krb/make_checksum_iov.c	2010-05-25 15:36:40 UTC (rev 24103)
+++ branches/plugins/src/lib/crypto/krb/make_checksum_iov.c	2010-05-26 17:54:37 UTC (rev 24104)
@@ -58,7 +58,7 @@
     if (ret != 0)
         return ret;
 
-    ret = ctp->checksum(context, ctp, key, usage, data, num_data, &cksum_data);
+    ret = ctp->checksum(ctp, key, usage, data, num_data, &cksum_data);
     if (ret != 0)
         goto cleanup;
 

Modified: branches/plugins/src/lib/crypto/krb/old_api_glue.c
===================================================================
--- branches/plugins/src/lib/crypto/krb/old_api_glue.c	2010-05-25 15:36:40 UTC (rev 24103)
+++ branches/plugins/src/lib/crypto/krb/old_api_glue.c	2010-05-26 17:54:37 UTC (rev 24104)
@@ -60,13 +60,11 @@
         if (ret)
             return ret;
 
-        ivecd.length = blocksize;
-        ivecd.data = ivec;
+        ivecd = make_data(ivec, blocksize);
     }
 
     /* size is the length of the input cleartext data. */
-    inputd.length = size;
-    inputd.data = inptr;
+    inputd = make_data((void *) inptr, size);
 
     /*
      * The size of the output buffer isn't part of the old api.  Not too
@@ -76,8 +74,7 @@
     if (ret)
         return ret;
 
-    outputd.ciphertext.length = outlen;
-    outputd.ciphertext.data = outptr;
+    outputd.ciphertext = make_data(outptr, outlen);
 
     return krb5_c_encrypt(context, eblock->key, 0, ivec ? &ivecd : 0,
                           &inputd, &outputd);
@@ -98,20 +95,17 @@
         if (ret)
             return ret;
 
-        ivecd.length = blocksize;
-        ivecd.data = ivec;
+        ivecd = make_data(ivec, blocksize);
     }
 
     /* size is the length of the input ciphertext data */
     inputd.enctype = eblock->key->enctype;
-    inputd.ciphertext.length = size;
-    inputd.ciphertext.data = inptr;
+    inputd.ciphertext = make_data((void *) inptr, size);
 
     /* we don't really know how big this is, but the code tends to assume
        that the output buffer size should be the same as the input
        buffer size */
-    outputd.length = size;
-    outputd.data = outptr;
+    outputd = make_data(outptr, size);
 
     return krb5_c_decrypt(context, eblock->key, 0, ivec ? &ivecd : 0,
                           &inputd, &outputd);
@@ -145,11 +139,8 @@
 krb5_init_random_key(krb5_context context, const krb5_encrypt_block *eblock,
                      const krb5_keyblock *keyblock, krb5_pointer *ptr)
 {
-    krb5_data data;
+    krb5_data data = make_data(keyblock->contents, keyblock->length);
 
-    data.length = keyblock->length;
-    data.data = (char *) keyblock->contents;
-
     return krb5_c_random_seed(context, &data);
 }
 
@@ -226,17 +217,14 @@
                         krb5_const_pointer seed, size_t seed_length,
                         krb5_checksum *outcksum)
 {
-    krb5_data input;
+    krb5_data input = make_data((void *) in, in_length);
     krb5_keyblock key;
     krb5_error_code ret;
     krb5_checksum cksum;
 
-    input.data = in;
-    input.length = in_length;
-
     key.enctype = ENCTYPE_NULL;
     key.length = seed_length;
-    key.contents = seed;
+    key.contents = (unsigned char *) seed;
 
     ret = krb5_c_make_checksum(context, ctype, &key, 0, &input, &cksum);
     if (ret)
@@ -264,16 +252,13 @@
                      size_t in_length, krb5_const_pointer seed,
                      size_t seed_length)
 {
-    krb5_data input;
+    krb5_data input = make_data((void *) in, in_length);
     krb5_keyblock key;
     krb5_error_code ret;
     krb5_boolean valid;
 
-    input.data = in;
-    input.length = in_length;
-
     key.length = seed_length;
-    key.contents = seed;
+    key.contents = (unsigned char *) seed;
 
     ret = krb5_c_verify_checksum(context, &key, 0, &input, cksum, &valid);
     if (ret)
@@ -288,11 +273,8 @@
 krb5_error_code KRB5_CALLCONV
 krb5_random_confounder(size_t size, krb5_pointer ptr)
 {
-    krb5_data random_data;
+    krb5_data random_data = make_data(ptr, size);
 
-    random_data.length = size;
-    random_data.data = ptr;
-
     return krb5_c_random_make_octets(NULL, &random_data);
 }
 
@@ -313,17 +295,15 @@
         if (ret)
             return ret;
 
-        ivecd.length = blocksize;
-        ivecd.data = ivec;
+        ivecd = make_data(ivec, blocksize);
     }
 
     enc_data->magic = KV5M_ENC_DATA;
     enc_data->kvno = 0;
     enc_data->enctype = key->enctype;
-    enc_data->ciphertext.length = enclen;
-    enc_data->ciphertext.data = malloc(enclen);
-    if (enc_data->ciphertext.data == NULL)
-        return ENOMEM;
+    ret = alloc_data(&enc_data->ciphertext, enclen);
+    if (ret)
+        return ret;
 
     ret = krb5_c_encrypt(context, key, 0, ivec ? &ivecd : 0, data, enc_data);
     if (ret)
@@ -345,14 +325,12 @@
         if (ret)
             return ret;
 
-        ivecd.length = blocksize;
-        ivecd.data = ivec;
+        ivecd = make_data(ivec, blocksize);
     }
 
-    data->length = enc_data->ciphertext.length;
-    data->data = malloc(data->length);
-    if (data->data == NULL)
-        return ENOMEM;
+    ret = alloc_data(data, enc_data->ciphertext.length);
+    if (ret)
+        return ret;
 
     ret = krb5_c_decrypt(context, key, 0, ivec ? &ivecd : 0, enc_data, data);
     if (ret)

Modified: branches/plugins/src/lib/crypto/krb/prf/dk_prf.c
===================================================================
--- branches/plugins/src/lib/crypto/krb/prf/dk_prf.c	2010-05-25 15:36:40 UTC (rev 24103)
+++ branches/plugins/src/lib/crypto/krb/prf/dk_prf.c	2010-05-26 17:54:37 UTC (rev 24104)
@@ -34,7 +34,7 @@
 #include <dk.h>
 
 krb5_error_code
-krb5int_dk_prf(krb5_context ctx, const struct krb5_keytypes *ktp, krb5_key key,
+krb5int_dk_prf(const struct krb5_keytypes *ktp, krb5_key key,
                const krb5_data *in, krb5_data *out)
 {
     const struct krb5_enc_provider *enc = ktp->enc;
@@ -55,7 +55,7 @@
         goto cleanup;
 
     /* Derive a key using the PRF constant. */
-    ret = krb5int_derive_key(ctx, ktp->enc, key, &kp, &prfconst);
+    ret = krb5int_derive_key(ktp->enc, key, &kp, &prfconst);
     if (ret != 0)
         goto cleanup;
 

Modified: branches/plugins/src/lib/crypto/krb/prf/prf_int.h
===================================================================
--- branches/plugins/src/lib/crypto/krb/prf/prf_int.h	2010-05-25 15:36:40 UTC (rev 24103)
+++ branches/plugins/src/lib/crypto/krb/prf/prf_int.h	2010-05-26 17:54:37 UTC (rev 24104)
@@ -40,7 +40,7 @@
                 const krb5_data *in, krb5_data *out);
 
 krb5_error_code
-krb5int_dk_prf(krb5_context ctx, const struct krb5_keytypes *ktp, krb5_key key,
+krb5int_dk_prf(const struct krb5_keytypes *ktp, krb5_key key,
                const krb5_data *in, krb5_data *out);
 
 #endif  /*PRF_INTERNAL_DEFS*/

Modified: branches/plugins/src/lib/crypto/krb/prng.c
===================================================================
--- branches/plugins/src/lib/crypto/krb/prng.c	2010-05-25 15:36:40 UTC (rev 24103)
+++ branches/plugins/src/lib/crypto/krb/prng.c	2010-05-26 17:54:37 UTC (rev 24104)
@@ -25,24 +25,78 @@
  */
 
 #include "k5-int.h"
+#include "enc_provider.h"
 #include <assert.h>
 #include "k5-thread.h"
 
-#include <plugin_manager.h>
-#include <plugin_prng.h>
+#include "yarrow.h"
+static Yarrow_CTX y_ctx;
+#define yarrow_lock krb5int_yarrow_lock
+k5_mutex_t yarrow_lock = K5_MUTEX_PARTIAL_INITIALIZER;
 
+/* Helper function to estimate entropy based on sample length
+ * and where it comes from.
+ */
 
+static size_t
+entropy_estimate(unsigned int randsource, size_t length)
+{
+    switch (randsource) {
+    case KRB5_C_RANDSOURCE_OLDAPI:
+        return 4 * length;
+    case KRB5_C_RANDSOURCE_OSRAND:
+        return 8 * length;
+    case KRB5_C_RANDSOURCE_TRUSTEDPARTY:
+        return 4 * length;
+    case KRB5_C_RANDSOURCE_TIMING:
+        return 2;
+    case KRB5_C_RANDSOURCE_EXTERNAL_PROTOCOL:
+        return 0;
+    default:
+        abort();
+    }
+    return 0;
+}
 
+int krb5int_prng_init(void)
+{
+    unsigned i, source_id;
+    int yerr;
+
+    yerr = k5_mutex_finish_init(&yarrow_lock);
+    if (yerr)
+        return yerr;
+
+    yerr = krb5int_yarrow_init (&y_ctx, NULL);
+    if (yerr != YARROW_OK && yerr != YARROW_NOT_SEEDED)
+        return KRB5_CRYPTO_INTERNAL;
+
+    for (i=0; i < KRB5_C_RANDSOURCE_MAX; i++ ) {
+        if (krb5int_yarrow_new_source(&y_ctx, &source_id) != YARROW_OK)
+            return KRB5_CRYPTO_INTERNAL;
+        assert (source_id == i);
+    }
+
+    return 0;
+}
+
 krb5_error_code KRB5_CALLCONV
 krb5_c_random_add_entropy(krb5_context context, unsigned int randsource,
                           const krb5_data *data)
 {
-    plhandle handle = plugin_manager_get_service(context->pl_handle, "plugin_prng");
+    int yerr;
 
-    plugin_prng_seed(handle, context, randsource, data);
+    /* Make sure the mutex got initialized.  */
+    yerr = krb5int_crypto_init();
+    if (yerr)
+        return yerr;
+    /* Now, finally, feed in the data.  */
+    yerr = krb5int_yarrow_input(&y_ctx, randsource,
+                                data->data, data->length,
+                                entropy_estimate(randsource, data->length));
+    if (yerr != YARROW_OK)
+        return KRB5_CRYPTO_INTERNAL;
     return 0;
-
-
 }
 
 krb5_error_code KRB5_CALLCONV
@@ -52,43 +106,110 @@
 }
 
 krb5_error_code KRB5_CALLCONV
-krb5_c_random_os_entropy(krb5_context context, int strong, int *success)
+krb5_c_random_make_octets(krb5_context context, krb5_data *data)
 {
-    plhandle handle = plugin_manager_get_service(context->pl_handle, "plugin_prng");
-
-    plugin_prng_os_seed(handle, context, strong, success);
-
+    int yerr;
+    yerr = krb5int_yarrow_output(&y_ctx, data->data, data->length);
+    if (yerr == YARROW_NOT_SEEDED) {
+        yerr = krb5int_yarrow_reseed(&y_ctx, YARROW_SLOW_POOL);
+        if (yerr == YARROW_OK)
+            yerr = krb5int_yarrow_output(&y_ctx, data->data, data->length);
+    }
+    if (yerr != YARROW_OK)
+        return KRB5_CRYPTO_INTERNAL;
     return 0;
 }
 
-krb5_error_code KRB5_CALLCONV
-krb5_c_random_make_octets(krb5_context context, krb5_data *data)
+void
+krb5int_prng_cleanup (void)
 {
-    plhandle handle = plugin_manager_get_service(context->pl_handle, "plugin_prng");
+    krb5int_yarrow_final (&y_ctx);
+    k5_mutex_destroy(&yarrow_lock);
+}
 
-    plugin_prng_rand(handle, context,  data);
 
+/*
+ * Routines to get entropy from the OS.  For UNIX we try /dev/urandom
+ * and /dev/random.  Currently we don't do anything for Windows.
+ */
+#if defined(_WIN32)
+
+krb5_error_code KRB5_CALLCONV
+krb5_c_random_os_entropy(krb5_context context, int strong, int *success)
+{
+    if (success)
+        *success = 0;
     return 0;
 }
 
-int krb5int_prng_init(krb5_context context)
+#else /*Windows*/
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+#ifdef HAVE_SYS_STAT_H
+#include <sys/stat.h>
+#endif
+
+/*
+ * Helper function to read entropy from  a random device.  Takes the
+ * name of a device, opens it, makes sure it is a device and if so,
+ * reads entropy.  Returns  a boolean indicating whether entropy was
+ * read.
+ */
+
+static int
+read_entropy_from_device(krb5_context context, const char *device)
 {
-    int ret = 0;
-    plhandle handle = plugin_manager_get_service(context->pl_handle, "plugin_prng");
+    krb5_data data;
+    struct stat sb;
+    int fd;
+    unsigned char buf[YARROW_SLOW_THRESH/8], *bp;
+    int left;
 
-    ret = plugin_prng_init(handle);
+    fd = open (device, O_RDONLY);
+    if (fd == -1)
+        return 0;
+    set_cloexec_fd(fd);
+    if (fstat(fd, &sb) == -1 || S_ISREG(sb.st_mode)) {
+        close(fd);
+        return 0;
+    }
 
-    return ret;
+    for (bp = buf, left = sizeof(buf); left > 0;) {
+        ssize_t count;
+        count = read(fd, bp, (unsigned) left);
+        if (count <= 0) {
+            close(fd);
+            return 0;
+        }
+        left -= count;
+        bp += count;
+    }
+    close(fd);
+    data.length = sizeof (buf);
+    data.data = (char *) buf;
+    return (krb5_c_random_add_entropy(context, KRB5_C_RANDSOURCE_OSRAND,
+                                      &data) == 0);
 }
 
-void
-krb5int_prng_cleanup(krb5_context context)
+krb5_error_code KRB5_CALLCONV
+krb5_c_random_os_entropy(krb5_context context, int strong, int *success)
 {
-    plhandle handle = plugin_manager_get_service(context->pl_handle, "plugin_prng");
+    int unused;
+    int *oursuccess = success ? success : &unused;
 
-    plugin_prng_cleanup(handle);
-
-    return;
+    *oursuccess = 0;
+    /* If we are getting strong data then try that first.  We are
+       guaranteed to cause a reseed of some kind if strong is true and
+       we have both /dev/random and /dev/urandom.  We want the strong
+       data included in the reseed so we get it first.*/
+    if (strong) {
+        if (read_entropy_from_device(context, "/dev/random"))
+            *oursuccess = 1;
+    }
+    if (read_entropy_from_device(context, "/dev/urandom"))
+        *oursuccess = 1;
+    return 0;
 }
 
-
+#endif /*Windows or pre-OSX Mac*/

Modified: branches/plugins/src/lib/crypto/krb/verify_checksum.c
===================================================================
--- branches/plugins/src/lib/crypto/krb/verify_checksum.c	2010-05-25 15:36:40 UTC (rev 24103)
+++ branches/plugins/src/lib/crypto/krb/verify_checksum.c	2010-05-26 17:54:37 UTC (rev 24104)
@@ -53,7 +53,7 @@
     /* If there's actually a verify function, call it. */
     cksum_data = make_data(cksum->contents, cksum->length);
     if (ctp->verify != NULL)
-        return ctp->verify(context, ctp, key, usage, &iov, 1, &cksum_data, valid);
+        return ctp->verify(ctp, key, usage, &iov, 1, &cksum_data, valid);
 
     /* Otherwise, make the checksum again, and compare. */
     if (cksum->length != ctp->output_size)

Modified: branches/plugins/src/lib/crypto/krb/verify_checksum_iov.c
===================================================================
--- branches/plugins/src/lib/crypto/krb/verify_checksum_iov.c	2010-05-25 15:36:40 UTC (rev 24103)
+++ branches/plugins/src/lib/crypto/krb/verify_checksum_iov.c	2010-05-26 17:54:37 UTC (rev 24104)
@@ -58,7 +58,7 @@
 
     /* If there's actually a verify function, call it. */
     if (ctp->verify != NULL) {
-        return ctp->verify(context, ctp, key, usage, data, num_data, &checksum->data,
+        return ctp->verify(ctp, key, usage, data, num_data, &checksum->data,
                            valid);
     }
 
@@ -66,7 +66,7 @@
     if (ret != 0)
         return ret;
 
-    ret = ctp->checksum(context, ctp, key, usage, data, num_data, &computed);
+    ret = ctp->checksum(ctp, key, usage, data, num_data, &computed);
     if (ret == 0) {
         *valid = (memcmp(computed.data, checksum->data.data,
                          ctp->output_size) == 0);

Modified: branches/plugins/src/lib/crypto/krb/yarrow/Makefile.in
===================================================================
--- branches/plugins/src/plugins/prng/plugin_yarrow/Makefile.in	2010-05-21 14:11:57 UTC (rev 24080)
+++ branches/plugins/src/lib/crypto/krb/yarrow/Makefile.in	2010-05-26 17:54:37 UTC (rev 24104)
@@ -1,30 +1,38 @@
-mydir=plugins/prng/plugin_yarrow
-BUILDTOP=$(REL)../../..
-RELDIR=../plugins/prng/plugin_yarrow
+mydir=lib/crypto/krb/yarrow
+BUILDTOP=$(REL)..$(S)..$(S)..$(S)..
+LOCALINCLUDES = -I$(srcdir)/.. \
+		-I$(srcdir)/../../@CRYPTO_IMPL@		\
+		-I$(srcdir)/../../@CRYPTO_IMPL@/sha1 	\
+		-I$(srcdir)/../../@CRYPTO_IMPL@/enc_provider
+DEFS=
+
+##DOS##BUILDTOP = ..\..\..\..
+##DOS##PREFIXDIR=yarrow
+##DOS##OBJFILE=..\$(OUTPRE)yarrow.lst
+
 PROG_LIBPATH=-L$(TOPLIBD)
 PROG_RPATH=$(KRB5_LIBDIR)
-DEFS=
 
-LOCALINCLUDES = -I../../../include/krb5 -I. -I../../../plugin_core -I..  -I$(srcdir)/.. \
-		-I$(srcdir)/../../../lib/crypto/@CRYPTO_IMPL@         \
-		-I$(srcdir)/../../../lib/crypto/@CRYPTO_IMPL@/sha1    \
-		-I$(srcdir)/../../../lib/crypto/@CRYPTO_IMPL@/enc_provider
+STLIBOBJS=\
+	yarrow.o \
+	ycipher.o
+OBJS=\
+	$(OUTPRE)yarrow.$(OBJEXT) \
+	$(OUTPRE)ycipher.$(OBJEXT)
 
-LIBBASE=plugin_yarrow
-
-STLIBOBJS= yarrow.o  ycipher.o  plugin_prng_impl.o
 SRCS=\
 	$(srcdir)/yarrow.c \
-	$(srcdir)/ycipher.c \
-	$(srcdir)/plugin_prng_impl.c
+	$(srcdir)/ycipher.c 
 
-STOBJLISTS=OBJS.ST
+##DOS##LIBOBJS = $(OBJS)
 
-all-unix:: all-liblinks
-clean-unix:: clean-liblinks clean-libs clean-libobjs
-install-unix:: install-libs
+all-unix:: all-libobjs
 
+includes:: depend
 
- at libpriv_frag@
- at lib_frag@
+depend:: $(SRCS)
+
+clean-unix:: clean-libobjs
+
 @libobj_frag@
+

Modified: branches/plugins/src/lib/crypto/krb/yarrow/deps
===================================================================
--- branches/plugins/src/plugins/prng/plugin_yarrow/deps	2010-05-21 14:11:57 UTC (rev 24080)
+++ branches/plugins/src/lib/crypto/krb/yarrow/deps	2010-05-26 17:54:37 UTC (rev 24104)
@@ -3,8 +3,8 @@
 #
 yarrow.so yarrow.po $(OUTPRE)yarrow.$(OBJEXT): $(BUILDTOP)/include/autoconf.h \
   $(BUILDTOP)/include/krb5/krb5.h $(BUILDTOP)/include/osconf.h \
-  $(BUILDTOP)/include/profile.h $(COM_ERR_DEPS) $(srcdir)/../../../lib/crypto/builtin/sha1/shs.h \
-  $(srcdir)/../../../lib/crypto/builtin/yhash.h $(top_srcdir)/include/k5-buf.h \
+  $(BUILDTOP)/include/profile.h $(COM_ERR_DEPS) $(srcdir)/../../../crypto/builtin/sha1/shs.h \
+  $(srcdir)/../../../crypto/builtin/yhash.h $(top_srcdir)/include/k5-buf.h \
   $(top_srcdir)/include/k5-err.h $(top_srcdir)/include/k5-gmt_mktime.h \
   $(top_srcdir)/include/k5-int-pkinit.h $(top_srcdir)/include/k5-int.h \
   $(top_srcdir)/include/k5-platform.h $(top_srcdir)/include/k5-plugin.h \
@@ -15,8 +15,8 @@
   ycipher.h yexcep.h ylock.h ystate.h ytypes.h
 ycipher.so ycipher.po $(OUTPRE)ycipher.$(OBJEXT): $(BUILDTOP)/include/autoconf.h \
   $(BUILDTOP)/include/krb5/krb5.h $(BUILDTOP)/include/osconf.h \
-  $(BUILDTOP)/include/profile.h $(COM_ERR_DEPS) $(srcdir)/../../../lib/crypto/builtin/enc_provider/enc_provider.h \
-  $(srcdir)/../../../lib/crypto/builtin/sha1/shs.h $(srcdir)/../../../lib/crypto/builtin/yhash.h \
+  $(BUILDTOP)/include/profile.h $(COM_ERR_DEPS) $(srcdir)/../../../crypto/builtin/enc_provider/enc_provider.h \
+  $(srcdir)/../../../crypto/builtin/sha1/shs.h $(srcdir)/../../../crypto/builtin/yhash.h \
   $(top_srcdir)/include/k5-buf.h $(top_srcdir)/include/k5-err.h \
   $(top_srcdir)/include/k5-gmt_mktime.h $(top_srcdir)/include/k5-int-pkinit.h \
   $(top_srcdir)/include/k5-int.h $(top_srcdir)/include/k5-platform.h \
@@ -29,7 +29,7 @@
   $(BUILDTOP)/include/krb5/krb5.h $(COM_ERR_DEPS) $(top_srcdir)/plugins/prng/plugin_yarrow/plugin_prng_impl.h \
   $(top_srcdir)/plugin_core/plugin_manager.h \
   $(top_srcdir)/plugin_core/plugin_factory.h \
-  $(srcdir)/../../../lib/crypto/builtin/yhash.h \
-  $(srcdir)/../../../lib/crypto/builtin/enc_provider/enc_provider.h \
+  $(srcdir)/../../../crypto/builtin/yhash.h \
+  $(srcdir)/../../../crypto/builtin/enc_provider/enc_provider.h \
   plugin_prng_impl.c
 

Modified: branches/plugins/src/lib/krb5/Makefile.in
===================================================================
--- branches/plugins/src/lib/krb5/Makefile.in	2010-05-25 15:36:40 UTC (rev 24103)
+++ branches/plugins/src/lib/krb5/Makefile.in	2010-05-26 17:54:37 UTC (rev 24104)
@@ -9,8 +9,7 @@
 
 PLUGINS_LIBS = \
 	../../plugin_core/impl/libplugin_impl.a $(PLUGIN_CORE_DEPLIB) 	\
-	../../plugins/pa/encrypted_challenge/libencrypted_challenge.a	\
-	../../plugins/prng/plugin_yarrow/libplugin_yarrow.a
+	../../plugins/pa/encrypted_challenge/libencrypted_challenge.a	
 
 
 ##DOSBUILDTOP = ..\..

Modified: branches/plugins/src/lib/krb5/krb/Makefile.in
===================================================================
--- branches/plugins/src/lib/krb5/krb/Makefile.in	2010-05-25 15:36:40 UTC (rev 24103)
+++ branches/plugins/src/lib/krb5/krb/Makefile.in	2010-05-26 17:54:37 UTC (rev 24104)
@@ -12,7 +12,8 @@
 ##DOS##PREFIXDIR=krb
 ##DOS##OBJFILE=..\$(OUTPRE)$(PREFIXDIR).lst
 
-PLUGINS_LIBS =   $(srcdir)/../../libplugin_impl.a $(srcdir)/../../libplugin_yarrow.a $(srcdir)/../../libencrypted_challenge.a 
+PLUGINS_LIBS =   $(srcdir)/../../libplugin_impl.a $(srcdir)/../../libencrypted_challenge.a 
+# PLUGINS_LIBS =   $(srcdir)/../../libplugin_impl.a $(srcdir)/../../libplugin_yarrow.a $(srcdir)/../../libencrypted_challenge.a 
 
 
 STLIBOBJS= \

Modified: branches/plugins/src/plugin_core/impl/Makefile.in
===================================================================
--- branches/plugins/src/plugin_core/impl/Makefile.in	2010-05-25 15:36:40 UTC (rev 24103)
+++ branches/plugins/src/plugin_core/impl/Makefile.in	2010-05-26 17:54:37 UTC (rev 24104)
@@ -6,7 +6,7 @@
 DEFS=
 
 LOCALINCLUDES = -I$(srcdir)/../../include/krb5  -I$(srcdir)/. 	\
-		-I$(srcdir)/../../plugins/prng/plugin_yarrow -I$(srcdir)/../../plugins/prng 	\
+		-I$(srcdir)/../../plugins/prng 	\
 		-I$(srcdir)/../../plugins/pa -I$(srcdir)/../../plugins/pa/encrypted_challenge 	\
 		-I$(srcdir)/..
 
@@ -18,11 +18,12 @@
 
 STOBJLISTS=OBJS.ST
 
-LIBS_UTILS = ../plugin_core$(SO_EXT) \
-	../../plugins/prng/plugin_yarrow/plugin_prng_impl$(SO_EXT) 	\
-	../../plugins/prng/plugin_yarrow/ycipher$(SO_EXT) 		\
-	../../plugins/prng/plugin_yarrow/yarrow$(SO_EXT) 
+LIBS_UTILS = ../plugin_core$(SO_EXT) 
 
+#	../../plugins/prng/plugin_yarrow/plugin_prng_impl$(SO_EXT) 	\
+#	../../plugins/prng/plugin_yarrow/ycipher$(SO_EXT) 		\
+#	../../plugins/prng/plugin_yarrow/yarrow$(SO_EXT) 
+
 SHLIB_EXPLIBS=  $(LIBS_UTILS) $(CRYPTO_DEPLIB) $(SUPPORT_DEPLIB)
 
 all-unix:: all-liblinks

Modified: branches/plugins/src/plugin_core/impl/deps
===================================================================
--- branches/plugins/src/plugin_core/impl/deps	2010-05-25 15:36:40 UTC (rev 24103)
+++ branches/plugins/src/plugin_core/impl/deps	2010-05-26 17:54:37 UTC (rev 24104)
@@ -8,7 +8,6 @@
 plugin_default_factory.so plugin_default_factory.po $(OUTPRE)plugin_default_factory.$(OBJEXT): \
   $(BUILDTOP)/include/krb5/krb5.h $(COM_ERR_DEPS) $(top_srcdir)/plugin_core/plugin_factory.h \
   $(top_srcdir)/plugin_core/plugin_manager.h \
-  $(top_srcdir)/plugins/prng/plugin_yarrow/plugin_prng_impl.h \
   $(top_srcdir)/plugins/pa/encrypted_challenge/plugin_pa_impl.h \
   $(top_srcdir)/plugin_core/impl/plugin_default_manager.h \
   $(top_srcdir)/plugin_core/impl/plugin_default_factory.h \

Modified: branches/plugins/src/plugin_core/impl/plugin_default_factory.c
===================================================================
--- branches/plugins/src/plugin_core/impl/plugin_default_factory.c	2010-05-25 15:36:40 UTC (rev 24103)
+++ branches/plugins/src/plugin_core/impl/plugin_default_factory.c	2010-05-26 17:54:37 UTC (rev 24104)
@@ -8,14 +8,14 @@
 
 #include "plugin_manager.h"
 #include "plugin_factory.h"
-#include "plugin_prng_impl.h"
+//#include "plugin_prng_impl.h"
 #include "plugin_pa_impl.h"
 #include "plugin_default_factory.h"
 
 static plugin_factory* _default_factory_instance = NULL;
 
 static plugin_descr  plugin_default_factory_table[] = {
-        {"plugin_yarrow_prng", plugin_yarrow_prng_create},
+//        {"plugin_yarrow_prng", plugin_yarrow_prng_create},
         {"plugin_encrypted_challenge_pa", plugin_encrypted_challenge_pa_create},
         {"plugin_ldap_audit", NULL},
         {NULL,NULL}

Modified: branches/plugins/src/plugin_core/impl/plugin_default_factory.h
===================================================================
--- branches/plugins/src/plugin_core/impl/plugin_default_factory.h	2010-05-25 15:36:40 UTC (rev 24103)
+++ branches/plugins/src/plugin_core/impl/plugin_default_factory.h	2010-05-26 17:54:37 UTC (rev 24104)
@@ -7,7 +7,7 @@
 #define PLUGIN_DEFAULT_FACTORY_H_
 
 #include <plugin_factory.h>
-#include "plugin_prng_impl.h"
+//#include "plugin_prng_impl.h"
 
 
 factory_handle plugin_default_factory_get_instance(void);

Modified: branches/plugins/src/plugins/pa/plugin_pa.h
===================================================================
--- branches/plugins/src/plugins/pa/plugin_pa.h	2010-05-25 15:36:40 UTC (rev 24103)
+++ branches/plugins/src/plugins/pa/plugin_pa.h	2010-05-26 17:54:37 UTC (rev 24104)
@@ -107,34 +107,5 @@
 krb5_error_code plugin_server_init(plhandle handle, krb5_context kcontext, void **module_context, const char **realmnames);
 void plugin_server_fini(plhandle handle, krb5_context kcontext, void *module_context);
 
-#if 0
-krb5_preauthtype supported_pa_types[] = {KRB5_PADATA_ENCRYPTED_CHALLENGE, 0};
 
-struct krb5plugin_preauth_server_ftable_v1 preauthentication_server_1 = {
-    "Encrypted challenge",
-    &supported_pa_types[0],
-    NULL,
-    NULL,
-    kdc_preauth_flags,
-    kdc_include_padata,
-    kdc_verify_preauth,
-    kdc_return_preauth,
-    NULL
-};
-
-struct krb5plugin_preauth_client_ftable_v1 preauthentication_client_1 = {
-    "Encrypted Challenge",                /* name */
-    &supported_pa_types[0],        /* pa_type_list */
-    NULL,                    /* enctype_list */
-    NULL,                    /* plugin init function */
-    NULL,                    /* plugin fini function */
-    preauth_flags,                /* get flags function */
-    NULL,                    /* request init function */
-    NULL,                    /* request fini function */
-    process_preauth,                /* process function */
-    NULL,                    /* try_again function */
-    NULL                /* get init creds opt function */
-};
-#endif
-
 #endif /* PLUGIN_PA_H_ */




More information about the cvs-krb5 mailing list