Home | Info | Community | Development | myReactOS | Contact Us

  1. Home
  2. Community
  3. Development
  4. myReactOS

  1. Main Page
  2. Alphabetical List
  3. Data Structures
  4. Directories
  5. File List
  6. Data Fields
  7. Globals
  8. Related Pages

ReactOS Development > Doxygen

static char* CRYPT_GetKeyName ( DWORD  dwEncodingType,
LPCSTR  pszFuncName,
LPCSTR  pszOID 
) [static]

Definition at line 144 of file oid.c.

Referenced by CRYPT_GetDefaultOIDKey(), CRYPT_GetFuncFromReg(), CryptGetDefaultOIDDllList(), CryptGetOIDFunctionValue(), CryptRegisterOIDFunction(), CryptSetOIDFunctionValue(), and CryptUnregisterOIDFunction().

00146 {
00147     static const char szEncodingTypeFmt[] =
00148      "Software\\Microsoft\\Cryptography\\OID\\EncodingType %d\\%s\\%s";
00149     UINT len;
00150     char numericOID[7]; /* enough for "#65535" */
00151     const char *oid;
00152     LPSTR szKey;
00153 
00154     /* MSDN says the encoding type is a mask, but it isn't treated that way.
00155      * (E.g., if dwEncodingType were 3, the key names "EncodingType 1" and
00156      * "EncodingType 2" would be expected if it were a mask.  Instead native
00157      * stores values in "EncodingType 3".
00158      */
00159     if (IS_INTOID(pszOID))
00160     {
00161         snprintf(numericOID, sizeof(numericOID), "#%d", LOWORD(pszOID));
00162         oid = numericOID;
00163     }
00164     else
00165         oid = pszOID;
00166 
00167     /* This is enough: the lengths of the two string parameters are explicitly
00168      * counted, and we need up to five additional characters for the encoding
00169      * type.  These are covered by the "%d", "%s", and "%s" characters in the
00170      * format specifier that are removed by sprintf.
00171      */
00172     len = sizeof(szEncodingTypeFmt) + lstrlenA(pszFuncName) + lstrlenA(oid);
00173     szKey = CryptMemAlloc(len);
00174     if (szKey)
00175         sprintf(szKey, szEncodingTypeFmt,
00176          GET_CERT_ENCODING_TYPE(dwEncodingType), pszFuncName, oid);
00177     return szKey;
00178 }


Generated on Fri Feb 10 05:27:54 2012 for ReactOS by doxygen 1.6.3

ReactOS is a registered trademark or a trademark of ReactOS Foundation in the United States and other countries.