wintrust: Fix encoding OIDs with only two components.

This commit is contained in:
Juan Lang 2008-12-23 08:48:09 -08:00 committed by Alexandre Julliard
parent 84d9b2c07b
commit ae133b808f

View file

@ -532,7 +532,7 @@ static BOOL WINAPI CRYPT_AsnEncodeOid(DWORD dwCertEncodingType,
const char *ptr;
int val1, val2;
if (sscanf(pszObjId, "%d.%d.%n", &val1, &val2, &firstPos) != 2)
if (sscanf(pszObjId, "%d.%d%n", &val1, &val2, &firstPos) != 2)
{
SetLastError(CRYPT_E_ASN1_ERROR);
return FALSE;
@ -540,6 +540,11 @@ static BOOL WINAPI CRYPT_AsnEncodeOid(DWORD dwCertEncodingType,
bytesNeeded++;
firstByte = val1 * 40 + val2;
ptr = pszObjId + firstPos;
if (*ptr == '.')
{
ptr++;
firstPos++;
}
while (ret && *ptr)
{
int pos;