return verify(this, key, reader, this->handshake);
}
-METHOD(tls_crypto_t, calculate_finished, bool,
+METHOD(tls_crypto_t, calculate_finished_legacy, bool,
private_tls_crypto_t *this, char *label, char out[12])
{
chunk_t seed;
return TRUE;
}
-METHOD(tls_crypto_t, calculate_finished_tls13, bool,
+METHOD(tls_crypto_t, calculate_finished, bool,
private_tls_crypto_t *this, bool is_server, chunk_t *out)
{
chunk_t finished_key, finished_hash;
.verify = _verify,
.sign_handshake = _sign_handshake,
.verify_handshake = _verify_handshake,
+ .calculate_finished_legacy = _calculate_finished_legacy,
.calculate_finished = _calculate_finished,
- .calculate_finished_tls13 = _calculate_finished_tls13,
.derive_secrets = _derive_secrets,
.derive_handshake_keys = _derive_handshake_keys,
.derive_app_keys = _derive_app_keys,
* @param out buffer to write finished data to
* @return TRUE if calculation successful
*/
- bool (*calculate_finished)(tls_crypto_t *this, char *label, char out[12]);
+ bool (*calculate_finished_legacy)(tls_crypto_t *this, char *label,
+ char out[12]);
/**
* Calculate the data of a TLS finished message.
* @param out buffer to write finished data to
* @return TRUE if calculation successful
*/
- bool (*calculate_finished_tls13)(tls_crypto_t *this, bool is_server,
- chunk_t *out);
+ bool (*calculate_finished)(tls_crypto_t *this, bool is_server,
+ chunk_t *out);
/**
* Derive the master secret, MAC and encryption keys.
this->alert->add(this->alert, TLS_FATAL, TLS_DECODE_ERROR);
return NEED_MORE;
}
- if (!this->crypto->calculate_finished(this->crypto, "server finished",
- buf))
+ if (!this->crypto->calculate_finished_legacy(this->crypto,
+ "server finished", buf))
{
DBG1(DBG_TLS, "calculating server finished failed");
this->alert->add(this->alert, TLS_FATAL, TLS_INTERNAL_ERROR);
this->alert->add(this->alert, TLS_FATAL, TLS_DECODE_ERROR);
return NEED_MORE;
}
- if (!this->crypto->calculate_finished_tls13(this->crypto, true,
+ if (!this->crypto->calculate_finished(this->crypto, true,
&verify_data))
{
DBG1(DBG_TLS, "calculating server finished failed");
{
char buf[12];
- if (!this->crypto->calculate_finished(this->crypto, "client finished", buf))
+ if (!this->crypto->calculate_finished_legacy(this->crypto,
+ "client finished", buf))
{
DBG1(DBG_TLS, "calculating client finished data failed");
this->alert->add(this->alert, TLS_FATAL, TLS_INTERNAL_ERROR);
}
else
{
- if (!this->crypto->calculate_finished_tls13(this->crypto, false,
- &verify_data))
+ if (!this->crypto->calculate_finished(this->crypto, FALSE, &verify_data))
{
DBG1(DBG_TLS, "calculating client finished data failed");
this->alert->add(this->alert, TLS_FATAL, TLS_INTERNAL_ERROR);
this->alert->add(this->alert, TLS_FATAL, TLS_DECODE_ERROR);
return NEED_MORE;
}
- if (!this->crypto->calculate_finished(this->crypto, "client finished", buf))
+ if (!this->crypto->calculate_finished_legacy(this->crypto,
+ "client finished", buf))
{
DBG1(DBG_TLS, "calculating client finished failed");
this->alert->add(this->alert, TLS_FATAL, TLS_INTERNAL_ERROR);
{
char buf[12];
- if (!this->crypto->calculate_finished(this->crypto, "server finished", buf))
+ if (!this->crypto->calculate_finished_legacy(this->crypto,
+ "server finished", buf))
{
DBG1(DBG_TLS, "calculating server finished data failed");
this->alert->add(this->alert, TLS_FATAL, TLS_INTERNAL_ERROR);