Skip to content

SslStream.HashAlgorithm does not seems to work with Tls12 and above #37578

Closed as not planned
@wfurt

Description

@wfurt

Description

I used examples from https://docs.microsoft.com/en-us/dotnet/api/system.net.security.sslstream.hashalgorithm?view=net-5.0

static void DisplaySecurityLevel(SslStream stream)
{
   Console.WriteLine("Cipher: {0} strength {1}", stream.CipherAlgorithm, stream.CipherStrength);
   Console.WriteLine("Hash: {0} strength {1}", stream.HashAlgorithm, stream.HashStrength);
   Console.WriteLine("Key exchange: {0} strength {1}", stream.KeyExchangeAlgorithm, stream.KeyExchangeStrength);
   Console.WriteLine("Protocol: {0}", stream.SslProtocol);
}

When I force Tls11 I see TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA negotiated and output of:

Cipher: Aes128 strength 128
Hash: Sha1 strength 160
Key exchange: DiffieHellman strength 0
Protocol: Tls11

when I use default, Tls12 or Tls13 I get TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256 and :

Cipher: Aes128 strength 128
Hash: None strength 0
Key exchange: DiffieHellman strength 0
Protocol: Tls12

Configuration

Tested with current 5.0 version on Linux with OpenSsl 1.1.1 and macOS 10.15 Catalina.

Other information

We seems to have no unit test to cover HashAlgorithm.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions