diff options
author | Ulf Möller <ulf@openssl.org> | 1999-07-29 00:09:49 +0000 |
---|---|---|
committer | Ulf Möller <ulf@openssl.org> | 1999-07-29 00:09:49 +0000 |
commit | 37b7185b5dafec8c1798b2f7ebb3e5c22bf74fa4 (patch) | |
tree | 610d5d66be4de7abacc2036e5e96738ee7bdd6fe /crypto/des/des.h | |
parent | 8c197cc55eda97fba9c51254fd0e1da7259ab174 (diff) | |
download | openssl-37b7185b5dafec8c1798b2f7ebb3e5c22bf74fa4.tar.gz |
Restore compability with kerberos/des.h (I had deleted some seemingly useless
definitions such as C_Block earlier).
Diffstat (limited to 'crypto/des/des.h')
-rw-r--r-- | crypto/des/des.h | 75 |
1 files changed, 35 insertions, 40 deletions
diff --git a/crypto/des/des.h b/crypto/des/des.h index 54d58ed602..08cd626c12 100644 --- a/crypto/des/des.h +++ b/crypto/des/des.h @@ -68,18 +68,13 @@ extern "C" { #endif #ifdef _KERBEROS_DES_H -#error kerberos/des.h and openssl/des.h +#error <openssl/des.h> replaces <kerberos/des.h>. #endif #include <stdio.h> #include <openssl/opensslconf.h> /* DES_LONG */ #include <openssl/e_os2.h> /* OPENSSL_EXTERN */ -#ifdef VMS -#undef des_init_random_number_generator -#define des_init_random_number_generator des_init_random_num_generator -#endif - typedef unsigned char des_cblock[8]; typedef /* const */ unsigned char const_des_cblock[8]; /* With "const", gcc 2.8.1 on Solaris thinks that des_cblock * @@ -91,7 +86,7 @@ typedef /* const */ unsigned char const_des_cblock[8]; typedef struct des_ks_struct { union { - des_cblock cblock; + des_cblock _; /* make sure things are correct size on machines with * 8 byte longs */ DES_LONG deslong[2]; @@ -120,30 +115,6 @@ typedef struct des_ks_struct #define des_ede2_ofb64_encrypt(i,o,l,k1,k2,iv,n) \ des_ede3_ofb64_encrypt((i),(o),(l),(k1),(k2),(k1),(iv),(n)) -#ifdef KERBEROS -#define ENCRYPT DES_ENCRYPT -#define DECRYPT DES_DECRYPT -#endif - -#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 set_key des_set_key -#define key_sched des_key_sched -#define ecb_encrypt des_ecb_encrypt -#define cbc_encrypt des_cbc_encrypt -#define ncbc_encrypt des_ncbc_encrypt -#define xcbc_encrypt des_xcbc_encrypt -#define cbc_cksum des_cbc_cksum -#define quad_cksum des_quad_cksum - -/* For compatibility with the MIT lib - eay 20/05/92 */ -typedef des_key_schedule bit_64; -#define des_fixup_key_parity des_set_odd_parity -#define des_check_key_parity check_parity - OPENSSL_EXTERN int des_check_key; /* defaults to false */ OPENSSL_EXTERN int des_rw_mode; /* defaults to DES_PCBC_MODE */ OPENSSL_EXTERN int des_set_weak_key_flag; /* set the weak key flag */ @@ -236,17 +207,41 @@ int des_read_pw(char *buf,char *buff,int size,const char *prompt,int verify); /* Extra functions from Mark Murray <mark@grondar.za> */ void des_cblock_print_file(const_des_cblock *cb, FILE *fp); -#ifdef FreeBSD -/* The following functions are not in the normal unix build or the - * SSLeay build. When using the SSLeay build, use RAND_seed() - * and RAND_bytes() instead. */ -int des_new_random_key(des_cblock *key); -void des_init_random_number_generator(des_cblock *key); -void des_set_random_generator_seed(des_cblock *key); -void des_set_sequence_number(des_cblock new_sequence_number); -void des_generate_random_block(des_cblock *block); +/* The following definitions provide compatibility with the MIT Kerberos + * library. The des_key_schedule structure is not binary compatible. */ + +#define _KERBEROS_DES_H + +#define KRBDES_ENCRYPT DES_ENCRYPT +#define KRBDES_DECRYPT DES_DECRYPT + +#ifdef KERBEROS +# define ENCRYPT DES_ENCRYPT +# define DECRYPT DES_DECRYPT +#endif + +#ifndef NCOMPAT +# define C_Block des_cblock +# define Key_schedule des_key_schedule +# 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 set_key des_set_key +# define key_sched des_key_sched +# define ecb_encrypt des_ecb_encrypt +# define cbc_encrypt des_cbc_encrypt +# define ncbc_encrypt des_ncbc_encrypt +# define xcbc_encrypt des_xcbc_encrypt +# define cbc_cksum des_cbc_cksum +# define quad_cksum des_quad_cksum #endif +typedef des_key_schedule bit_64; +#define des_fixup_key_parity des_set_odd_parity +#define des_check_key_parity check_parity + #ifdef __cplusplus } #endif |