diff options
author | Andrew Bartlett <abartlet@samba.org> | 2005-08-09 03:04:47 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 13:31:33 -0500 |
commit | c0e8144c5d1e402b36ebe04b843eba62e7ab9958 (patch) | |
tree | 1b885ceee1a88e8cb2822051690b023c8f8acb78 /source4/heimdal/lib/des | |
parent | 4b93e377cd9809199487e20fa53d8a2c98ad32ea (diff) | |
download | samba-c0e8144c5d1e402b36ebe04b843eba62e7ab9958.tar.gz samba-c0e8144c5d1e402b36ebe04b843eba62e7ab9958.tar.bz2 samba-c0e8144c5d1e402b36ebe04b843eba62e7ab9958.zip |
r9221: Try to merge Heimdal across from lorikeet-heimdal to samba4.
This is my first attempt at this, so there may be a few rough edges.
Andrew Bartlett
(This used to be commit 9a1d2f2fec67930975da856a2d365345cec46216)
Diffstat (limited to 'source4/heimdal/lib/des')
-rw-r--r-- | source4/heimdal/lib/des/des.c | 21 | ||||
-rw-r--r-- | source4/heimdal/lib/des/des.h | 16 | ||||
-rw-r--r-- | source4/heimdal/lib/des/rnd_keys.c | 7 |
3 files changed, 27 insertions, 17 deletions
diff --git a/source4/heimdal/lib/des/des.c b/source4/heimdal/lib/des/des.c index 66d2bf4f4e..b615bbd30e 100644 --- a/source4/heimdal/lib/des/des.c +++ b/source4/heimdal/lib/des/des.c @@ -45,7 +45,7 @@ #ifdef HAVE_CONFIG_H #include <config.h> -RCSID("$Id: des.c,v 1.14 2005/06/18 22:47:17 lha Exp $"); +RCSID("$Id: des.c,v 1.15 2005/07/20 10:49:22 lha Exp $"); #endif #include <stdio.h> @@ -267,9 +267,11 @@ DES_ecb_encrypt(DES_cblock *input, DES_cblock *output, */ void -DES_cbc_encrypt(unsigned char *input, unsigned char *output, long length, +DES_cbc_encrypt(const void *in, void *out, long length, DES_key_schedule *ks, DES_cblock *iv, int forward_encrypt) { + const unsigned char *input = in; + unsigned char *output = out; uint32_t u[2]; uint32_t uiv[2]; @@ -328,9 +330,11 @@ DES_cbc_encrypt(unsigned char *input, unsigned char *output, long length, */ void -DES_pcbc_encrypt(unsigned char *input, unsigned char *output, long length, +DES_pcbc_encrypt(const void *in, void *out, long length, DES_key_schedule *ks, DES_cblock *iv, int forward_encrypt) { + const unsigned char *input = in; + unsigned char *output = out; uint32_t u[2]; uint32_t uiv[2]; @@ -430,11 +434,13 @@ DES_ecb3_encrypt(DES_cblock *input, */ void -DES_ede3_cbc_encrypt(const unsigned char *input, unsigned char *output, +DES_ede3_cbc_encrypt(const void *in, void *out, long length, DES_key_schedule *ks1, DES_key_schedule *ks2, DES_key_schedule *ks3, DES_cblock *iv, int forward_encrypt) { + const unsigned char *input = in; + unsigned char *output = out; uint32_t u[2]; uint32_t uiv[2]; @@ -494,10 +500,12 @@ DES_ede3_cbc_encrypt(const unsigned char *input, unsigned char *output, */ void -DES_cfb64_encrypt(unsigned char *input, unsigned char *output, +DES_cfb64_encrypt(const void *in, void *out, long length, DES_key_schedule *ks, DES_cblock *iv, int *num, int forward_encrypt) { + const unsigned char *input = in; + unsigned char *output = out; unsigned char tmp[DES_CBLOCK_LEN]; uint32_t uiv[2]; @@ -555,9 +563,10 @@ DES_cfb64_encrypt(unsigned char *input, unsigned char *output, */ uint32_t -DES_cbc_cksum(const unsigned char *input, DES_cblock *output, +DES_cbc_cksum(const void *in, DES_cblock *output, long length, DES_key_schedule *ks, DES_cblock *iv) { + const unsigned char *input = in; uint32_t uiv[2]; uint32_t u[2] = { 0, 0 }; diff --git a/source4/heimdal/lib/des/des.h b/source4/heimdal/lib/des/des.h index 378c77572c..887c2e14d4 100644 --- a/source4/heimdal/lib/des/des.h +++ b/source4/heimdal/lib/des/des.h @@ -31,7 +31,7 @@ * SUCH DAMAGE. */ -/* $Id: des.h,v 1.23 2005/04/30 14:09:50 lha Exp $ */ +/* $Id: des.h,v 1.24 2005/07/20 10:49:23 lha Exp $ */ #ifndef _DESperate_H #define _DESperate_H 1 @@ -59,10 +59,10 @@ int DES_read_password(DES_cblock *, char *, int); int UI_UTIL_read_pw_string(char *, int, const char *, int); /* XXX */ -void DES_rand_data(unsigned char *, int); +void DES_rand_data(void *, int); void DES_set_random_generator_seed(DES_cblock *); void DES_generate_random_block(DES_cblock *); -void DES_set_sequence_number(unsigned char *); +void DES_set_sequence_number(void *); void DES_init_random_number_generator(DES_cblock *); void DES_random_key(DES_cblock *); @@ -71,18 +71,18 @@ void DES_encrypt(uint32_t [2], DES_key_schedule *, int); void DES_ecb_encrypt(DES_cblock *, DES_cblock *, DES_key_schedule *, int); void DES_ecb3_encrypt(DES_cblock *,DES_cblock *, DES_key_schedule *, DES_key_schedule *, DES_key_schedule *, int); -void DES_pcbc_encrypt(unsigned char *, unsigned char *, long, +void DES_pcbc_encrypt(const void *, void *, long, DES_key_schedule *, DES_cblock *, int); -void DES_cbc_encrypt(unsigned char *, unsigned char *, long, +void DES_cbc_encrypt(const void *, void *, long, DES_key_schedule *, DES_cblock *, int); -void DES_ede3_cbc_encrypt(const unsigned char *, unsigned char *, long, +void DES_ede3_cbc_encrypt(const void *, void *, long, DES_key_schedule *, DES_key_schedule *, DES_key_schedule *, DES_cblock *, int); -void DES_cfb64_encrypt(unsigned char *, unsigned char *, long, +void DES_cfb64_encrypt(const void *, void *, long, DES_key_schedule *, DES_cblock *, int *, int); -uint32_t DES_cbc_cksum(const unsigned char *, DES_cblock *, +uint32_t DES_cbc_cksum(const void *, DES_cblock *, long, DES_key_schedule *, DES_cblock *); diff --git a/source4/heimdal/lib/des/rnd_keys.c b/source4/heimdal/lib/des/rnd_keys.c index 49d8838a10..63dddeb8ce 100644 --- a/source4/heimdal/lib/des/rnd_keys.c +++ b/source4/heimdal/lib/des/rnd_keys.c @@ -34,7 +34,7 @@ #ifdef HAVE_CONFIG_H #include "config.h" -RCSID("$Id: rnd_keys.c,v 1.68 2005/06/29 22:28:10 lha Exp $"); +RCSID("$Id: rnd_keys.c,v 1.69 2005/07/20 10:49:24 lha Exp $"); #endif #ifdef KRB5 @@ -240,8 +240,9 @@ static RETSIGTYPE * It's not neccessary to be root to run it. */ void -DES_rand_data(unsigned char *data, int size) +DES_rand_data(void *outdata, int size) { + unsigned char *data = outdata; struct itimerval tv, otv; RETSIGTYPE (*osa)(int); int i, j; @@ -388,7 +389,7 @@ memcpy((char *)sequence_index, (ll), sizeof(sequence_index)); * Set the sequnce number to this value (a long long). */ void -DES_set_sequence_number(unsigned char *ll) +DES_set_sequence_number(void *ll) { set_sequence_number(ll); } |