Juan Lang : wintrust: Fix encoding OIDs with only two components.

Alexandre Julliard julliard at winehq.org
Tue Dec 23 13:41:45 CST 2008


Module: wine
Branch: master
Commit: ae133b808fca2410b95178bff00eb25c15a1d2d3
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=ae133b808fca2410b95178bff00eb25c15a1d2d3

Author: Juan Lang <juan.lang at gmail.com>
Date:   Tue Dec 23 08:48:09 2008 -0800

wintrust: Fix encoding OIDs with only two components.

---

 dlls/wintrust/asn.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/dlls/wintrust/asn.c b/dlls/wintrust/asn.c
index 4799a68..d3ac3e9 100644
--- a/dlls/wintrust/asn.c
+++ b/dlls/wintrust/asn.c
@@ -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;




More information about the wine-cvs mailing list