diffie-hellman: Use bool instead of status_t as get_shared_secret() return value

While such a change is not unproblematic, keeping status_t makes the API
inconsistent once we introduce return values for the public value operations.
This commit is contained in:
Martin Willi
2015-03-23 17:54:02 +01:00
parent 4909612c3b
commit bace1d6479
18 changed files with 41 additions and 43 deletions
+1 -1
View File
@@ -97,7 +97,7 @@ METHOD(listener_t, child_keys, bool,
}
m->add_attribute(m, HA_NONCE_I, nonce_i);
m->add_attribute(m, HA_NONCE_R, nonce_r);
if (dh && dh->get_shared_secret(dh, &secret) == SUCCESS)
if (dh && dh->get_shared_secret(dh, &secret))
{
m->add_attribute(m, HA_SECRET, secret);
chunk_clear(&secret);
+2 -2
View File
@@ -81,11 +81,11 @@ struct ha_diffie_hellman_t {
chunk_t pub;
};
METHOD(diffie_hellman_t, dh_get_shared_secret, status_t,
METHOD(diffie_hellman_t, dh_get_shared_secret, bool,
ha_diffie_hellman_t *this, chunk_t *secret)
{
*secret = chunk_clone(this->secret);
return SUCCESS;
return TRUE;
}
METHOD(diffie_hellman_t, dh_get_my_public_value, void,
+1 -1
View File
@@ -84,7 +84,7 @@ METHOD(listener_t, ike_keys, bool,
{ /* do not sync SA between nodes */
return TRUE;
}
if (dh->get_shared_secret(dh, &secret) != SUCCESS)
if (!dh->get_shared_secret(dh, &secret))
{
return TRUE;
}