Make enc provider free_state function return void
authorGreg Hudson <ghudson@mit.edu>
Sat, 5 Mar 2011 14:00:38 +0000 (14:00 +0000)
committerGreg Hudson <ghudson@mit.edu>
Sat, 5 Mar 2011 14:00:38 +0000 (14:00 +0000)
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@24682 dc483132-0cff-0310-8789-dd5450dbe970

src/lib/crypto/krb/crypto_int.h
src/lib/crypto/krb/default_state.c
src/lib/crypto/nss/enc_provider/enc_gen.c
src/lib/crypto/nss/enc_provider/rc4.c
src/lib/crypto/nss/nss_gen.h
src/lib/crypto/openssl/enc_provider/rc4.c

index 9512e4013f5d646a2ad5b52209d2a073ff934362..3b46fc6279b0a821026a431c1c2a725d2778ea7b 100644 (file)
@@ -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 **/
 
index 4968a7767ce254665aa916ccd44c196eef6b11ca..12124487188bfe70532ca78423fa3edd4381d797 100644 (file)
@@ -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;
 }
index 19f8d2ccf76217288ac6781044ee9ebe9050648f..bdd9d67261d35dc551ea08e40c40834268d08d9b 100644 (file)
@@ -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
index 908924358f71c2f92c86b75f7c65f2ae2f1288d3..bd1cefd7e20da105763380dad632b6b0b62e272e 100644 (file)
@@ -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
index 73f77348adb610178d09e3a2376f098d931dbae8..54e1022affeb76e84827bbbc28bbecf9f497838b 100644 (file)
@@ -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
index 73e25bc7a83e0d824183eca56b25f0c998f04006..2ae4a84f19df4bed78327f35735fd4fe954ff9d6 100644 (file)
@@ -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;