aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMartin Willi <martin@revosec.ch>2015-03-28 08:36:35 +0100
committerMartin Willi <martin@revosec.ch>2015-03-28 08:36:35 +0100
commitb234fdfce8d010ac2d5981f40650f95f1454f7e3 (patch)
tree046e2821b34753d812d9b7ca7c40c3f6288f4b24 /src
parentb07fb365efe1377f17a82a05e0c5f510d3169b7d (diff)
downloadstrongswan-b234fdfce8d010ac2d5981f40650f95f1454f7e3.tar.bz2
strongswan-b234fdfce8d010ac2d5981f40650f95f1454f7e3.tar.xz
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.
Diffstat (limited to 'src')
-rw-r--r--src/libstrongswan/plugins/fips_prf/fips_prf.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/libstrongswan/plugins/fips_prf/fips_prf.c b/src/libstrongswan/plugins/fips_prf/fips_prf.c
index 23825078e..25accf996 100644
--- a/src/libstrongswan/plugins/fips_prf/fips_prf.c
+++ b/src/libstrongswan/plugins/fips_prf/fips_prf.c
@@ -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;
}
-