Prev Previous Post   Next Post Next

Problem with CryptRegisterOIDInfo in Microsoft "Longhorn" Server Beta2

Posted: 06-09-2006, 01:42 PM
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


Reply With Quote

Responses to "Problem with CryptRegisterOIDInfo in Microsoft "Longhorn" Server Beta2"

 
LinkBack Thread Tools Display Modes
 


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


Similar Threads
Thread Thread Starter Forum Replies Last Post
ANS: "What's the deal with UAC (Windows Needs Your Permission screens)" and "...But I thought I was an administrator" Jimmy Brush Windows Vista File Management 193 07-20-2008 11:29 AM
ANS: "What's the deal with UAC (Windows Needs Your Permission screens)" and "...But I thought I was an administrator" Jimmy Brush Windows Vista Administration 194 07-20-2008 11:29 AM
1st boot hang: "Windows 2006 Microsoft" with moving progress bar stmckin Windows Vista Install & Setup 6 06-20-2006 03:01 PM
Longhorn Beta2: Error on adding Role "Windows Sharepoint Services" André M. Bautz Windows Vista Install & Setup 2 06-02-2006 02:34 PM
Microsoft "Origami" news Windows Vista 0 03-05-2006 11:40 AM