A subsequent patch will make the DH implementation to reject any inputReviewed-by: Hannes Reinecke <hare@xxxxxxx>
domain parameter set with ->group_id == dh_group_id_unknown in FIPS mode.
However, as the keyctl(KEYCTL_DH_COMPUTE) implementation simply passes
forward keys from userspace, it does not (and cannot) set ->group_id to
anything else than dh_group_id_unknown.
In order to still allow for keyctl(KEYCTL_DH_COMPUTE) to work on approved
domain parameters passed in from userspace in FIPS mode, make
crypto_dh_decode_key() to compare them against any of the known groups and
set ->group_id upon having found a match, if any.
Signed-off-by: Nicolai Stange <nstange@xxxxxxx>
---
crypto/dh_helper.c | 33 +++++++++++++++++++++++++++++++++
1 file changed, 33 insertions(+)