tls-crypto: Fix usage of chunk_from_chars()

See 8ea13bbc5c for details.

References #3249.
This commit is contained in:
Tobias Brunner
2020-01-30 18:18:06 +01:00
parent da9e4fa04b
commit d5cf2d1f85
+3 -2
View File
@@ -1409,6 +1409,8 @@ METHOD(tls_crypto_t, sign, bool,
{
if (this->tls->get_version(this->tls) >= TLS_1_2)
{
const chunk_t hashsig_def = chunk_from_chars(
TLS_HASH_SHA1, TLS_SIG_RSA, TLS_HASH_SHA1, TLS_SIG_ECDSA);
signature_scheme_t scheme;
bio_reader_t *reader;
uint8_t hash, alg;
@@ -1417,8 +1419,7 @@ METHOD(tls_crypto_t, sign, bool,
if (!hashsig.len)
{ /* fallback if none given */
hashsig = chunk_from_chars(
TLS_HASH_SHA1, TLS_SIG_RSA, TLS_HASH_SHA1, TLS_SIG_ECDSA);
hashsig = hashsig_def;
}
reader = bio_reader_create(hashsig);
while (reader->remaining(reader) >= 2)