/*
- * Copyright (C) 2008-2017 Tobias Brunner
+ * Copyright (C) 2008-2018 Tobias Brunner
* Copyright (C) 2005-2008 Martin Willi
* Copyright (C) 2005 Jan Hutter
* HSR Hochschule fuer Technik Rapperswil
chunk_empty);
return SUCCESS;
}
- if (!this->retry)
- {
+ if (!this->retry && this->dh_group == MODP_NONE)
+ { /* during a rekeying the group might already be set */
this->dh_group = this->config->get_dh_group(this->config);
}
break;
this->mark_out = out;
}
+METHOD(child_create_t, use_dh_group, void,
+ private_child_create_t *this, diffie_hellman_group_t dh_group)
+{
+ this->dh_group = dh_group;
+}
+
METHOD(child_create_t, get_child, child_sa_t*,
private_child_create_t *this)
{
.get_lower_nonce = _get_lower_nonce,
.use_reqid = _use_reqid,
.use_marks = _use_marks,
+ .use_dh_group = _use_dh_group,
.task = {
.get_type = _get_type,
.migrate = _migrate,
/*
+ * Copyright (C) 2018 Tobias Brunner
* Copyright (C) 2007 Martin Willi
- * Hochschule fuer Technik Rapperswil
+ * 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
*/
void (*use_marks)(child_create_t *this, u_int in, u_int out);
+ /**
+ * Initially propose a specific DH group to override configuration.
+ *
+ * This is used during rekeying to prefer the previously negotiated group.
+ *
+ * @param dh_group DH group to use
+ */
+ void (*use_dh_group)(child_create_t *this, diffie_hellman_group_t dh_group);
+
/**
* Get the lower of the two nonces, used for rekey collisions.
*