Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/crypto/dist/heimdal/lib merge back some hacks



details:   https://anonhg.NetBSD.org/src/rev/db1fc2397b2c
branches:  trunk
changeset: 495693:db1fc2397b2c
user:      assar <assar%NetBSD.org@localhost>
date:      Thu Aug 03 03:38:25 2000 +0000

description:
merge back some hacks

diffstat:

 crypto/dist/heimdal/lib/asn1/gen.c          |   4 +-
 crypto/dist/heimdal/lib/des/rnd_keys.c      |  33 ++++++++--
 crypto/dist/heimdal/lib/gssapi/8003.c       |  22 +++---
 crypto/dist/heimdal/lib/gssapi/get_mic.c    |  10 +-
 crypto/dist/heimdal/lib/gssapi/unwrap.c     |  10 +-
 crypto/dist/heimdal/lib/gssapi/verify_mic.c |  10 +-
 crypto/dist/heimdal/lib/gssapi/wrap.c       |  10 +-
 crypto/dist/heimdal/lib/krb5/crypto.c       |  84 ++++++++++++++--------------
 8 files changed, 100 insertions(+), 83 deletions(-)

diffs (truncated from 452 to 300 lines):

diff -r e218b59dcd4b -r db1fc2397b2c crypto/dist/heimdal/lib/asn1/gen.c
--- a/crypto/dist/heimdal/lib/asn1/gen.c        Thu Aug 03 03:07:30 2000 +0000
+++ b/crypto/dist/heimdal/lib/asn1/gen.c        Thu Aug 03 03:38:25 2000 +0000
@@ -33,7 +33,7 @@
 
 #include "gen_locl.h"
 
-RCSID("$Id: gen.c,v 1.1.1.2 2000/08/02 19:59:03 assar Exp $");
+RCSID("$Id: gen.c,v 1.2 2000/08/03 03:38:25 assar Exp $");
 
 FILE *headerfile, *codefile, *logfile;
 
@@ -55,7 +55,7 @@
     orig_filename = filename;
     if(base)
        strcpy(headerbase, base);
-    sprintf(header, "%s.h", headerbase);
+    sprintf(header, "%s.hx", headerbase);
     headerfile = fopen (header, "w");
     if (headerfile == NULL)
        err (1, "open %s", header);
diff -r e218b59dcd4b -r db1fc2397b2c crypto/dist/heimdal/lib/des/rnd_keys.c
--- a/crypto/dist/heimdal/lib/des/rnd_keys.c    Thu Aug 03 03:07:30 2000 +0000
+++ b/crypto/dist/heimdal/lib/des/rnd_keys.c    Thu Aug 03 03:38:25 2000 +0000
@@ -34,7 +34,7 @@
 #ifdef HAVE_CONFIG_H
 #include "config.h"
 
-RCSID("$Id: rnd_keys.c,v 1.1.1.2 2000/08/02 20:00:09 assar Exp $");
+RCSID("$Id: rnd_keys.c,v 1.2 2000/08/03 03:38:25 assar Exp $");
 #endif
 
 #include <des.h>
@@ -78,6 +78,26 @@
 #include <winsock.h>
 #endif
 
+/* kludge prototypes */
+
+void
+des_rand_data(unsigned char *data, int size);
+
+void
+des_generate_random_block(des_cblock *block);
+
+void
+des_rand_data_key(des_cblock *key);
+
+void
+des_set_sequence_number(unsigned char *ll);
+
+void
+des_set_random_generator_seed(des_cblock *seed);
+
+int
+des_new_random_key(des_cblock *key);
+
 /*
  * Generate "random" data by checksumming a file.
  *
@@ -194,6 +214,7 @@
 #endif
 #endif
 
+#if 0
 static void
 des_not_rand_data(unsigned char *data, int size)
 {
@@ -204,6 +225,7 @@
   for(i = 0; i < size; ++i)
     data[i] ^= random() % 0x100;
 }
+#endif
 
 #if !defined(WIN32) && !defined(__EMX__) && !defined(__OS2__) && !defined(__CYGWIN32__)
 
@@ -352,11 +374,6 @@
  * It's neccessary to be root to run it. Returns -1 if there were any
  * problems with permissions.
  */
-int
-des_mem_rand8(unsigned char *data)
-{
-  return 1;
-}
 
 /*
  * In case the generator does not get initialized use this as fallback.
@@ -458,9 +475,9 @@
 
 /* This is for backwards compatibility. */
 void
-des_random_key(des_cblock ret)
+des_random_key(des_cblock *ret)
 {
-    des_new_random_key((des_cblock *)ret);
+    des_new_random_key(ret);
 }
 
 #ifdef TESTRUN
diff -r e218b59dcd4b -r db1fc2397b2c crypto/dist/heimdal/lib/gssapi/8003.c
--- a/crypto/dist/heimdal/lib/gssapi/8003.c     Thu Aug 03 03:07:30 2000 +0000
+++ b/crypto/dist/heimdal/lib/gssapi/8003.c     Thu Aug 03 03:38:25 2000 +0000
@@ -33,7 +33,7 @@
 
 #include "gssapi_locl.h"
 
