http://bugs.winehq.org/show_bug.cgi?id=16563
Summary: asn.1-decoding OIDs with only two components fails Product: Wine Version: 1.1.10 Platform: All OS/Version: All Status: NEW Severity: normal Priority: P2 Component: crypt32 AssignedTo: juan_lang@yahoo.com ReportedBy: juan_lang@yahoo.com
Spotted this while playing with the new cryptui dialogs. They're probably the easiest way to reproduce it, too.
As of today's git, to reproduce, apply the 15-patch series beginning here: http://www.winehq.org/pipermail/wine-patches/2008-December/066402.html Assuming the patches are accepted, you can use git version 1.1.11 when it comes out instead.
Steps to reproduce: 1. Find a program or write a small program that calls CryptUIDlgViewCertificateA/W (Outlook and Chrome are two examples.) 2. Switch to the "Details" tab of the "Certificate" dialog. 3. Click "Edit Properties" in the "Details" tab. 4. Click "Enable only the following purposes for this certificate" in the "Certificate Properties" dialog. 5. Click "Add Purpose". Add an OID with no more than two components in the "Add Purpose" dialog and click OK. Example OIDs: 1.1, 2.2, 1.700 6. Click OK in the "Certificate Properties" dialog. 7. Click "Edit Properties" again in the "Certificate" dialog.
Expected behavior: The OID you entered in step 5. appears in the OID list.
Actual behavior: Some random OID appears instead.
Scanning traces shows that the correct OID is passed all the way through CryptEncodeObjectEx and saved in the certificate's property list, but when it's decoded the random OID comes back from CryptDecodeObjectEx.
Assigning to myself since I wrote all of the offending code.