Remove the non-iov entry point introduced in r23378, since it's easy
authorGreg Hudson <ghudson@mit.edu>
Sun, 29 Nov 2009 23:13:57 +0000 (23:13 +0000)
committerGreg Hudson <ghudson@mit.edu>
Sun, 29 Nov 2009 23:13:57 +0000 (23:13 +0000)
to use the iov entry point at both call sites.  Rename the iov entry
point to remove the "_iov" suffix since it's no longer needed to
disambiguate.

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@23381 dc483132-0cff-0310-8789-dd5450dbe970

src/include/k5-int.h
src/lib/crypto/krb/arcfour/arcfour.c
src/lib/crypto/krb/arcfour/arcfour_aead.c
src/lib/crypto/libk5crypto.exports
src/lib/gssapi/krb5/util_crypt.c
src/lib/krb5/os/accessor.c

index 43d9d21fe5753320ced988a6b9fcdb64cc9a9467..19389145ac4980315ca8718591afb94c7a70d3b2 100644 (file)
@@ -756,13 +756,8 @@ krb5_error_code krb5int_pbkdf2_hmac_sha1(const krb5_data *, unsigned long,
 
 krb5_error_code
 krb5int_arcfour_gsscrypt(const krb5_keyblock *keyblock, krb5_keyusage usage,
-                         const krb5_data *kd_data, const krb5_data *input,
-                         krb5_data *output);
-
-krb5_error_code
-krb5int_arcfour_gsscrypt_iov(const krb5_keyblock *keyblock,
-                             krb5_keyusage usage, const krb5_data *kd_data,
-                             krb5_crypto_iov *data, size_t num_data);
+                         const krb5_data *kd_data, krb5_crypto_iov *data,
+                         size_t num_data);
 
 /*
  * Attempt to zero memory in a way that compilers won't optimize out.
@@ -2205,13 +2200,8 @@ typedef struct _krb5int_access {
     krb5_error_code (*arcfour_gsscrypt)(const krb5_keyblock *keyblock,
                                         krb5_keyusage usage,
                                         const krb5_data *kd_data,
-                                        const krb5_data *input,
-                                        krb5_data *output);
-    krb5_error_code (*arcfour_gsscrypt_iov)(const krb5_keyblock *keyblock,
-                                            krb5_keyusage usage,
-                                            const krb5_data *kd_data,
-                                            krb5_crypto_iov *data,
-                                            size_t num_data);
+                                        krb5_crypto_iov *data,
+                                        size_t num_data);
 
     krb5_error_code (*auth_con_get_subkey_enctype)(krb5_context,
                                                    krb5_auth_context,
index ba48d727567431f3b9f75aea6da66dfd93610ac4..eb80124e4e544e1b57248ef0635195d8a667f81c 100644 (file)
@@ -263,49 +263,3 @@ cleanup:
     zapfree(comp_checksum.data, comp_checksum.length);
     return ret;
 }
-
-/* Encrypt or decrypt data for a GSSAPI token. */
-krb5_error_code
-krb5int_arcfour_gsscrypt(const krb5_keyblock *keyblock, krb5_keyusage usage,
-                         const krb5_data *kd_data, const krb5_data *input,
-                         krb5_data *output)
-{
-    const struct krb5_enc_provider *enc = &krb5int_enc_arcfour;
-    const struct krb5_hash_provider *hash = &krb5int_hash_md5;
-    krb5_keyblock *usage_keyblock = NULL, *enc_keyblock = NULL;
-    krb5_key enc_key;
-    krb5_error_code ret;
-
-    ret = krb5int_c_init_keyblock(NULL, keyblock->enctype, enc->keybytes,
-                                  &usage_keyblock);
-    if (ret != 0)
-        goto cleanup;
-    ret = krb5int_c_init_keyblock(NULL, keyblock->enctype, enc->keybytes,
-                                  &enc_keyblock);
-    if (ret != 0)
-        goto cleanup;
-
-    /* Derive a usage key from the session key and usage. */
-    ret = krb5int_arcfour_usage_key(enc, hash, keyblock, usage,
-                                    usage_keyblock);
-    if (ret != 0)
-        goto cleanup;
-
-    /* Derive the encryption key from the usage key and kd_data. */
-    ret = krb5int_arcfour_enc_key(enc, hash, usage_keyblock, kd_data,
-                                  enc_keyblock);
-    if (ret != 0)
-        goto cleanup;
-
-    /* Encrypt or decrypt (encrypt works for both) the input. */
-    ret = krb5_k_create_key(NULL, enc_keyblock, &enc_key);
-    if (ret != 0)
-        goto cleanup;
-    ret = (*enc->encrypt)(enc_key, 0, input, output);
-    krb5_k_free_key(NULL, enc_key);
-
-cleanup:
-    krb5int_c_free_keyblock(NULL, usage_keyblock);
-    krb5int_c_free_keyblock(NULL, enc_keyblock);
-    return ret;
-}
index c5e65ca429a7e4e9f75c67be314b6a1b231093bb..c8612fbf1dee3a346667f6734141c4c2384ec83c 100644 (file)
@@ -268,9 +268,9 @@ const struct krb5_aead_provider krb5int_aead_arcfour = {
 };
 
 krb5_error_code
