From e20674d9d3295ade4fa0525f6127ec69a67585ff Mon Sep 17 00:00:00 2001 From: Ken Raeburn Date: Tue, 10 Apr 2001 01:11:52 +0000 Subject: rename des.h -> des425.h git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@13149 dc483132-0cff-0310-8789-dd5450dbe970 --- src/lib/des425/ChangeLog | 4 ++ src/lib/des425/cksum.c | 2 +- src/lib/des425/des.c | 2 +- src/lib/des425/des.h | 89 ------------------------------------------- src/lib/des425/des425.h | 89 +++++++++++++++++++++++++++++++++++++++++++ src/lib/des425/enc_dec.c | 2 +- src/lib/des425/key_parity.c | 2 +- src/lib/des425/key_sched.c | 2 +- src/lib/des425/new_rnd_key.c | 2 +- src/lib/des425/pcbc_encrypt.c | 2 +- src/lib/des425/quad_cksum.c | 2 +- src/lib/des425/random_key.c | 2 +- src/lib/des425/read_passwd.c | 2 +- src/lib/des425/str_to_key.c | 2 +- src/lib/des425/string2key.c | 2 +- src/lib/des425/t_quad.c | 2 +- src/lib/des425/util.c | 2 +- src/lib/des425/verify.c | 2 +- src/lib/des425/weak_key.c | 2 +- 19 files changed, 109 insertions(+), 105 deletions(-) delete mode 100644 src/lib/des425/des.h create mode 100644 src/lib/des425/des425.h (limited to 'src/lib') diff --git a/src/lib/des425/ChangeLog b/src/lib/des425/ChangeLog index 32747722b..034580f7c 100644 --- a/src/lib/des425/ChangeLog +++ b/src/lib/des425/ChangeLog @@ -1,5 +1,9 @@ 2001-04-09 Ken Raeburn + * des425.h: Renamed from des.h to avoid confusion with the other + des.h in the source tree. Adjust include directives in all other + files. + * quad_cksum.c (des_quad_cksum): Add comments. Force 32-bit arithmetic just to be careful. diff --git a/src/lib/des425/cksum.c b/src/lib/des425/cksum.c index 5f413cf25..e43523118 100644 --- a/src/lib/des425/cksum.c +++ b/src/lib/des425/cksum.c @@ -38,7 +38,7 @@ */ -#include "des.h" +#include "des425.h" /* * This routine performs DES cipher-block-chaining checksum operation, diff --git a/src/lib/des425/des.c b/src/lib/des425/des.c index 7a4520d6f..2315b434b 100644 --- a/src/lib/des425/des.c +++ b/src/lib/des425/des.c @@ -52,7 +52,7 @@ */ -#include "des.h" +#include "des425.h" KRB5_DLLIMP int KRB5_CALLCONV des_ecb_encrypt(clear, cipher, schedule, encrypt) diff --git a/src/lib/des425/des.h b/src/lib/des425/des.h deleted file mode 100644 index da91b996c..000000000 --- a/src/lib/des425/des.h +++ /dev/null @@ -1,89 +0,0 @@ -/* - * lib/des425/des.h - * - * Copyright 1991 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. Furthermore if you modify this software you must label - * your software as modified software and not distribute it in such a - * fashion that it might be confused with the original M.I.T. software. - * 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. - * - * - */ - -/* - * Include file for the Data Encryption Standard library. - */ - -/* only do the whole thing once */ -#ifndef DES_DEFS -#define DES_DEFS - -#include - -typedef mit_des_cblock des_cblock; /* crypto-block size */ - -/* Key schedule */ -typedef mit_des_key_schedule des_key_schedule; - -#define DES_KEY_SZ (sizeof(des_cblock)) -#define DES_ENCRYPT 1 -#define DES_DECRYPT 0 - -#ifndef NCOMPAT -#define C_Block des_cblock -#define Key_schedule des_key_schedule -#define ENCRYPT DES_ENCRYPT -#define DECRYPT DES_DECRYPT -#define KEY_SZ DES_KEY_SZ -#define string_to_key des_string_to_key -#define read_pw_string des_read_pw_string -#define random_key des_random_key -#define pcbc_encrypt des_pcbc_encrypt -#define key_sched des_key_sched -#define cbc_encrypt des_cbc_encrypt -#define cbc_cksum des_cbc_cksum -#define C_Block_print des_cblock_print -#define quad_cksum des_quad_cksum -typedef struct des_ks_struct bit_64; -#endif - -#define des_cblock_print(x) des_cblock_print_file(x, stdout) - -/* - * Windows needs everything prototyped because we're exporting all the fuctions. - */ -void des_cbc_cksum(); -KRB5_DLLIMP int KRB5_CALLCONV des_ecb_encrypt(); -int des_cbc_encrypt(); -void des_fixup_key_parity(); -int des_check_key_parity(); -KRB5_DLLIMP int KRB5_CALLCONV des_key_sched(); -KRB5_DLLIMP int KRB5_CALLCONV des_new_random_key(); -void des_init_random_number_generator(); -KRB5_DLLIMP void KRB5_CALLCONV des_set_random_generator_seed(); -void des_set_sequence_number(); -void des_generate_random_block(); -KRB5_DLLIMP int KRB5_CALLCONV des_pcbc_encrypt(); -KRB5_DLLIMP unsigned long KRB5_CALLCONV des_quad_cksum(); -int des_random_key(); -krb5_error_code des_read_password(); -KRB5_DLLIMP int KRB5_CALLCONV des_string_to_key(); -int des_is_weak_key(); - -#endif /* DES_DEFS */ diff --git a/src/lib/des425/des425.h b/src/lib/des425/des425.h new file mode 100644 index 000000000..9ccc82ce8 --- /dev/null +++ b/src/lib/des425/des425.h @@ -0,0 +1,89 @@ +/* + * lib/des425/des425.h (formerly des.h) + * + * Copyright 1991 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. Furthermore if you modify this software you must label + * your software as modified software and not distribute it in such a + * fashion that it might be confused with the original M.I.T. software. + * 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. + * + * + */ + +/* + * Include file for the Data Encryption Standard library. + */ + +/* only do the whole thing once */ +#ifndef DES_DEFS +#define DES_DEFS + +#include + +typedef mit_des_cblock des_cblock; /* crypto-block size */ + +/* Key schedule */ +typedef mit_des_key_schedule des_key_schedule; + +#define DES_KEY_SZ (sizeof(des_cblock)) +#define DES_ENCRYPT 1 +#define DES_DECRYPT 0 + +#ifndef NCOMPAT +#define C_Block des_cblock +#define Key_schedule des_key_schedule +#define ENCRYPT DES_ENCRYPT +#define DECRYPT DES_DECRYPT +#define KEY_SZ DES_KEY_SZ +#define string_to_key des_string_to_key +#define read_pw_string des_read_pw_string +#define random_key des_random_key +#define pcbc_encrypt des_pcbc_encrypt +#define key_sched des_key_sched +#define cbc_encrypt des_cbc_encrypt +#define cbc_cksum des_cbc_cksum +#define C_Block_print des_cblock_print +#define quad_cksum des_quad_cksum +typedef struct des_ks_struct bit_64; +#endif + +#define des_cblock_print(x) des_cblock_print_file(x, stdout) + +/* + * Windows needs everything prototyped because we're exporting all the fuctions. + */ +void des_cbc_cksum(); +KRB5_DLLIMP int KRB5_CALLCONV des_ecb_encrypt(); +int des_cbc_encrypt(); +void des_fixup_key_parity(); +int des_check_key_parity(); +KRB5_DLLIMP int KRB5_CALLCONV des_key_sched(); +KRB5_DLLIMP int KRB5_CALLCONV des_new_random_key(); +void des_init_random_number_generator(); +KRB5_DLLIMP void KRB5_CALLCONV des_set_random_generator_seed(); +void des_set_sequence_number(); +void des_generate_random_block(); +KRB5_DLLIMP int KRB5_CALLCONV des_pcbc_encrypt(); +KRB5_DLLIMP unsigned long KRB5_CALLCONV des_quad_cksum(); +int des_random_key(); +krb5_error_code des_read_password(); +KRB5_DLLIMP int KRB5_CALLCONV des_string_to_key(); +int des_is_weak_key(); + +#endif /* DES_DEFS */ diff --git a/src/lib/des425/enc_dec.c b/src/lib/des425/enc_dec.c index 8834771e9..0be356075 100644 --- a/src/lib/des425/enc_dec.c +++ b/src/lib/des425/enc_dec.c @@ -39,7 +39,7 @@ */ -#include "des.h" +#include "des425.h" /* * This routine performs DES cipher-block-chaining operation, either diff --git a/src/lib/des425/key_parity.c b/src/lib/des425/key_parity.c index 6a3cae8dc..67480d53f 100644 --- a/src/lib/des425/key_parity.c +++ b/src/lib/des425/key_parity.c @@ -35,7 +35,7 @@ */ -#include "des.h" +#include "des425.h" /* * des_fixup_key_parity: Forces odd parity per byte; parity is bits diff --git a/src/lib/des425/key_sched.c b/src/lib/des425/key_sched.c index 6f9e24b10..b30571c20 100644 --- a/src/lib/des425/key_sched.c +++ b/src/lib/des425/key_sched.c @@ -49,7 +49,7 @@ #include -#include "des.h" +#include "des425.h" KRB5_DLLIMP int KRB5_CALLCONV des_key_sched(k,schedule) diff --git a/src/lib/des425/new_rnd_key.c b/src/lib/des425/new_rnd_key.c index 2e42719b2..2dd6cb103 100644 --- a/src/lib/des425/new_rnd_key.c +++ b/src/lib/des425/new_rnd_key.c @@ -53,7 +53,7 @@ */ -#include "des.h" +#include "des425.h" /* * des_init_random_number_generator: diff --git a/src/lib/des425/pcbc_encrypt.c b/src/lib/des425/pcbc_encrypt.c index 3f48fef4e..dd9ad1995 100644 --- a/src/lib/des425/pcbc_encrypt.c +++ b/src/lib/des425/pcbc_encrypt.c @@ -15,7 +15,7 @@ * des_pcbc_encrypt.c - encrypt a string of characters in error propagation mode */ -#include "des.h" +#include "des425.h" #include /* diff --git a/src/lib/des425/quad_cksum.c b/src/lib/des425/quad_cksum.c index e9340bd5b..2dc51f2c4 100644 --- a/src/lib/des425/quad_cksum.c +++ b/src/lib/des425/quad_cksum.c @@ -106,7 +106,7 @@ #include #include -#include "des.h" +#include "des425.h" /* Definitions for byte swapping */ diff --git a/src/lib/des425/random_key.c b/src/lib/des425/random_key.c index 128a012ed..10e1a3c4e 100644 --- a/src/lib/des425/random_key.c +++ b/src/lib/des425/random_key.c @@ -52,7 +52,7 @@ * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. */ -#include "des.h" +#include "des425.h" /* random_key */ int diff --git a/src/lib/des425/read_passwd.c b/src/lib/des425/read_passwd.c index c69d5ffd2..f09020161 100644 --- a/src/lib/des425/read_passwd.c +++ b/src/lib/des425/read_passwd.c @@ -32,7 +32,7 @@ #if !defined(_MSDOS)&&!defined(_WIN32) -#include "des.h" +#include "des425.h" #include #include #include diff --git a/src/lib/des425/str_to_key.c b/src/lib/des425/str_to_key.c index 44fb143dc..7bf75fb8d 100644 --- a/src/lib/des425/str_to_key.c +++ b/src/lib/des425/str_to_key.c @@ -43,7 +43,7 @@ #include #include -#include "des.h" +#include "des425.h" /* #include "des_internal.h" */ extern int mit_des_debug; diff --git a/src/lib/des425/string2key.c b/src/lib/des425/string2key.c index 8756787a1..5078d5a95 100644 --- a/src/lib/des425/string2key.c +++ b/src/lib/des425/string2key.c @@ -29,7 +29,7 @@ */ -#include "des.h" +#include "des425.h" #include "des_int.h" #ifdef DEBUG diff --git a/src/lib/des425/t_quad.c b/src/lib/des425/t_quad.c index 106b67437..373a5a49e 100644 --- a/src/lib/des425/t_quad.c +++ b/src/lib/des425/t_quad.c @@ -27,7 +27,7 @@ #include #include -#include "des.h" +#include "des425.h" extern char *errmsg(); extern int errno; diff --git a/src/lib/des425/util.c b/src/lib/des425/util.c index 99b5e866d..6f0330269 100644 --- a/src/lib/des425/util.c +++ b/src/lib/des425/util.c @@ -13,7 +13,7 @@ /* Application include files */ #include "k5-int.h" -#include "des.h" +#include "des425.h" void des_cblock_print_file(x, fp) des_cblock *x; diff --git a/src/lib/des425/verify.c b/src/lib/des425/verify.c index bff3c47da..abce45849 100644 --- a/src/lib/des425/verify.c +++ b/src/lib/des425/verify.c @@ -34,7 +34,7 @@ #include #include -#include "./des.h" +#include "des425.h" extern char *errmsg(); extern int errno; diff --git a/src/lib/des425/weak_key.c b/src/lib/des425/weak_key.c index 948451db5..6ef232ee0 100644 --- a/src/lib/des425/weak_key.c +++ b/src/lib/des425/weak_key.c @@ -33,7 +33,7 @@ */ -#include "des.h" +#include "des425.h" /* * mit_des_is_weak_key: returns true iff key is a [semi-]weak des key. -- cgit