signature-params: Add struct for RSASSA-PSS parameters
authorTobias Brunner <tobias@strongswan.org>
Tue, 19 Sep 2017 16:21:37 +0000 (18:21 +0200)
committerTobias Brunner <tobias@strongswan.org>
Wed, 8 Nov 2017 15:48:10 +0000 (16:48 +0100)
src/libstrongswan/Makefile.am
src/libstrongswan/credentials/keys/signature_params.h [new file with mode: 0644]

index ef12508..c0cc094 100644 (file)
@@ -79,6 +79,7 @@ crypto/xofs/xof.h crypto/xofs/xof_bitspender.h crypto/xofs/mgf1.h \
 credentials/credential_factory.h credentials/builder.h \
 credentials/cred_encoding.h credentials/keys/private_key.h \
 credentials/keys/public_key.h credentials/keys/shared_key.h \
+credentials/keys/signature_params.h \
 credentials/certificates/certificate.h credentials/certificates/x509.h \
 credentials/certificates/ac.h credentials/certificates/crl.h \
 credentials/certificates/pkcs10.h credentials/certificates/ocsp_request.h \
diff --git a/src/libstrongswan/credentials/keys/signature_params.h b/src/libstrongswan/credentials/keys/signature_params.h
new file mode 100644 (file)
index 0000000..24f0f40
--- /dev/null
@@ -0,0 +1,41 @@
+/*
+ * Copyright (C) 2017 Tobias Brunner
+ * HSR Hochschule fuer Technik Rapperswil
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.  See <http://www.fsf.org/copyleft/gpl.txt>.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * for more details.
+ */
+
+/**
+ * @defgroup signature_params signature_params
+ * @{ @ingroup keys
+ */
+
+#ifndef SIGNATURE_PARAMS_H_
+#define SIGNATURE_PARAMS_H_
+
+typedef struct rsa_pss_params_t rsa_pss_params_t;
+
+#include <crypto/hashers/hasher.h>
+
+/**
+ * Parameters for SIGN_RSA_EMSA_PSS signature scheme
+ */
+struct rsa_pss_params_t {
+       /** Hash algorithm */
+       hash_algorithm_t hash;
+       /** Hash for the MGF1 function */
+       hash_algorithm_t mgf1_hash;
+       /** Salt length, use RSA_PSS_SALT_LEN_DEFAULT for length equal to hash */
+       ssize_t salt_len;
+#define RSA_PSS_SALT_LEN_DEFAULT -1
+};
+
+#endif /** SIGNATURE_PARAMS_H_ @}*/