* des_int.h: the cs_entry routines in cbc_cksum.c are now static
authorRichard Basch <probe@mit.edu>
Wed, 15 May 1996 00:59:30 +0000 (00:59 +0000)
committerRichard Basch <probe@mit.edu>
Wed, 15 May 1996 00:59:30 +0000 (00:59 +0000)
* Makefile.in: removed cs_entry.c

* cbc_cksum.c:
        caller is responsible for allocating cksum->contents
          and indicate the allocated amount in cksum->length.
        the cs_entry routines are now static and the cs_entry
          structure is now in this file to enforce proper use.

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@8023 dc483132-0cff-0310-8789-dd5450dbe970

src/lib/crypto/des/ChangeLog
src/lib/crypto/des/Makefile.in
src/lib/crypto/des/cbc_cksum.c
src/lib/crypto/des/cs_entry.c [deleted file]
src/lib/crypto/des/des_int.h

index 50c2d011568b0a32e4edabeb9125b0e7abe2a6a0..5768c55a1f6d43f6f9190ab1a5d0e4efd5841628 100644 (file)
@@ -1,3 +1,15 @@
+Tue May 14 18:59:38 1996  Richard Basch  <basch@lehman.com>
+
+       * des_int.h: the cs_entry routines in cbc_cksum.c are now static.
+
+       * Makefile.in: removed cs_entry.c
+
+       * cbc_cksum.c:
+               caller is responsible for allocating cksum->contents
+                 and indicate the allocated amount in cksum->length.
+               the cs_entry routines are now static and the cs_entry
+                 structure is now in this file to enforce proper use.
+
 Fri May 10 01:46:25 1996  Richard Basch  <basch@lehman.com>
 
        * d3_str2ky.c d3_procky.c des_int.h init_rkey.c:
index 6875c762ddb144da7d3306f241bdf72c2c4f6903..62aceb2c8115b5406cf3c556b6789ea3f9eee2cc 100644 (file)
@@ -14,7 +14,6 @@ DEPKLIB = $(TOPLIBD)/libkrb5.$(LIBEXT) $(TOPLIBD)/libcrypto.$(LIBEXT) $(COMERRLI
 
 OBJS=  afsstring2key.$(OBJEXT) \
        cbc_cksum.$(OBJEXT)     \
-       cs_entry.$(OBJEXT)      \
        finish_key.$(OBJEXT)    \
        fin_rndkey.$(OBJEXT)    \
        init_rkey.$(OBJEXT)     \
@@ -38,7 +37,6 @@ OBJS= afsstring2key.$(OBJEXT) \
        u_rn_key.$(OBJEXT)
 
 SRCS=  $(srcdir)/afsstring2key.c \
-       $(srcdir)/cs_entry.c    \
        $(srcdir)/cbc_cksum.c   \
        $(srcdir)/finish_key.c  \
        $(srcdir)/fin_rndkey.c  \
index 6004aa382717c2c17f273504e0461c7da65f3af2..9c98263a2abd93bede7053b69851e1a427dc68bd 100644 (file)
        with the help of key "key" of size "key_size" (which should be 8);
        fills out krb5_checksum structure.
 
-       caller is responsible for freeing "contents" element in 
+       caller is responsible for allocating & freeing "contents" element in 
        krb5_checksum structure.
 
        returns: errors
 */
-krb5_error_code
+
+static krb5_error_code mit_des_cbc_checksum
+    PROTOTYPE((krb5_pointer, size_t,krb5_pointer,size_t, krb5_checksum FAR * ));
+
+static krb5_error_code mit_des_cbc_verf_cksum
+    PROTOTYPE ((krb5_checksum FAR *, krb5_pointer, size_t, krb5_pointer,
+                size_t ));
+
+static krb5_error_code
 mit_des_cbc_checksum(in, in_length, key, key_size, cksum)
     krb5_pointer in;
     size_t in_length;
@@ -51,8 +59,9 @@ mit_des_cbc_checksum(in, in_length, key, key_size, cksum)
     krb5_checksum FAR * cksum;
 {
     struct mit_des_ks_struct       *schedule;      /* pointer to key schedules */
-    krb5_octet         *contents;
 
+    if (cksum->length < sizeof(mit_des_cblock))
+       return KRB5_BAD_MSIZE;
     if (key_size != sizeof(mit_des_cblock))
        return KRB5_BAD_KEYSIZE;
 
@@ -75,22 +84,17 @@ mit_des_cbc_checksum(in, in_length, key, key_size, cksum)
         ;
     }
 
-    if (!(contents = (krb5_octet *) malloc(sizeof(mit_des_cblock)))) {
-       cleanup();
-        return ENOMEM;
-    }
-
-    mit_des_cbc_cksum(in, contents, in_length, schedule, key);
-
     cksum->checksum_type = CKSUMTYPE_DESCBC;
     cksum->length = sizeof(mit_des_cblock);
-    cksum->contents = contents;
+
+    mit_des_cbc_cksum(in, cksum->contents, in_length, schedule, key);
+
     cleanup();
 
     return 0;
 }
     
