From: Greg Hudson Date: Sat, 5 Mar 2011 14:00:38 +0000 (+0000) Subject: Make enc provider free_state function return void X-Git-Tag: krb5-1.10-alpha1~554 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=41cad8f7218c9c1c9356be626d0eb88e0a5b772a;p=krb5.git Make enc provider free_state function return void git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@24682 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/lib/crypto/krb/crypto_int.h b/src/lib/crypto/krb/crypto_int.h index 9512e4013..3b46fc627 100644 --- a/src/lib/crypto/krb/crypto_int.h +++ b/src/lib/crypto/krb/crypto_int.h @@ -54,7 +54,7 @@ struct krb5_enc_provider { krb5_error_code (*init_state)(const krb5_keyblock *key, krb5_keyusage keyusage, krb5_data *out_state); - krb5_error_code (*free_state)(krb5_data *state); + void (*free_state)(krb5_data *state); /* May be NULL if there is no key-derived data cached. */ void (*key_cleanup)(krb5_key key); @@ -369,7 +369,7 @@ krb5_error_code krb5int_des_init_state(const krb5_keyblock *key, krb5_data *new_state); /* Default state cleanup handler (used by module enc providers). */ -krb5_error_code krb5int_default_free_state(krb5_data *state); +void krb5int_default_free_state(krb5_data *state); /*** Input/output vector processing declarations **/ diff --git a/src/lib/crypto/krb/default_state.c b/src/lib/crypto/krb/default_state.c index 4968a7767..121244871 100644 --- a/src/lib/crypto/krb/default_state.c +++ b/src/lib/crypto/krb/default_state.c @@ -32,8 +32,9 @@ #include "crypto_int.h" -krb5_error_code krb5int_des_init_state -(const krb5_keyblock *key, krb5_keyusage usage, krb5_data *new_state ) +krb5_error_code +krb5int_des_init_state(const krb5_keyblock *key, krb5_keyusage usage, + krb5_data *new_state) { new_state->length = 8; new_state->data = (void *) malloc(8); @@ -49,13 +50,12 @@ krb5_error_code krb5int_des_init_state return 0; } -krb5_error_code krb5int_default_free_state -(krb5_data *state) +void +krb5int_default_free_state(krb5_data *state) { if (state->data) { free (state->data); state-> data = NULL; state->length = 0; } - return 0; } diff --git a/src/lib/crypto/nss/enc_provider/enc_gen.c b/src/lib/crypto/nss/enc_provider/enc_gen.c index 19f8d2ccf..bdd9d6726 100644 --- a/src/lib/crypto/nss/enc_provider/enc_gen.c +++ b/src/lib/crypto/nss/enc_provider/enc_gen.c @@ -269,7 +269,7 @@ k5_nss_stream_init_state(krb5_data *new_state) return 0; } -krb5_error_code +void k5_nss_stream_free_state(krb5_data *state) { struct stream_state *sstate = (struct stream_state *) state->data; @@ -280,7 +280,6 @@ k5_nss_stream_free_state(krb5_data *state) PK11_DestroyContext(sstate->ctx, PR_TRUE); } free(sstate); - return 0; } krb5_error_code diff --git a/src/lib/crypto/nss/enc_provider/rc4.c b/src/lib/crypto/nss/enc_provider/rc4.c index 908924358..bd1cefd7e 100644 --- a/src/lib/crypto/nss/enc_provider/rc4.c +++ b/src/lib/crypto/nss/enc_provider/rc4.c @@ -67,10 +67,10 @@ k5_arcfour_decrypt_iov(krb5_key key, const krb5_data *state, data, num_data); } -static krb5_error_code +static void k5_arcfour_free_state(krb5_data *state) { - return k5_nss_stream_free_state(state); + (void)k5_nss_stream_free_state(state); } static krb5_error_code diff --git a/src/lib/crypto/nss/nss_gen.h b/src/lib/crypto/nss/nss_gen.h index 73f77348a..54e1022af 100644 --- a/src/lib/crypto/nss/nss_gen.h +++ b/src/lib/crypto/nss/nss_gen.h @@ -98,7 +98,7 @@ k5_nss_gen_cbcmac_iov(krb5_key key, CK_MECHANISM_TYPE mech, /* Stream state management calls. */ krb5_error_code k5_nss_stream_init_state(krb5_data *new_state); -krb5_error_code k5_nss_stream_free_state(krb5_data *state); +void k5_nss_stream_free_state(krb5_data *state); /* * Common hash functions diff --git a/src/lib/crypto/openssl/enc_provider/rc4.c b/src/lib/crypto/openssl/enc_provider/rc4.c index 73e25bc7a..2ae4a84f1 100644 --- a/src/lib/crypto/openssl/enc_provider/rc4.c +++ b/src/lib/crypto/openssl/enc_provider/rc4.c @@ -53,14 +53,7 @@ struct arcfour_state { #define RC4_KEY_SIZE 16 #define RC4_BLOCK_SIZE 1 -/* Interface layer to kerb5 crypto layer */ - -/* prototypes */ -static krb5_error_code -k5_arcfour_free_state ( krb5_data *state); -static krb5_error_code -k5_arcfour_init_state (const krb5_keyblock *key, - krb5_keyusage keyusage, krb5_data *new_state); +/* Interface layer to krb5 crypto layer */ /* The workhorse of the arcfour system, * this impliments the cipher @@ -119,8 +112,8 @@ k5_arcfour_docrypt(krb5_key key,const krb5_data *state, krb5_crypto_iov *data, return 0; } -static krb5_error_code -k5_arcfour_free_state ( krb5_data *state) +static void +k5_arcfour_free_state(krb5_data *state) { struct arcfour_state *arcstate = (struct arcfour_state *) state->data; @@ -128,12 +121,11 @@ k5_arcfour_free_state ( krb5_data *state) if (arcstate && arcstate->loopback == arcstate) EVP_CIPHER_CTX_cleanup(&arcstate->ctx); free(arcstate); - return 0; } static krb5_error_code -k5_arcfour_init_state (const krb5_keyblock *key, - krb5_keyusage keyusage, krb5_data *new_state) +k5_arcfour_init_state(const krb5_keyblock *key, + krb5_keyusage keyusage, krb5_data *new_state) { struct arcfour_state *arcstate;