Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Vista Newsgroups > Vista security

Vista - Problem with CryptRegisterOIDInfo in Microsoft "Longhorn" Server Beta2

Reply
 
Old 06-09-2006   #1 (permalink)
Roman Sedov


 
 

Problem with CryptRegisterOIDInfo in Microsoft "Longhorn" Server Beta2

When I call CryptRegisterOIDInfo with pInfo parameter pointing on
"old-style" CRYPT_OID_INFO structure (cbSize = 28) without pwszCNGAlgid and
pwszCNGExtraAlgid members, I get error about invalid parameter.
If use CRYPT_OID_INFO with new members (csSize = 36) it's OK.

Usually, there are back-compatibility in CryptoAPI for such changes...

The repro-example is:

typedef struct _CRYPT_OID_INFO_LH
{
DWORD cbSize;
LPCSTR pszOID;
LPCWSTR pwszName;
DWORD dwGroupId;
union {
DWORD dwValue;
ALG_ID Algid;
DWORD dwLength;
};
CRYPT_DATA_BLOB ExtraInfo;
LPCWSTR pwszCNGAlgid;
LPCWSTR pwszCNGExtraAlgid;
} CRYPT_OID_INFO_LH, *PCRYPT_OID_INFO_LH;

CRYPT_OID_INFO OIDInfo =
{
sizeof(CRYPT_OID_INFO),
"1.2.3",
L"Test",
CRYPT_ENHKEY_USAGE_OID_GROUP_ID
};
CRYPT_OID_INFO_LH OIDInfoLH =
{
sizeof(CRYPT_OID_INFO_LH),
"1.2.3",
L"Test",
CRYPT_ENHKEY_USAGE_OID_GROUP_ID
};
OIDInfoLH.pwszCNGAlgid = L"";
OIDInfoLH.pwszCNGExtraAlgid = L"";

DWORD dwError;
BOOL res;
res = CryptRegisterOIDInfo(&OIDInfo, 0); // res: FALSE
dwError = GetLastError(); //dwError :0x80070057
res = CryptRegisterOIDInfo((PCCRYPT_OID_INFO)&OIDInfoLH, 0); //res: TRUE



My System SpecsSystem Spec
Reply

Thread Tools


Similar Threads
Thread Forum
Re: "Virtual Server 2005 R2 SP1" on "Windows Web Server 2008" host? Virtual Server
New Problem - "From" Address format in "Microsoft Communities" Live Mail
Windows Server "Longhorn" (Vista Server ??) Vista General
New updates for WinVista & "Longhorn" Server -> Beta 2 Vista General
Longhorn Beta2: Error on adding Role "Windows Sharepoint Services" Vista installation & setup


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46