http://bugs.winehq.org/show_bug.cgi?id=20340
--- Comment #3 from Juan Lang juan_lang@yahoo.com 2009-10-20 17:39:03 --- It still fails for me with today's Wine. From a +crypt log: trace:crypt:CryptImportKey (0x1528d0, 0xca7bb8, 32, 0x0, 00000100, 0xca7b88) trace:crypt:RSAENH_CPImportKey (hProv=00000001, pbData=0xca7bb8, dwDataLen=32, hPubKey=00000000, dwFlags=00000100, phKey=0x152ac4) trace:crypt:import_key blob type: 8 trace:crypt:new_key alg = "RC2", dwKeyLen = 160 trace:crypt:new_key key len 160 out of bounds (40, 128)
This is from these lines in hmac_win.cc: if (!CryptImportKey(plat_->provider_, &key_blob_storage[0], key_blob_storage.size(), 0, CRYPT_IPSEC_HMAC_KEY, &plat_->hkey_)) { NOTREACHED();
Wine's enhanced provider is restricted to 128 bits, and it ignores the CRYPT_IPSEC_HMAC_KEY flag. MSDN states that passing CRYPT_IPSEC_HMAC_KEY: "Allows for the import of an RC2 key that is larger than 16 bytes. If this flag is not set, calls to the CryptImportKey function with RC2 keys that are greater than 16 bytes fail, and a call to GetLastError will return NTE_BAD_DATA."
More tests needed, of course.