-RCSID("$Id: 8003.c,v 1.1.1.2 2000/08/02 19:59:06 assar Exp $");
+RCSID("$Id: 8003.c,v 1.2 2000/08/03 03:38:25 assar Exp $");
 
 static krb5_error_code
 encode_om_uint32(OM_uint32 n, u_char *p)
@@ -59,30 +59,30 @@
   u_char num[4];
   MD5_CTX md5;
 
-  MD5Init(&md5);
+  MD5_Init(&md5);
   encode_om_uint32 (b->initiator_addrtype, num);
-  MD5Update (&md5, num, sizeof(num));
+  MD5_Update (&md5, num, sizeof(num));
   encode_om_uint32 (b->initiator_address.length, num);
-  MD5Update (&md5, num, sizeof(num));
+  MD5_Update (&md5, num, sizeof(num));
   if (b->initiator_address.length)
-    MD5Update (&md5,
+    MD5_Update (&md5,
                b->initiator_address.value,
                b->initiator_address.length);
   encode_om_uint32 (b->acceptor_addrtype, num);
-  MD5Update (&md5, num, sizeof(num));
+  MD5_Update (&md5, num, sizeof(num));
   encode_om_uint32 (b->acceptor_address.length, num);
-  MD5Update (&md5, num, sizeof(num));
+  MD5_Update (&md5, num, sizeof(num));
   if (b->acceptor_address.length)
-    MD5Update (&md5,
+    MD5_Update (&md5,
                b->acceptor_address.value,
                b->acceptor_address.length);
   encode_om_uint32 (b->application_data.length, num);
-  MD5Update (&md5, num, sizeof(num));
+  MD5_Update (&md5, num, sizeof(num));
   if (b->application_data.length)
-    MD5Update (&md5,
+    MD5_Update (&md5,
                b->application_data.value,
                b->application_data.length);
-  MD5Final (p, &md5);
+  MD5_Final (p, &md5);
   return 0;
 }
 
diff -r e218b59dcd4b -r db1fc2397b2c crypto/dist/heimdal/lib/gssapi/get_mic.c
--- a/crypto/dist/heimdal/lib/gssapi/get_mic.c  Thu Aug 03 03:07:30 2000 +0000
+++ b/crypto/dist/heimdal/lib/gssapi/get_mic.c  Thu Aug 03 03:38:25 2000 +0000
@@ -33,7 +33,7 @@
 
 #include "gssapi_locl.h"
 
-RCSID("$Id: get_mic.c,v 1.1.1.2 2000/08/02 19:59:08 assar Exp $");
+RCSID("$Id: get_mic.c,v 1.2 2000/08/03 03:38:25 assar Exp $");
 
 OM_uint32 gss_get_mic
            (OM_uint32 * minor_status,
@@ -73,11 +73,11 @@
   p += 16;
 
   /* checksum */
-  MD5Init (&md5);
-  MD5Update (&md5, p - 24, 8);
-  MD5Update (&md5, message_buffer->value,
+  MD5_Init (&md5);
+  MD5_Update (&md5, p - 24, 8);
+  MD5_Update (&md5, message_buffer->value,
             message_buffer->length);
-  MD5Final (hash, &md5);
+  MD5_Final (hash, &md5);
 
   memset (&zero, 0, sizeof(zero));
   gss_krb5_getsomekey(context_handle, &key);
diff -r e218b59dcd4b -r db1fc2397b2c crypto/dist/heimdal/lib/gssapi/unwrap.c
--- a/crypto/dist/heimdal/lib/gssapi/unwrap.c   Thu Aug 03 03:07:30 2000 +0000
+++ b/crypto/dist/heimdal/lib/gssapi/unwrap.c   Thu Aug 03 03:38:25 2000 +0000
@@ -33,7 +33,7 @@
 
 #include "gssapi_locl.h"
 
-RCSID("$Id: unwrap.c,v 1.1.1.2 2000/08/02 19:59:10 assar Exp $");
+RCSID("$Id: unwrap.c,v 1.2 2000/08/03 03:38:25 assar Exp $");
 
 OM_uint32
 gss_krb5_getsomekey(const gss_ctx_id_t context_handle,
@@ -134,10 +134,10 @@
   if (i != 0)
     return GSS_S_BAD_MIC;
 
-  MD5Init (&md5);
-  MD5Update (&md5, p - 24, 8);
-  MD5Update (&md5, p, input_message_buffer->length - len);
-  MD5Final (hash, &md5);
+  MD5_Init (&md5);
+  MD5_Update (&md5, p - 24, 8);
+  MD5_Update (&md5, p, input_message_buffer->length - len);
+  MD5_Final (hash, &md5);
 
   memset (&zero, 0, sizeof(zero));
   gss_krb5_getsomekey(context_handle, &key);
diff -r e218b59dcd4b -r db1fc2397b2c crypto/dist/heimdal/lib/gssapi/verify_mic.c
--- a/crypto/dist/heimdal/lib/gssapi/verify_mic.c       Thu Aug 03 03:07:30 2000 +0000
+++ b/crypto/dist/heimdal/lib/gssapi/verify_mic.c       Thu Aug 03 03:38:25 2000 +0000
@@ -33,7 +33,7 @@
 
 #include "gssapi_locl.h"
 
-RCSID("$Id: verify_mic.c,v 1.1.1.2 2000/08/02 19:59:10 assar Exp $");
+RCSID("$Id: verify_mic.c,v 1.2 2000/08/03 03:38:25 assar Exp $");
 
 OM_uint32 gss_verify_mic
            (OM_uint32 * minor_status,
@@ -68,11 +68,11 @@
   p += 16;
 
   /* verify checksum */
-  MD5Init (&md5);
-  MD5Update (&md5, p - 24, 8);
-  MD5Update (&md5, message_buffer->value,
+  MD5_Init (&md5);
+  MD5_Update (&md5, p - 24, 8);
+  MD5_Update (&md5, message_buffer->value,
             message_buffer->length);
-  MD5Final (hash, &md5);
+  MD5_Final (hash, &md5);
 
   memset (&zero, 0, sizeof(zero));
 #if 0
diff -r e218b59dcd4b -r db1fc2397b2c crypto/dist/heimdal/lib/gssapi/wrap.c
--- a/crypto/dist/heimdal/lib/gssapi/wrap.c     Thu Aug 03 03:07:30 2000 +0000
+++ b/crypto/dist/heimdal/lib/gssapi/wrap.c     Thu Aug 03 03:38:25 2000 +0000
@@ -33,7 +33,7 @@
 
 #include "gssapi_locl.h"
 
-RCSID("$Id: wrap.c,v 1.1.1.2 2000/08/02 19:59:10 assar Exp $");
+RCSID("$Id: wrap.c,v 1.2 2000/08/03 03:38:25 assar Exp $");
 
 OM_uint32 gss_wrap_size_limit (
             OM_uint32 * minor_status,
@@ -110,10 +110,10 @@
   memset (p + 8 + input_message_buffer->length, padlength, padlength);
 
   /* checksum */
-  MD5Init (&md5);
-  MD5Update (&md5, p - 24, 8);
-  MD5Update (&md5, p, input_message_buffer->length + padlength + 8);
-  MD5Final (hash, &md5);
+  MD5_Init (&md5);
+  MD5_Update (&md5, p - 24, 8);
+  MD5_Update (&md5, p, input_message_buffer->length + padlength + 8);
+  MD5_Final (hash, &md5);
 
   memset (&zero, 0, sizeof(zero));
   gss_krb5_getsomekey(context_handle, &key);
diff -r e218b59dcd4b -r db1fc2397b2c crypto/dist/heimdal/lib/krb5/crypto.c
--- a/crypto/dist/heimdal/lib/krb5/crypto.c     Thu Aug 03 03:07:30 2000 +0000
+++ b/crypto/dist/heimdal/lib/krb5/crypto.c     Thu Aug 03 03:38:25 2000 +0000
@@ -32,7 +32,7 @@
  */
 
 #include "krb5_locl.h"
-RCSID("$Id: crypto.c,v 1.1.1.2 2000/08/02 19:59:26 assar Exp $");
+RCSID("$Id: crypto.c,v 1.2 2000/08/03 03:38:26 assar Exp $");
 
 #undef CRYPTO_DEBUG
 #ifdef CRYPTO_DEBUG
@@ -239,12 +239,12 @@
     memcpy(&temp_key, "kerberos", 8);
     des_set_odd_parity (&temp_key);
     des_set_key (&temp_key, schedule);
-    des_cbc_cksum ((des_cblock *)password, &ivec, passlen, schedule, &ivec);
+    des_cbc_cksum ((const void *)password, &ivec, passlen, schedule, &ivec);
 
     memcpy(&temp_key, &ivec, 8);
     des_set_odd_parity (&temp_key);
     des_set_key (&temp_key, schedule);
-    des_cbc_cksum ((des_cblock *)password, key, passlen, schedule, &ivec);
+    des_cbc_cksum ((const void *)password, key, passlen, schedule, &ivec);
     memset(&schedule, 0, sizeof(schedule));
     memset(&temp_key, 0, sizeof(temp_key));
     memset(&ivec, 0, sizeof(ivec));
@@ -348,8 +348,8 @@
            des_set_key(keys + i, s[i]);
        }
        memset(&ivec, 0, sizeof(ivec));
-       des_ede3_cbc_encrypt((des_cblock *)tmp,
-                            (des_cblock *)tmp, sizeof(tmp), 
+       des_ede3_cbc_encrypt((const void *)tmp,
+                            (void *)tmp, sizeof(tmp), 
                             s[0], s[1], s[2], &ivec, DES_ENCRYPT);
        memset(s, 0, sizeof(s));



Home | Main Index | Thread Index | Old Index