finished);
}
+METHOD(tls_hkdf_t, allocate_bytes, bool,
+ private_tls_hkdf_t *this, chunk_t key, chunk_t seed,
+ chunk_t *out)
+{
+ return this->prf->set_key(this->prf, key) &&
+ this->prf->allocate_bytes(this->prf, seed, out);
+}
+
METHOD(tls_hkdf_t, destroy, void,
private_tls_hkdf_t *this)
{
.derive_key = _derive_key,
.derive_iv = _derive_iv,
.derive_finished = _derive_finished,
+ .allocate_bytes = _allocate_bytes,
.destroy = _destroy,
},
.phase = HKDF_PHASE_0,
chunk_t *finished);
/**
+ * Use the internal PRF to allocate data (mainly for the finished message
+ * where the key is from derive_finished() and the seed is the transcript
+ * hash).
+ *
+ * @param key key to use with the PRF
+ * @param seed seed to use with the PRF
+ * @param out output from the PRF (allocated)
+ * @return TRUE if output was generated
+ */
+ bool (*allocate_bytes)(tls_hkdf_t *this, chunk_t key, chunk_t seed,
+ chunk_t *out);
+
+ /**
* Destroy a tls_hkdf_t
*/
void (*destroy)(tls_hkdf_t *this);