Maris B.
Maris B.

Reputation: 2480

SSPI Schannel API returns undocumented value of 0xAE06 or CALG_ECDH_EPHEM

I am using the following code to query current TLS connection:

SecPkgContext_ConnectionInfo data;
QueryContextAttributes(&myHandle, SECPKG_ATTR_CONNECTION_INFO, &data);

It returns correct structure with all the fields:

typedef struct _SecPkgContext_ConnectionInfo {
  DWORD  dwProtocol;
  ALG_ID aiCipher;
  DWORD  dwCipherStrength;
  ALG_ID aiHash;
  DWORD  dwHashStrength;
  ALG_ID aiExch;
  DWORD  dwExchStrength;
} SecPkgContext_ConnectionInfo, *PSecPkgContext_ConnectionInfo;

as per MSDN documentation: https://learn.microsoft.com/en-us/windows/win32/api/schannel/ns-schannel-secpkgcontext_connectioninfo

However, the field aiExch has value of 0xAE06 which I guess (from wincrypt.h file) is defined as CALG_ECDH_EPHEM, but documentation only mention two possible values:

CALG_RSA_KEYX 0xA400   // RSA key exchange
CALG_DH_EPHEM 0xAA02   // Diffie-Hellman key exchange.

Now the questions:

  1. What is the meaning of 0xAE06 / CALG_ECDH_EPHEM?
  2. What other values the field aiExch can have?

Upvotes: 1

Views: 317

Answers (1)

SoronelHaetir
SoronelHaetir

Reputation: 15164

From ALG_ID:

CALG_ECDH_EPHEM |  0x0000ae06 |  Ephemeral elliptic curve Diffie-Hellman key exchange algorithm.

[!Note]
This algorithm is supported only through Cryptography API: Next Generation

Windows Server 2003 and Windows XP: This algorithm is not supported.

I can't tell you what else might show up.

Upvotes: 2

Related Questions