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:
@@ -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);
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user