From c019e03e70e95258da1af40d96d9798db1b8b2d2 Mon Sep 17 00:00:00 2001 From: Simon Wilkinson Date: Fri, 25 Mar 2011 17:34:51 +0000 Subject: [PATCH] crypto: Fixes for recent Heimdal changes The last Heimdal import changed the name of a number of structures so that they are private to the krb5 code. Mirror this by changing our prototypes to match the new names. This solves the key_type problem that we previously fixed by #defining key_type to hc_key_type, so remove that define. Change-Id: I9b3f1712b0bf6641a780cc4002e73f8a511ff080 Reviewed-on: http://gerrit.openafs.org/4340 Tested-by: BuildBot Reviewed-by: Derrick Brashear --- src/crypto/hcrypto/kernel/config.h | 4 ---- src/crypto/rfc3961/kernel/algs.c | 4 ++-- src/crypto/rfc3961/krb5_locl.h | 24 +++++++++++++----------- 3 files changed, 15 insertions(+), 17 deletions(-) diff --git a/src/crypto/hcrypto/kernel/config.h b/src/crypto/hcrypto/kernel/config.h index 6959ce1..29e9947 100644 --- a/src/crypto/hcrypto/kernel/config.h +++ b/src/crypto/hcrypto/kernel/config.h @@ -39,10 +39,6 @@ #define inline #endif -/* Both Linux and hcrypto want to use 'struct key_type', so we rename our - * local version */ -#define key_type hc_key_type - /* We need wrappers for the various memory management functions */ #define calloc _afscrypto_calloc void * _afscrypto_calloc(int, size_t); diff --git a/src/crypto/rfc3961/kernel/algs.c b/src/crypto/rfc3961/kernel/algs.c index a623a5f..78dd8dd 100644 --- a/src/crypto/rfc3961/kernel/algs.c +++ b/src/crypto/rfc3961/kernel/algs.c @@ -28,7 +28,7 @@ #include "krb5_locl.h" -struct checksum_type *_krb5_checksum_types[] = { +struct _krb5_checksum_type *_krb5_checksum_types[] = { &_krb5_checksum_sha1, &_krb5_checksum_hmac_sha1_aes128, &_krb5_checksum_hmac_sha1_aes256, @@ -37,7 +37,7 @@ struct checksum_type *_krb5_checksum_types[] = { int _krb5_num_checksums = sizeof(_krb5_checksum_types) / sizeof(_krb5_checksum_types[0]); -struct encryption_type *_krb5_etypes[] = { +struct _krb5_encryption_type *_krb5_etypes[] = { &_krb5_enctype_aes256_cts_hmac_sha1, &_krb5_enctype_aes128_cts_hmac_sha1, }; diff --git a/src/crypto/rfc3961/krb5_locl.h b/src/crypto/rfc3961/krb5_locl.h index a3eae68..924dc89 100644 --- a/src/crypto/rfc3961/krb5_locl.h +++ b/src/crypto/rfc3961/krb5_locl.h @@ -164,20 +164,22 @@ int ct_memcmp(const void *p1, const void *p2, size_t len); #include "crypto.h" -struct checksum_type * _krb5_find_checksum (krb5_cksumtype); -struct encryption_type * _krb5_find_enctype (krb5_enctype); -void _krb5_free_key_data (krb5_context, struct key_data *, - struct encryption_type *); -void _krb5_evp_cleanup (krb5_context, struct key_data *); -krb5_error_code _krb5_evp_encrypt (krb5_context, struct key_data *, void *, - size_t, krb5_boolean, int, void *); -krb5_error_code _krb5_evp_encrypt_cts (krb5_context, struct key_data *, +struct _krb5_checksum_type * _krb5_find_checksum (krb5_cksumtype); +struct _krb5_encryption_type * _krb5_find_enctype (krb5_enctype); +void _krb5_free_key_data (krb5_context, struct _krb5_key_data *, + struct _krb5_encryption_type *); +void _krb5_evp_cleanup (krb5_context, struct _krb5_key_data *); + +krb5_error_code _krb5_evp_encrypt (krb5_context, struct _krb5_key_data *, + void *, size_t, krb5_boolean, int, + void *); +krb5_error_code _krb5_evp_encrypt_cts (krb5_context, struct _krb5_key_data *, void *,size_t, krb5_boolean, int, void *); -void _krb5_evp_schedule (krb5_context, struct key_type *,struct key_data *); - +void _krb5_evp_schedule (krb5_context, struct _krb5_key_type *, + struct _krb5_key_data *); krb5_error_code _krb5_SP_HMAC_SHA1_checksum (krb5_context, - struct key_data *, + struct _krb5_key_data *, const void *, size_t, unsigned, Checksum *); -- 1.9.4