blob_id_type pubvalue_id;
bool ret = FALSE;
- if (!key_exchange_verify_pubkey(this->method, value))
+ if (!key_exchange_check_pubkey_len(this->method, value))
{
return FALSE;
}
/*
* Described in header
*/
-bool key_exchange_verify_pubkey(key_exchange_method_t ke, chunk_t value)
+bool key_exchange_check_pubkey_len(key_exchange_method_t ke, chunk_t value)
{
diffie_hellman_params_t *params;
bool valid = FALSE;
bool key_exchange_is_kem(key_exchange_method_t ke);
/**
- * Check if a public key is valid for given key exchange method.
+ * Check if a public key's length is valid for the given key exchange method.
*
* @param ke key exchange method
* @param value public key to check
- * @return TRUE if value looks valid
+ * @return TRUE if value's length is valid
*/
-bool key_exchange_verify_pubkey(key_exchange_method_t ke, chunk_t value);
+bool key_exchange_check_pubkey_len(key_exchange_method_t ke, chunk_t value);
/**
* Return the first shared secret plus the concatenated additional shared
METHOD(key_exchange_t, set_public_key, bool,
private_botan_diffie_hellman_t *this, chunk_t value)
{
- if (!key_exchange_verify_pubkey(this->group, value))
+ if (!key_exchange_check_pubkey_len(this->group, value))
{
return FALSE;
}
METHOD(key_exchange_t, set_public_key, bool,
private_botan_ec_diffie_hellman_t *this, chunk_t value)
{
- if (!key_exchange_verify_pubkey(this->group, value))
+ if (!key_exchange_check_pubkey_len(this->group, value))
{
return FALSE;
}
METHOD(key_exchange_t, set_public_key, bool,
private_diffie_hellman_t *this, chunk_t value)
{
- if (!key_exchange_verify_pubkey(CURVE_25519, value))
+ if (!key_exchange_check_pubkey_len(CURVE_25519, value))
{
return FALSE;
}
gcry_mpi_t p_min_1;
gcry_error_t err;
- if (!key_exchange_verify_pubkey(this->group, value))
+ if (!key_exchange_check_pubkey_len(this->group, value))
{
return FALSE;
}
{
mpz_t p_min_1;
- if (!key_exchange_verify_pubkey(this->group, value))
+ if (!key_exchange_check_pubkey_len(this->group, value))
{
return FALSE;
}
METHOD(key_exchange_t, set_public_key, bool,
private_openssl_diffie_hellman_t *this, chunk_t value)
{
- if (!key_exchange_verify_pubkey(this->group, value))
+ if (!key_exchange_check_pubkey_len(this->group, value))
{
return FALSE;
}
METHOD(key_exchange_t, set_public_key, bool,
private_openssl_ec_diffie_hellman_t *this, chunk_t value)
{
- if (!key_exchange_verify_pubkey(this->group, value))
+ if (!key_exchange_check_pubkey_len(this->group, value))
{
return FALSE;
}
METHOD(key_exchange_t, set_public_key, bool,
private_key_exchange_t *this, chunk_t value)
{
- if (!key_exchange_verify_pubkey(this->ke, value))
+ if (!key_exchange_check_pubkey_len(this->ke, value))
{
return FALSE;
}
METHOD(key_exchange_t, set_public_key, bool,
private_pkcs11_dh_t *this, chunk_t value)
{
- if (!key_exchange_verify_pubkey(this->group, value))
+ if (!key_exchange_check_pubkey_len(this->group, value))
{
return FALSE;
}
METHOD(key_exchange_t, set_public_key, bool,
private_wolfssl_diffie_hellman_t *this, chunk_t value)
{
- if (!key_exchange_verify_pubkey(this->group, value))
+ if (!key_exchange_check_pubkey_len(this->group, value))
{
return FALSE;
}
{
chunk_t uncomp;
- if (!key_exchange_verify_pubkey(this->group, value))
+ if (!key_exchange_check_pubkey_len(this->group, value))
{
return FALSE;
}
METHOD(key_exchange_t, set_public_key_25519, bool,
private_diffie_hellman_t *this, chunk_t value)
{
- if (!key_exchange_verify_pubkey(this->group, value))
+ if (!key_exchange_check_pubkey_len(this->group, value))
{
return FALSE;
}
METHOD(key_exchange_t, set_public_key_448, bool,
private_diffie_hellman_t *this, chunk_t value)
{
- if (!key_exchange_verify_pubkey(this->group, value))
+ if (!key_exchange_check_pubkey_len(this->group, value))
{
return FALSE;
}