const krb5_crypto_iov *data, size_t num_data,
krb5_boolean *valid);
+krb5_error_code KRB5_CALLCONV
+krb5_k_prf(krb5_context context, krb5_key key, krb5_data *in, krb5_data *out);
+
#ifdef KRB5_OLD_CRYPTO
/*
* old cryptosystem routine prototypes. These are now layered
}
krb5_error_code KRB5_CALLCONV
-krb5_c_prf(krb5_context context, const krb5_keyblock *keyblock,
+krb5_k_prf(krb5_context context, krb5_key key,
krb5_data *input, krb5_data *output)
{
const struct krb5_keytypes *ktp;
- krb5_key key;
krb5_error_code ret;
assert(input && output);
assert(output->data);
- ktp = find_enctype(keyblock->enctype);
+ ktp = find_enctype(key->keyblock.enctype);
if (ktp == NULL)
return KRB5_BAD_ENCTYPE;
if (ktp->prf == NULL)
output->magic = KV5M_DATA;
if (ktp->prf_length != output->length)
return KRB5_CRYPTO_INTERNAL;
+ ret = (*ktp->prf)(ktp->enc, ktp->hash, key, input, output);
+ return ret;
+}
+
+krb5_error_code KRB5_CALLCONV
+krb5_c_prf(krb5_context context, const krb5_keyblock *keyblock,
+ krb5_data *input, krb5_data *output)
+{
+ krb5_key key;
+ krb5_error_code ret;
+
ret = krb5_k_create_key(context, keyblock, &key);
if (ret != 0)
return ret;
- ret = (*ktp->prf)(ktp->enc, ktp->hash, key, input, output);
+ ret = krb5_k_prf(context, key, input, output);
krb5_k_free_key(context, key);
return ret;
}