+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:
OBJS= afsstring2key.$(OBJEXT) \
cbc_cksum.$(OBJEXT) \
- cs_entry.$(OBJEXT) \
finish_key.$(OBJEXT) \
fin_rndkey.$(OBJEXT) \
init_rkey.$(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 \
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;
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;
;
}
- 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;
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 */
+};
+++ /dev/null
-/*
- * 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 */
-};
* 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 ,