Define MODP_CUSTOM constructors as variadic functions

They now match the dh_constructor_t signature.  This is a follow up for
the changes merged with b668bf3f9e and should fix use of MODP_CUSTOM on
Apple's ARM64 platform.
This commit is contained in:
Tobias Brunner
2017-09-18 12:07:26 +02:00
parent f871b341d7
commit 46a62f0126
8 changed files with 28 additions and 22 deletions
+4 -2
View File
@@ -415,13 +415,15 @@ static chunk_t ecparams_lookup(diffie_hellman_group_t group)
/**
* Described in header.
*/
pkcs11_dh_t *pkcs11_dh_create(diffie_hellman_group_t group,
chunk_t g, chunk_t p)
pkcs11_dh_t *pkcs11_dh_create(diffie_hellman_group_t group, ...)
{
switch (group)
{
case MODP_CUSTOM:
{
chunk_t g, p;
VA_ARGS_GET(group, g, p);
return create_modp(group, p.len, g, p);
}
case ECP_192_BIT:
+2 -4
View File
@@ -40,12 +40,10 @@ struct pkcs11_dh_t {
* Creates a new pkcs11_dh_t object.
*
* @param group Diffie Hellman group number to use
* @param g generator in case group is MODP_CUSTOM
* @param p prime in case group is MODP_CUSTOM
* @param ... expects generator and prime as chunk_t if MODP_CUSTOM
* @return pkcs11_dh_t object, NULL if not supported
*/
pkcs11_dh_t *pkcs11_dh_create(diffie_hellman_group_t group,
chunk_t g, chunk_t p);
pkcs11_dh_t *pkcs11_dh_create(diffie_hellman_group_t group, ...);
#endif /** PKCS11_DH_H_ @}*/