diffie-hellman: Add a bool return value to get_my_public_value()
This commit is contained in:
@@ -55,10 +55,11 @@ struct private_tkm_diffie_hellman_t {
|
||||
|
||||
};
|
||||
|
||||
METHOD(diffie_hellman_t, get_my_public_value, void,
|
||||
METHOD(diffie_hellman_t, get_my_public_value, bool,
|
||||
private_tkm_diffie_hellman_t *this, chunk_t *value)
|
||||
{
|
||||
sequence_to_chunk(this->pubvalue.data, this->pubvalue.size, value);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
METHOD(diffie_hellman_t, get_shared_secret, bool,
|
||||
|
||||
@@ -40,7 +40,7 @@ START_TEST(test_dh_get_my_pubvalue)
|
||||
fail_if(!dh, "Unable to create DH");
|
||||
|
||||
chunk_t value;
|
||||
dh->dh.get_my_public_value(&dh->dh, &value);
|
||||
ck_assert(dh->dh.get_my_public_value(&dh->dh, &value));
|
||||
dh->dh.destroy(&dh->dh);
|
||||
|
||||
fail_if(value.ptr == NULL, "Pubvalue is NULL");
|
||||
|
||||
@@ -53,7 +53,7 @@ START_TEST(test_derive_ike_keys)
|
||||
|
||||
/* Use the same pubvalue for both sides */
|
||||
chunk_t pubvalue;
|
||||
dh->dh.get_my_public_value(&dh->dh, &pubvalue);
|
||||
ck_assert(dh->dh.get_my_public_value(&dh->dh, &pubvalue));
|
||||
dh->dh.set_other_public_value(&dh->dh, pubvalue);
|
||||
|
||||
fail_unless(keymat->keymat_v2.derive_ike_keys(&keymat->keymat_v2, proposal,
|
||||
|
||||
Reference in New Issue
Block a user