Cannot Create Master Hash on Win 8.1

1

Using the Microsoft recommended procedures to create a Master Hash:
http://msdn.microsoft.com/en-us/library/windows/desktop/aa381960%28v=vs.85%29.aspx
I have successfully developed a TLS program that works like a charm on Win Vista and Win 7. Unfortunately, it fails on Win 8.1 with the call:

CryptCreateHash(hProv, CALG_SCHANNEL_MASTER_HASH, hMasterKey, 0, &hMasterHash);  

returning an error 0x80090020.

Acquiring the context PROV_RSA_SCHANNEL provides the following info:

Provider Type   Provider TypeName
------------------------------
1               RSA Full (Signature and Key Exchange)  
3               DSS Signature  
12              RSA SChannel  
13              DSS Signature with Diffie-Hellman Key Exchange  
18              Diffie-Hellman SChannel  
24              RSA Full and AES  

Provider Type   Provider Name  
------------------------------  
1               Microsoft Base Cryptographic Provider v1.0  
13              Microsoft Base DSS and Diffie-Hellman Cryptographic Provider  
3               Microsoft Base DSS Cryptographic Provider  
1               Microsoft Base Smart Card Crypto Provider  
18              Microsoft DH SChannel Cryptographic Provider  
1               Microsoft Enhanced Cryptographic Provider v1.0  
13              Microsoft Enhanced DSS and Diffie-Hellman Cryptographic Provider  
24              Microsoft Enhanced RSA and AES Cryptographic Provider  
12              Microsoft RSA SChannel Cryptographic Provider  
1               Microsoft Strong Cryptographic Provider  

Default Provider Name : Microsoft Strong Cryptographic Provider
ALGID   dwBits  algType         namelen Name
------------------------------
26126      128  Data_Encrypt    8       AES 128  
26128      256  Data_Encrypt    8       AES 256  
26114      128  Data_Encrypt    4       RC2  
26625      128  Data_Encrypt    4       RC4  
26113       56  Data_Encrypt    4       DES  
26121      112  Data_Encrypt    13      3DES TWO KEY  
26115      168  Data_Encrypt    5       3DES  
32772      160  Hash            6       SHA-1  
32771      128  Hash            4       MD5  
32776      288  Hash            12      SSL3 SHAMD5  
32773        0  Hash            4       MAC  
41984     1024  Exchange        9       RSA_KEYX  
32777        0  Hash            5       HMAC  
19461       40  Msg_Encrypt     12      SSL2 MASTER  
19457      384  Msg_Encrypt     12      SSL3 MASTER  
19462      384  Msg_Encrypt     12      TLS1 MASTER  
19458        0  Msg_Encrypt     16      SCH MASTER HASH  
19459        0  Msg_Encrypt     12      SCH MAC KEY  
19463        0  Msg_Encrypt     12      SCH ENC KEY  

I am using SCHANNEL_ENC_KEY = CALG_RC4/128 and SCHANNEL_MAC_KEY = CALG_SHA1/160, but CALG_AES_256/256 or CALG_3DES/168 produces the same error. Using SCHANNEL_MAC_KEY = CALG_SHA_256 fails at the preceeding CryptSetKeyParam with an error 80090005.

I posted this question to MSDN more than 2 months ago, and have yet to get a response.

cryptography
asked on Stack Overflow Jan 17, 2015 by couttsj • edited Jan 18, 2015 by trooper

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0