fips-prf: Fail when trying to use append mode on FIPS-PRF

Append mode hardly makes sense for the special stateful FIPS-PRF, which is
different to other PRFs.
This commit is contained in:
Martin Willi
2015-03-28 08:36:35 +01:00
parent b07fb365ef
commit b234fdfce8
@@ -116,6 +116,12 @@ METHOD(prf_t, get_bytes, bool,
u_int8_t *xkey = this->key;
u_int8_t one[this->b];
if (!w)
{
/* append mode is not supported */
return FALSE;
}
memset(one, 0, this->b);
one[this->b - 1] = 0x01;
@@ -250,4 +256,3 @@ fips_prf_t *fips_prf_create(pseudo_random_function_t algo)
return &this->public;
}