Juan Lang : crypt32: Simplify CRYPT_AsnDecodeDistPointName.

Alexandre Julliard julliard at winehq.org
Thu Oct 15 08:54:32 CDT 2009


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

Author: Juan Lang <juan.lang at gmail.com>
Date:   Wed Oct 14 12:50:50 2009 -0700

crypt32: Simplify CRYPT_AsnDecodeDistPointName.

---

 dlls/crypt32/decode.c |   17 ++++++-----------
 1 files changed, 6 insertions(+), 11 deletions(-)

diff --git a/dlls/crypt32/decode.c b/dlls/crypt32/decode.c
index 296799c..7e895eb 100644
--- a/dlls/crypt32/decode.c
+++ b/dlls/crypt32/decode.c
@@ -4931,15 +4931,10 @@ static BOOL CRYPT_AsnDecodeDistPointName(const BYTE *pbEncoded,
 
             if (dataLen)
             {
-                ret = CRYPT_AsnDecodeArray(&arrayDesc,
+                ret = CRYPT_AsnDecodeArrayNoAlloc(&arrayDesc,
                  pbEncoded + 1 + lenBytes, cbEncoded - 1 - lenBytes,
-                 0, NULL, NULL, &nameLen, NULL, NULL);
-                /* The CERT_ALT_NAME_INFO's size is included by CRYPT_AsnDecodeArray
-                 * as the sizeof(struct GenericArray), so don't include it in the
-                 * total bytes needed.
-                 */
-                bytesNeeded = sizeof(CRL_DIST_POINT_NAME) + nameLen -
-                 sizeof(CERT_ALT_NAME_INFO);
+                 NULL, NULL, &nameLen, NULL);
+                bytesNeeded = sizeof(CRL_DIST_POINT_NAME) + nameLen;
             }
             else
                 bytesNeeded = sizeof(CRL_DIST_POINT_NAME);
@@ -4961,10 +4956,10 @@ static BOOL CRYPT_AsnDecodeDistPointName(const BYTE *pbEncoded,
                 if (dataLen)
                 {
                     name->dwDistPointNameChoice = CRL_DIST_POINT_FULL_NAME;
-                    ret = CRYPT_AsnDecodeArray(&arrayDesc,
+                    ret = CRYPT_AsnDecodeArrayNoAlloc(&arrayDesc,
                      pbEncoded + 1 + lenBytes, cbEncoded - 1 - lenBytes,
-                     0, NULL, &name->u.FullName, &nameLen, NULL,
-                     name->u.FullName.rgAltEntry);
+                     &name->u.FullName.cAltEntry, name->u.FullName.rgAltEntry,
+                     &nameLen, NULL);
                 }
                 else
                     name->dwDistPointNameChoice = CRL_DIST_POINT_NO_NAME;




More information about the wine-cvs mailing list