From: Greg Hudson Date: Sun, 29 Nov 2009 23:13:57 +0000 (+0000) Subject: Remove the non-iov entry point introduced in r23378, since it's easy X-Git-Tag: krb5-1.8-alpha1~127 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=6af933667efaab3e74add5ffefd7f9691a362958;p=krb5.git Remove the non-iov entry point introduced in r23378, since it's easy 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 --- diff --git a/src/include/k5-int.h b/src/include/k5-int.h index 43d9d21fe..19389145a 100644 --- a/src/include/k5-int.h +++ b/src/include/k5-int.h @@ -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, diff --git a/src/lib/crypto/krb/arcfour/arcfour.c b/src/lib/crypto/krb/arcfour/arcfour.c index ba48d7275..eb80124e4 100644 --- a/src/lib/crypto/krb/arcfour/arcfour.c +++ b/src/lib/crypto/krb/arcfour/arcfour.c @@ -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; -} diff --git a/src/lib/crypto/krb/arcfour/arcfour_aead.c b/src/lib/crypto/krb/arcfour/arcfour_aead.c index c5e65ca42..c8612fbf1 100644 --- a/src/lib/crypto/krb/arcfour/arcfour_aead.c +++ b/src/lib/crypto/krb/arcfour/arcfour_aead.c @@ -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; diff --git a/src/lib/crypto/libk5crypto.exports b/src/lib/crypto/libk5crypto.exports index 9b1955756..bc31c3069 100644 --- a/src/lib/crypto/libk5crypto.exports +++ b/src/lib/crypto/libk5crypto.exports @@ -96,4 +96,3 @@ krb5int_MD5Final krb5int_aes_decrypt krb5int_enc_des3 krb5int_arcfour_gsscrypt -krb5int_arcfour_gsscrypt_iov diff --git a/src/lib/gssapi/krb5/util_crypt.c b/src/lib/gssapi/krb5/util_crypt.c index 7478c7f12..51e648750 100644 --- a/src/lib/gssapi/krb5/util_crypt.c +++ b/src/lib/gssapi/krb5/util_crypt.c @@ -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; } diff --git a/src/lib/krb5/os/accessor.c b/src/lib/krb5/os/accessor.c index 4561c6cf4..fa97c5789 100644 --- a/src/lib/krb5/os/accessor.c +++ b/src/lib/krb5/os/accessor.c @@ -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),