diff options
author | Greg Hudson <ghudson@mit.edu> | 2009-12-06 16:23:11 +0000 |
---|---|---|
committer | Greg Hudson <ghudson@mit.edu> | 2009-12-06 16:23:11 +0000 |
commit | 638fc9ce2cfdd2e8395471d974ec0d28d1b9064c (patch) | |
tree | 31ea13f7a88d93b17c77f19a6b1eb66ad0fe8175 /src/lib/crypto/builtin/pbkdf2.c | |
parent | 0c3ba5525f2e3fff51da72bdfaa35ce7dae9f800 (diff) | |
download | krb5-638fc9ce2cfdd2e8395471d974ec0d28d1b9064c.zip krb5-638fc9ce2cfdd2e8395471d974ec0d28d1b9064c.tar.gz krb5-638fc9ce2cfdd2e8395471d974ec0d28d1b9064c.tar.bz2 |
Make the libk5crypto hash_provider interface take crypto_iov lists
instead of lists of krb5_data. Make the base HMAC APIs take
crypto_iov lists and drop the _iov variants.
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@23450 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'src/lib/crypto/builtin/pbkdf2.c')
-rw-r--r-- | src/lib/crypto/builtin/pbkdf2.c | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/src/lib/crypto/builtin/pbkdf2.c b/src/lib/crypto/builtin/pbkdf2.c index 6c954d3..7ee07f0 100644 --- a/src/lib/crypto/builtin/pbkdf2.c +++ b/src/lib/crypto/builtin/pbkdf2.c @@ -221,31 +221,36 @@ hmac_sha1(krb5_key pass, krb5_data *salt, krb5_data *out) { const struct krb5_hash_provider *h = &krb5int_hash_sha1; krb5_error_code err; + krb5_crypto_iov iov; if (debug_hmac) printd(" hmac input", salt); - err = krb5int_hmac(h, pass, 1, salt, out); + iov.flags = KRB5_CRYPTO_TYPE_DATA; + iov.data = *salt; + err = krb5int_hmac(h, pass, &iov, 1, out); if (err == 0 && debug_hmac) printd(" hmac output", out); return err; } krb5_error_code -krb5int_pbkdf2_hmac_sha1 (const krb5_data *out, unsigned long count, - const krb5_data *pass, const krb5_data *salt) +krb5int_pbkdf2_hmac_sha1(const krb5_data *out, unsigned long count, + const krb5_data *pass, const krb5_data *salt) { const struct krb5_hash_provider *h = &krb5int_hash_sha1; krb5_keyblock keyblock; krb5_key key; char tmp[40]; krb5_data d; + krb5_crypto_iov iov; krb5_error_code err; assert(h->hashsize <= sizeof(tmp)); if (pass->length > h->blocksize) { - d.data = tmp; - d.length = h->hashsize; - err = h->hash (1, pass, &d); + d = make_data(tmp, h->hashsize); + iov.flags = KRB5_CRYPTO_TYPE_DATA; + iov.data = *pass; + err = h->hash(&iov, 1, &d); if (err) return err; keyblock.length = d.length; |