]> git.ipfire.org Git - thirdparty/strongswan.git/blame - src/libcharon/plugins/load_tester/load_tester_diffie_hellman.c
diffie-hellman: Add a bool return value to set_other_public_value()
[thirdparty/strongswan.git] / src / libcharon / plugins / load_tester / load_tester_diffie_hellman.c
CommitLineData
a20abb81
MW
1/*
2 * Copyright (C) 2008 Martin Willi
3 * Hochschule fuer Technik Rapperswil
4 *
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License as published by the
7 * Free Software Foundation; either version 2 of the License, or (at your
8 * option) any later version. See <http://www.fsf.org/copyleft/gpl.txt>.
9 *
10 * This program is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
12 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
13 * for more details.
a20abb81
MW
14 */
15
16#include "load_tester_diffie_hellman.h"
17
42431690 18METHOD(diffie_hellman_t, get_my_public_value, bool,
4909612c 19 load_tester_diffie_hellman_t *this, chunk_t *value)
a20abb81
MW
20{
21 *value = chunk_empty;
42431690 22 return TRUE;
a20abb81
MW
23}
24
a777155f 25METHOD(diffie_hellman_t, set_other_public_value, bool,
4909612c
MW
26 load_tester_diffie_hellman_t *this, chunk_t value)
27{
a777155f 28 return TRUE;
4909612c
MW
29}
30
bace1d64 31METHOD(diffie_hellman_t, get_shared_secret, bool,
4909612c 32 load_tester_diffie_hellman_t *this, chunk_t *secret)
a20abb81
MW
33{
34 *secret = chunk_empty;
bace1d64 35 return TRUE;
a20abb81
MW
36}
37
4909612c
MW
38METHOD(diffie_hellman_t, get_dh_group, diffie_hellman_group_t,
39 load_tester_diffie_hellman_t *this)
a20abb81
MW
40{
41 return MODP_NULL;
42}
43
4909612c
MW
44METHOD(diffie_hellman_t, destroy, void,
45 load_tester_diffie_hellman_t *this)
46{
47 free(this);
48}
49
a20abb81
MW
50/**
51 * See header
52 */
53load_tester_diffie_hellman_t *load_tester_diffie_hellman_create(
54 diffie_hellman_group_t group)
55{
56 load_tester_diffie_hellman_t *this;
7daf5226 57
a20abb81
MW
58 if (group != MODP_NULL)
59 {
60 return NULL;
61 }
7daf5226 62
4909612c
MW
63 INIT(this,
64 .dh = {
65 .get_shared_secret = _get_shared_secret,
66 .set_other_public_value = _set_other_public_value,
67 .get_my_public_value = _get_my_public_value,
68 .get_dh_group = _get_dh_group,
69 .destroy = _destroy,
70 }
71 );
7daf5226 72
a20abb81
MW
73 return this;
74}