crypt32: Fix decoding sequences with extra trailing data.
[wine] / dlls / crypt32 / tests / oid.c
1 /*
2  * Unit test suite for crypt32.dll's OID support functions.
3  *
4  * Copyright 2005 Juan Lang
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2.1 of the License, or (at your option) any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this library; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
19  */
20 #include <stdio.h>
21 #include <stdarg.h>
22 #include <windef.h>
23 #include <winbase.h>
24 #include <winerror.h>
25 #include <wincrypt.h>
26 #include <winreg.h>
27
28 #include "wine/test.h"
29
30 struct OIDToAlgID
31 {
32     LPCSTR oid;
33     DWORD algID;
34 };
35
36 static const struct OIDToAlgID oidToAlgID[] = {
37  { szOID_RSA_RSA, CALG_RSA_KEYX },
38  { szOID_RSA_MD2RSA, CALG_MD2 },
39  { szOID_RSA_MD4RSA, CALG_MD4 },
40  { szOID_RSA_MD5RSA, CALG_MD5 },
41  { szOID_RSA_SHA1RSA, CALG_SHA },
42  { szOID_RSA_DH, CALG_DH_SF },
43  { szOID_RSA_SMIMEalgESDH, CALG_DH_EPHEM },
44  { szOID_RSA_SMIMEalgCMS3DESwrap, CALG_3DES },
45  { szOID_RSA_SMIMEalgCMSRC2wrap, CALG_RC2 },
46  { szOID_RSA_MD2, CALG_MD2 },
47  { szOID_RSA_MD4, CALG_MD4 },
48  { szOID_RSA_MD5, CALG_MD5 },
49  { szOID_RSA_RC2CBC, CALG_RC2 },
50  { szOID_RSA_RC4, CALG_RC4 },
51  { szOID_RSA_DES_EDE3_CBC, CALG_3DES },
52  { szOID_ANSI_X942_DH, CALG_DH_SF },
53  { szOID_X957_DSA, CALG_DSS_SIGN },
54  { szOID_X957_SHA1DSA, CALG_SHA },
55  { szOID_OIWSEC_md4RSA, CALG_MD4 },
56  { szOID_OIWSEC_md5RSA, CALG_MD5 },
57  { szOID_OIWSEC_md4RSA2, CALG_MD4 },
58  { szOID_OIWSEC_desCBC, CALG_DES },
59  { szOID_OIWSEC_dsa, CALG_DSS_SIGN },
60  { szOID_OIWSEC_shaDSA, CALG_SHA },
61  { szOID_OIWSEC_shaRSA, CALG_SHA },
62  { szOID_OIWSEC_sha, CALG_SHA },
63  { szOID_OIWSEC_rsaXchg, CALG_RSA_KEYX },
64  { szOID_OIWSEC_sha1, CALG_SHA },
65  { szOID_OIWSEC_dsaSHA1, CALG_SHA },
66  { szOID_OIWSEC_sha1RSASign, CALG_SHA },
67  { szOID_OIWDIR_md2RSA, CALG_MD2 },
68  { szOID_INFOSEC_mosaicUpdatedSig, CALG_SHA },
69  { szOID_INFOSEC_mosaicKMandUpdSig, CALG_DSS_SIGN },
70 };
71
72 static const struct OIDToAlgID algIDToOID[] = {
73  { szOID_RSA_RSA, CALG_RSA_KEYX },
74  { szOID_RSA_SMIMEalgESDH, CALG_DH_EPHEM },
75  { szOID_RSA_MD2, CALG_MD2 },
76  { szOID_RSA_MD4, CALG_MD4 },
77  { szOID_RSA_MD5, CALG_MD5 },
78  { szOID_RSA_RC2CBC, CALG_RC2 },
79  { szOID_RSA_RC4, CALG_RC4 },
80  { szOID_RSA_DES_EDE3_CBC, CALG_3DES },
81  { szOID_ANSI_X942_DH, CALG_DH_SF },
82  { szOID_X957_DSA, CALG_DSS_SIGN },
83  { szOID_OIWSEC_desCBC, CALG_DES },
84  { szOID_OIWSEC_sha1, CALG_SHA },
85 };
86
87 static const WCHAR bogusDll[] = { 'b','o','g','u','s','.','d','l','l',0 };
88 static const WCHAR bogus2Dll[] = { 'b','o','g','u','s','2','.','d','l','l',0 };
89
90 static void testOIDToAlgID(void)
91 {
92     int i;
93     DWORD alg;
94
95     /* Test with a bogus one */
96     SetLastError(0xdeadbeef);
97     alg = CertOIDToAlgId("1.2.3");
98     ok(!alg && (GetLastError() == 0xdeadbeef ||
99      GetLastError() == ERROR_RESOURCE_NAME_NOT_FOUND),
100      "Expected ERROR_RESOURCE_NAME_NOT_FOUND or no error set, got %08x\n",
101      GetLastError());
102
103     for (i = 0; i < sizeof(oidToAlgID) / sizeof(oidToAlgID[0]); i++)
104     {
105         alg = CertOIDToAlgId(oidToAlgID[i].oid);
106         /* Not all Windows installations support all these, so make sure it's
107          * at least not the wrong one.
108          */
109         ok(alg == 0 || alg == oidToAlgID[i].algID,
110          "Expected %d, got %d\n", oidToAlgID[i].algID, alg);
111     }
112 }
113
114 static void testAlgIDToOID(void)
115 {
116     int i;
117     LPCSTR oid;
118
119     /* Test with a bogus one */
120     SetLastError(0xdeadbeef);
121     oid = CertAlgIdToOID(ALG_CLASS_SIGNATURE | ALG_TYPE_ANY | 80);
122     ok(!oid && GetLastError() == 0xdeadbeef,
123      "Didn't expect last error (%08x) to be set\n", GetLastError());
124     for (i = 0; i < sizeof(algIDToOID) / sizeof(algIDToOID[0]); i++)
125     {
126         oid = CertAlgIdToOID(algIDToOID[i].algID);
127         /* Allow failure, not every version of Windows supports every algo */
128         if (oid)
129             ok(!strcmp(oid, algIDToOID[i].oid), 
130              "Expected %s, got %s\n", algIDToOID[i].oid, oid);
131     }
132 }
133
134 static void test_oidFunctionSet(void)
135 {
136     HCRYPTOIDFUNCSET set1, set2;
137     BOOL ret;
138     LPWSTR buf = NULL;
139     DWORD size;
140
141     /* This crashes
142     set = CryptInitOIDFunctionSet(NULL, 0);
143      */
144
145     /* The name doesn't mean much */
146     set1 = CryptInitOIDFunctionSet("funky", 0);
147     ok(set1 != 0, "CryptInitOIDFunctionSet failed: %08x\n", GetLastError());
148     if (set1)
149     {
150         /* These crash
151         ret = CryptGetDefaultOIDDllList(NULL, 0, NULL, NULL);
152         ret = CryptGetDefaultOIDDllList(NULL, 0, NULL, &size);
153          */
154         size = 0;
155         ret = CryptGetDefaultOIDDllList(set1, 0, NULL, &size);
156         ok(ret, "CryptGetDefaultOIDDllList failed: %08x\n", GetLastError());
157         if (ret)
158         {
159             buf = HeapAlloc(GetProcessHeap(), 0, size * sizeof(WCHAR));
160             if (buf)
161             {
162                 ret = CryptGetDefaultOIDDllList(set1, 0, buf, &size);
163                 ok(ret, "CryptGetDefaultOIDDllList failed: %08x\n",
164                  GetLastError());
165                 ok(!*buf, "Expected empty DLL list\n");
166                 HeapFree(GetProcessHeap(), 0, buf);
167             }
168         }
169     }
170
171     /* MSDN says flags must be 0, but it's not checked */
172     set1 = CryptInitOIDFunctionSet("", 1);
173     ok(set1 != 0, "CryptInitOIDFunctionSet failed: %08x\n", GetLastError());
174     set2 = CryptInitOIDFunctionSet("", 0);
175     ok(set2 != 0, "CryptInitOIDFunctionSet failed: %08x\n", GetLastError());
176     /* There isn't a free function, so there must be only one set per name to
177      * limit leaks.  (I guess the sets are freed when crypt32 is unloaded.)
178      */
179     ok(set1 == set2, "Expected identical sets\n");
180     if (set1)
181     {
182         /* The empty name function set used here seems to correspond to
183          * DEFAULT.
184          */
185     }
186
187     /* There's no installed function for a built-in encoding. */
188     set1 = CryptInitOIDFunctionSet("CryptDllEncodeObject", 0);
189     ok(set1 != 0, "CryptInitOIDFunctionSet failed: %08x\n", GetLastError());
190     if (set1)
191     {
192         void *funcAddr;
193         HCRYPTOIDFUNCADDR hFuncAddr;
194
195         ret = CryptGetOIDFunctionAddress(set1, X509_ASN_ENCODING, X509_CERT, 0,
196          &funcAddr, &hFuncAddr);
197         ok(!ret && GetLastError() == ERROR_FILE_NOT_FOUND,
198          "Expected ERROR_FILE_NOT_FOUND, got %08x\n", GetLastError());
199     }
200 }
201
202 typedef int (*funcY)(int);
203
204 static int funky(int x)
205 {
206     return x;
207 }
208
209 static void test_installOIDFunctionAddress(void)
210 {
211     BOOL ret;
212     CRYPT_OID_FUNC_ENTRY entry = { CRYPT_DEFAULT_OID, funky };
213     HCRYPTOIDFUNCSET set;
214
215     /* This crashes
216     ret = CryptInstallOIDFunctionAddress(NULL, 0, NULL, 0, NULL, 0);
217      */
218
219     /* Installing zero functions should work */
220     SetLastError(0xdeadbeef);
221     ret = CryptInstallOIDFunctionAddress(NULL, 0, "CryptDllEncodeObject", 0,
222      NULL, 0);
223     ok(ret && GetLastError() == 0xdeadbeef, "Expected success, got %08x\n",
224      GetLastError());
225
226     /* The function name doesn't much matter */
227     SetLastError(0xdeadbeef);
228     ret = CryptInstallOIDFunctionAddress(NULL, 0, "OhSoFunky", 0, NULL, 0);
229     ok(ret && GetLastError() == 0xdeadbeef, "Expected success, got %08x\n",
230      GetLastError());
231     SetLastError(0xdeadbeef);
232     entry.pszOID = X509_CERT;
233     ret = CryptInstallOIDFunctionAddress(NULL, 0, "OhSoFunky", 1, &entry, 0);
234     ok(ret && GetLastError() == 0xdeadbeef, "Expected success, got %08x\n",
235      GetLastError());
236     set = CryptInitOIDFunctionSet("OhSoFunky", 0);
237     ok(set != 0, "CryptInitOIDFunctionSet failed: %08x\n", GetLastError());
238     if (set)
239     {
240         funcY funcAddr = NULL;
241         HCRYPTOIDFUNCADDR hFuncAddr = NULL;
242
243         /* This crashes
244         ret = CryptGetOIDFunctionAddress(set, X509_ASN_ENCODING, 0, 0, NULL,
245          NULL);
246          */
247         ret = CryptGetOIDFunctionAddress(set, X509_ASN_ENCODING, 0, 0,
248          (void **)&funcAddr, &hFuncAddr);
249         ok(!ret && GetLastError() == ERROR_FILE_NOT_FOUND,
250          "Expected ERROR_FILE_NOT_FOUND, got %d\n", GetLastError());
251         ret = CryptGetOIDFunctionAddress(set, X509_ASN_ENCODING, X509_CERT, 0,
252          (void **)&funcAddr, &hFuncAddr);
253         ok(!ret && GetLastError() == ERROR_FILE_NOT_FOUND,
254          "Expected ERROR_FILE_NOT_FOUND, got %d\n", GetLastError());
255         ret = CryptGetOIDFunctionAddress(set, 0, X509_CERT, 0,
256          (void **)&funcAddr, &hFuncAddr);
257         ok(ret, "CryptGetOIDFunctionAddress failed: %d\n", GetLastError());
258         if (funcAddr)
259         {
260             int y = funcAddr(0xabadc0da);
261
262             ok(y == 0xabadc0da, "Unexpected return (%d) from function\n", y);
263             CryptFreeOIDFunctionAddress(hFuncAddr, 0);
264         }
265     }
266 }
267
268 static void test_registerOIDFunction(void)
269 {
270     BOOL ret;
271
272     /* oddly, this succeeds under WinXP; the function name key is merely
273      * omitted.  This may be a side effect of the registry code, I don't know.
274      * I don't check it because I doubt anyone would depend on it.
275     ret = CryptRegisterOIDFunction(X509_ASN_ENCODING, NULL,
276      "1.2.3.4.5.6.7.8.9.10", bogusDll, NULL);
277      */
278     /* On windows XP, GetLastError is incorrectly being set with an HRESULT,
279      * E_INVALIDARG
280      */
281     ret = CryptRegisterOIDFunction(X509_ASN_ENCODING, "foo", NULL, bogusDll,
282      NULL);
283     ok(!ret && GetLastError() == E_INVALIDARG,
284      "Expected E_INVALIDARG: %d\n", GetLastError());
285     /* This has no effect, but "succeeds" on XP */
286     ret = CryptRegisterOIDFunction(X509_ASN_ENCODING, "foo",
287      "1.2.3.4.5.6.7.8.9.10", NULL, NULL);
288     ok(ret, "Expected pseudo-success, got %d\n", GetLastError());
289     SetLastError(0xdeadbeef);
290     ret = CryptRegisterOIDFunction(X509_ASN_ENCODING, "CryptDllEncodeObject",
291      "1.2.3.4.5.6.7.8.9.10", bogusDll, NULL);
292     if (!ret && GetLastError() == ERROR_ACCESS_DENIED)
293     {
294         skip("Need admin rights\n");
295         return;
296     }
297     ok(ret, "CryptRegisterOIDFunction failed: %d\n", GetLastError());
298     ret = CryptUnregisterOIDFunction(X509_ASN_ENCODING, "CryptDllEncodeObject",
299      "1.2.3.4.5.6.7.8.9.10");
300     ok(ret, "CryptUnregisterOIDFunction failed: %d\n", GetLastError());
301     ret = CryptRegisterOIDFunction(X509_ASN_ENCODING, "bogus",
302      "1.2.3.4.5.6.7.8.9.10", bogusDll, NULL);
303     ok(ret, "CryptRegisterOIDFunction failed: %d\n", GetLastError());
304     ret = CryptUnregisterOIDFunction(X509_ASN_ENCODING, "bogus",
305      "1.2.3.4.5.6.7.8.9.10");
306     ok(ret, "CryptUnregisterOIDFunction failed: %d\n", GetLastError());
307     /* This has no effect */
308     ret = CryptRegisterOIDFunction(PKCS_7_ASN_ENCODING, "CryptDllEncodeObject",
309      "1.2.3.4.5.6.7.8.9.10", bogusDll, NULL);
310     ok(ret, "CryptRegisterOIDFunction failed: %d\n", GetLastError());
311     /* Check with bogus encoding type: */
312     ret = CryptRegisterOIDFunction(0, "CryptDllEncodeObject",
313      "1.2.3.4.5.6.7.8.9.10", bogusDll, NULL);
314     ok(ret, "CryptRegisterOIDFunction failed: %d\n", GetLastError());
315     /* This is written with value 3 verbatim.  Thus, the encoding type isn't
316      * (for now) treated as a mask.
317      */
318     ret = CryptRegisterOIDFunction(3, "CryptDllEncodeObject",
319      "1.2.3.4.5.6.7.8.9.10", bogusDll, NULL);
320     ok(ret, "CryptRegisterOIDFunction failed: %d\n", GetLastError());
321     ret = CryptUnregisterOIDFunction(3, "CryptDllEncodeObject",
322      "1.2.3.4.5.6.7.8.9.10");
323     ok(ret, "CryptUnregisterOIDFunction failed: %d\n", GetLastError());
324 }
325
326 static void test_registerDefaultOIDFunction(void)
327 {
328     static const char fmt[] =
329      "Software\\Microsoft\\Cryptography\\OID\\EncodingType %d\\%s\\DEFAULT";
330     static const char func[] = "CertDllOpenStoreProv";
331     char buf[MAX_PATH];
332     BOOL ret;
333     long rc;
334     HKEY key;
335
336     ret = CryptRegisterDefaultOIDFunction(0, NULL, 0, NULL);
337     ok(!ret && GetLastError() == E_INVALIDARG,
338      "Expected E_INVALIDARG, got %08x\n", GetLastError());
339     /* This succeeds on WinXP, although the bogus entry is unusable.
340     ret = CryptRegisterDefaultOIDFunction(0, NULL, 0, bogusDll);
341      */
342     /* Register one at index 0 */
343     SetLastError(0xdeadbeef);
344     ret = CryptRegisterDefaultOIDFunction(0, "CertDllOpenStoreProv", 0,
345      bogusDll);
346     if (!ret && GetLastError() == ERROR_ACCESS_DENIED)
347     {
348         skip("Need admin rights\n");
349         return;
350     }
351     ok(ret, "CryptRegisterDefaultOIDFunction failed: %08x\n", GetLastError());
352     /* Reregistering should fail */
353     ret = CryptRegisterDefaultOIDFunction(0, "CertDllOpenStoreProv", 0,
354      bogusDll);
355     ok(!ret && GetLastError() == ERROR_FILE_EXISTS,
356      "Expected ERROR_FILE_EXISTS, got %08x\n", GetLastError());
357     /* Registering the same one at index 1 should also fail */
358     ret = CryptRegisterDefaultOIDFunction(0, "CertDllOpenStoreProv", 1,
359      bogusDll);
360     ok(!ret && GetLastError() == ERROR_FILE_EXISTS,
361      "Expected ERROR_FILE_EXISTS, got %08x\n", GetLastError());
362     /* Registering a different one at index 1 succeeds */
363     ret = CryptRegisterDefaultOIDFunction(0, "CertDllOpenStoreProv", 1,
364      bogus2Dll);
365     ok(ret, "CryptRegisterDefaultOIDFunction failed: %08x\n", GetLastError());
366     sprintf(buf, fmt, 0, func);
367     rc = RegOpenKeyA(HKEY_LOCAL_MACHINE, buf, &key);
368     ok(rc == 0, "Expected key to exist, RegOpenKeyA failed: %ld\n", rc);
369     if (rc == 0)
370     {
371         static const CHAR dllA[] = "Dll";
372         static const CHAR bogusDll_A[] = "bogus.dll";
373         static const CHAR bogus2Dll_A[] = "bogus2.dll";
374         CHAR dllBuf[MAX_PATH];
375         DWORD type, size;
376         LPSTR ptr;
377
378         size = sizeof(dllBuf) / sizeof(dllBuf[0]);
379         rc = RegQueryValueExA(key, dllA, NULL, &type, (LPBYTE)dllBuf, &size);
380         ok(rc == 0,
381          "Expected Dll value to exist, RegQueryValueExA failed: %ld\n", rc);
382         ok(type == REG_MULTI_SZ, "Expected type REG_MULTI_SZ, got %d\n", type);
383         /* bogusDll was registered first, so that should be first */
384         ptr = dllBuf;
385         ok(!lstrcmpiA(ptr, bogusDll_A), "Unexpected dll\n");
386         ptr += lstrlenA(ptr) + 1;
387         ok(!lstrcmpiA(ptr, bogus2Dll_A), "Unexpected dll\n");
388         RegCloseKey(key);
389     }
390     /* Unregister both of them */
391     ret = CryptUnregisterDefaultOIDFunction(0, "CertDllOpenStoreProv",
392      bogusDll);
393     ok(ret, "CryptUnregisterDefaultOIDFunction failed: %08x\n",
394      GetLastError());
395     ret = CryptUnregisterDefaultOIDFunction(0, "CertDllOpenStoreProv",
396      bogus2Dll);
397     ok(ret, "CryptUnregisterDefaultOIDFunction failed: %08x\n",
398      GetLastError());
399     /* Now that they're both unregistered, unregistering should fail */
400     ret = CryptUnregisterDefaultOIDFunction(0, "CertDllOpenStoreProv",
401      bogusDll);
402     ok(!ret && GetLastError() == ERROR_FILE_NOT_FOUND,
403      "Expected ERROR_FILE_NOT_FOUND, got %d\n", GetLastError());
404
405     /* Repeat a few tests on the normal encoding type */
406     ret = CryptRegisterDefaultOIDFunction(X509_ASN_ENCODING,
407      "CertDllOpenStoreProv", 0, bogusDll);
408     ret = CryptUnregisterDefaultOIDFunction(X509_ASN_ENCODING,
409      "CertDllOpenStoreProv", bogusDll);
410     ok(ret, "CryptUnregisterDefaultOIDFunction failed\n");
411     ret = CryptUnregisterDefaultOIDFunction(X509_ASN_ENCODING,
412      "CertDllOpenStoreProv", bogusDll);
413     ok(!ret && GetLastError() == ERROR_FILE_NOT_FOUND,
414      "Expected ERROR_FILE_NOT_FOUND, got %08x\n", GetLastError());
415 }
416
417 static BOOL WINAPI countOidInfo(PCCRYPT_OID_INFO pInfo, void *pvArg)
418 {
419     (*(DWORD *)pvArg)++;
420     return TRUE;
421 }
422
423 static BOOL WINAPI noOidInfo(PCCRYPT_OID_INFO pInfo, void *pvArg)
424 {
425     return FALSE;
426 }
427
428 static void test_enumOIDInfo(void)
429 {
430     BOOL ret;
431     DWORD count = 0;
432
433     /* This crashes
434     ret = CryptEnumOIDInfo(7, 0, NULL, NULL);
435      */
436
437     /* Silly tests, check that more than one thing is enumerated */
438     ret = CryptEnumOIDInfo(0, 0, &count, countOidInfo);
439     ok(ret && count > 0, "Expected more than item enumerated\n");
440     ret = CryptEnumOIDInfo(0, 0, NULL, noOidInfo);
441     ok(!ret, "Expected FALSE\n");
442 }
443
444 static void test_findOIDInfo(void)
445 {
446     static WCHAR sha1[] = { 's','h','a','1',0 };
447     static CHAR oid_rsa_md5[] = szOID_RSA_MD5;
448     ALG_ID alg = CALG_SHA1;
449     ALG_ID algs[2] = { CALG_MD5, CALG_RSA_SIGN };
450     PCCRYPT_OID_INFO info;
451
452     info = CryptFindOIDInfo(0, NULL, 0);
453     ok(info == NULL, "Expected NULL\n");
454     info = CryptFindOIDInfo(CRYPT_OID_INFO_OID_KEY, oid_rsa_md5, 0);
455     ok(info != NULL, "Expected to find szOID_RSA_MD5\n");
456     if (info)
457     {
458         ok(!strcmp(info->pszOID, szOID_RSA_MD5), "Expected %s, got %s\n",
459          szOID_RSA_MD5, info->pszOID);
460         ok(U(*info).Algid == CALG_MD5, "Expected CALG_MD5, got %d\n",
461            U(*info).Algid);
462     }
463     info = CryptFindOIDInfo(CRYPT_OID_INFO_NAME_KEY, sha1, 0);
464     ok(info != NULL, "Expected to find sha1\n");
465     if (info)
466     {
467         ok(!strcmp(info->pszOID, szOID_OIWSEC_sha1), "Expected %s, got %s\n",
468          szOID_OIWSEC_sha1, info->pszOID);
469         ok(U(*info).Algid == CALG_SHA1, "Expected CALG_SHA1, got %d\n",
470            U(*info).Algid);
471     }
472     info = CryptFindOIDInfo(CRYPT_OID_INFO_ALGID_KEY, &alg, 0);
473     ok(info != NULL, "Expected to find sha1\n");
474     if (info)
475     {
476         ok(!strcmp(info->pszOID, szOID_OIWSEC_sha1), "Expected %s, got %s\n",
477          szOID_OIWSEC_sha1, info->pszOID);
478         ok(U(*info).Algid == CALG_SHA1, "Expected CALG_SHA1, got %d\n",
479            U(*info).Algid);
480     }
481     info = CryptFindOIDInfo(CRYPT_OID_INFO_SIGN_KEY, algs, 0);
482     ok(info != NULL, "Expected to find md5RSA\n");
483     if (info)
484     {
485         ok(!strcmp(info->pszOID, szOID_RSA_MD5RSA), "Expected %s, got %s\n",
486          szOID_RSA_MD5RSA, info->pszOID);
487         ok(U(*info).Algid == CALG_MD5, "Expected CALG_MD5, got %d\n",
488            U(*info).Algid);
489     }
490 }
491
492 START_TEST(oid)
493 {
494     testOIDToAlgID();
495     testAlgIDToOID();
496     test_enumOIDInfo();
497     test_findOIDInfo();
498     test_oidFunctionSet();
499     test_installOIDFunctionAddress();
500     test_registerOIDFunction();
501     test_registerDefaultOIDFunction();
502 }