aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTobias Brunner <tobias@strongswan.org>2017-09-25 18:17:54 +0200
committerTobias Brunner <tobias@strongswan.org>2017-11-08 16:48:10 +0100
commit90a3bc50753b4cf76ca24d7f9c0ccd8405c37a43 (patch)
treece5cbc150dcc2ea4efe1bd657ffb950b198c428a
parent720a76c22957b8c43aac1b4b74a9c1b07e5b48e8 (diff)
downloadstrongswan-90a3bc50753b4cf76ca24d7f9c0ccd8405c37a43.tar.bz2
strongswan-90a3bc50753b4cf76ca24d7f9c0ccd8405c37a43.tar.xz
mgf1: Add support for SHA-224/384 based MGF1
-rw-r--r--src/libstrongswan/plugins/mgf1/mgf1_plugin.c4
-rw-r--r--src/libstrongswan/plugins/mgf1/mgf1_xof.c8
2 files changed, 11 insertions, 1 deletions
diff --git a/src/libstrongswan/plugins/mgf1/mgf1_plugin.c b/src/libstrongswan/plugins/mgf1/mgf1_plugin.c
index 8df3ac261..a78d2f254 100644
--- a/src/libstrongswan/plugins/mgf1/mgf1_plugin.c
+++ b/src/libstrongswan/plugins/mgf1/mgf1_plugin.c
@@ -44,8 +44,12 @@ METHOD(plugin_t, get_features, int,
PLUGIN_REGISTER(XOF, mgf1_xof_create),
PLUGIN_PROVIDE(XOF, XOF_MGF1_SHA1),
PLUGIN_DEPENDS(HASHER, HASH_SHA1),
+ PLUGIN_PROVIDE(XOF, XOF_MGF1_SHA224),
+ PLUGIN_DEPENDS(HASHER, HASH_SHA224),
PLUGIN_PROVIDE(XOF, XOF_MGF1_SHA256),
PLUGIN_DEPENDS(HASHER, HASH_SHA256),
+ PLUGIN_PROVIDE(XOF, XOF_MGF1_SHA384),
+ PLUGIN_DEPENDS(HASHER, HASH_SHA384),
PLUGIN_PROVIDE(XOF, XOF_MGF1_SHA512),
PLUGIN_DEPENDS(HASHER, HASH_SHA512),
};
diff --git a/src/libstrongswan/plugins/mgf1/mgf1_xof.c b/src/libstrongswan/plugins/mgf1/mgf1_xof.c
index 0f5fda952..8f5a18f87 100644
--- a/src/libstrongswan/plugins/mgf1/mgf1_xof.c
+++ b/src/libstrongswan/plugins/mgf1/mgf1_xof.c
@@ -244,9 +244,15 @@ mgf1_xof_t *mgf1_xof_create(ext_out_function_t algorithm)
case XOF_MGF1_SHA1:
hash_alg = HASH_SHA1;
break;
+ case XOF_MGF1_SHA224:
+ hash_alg = HASH_SHA224;
+ break;
case XOF_MGF1_SHA256:
hash_alg = HASH_SHA256;
break;
+ case XOF_MGF1_SHA384:
+ hash_alg = HASH_SHA384;
+ break;
case XOF_MGF1_SHA512:
hash_alg = HASH_SHA512;
break;
@@ -261,7 +267,7 @@ mgf1_xof_t *mgf1_xof_create(ext_out_function_t algorithm)
hash_algorithm_names, hash_alg);
return NULL;
}
-
+
INIT(this,
.public = {
.mgf1_interface = {