Implemented EdDSA for IKEv2 using a pro forma Identity hash function
This commit is contained in:
committed by
Tobias Brunner
parent
d47ad3d67e
commit
f2eb367adc
@@ -23,6 +23,7 @@ libstrongswan_curve25519_la_SOURCES = \
|
||||
curve25519_dh.h curve25519_dh.c \
|
||||
curve25519_drv.h curve25519_drv.c \
|
||||
curve25519_drv_portable.h curve25519_drv_portable.c \
|
||||
curve25519_identity_hasher.h curve25519_identity_hasher.c \
|
||||
curve25519_plugin.h curve25519_plugin.c
|
||||
|
||||
libstrongswan_curve25519_la_LDFLAGS = -module -avoid-version
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
/*
|
||||
* Copyright (C) 2016 Andreas Steffen
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#include "curve25519_identity_hasher.h"
|
||||
|
||||
/*
|
||||
* Described in header.
|
||||
*/
|
||||
curve25519_identity_hasher_t *curve25519_identity_hasher_create(hash_algorithm_t algo)
|
||||
{
|
||||
/* since the identity hasher is never actually used, always return NULL */
|
||||
return NULL;
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
/*
|
||||
* Copyright (C) 2016 Andreas Steffen
|
||||
* 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 curve25519_identity_hasher curve25519_identity_hasher
|
||||
* @{ @ingroup curve25519_p
|
||||
*/
|
||||
|
||||
#ifndef CURVE25519_IDENTITY_HASHER_H_
|
||||
#define CURVE25519_IDENTITY_HASHER_H_
|
||||
|
||||
typedef struct curve25519_identity_hasher_t curve25519_identity_hasher_t;
|
||||
|
||||
#include <crypto/hashers/hasher.h>
|
||||
|
||||
/**
|
||||
* Implementation of hasher_t interface using the Identity algorithm.
|
||||
*/
|
||||
struct curve25519_identity_hasher_t {
|
||||
|
||||
/**
|
||||
* Implements hasher_t interface.
|
||||
*/
|
||||
hasher_t hasher_interface;
|
||||
};
|
||||
|
||||
/**
|
||||
* Creates a new curve25519_identity_hasher_t.
|
||||
*
|
||||
* @param algo algorithm, must be HASH_IDENTITY
|
||||
* @return curve25519_identity_hasher_t object
|
||||
*/
|
||||
curve25519_identity_hasher_t *curve25519_identity_hasher_create(hash_algorithm_t algo);
|
||||
|
||||
#endif /** CURVE25519_IDENTITY_HASHER_H_ @}*/
|
||||
@@ -20,6 +20,7 @@
|
||||
#include "curve25519_dh.h"
|
||||
#include "curve25519_private_key.h"
|
||||
#include "curve25519_public_key.h"
|
||||
#include "curve25519_identity_hasher.h"
|
||||
|
||||
#include <library.h>
|
||||
|
||||
@@ -65,6 +66,9 @@ METHOD(plugin_t, get_features, int,
|
||||
/* Ed25519 signature verification scheme, public */
|
||||
PLUGIN_PROVIDE(PUBKEY_VERIFY, SIGN_ED25519),
|
||||
PLUGIN_DEPENDS(HASHER, HASH_SHA512),
|
||||
/* register a pro forma identity hasher */
|
||||
PLUGIN_REGISTER(HASHER, curve25519_identity_hasher_create),
|
||||
PLUGIN_PROVIDE(HASHER, HASH_IDENTITY),
|
||||
};
|
||||
*features = f;
|
||||
return countof(f);
|
||||
|
||||
Reference in New Issue
Block a user