SslComputeFinishedHash function

The SslComputeFinishedHash function computes the hash sent in the finished message of the Secure Sockets Layer protocol (SSL) handshake.

Syntax

SECURITY_STATUS WINAPI SslComputeFinishedHash(
  _In_  NCRYPT_PROV_HANDLE hSslProvider,
  _In_  NCRYPT_KEY_HANDLE  hMasterKey,
  _In_  NCRYPT_HASH_HANDLE hHandshakeHash,
  _Out_ PBYTE              pbOutput,
  _In_  DWORD              cbOutput,
  _In_  DWORD              dwFlags
);

Parameters

hSslProvider [in]

The handle of the SSL protocol provider instance.

hMasterKey [in]

The handle of the master key object.

hHandshakeHash [in]

The handle of the hash of the handshake messages.

pbOutput [out]

A pointer to a buffer that receives the hash for the finish message.

cbOutput [in]

The length, in bytes, of the pbOutput buffer.

dwFlags [in]

One of the following constants.

Value Meaning
NCRYPT_SSL_CLIENT_FLAG
0x00000001
Specifies that this is a client call.
NCRYPT_SSL_SERVER_FLAG
0x00000002
Specifies that this is a server call.

Return value

If the function succeeds, it returns zero.

If the function fails, it returns a nonzero error value.

Return code/value Description
NTE_INVALID_HANDLE
2148073510 (0x80090026)
One of the supplied handles is not valid.

Remarks

The SslComputeFinishedHash function is one of three functions used to generate a hash to use during the SSL handshake.

  1. The SslCreateHandshakeHash function is called to obtain a hash handle.
  2. The SslHashHandshake function is called any number of times with the hash handle to add data to the hash.
  3. The SslComputeFinishedHash function is called with the hash handle to obtain the digest of the hashed data.

The hash value is computed by hashing the master secret with a hash of all previous handshake messages sent or received.

The value of cbOutput determines the length of the hash data. When the Transport Layer Security protocol (TLS) 1.0 protocol is used, this should always be 12 (bytes). For more information, see The TLS Protocol Version 1.0.

Requirements

Requirement Value
Minimum supported client
Windows Vista [desktop apps only]
Minimum supported server
Windows Server 2008 [desktop apps only]
Header
Sslprovider.h
DLL
Ncrypt.dll