-krb5int_arcfour_gsscrypt_iov(const krb5_keyblock *keyblock,
-                             krb5_keyusage usage, const krb5_data *kd_data,
-                             krb5_crypto_iov *data, size_t num_data)
+krb5int_arcfour_gsscrypt(const krb5_keyblock *keyblock, krb5_keyusage usage,
+                         const krb5_data *kd_data, krb5_crypto_iov *data,
+                         size_t num_data)
 {
     const struct krb5_enc_provider *enc = &krb5int_enc_arcfour;
     const struct krb5_hash_provider *hash = &krb5int_hash_md5;
index 9b19557568f50aeb86c243100ccf39d709e4791e..bc31c30694a0f8b75895a0b71721a876bc46f0de 100644 (file)
@@ -96,4 +96,3 @@ krb5int_MD5Final
 krb5int_aes_decrypt
 krb5int_enc_des3
 krb5int_arcfour_gsscrypt
-krb5int_arcfour_gsscrypt_iov
index 7478c7f12529139ffe03a444dc092d162d6758f0..51e6487502c983756562de38fb3355527d8ca58a 100644 (file)
@@ -289,14 +289,16 @@ kg_arcfour_docrypt(const krb5_keyblock *keyblock, int usage,
 {
     krb5_error_code code;
     krb5_data kd = make_data((char *) kd_data, kd_data_len);
-    krb5_data input = make_data((char *) input_buf, input_len);
-    krb5_data output = make_data(output_buf, input_len);
+    krb5_crypto_iov kiov;
     krb5int_access kaccess;
 
     code = krb5int_accessor(&kaccess, KRB5INT_ACCESS_VERSION);
     if (code)
         return code;
-    return (*kaccess.arcfour_gsscrypt)(keyblock, usage, &kd, &input, &output);
+    memcpy(output_buf, input_buf, input_len);
+    kiov.flags = KRB5_CRYPTO_TYPE_DATA;
+    kiov.data = make_data(output_buf, input_len);
+    return (*kaccess.arcfour_gsscrypt)(keyblock, usage, &kd, &kiov, 1);
 }
 
 /* AEAD */
@@ -593,8 +595,7 @@ kg_arcfour_docrypt_iov(krb5_context context, const krb5_keyblock *keyblock,
                             iov, iov_count, &kiov, &kiov_count);
     if (code)
         return code;
-    code = (*kaccess.arcfour_gsscrypt_iov)(keyblock, usage, &kd,
-                                           kiov, kiov_count);
+    code = (*kaccess.arcfour_gsscrypt)(keyblock, usage, &kd, kiov, kiov_count);
     free(kiov);
     return code;
 }
index 4561c6cf4dc53ac98e48a056fe57f609326173d1..fa97c5789e853edff1f8cd7291812e8576557de1 100644 (file)
@@ -53,7 +53,6 @@ krb5int_accessor(krb5int_access *internals, krb5_int32 version)
             krb5int_access internals_temp;
 #endif
             S (arcfour_gsscrypt, krb5int_arcfour_gsscrypt),
-            S (arcfour_gsscrypt_iov, krb5int_arcfour_gsscrypt_iov),
             S (free_addrlist, krb5int_free_addrlist),
             S (auth_con_get_subkey_enctype, krb5_auth_con_get_subkey_enctype),
             S (sendto_udp, &krb5int_sendto),