diffie-hellman: Add a bool return value to get_my_public_value()

This commit is contained in:
Martin Willi
2015-03-23 17:54:03 +01:00
parent 8a7dbf3c2a
commit 42431690e0
23 changed files with 87 additions and 39 deletions
+3 -2
View File
@@ -109,7 +109,7 @@ struct private_ntru_ke_t {
ntru_drbg_t *drbg;
};
METHOD(diffie_hellman_t, get_my_public_value, void,
METHOD(diffie_hellman_t, get_my_public_value, bool,
private_ntru_ke_t *this, chunk_t *value)
{
*value = chunk_empty;
@@ -130,13 +130,14 @@ METHOD(diffie_hellman_t, get_my_public_value, void,
if (!this->privkey)
{
DBG1(DBG_LIB, "NTRU keypair generation failed");
return;
return FALSE;
}
this->pubkey = this->privkey->get_public_key(this->privkey);
}
*value = chunk_clone(this->pubkey->get_encoding(this->pubkey));
DBG3(DBG_LIB, "NTRU public key: %B", value);
}
return TRUE;
}
METHOD(diffie_hellman_t, get_shared_secret, bool,