-krb5_error_code
+static krb5_error_code
 mit_des_cbc_verf_cksum(cksum, in, in_length, key, key_size)
     krb5_checksum FAR * cksum;
     krb5_pointer in;
@@ -144,3 +148,11 @@ mit_des_cbc_verf_cksum(cksum, in, in_length, key, key_size)
     return retval;
 }
 
+krb5_checksum_entry krb5_des_cbc_cksumtable_entry = {
+    0,
+    mit_des_cbc_checksum,
+    mit_des_cbc_verf_cksum,
+    sizeof(mit_des_cblock),
+    1,                                 /* is collision proof */
+    1,                                 /* is keyed */
+};
diff --git a/src/lib/crypto/des/cs_entry.c b/src/lib/crypto/des/cs_entry.c
deleted file mode 100644 (file)
index c32acf1..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * lib/crypto/des/cs_entry.c
- *
- * Copyright 1990, 1991, 1995 by the Massachusetts Institute of Technology.
- * All Rights Reserved.
- *
- * Export of this software from the United States of America may
- *   require a specific license from the United States Government.
- *   It is the responsibility of any person or organization contemplating
- *   export to obtain such a license before exporting.
- * 
- * WITHIN THAT CONSTRAINT, permission to use, copy, modify, and
- * distribute this software and its documentation for any purpose and
- * without fee is hereby granted, provided that the above copyright
- * notice appear in all copies and that both that copyright notice and
- * this permission notice appear in supporting documentation, and that
- * the name of M.I.T. not be used in advertising or publicity pertaining
- * to distribution of the software without specific, written prior
- * permission.  M.I.T. makes no representations about the suitability of
- * this software for any purpose.  It is provided "as is" without express
- * or implied warranty.
- * 
- *
- * DES encryption interface file
- */
-
-#include "k5-int.h"
-#include "des_int.h"
-
-krb5_checksum_entry krb5_des_cbc_cksumtable_entry = {
-    0,
-    mit_des_cbc_checksum,
-    mit_des_cbc_verf_cksum,
-    sizeof(mit_des_cblock),
-    1,                                 /* is collision proof */
-    1,                                 /* is keyed */
-};
index 6f97449f5205e305d8cab215d622c27ba6cc77c9..a04621103eb5ffb3ea7b81590434e9cd74b581c0 100644 (file)
@@ -92,15 +92,6 @@ error(MIT_DES_KEYSIZE does not equal KRB5_MIT_DES_KEYSIZE)
  * End "mit-des.h"
  */
 
-/* cbc_cksum.c */
-extern krb5_error_code mit_des_cbc_checksum
-    PROTOTYPE((krb5_pointer, size_t,krb5_pointer,size_t, krb5_checksum FAR * ));
-
-extern krb5_error_code mit_des_cbc_verf_cksum
-    PROTOTYPE ((krb5_checksum FAR *, krb5_pointer, size_t, krb5_pointer,
-                size_t ));
-
-
 /* f_cksum.c */
 extern unsigned long mit_des_cbc_cksum
     PROTOTYPE((krb5_octet FAR *, krb5_octet FAR *, long , mit_des_key_schedule ,