diff options
Diffstat (limited to 'crypto/heimdal/lib/krb5/crypto.c')
-rw-r--r-- | crypto/heimdal/lib/krb5/crypto.c | 49 |
1 files changed, 17 insertions, 32 deletions
diff --git a/crypto/heimdal/lib/krb5/crypto.c b/crypto/heimdal/lib/krb5/crypto.c index db9e810..65fa793 100644 --- a/crypto/heimdal/lib/krb5/crypto.c +++ b/crypto/heimdal/lib/krb5/crypto.c @@ -32,7 +32,7 @@ */ #include "krb5_locl.h" -RCSID("$Id: crypto.c,v 1.64 2002/04/29 16:31:54 joda Exp $"); +RCSID("$Id: crypto.c,v 1.66 2002/09/03 19:58:15 joda Exp $"); #undef CRYPTO_DEBUG #ifdef CRYPTO_DEBUG @@ -1676,26 +1676,14 @@ DES3_CBC_encrypt(krb5_context context, size_t len, krb5_boolean encrypt, int usage, - void *ignore_ivec) -{ - des_cblock ivec; - des_key_schedule *s = key->schedule->data; - memset(&ivec, 0, sizeof(ivec)); - des_ede3_cbc_encrypt(data, data, len, s[0], s[1], s[2], &ivec, encrypt); - return 0; -} - -static krb5_error_code -DES3_CBC_encrypt_ivec(krb5_context context, - struct key_data *key, - void *data, - size_t len, - krb5_boolean encrypt, - int usage, - void *ivec) + void *ivec) { + des_cblock local_ivec; des_key_schedule *s = key->schedule->data; - + if(ivec == NULL) { + ivec = &local_ivec; + memset(local_ivec, 0, sizeof(local_ivec)); + } des_ede3_cbc_encrypt(data, data, len, s[0], s[1], s[2], ivec, encrypt); return 0; } @@ -2070,17 +2058,6 @@ static struct encryption_type enctype_des3_cbc_none = { F_PSEUDO, DES3_CBC_encrypt, }; -static struct encryption_type enctype_des3_cbc_none_ivec = { - ETYPE_DES3_CBC_NONE_IVEC, - "des3-cbc-none-ivec", - 8, - 0, - &keytype_des3_derived, - &checksum_none, - NULL, - F_PSEUDO, - DES3_CBC_encrypt_ivec, -}; static struct encryption_type *etypes[] = { &enctype_null, @@ -2094,8 +2071,7 @@ static struct encryption_type *etypes[] = { &enctype_des_cbc_none, &enctype_des_cfb64_none, &enctype_des_pcbc_none, - &enctype_des3_cbc_none, - &enctype_des3_cbc_none_ivec + &enctype_des3_cbc_none }; static unsigned num_etypes = sizeof(etypes) / sizeof(etypes[0]); @@ -3057,6 +3033,15 @@ krb5_crypto_destroy(krb5_context context, } krb5_error_code +krb5_crypto_getblocksize(krb5_context context, + krb5_crypto crypto, + size_t *blocksize) +{ + *blocksize = crypto->et->blocksize; + return 0; +} + +krb5_error_code krb5_string_to_key_derived(krb5_context context, const void *str, size_t len, |