Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
9d63e6f9
Commit
9d63e6f9
authored
Nov 21, 2011
by
Alexander Morozov
Committed by
Alexandre Julliard
Nov 22, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
crypt32: Initialize a pointer for dynamic data.
parent
fc78c224
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
12 deletions
+26
-12
decode.c
dlls/crypt32/decode.c
+25
-0
encode.c
dlls/crypt32/tests/encode.c
+1
-12
No files found.
dlls/crypt32/decode.c
View file @
9d63e6f9
...
@@ -1465,7 +1465,10 @@ static BOOL WINAPI CRYPT_AsnDecodeExtensions(DWORD dwCertEncodingType,
...
@@ -1465,7 +1465,10 @@ static BOOL WINAPI CRYPT_AsnDecodeExtensions(DWORD dwCertEncodingType,
sizeof
(
CERT_EXTENSIONS
),
sizeof
(
CERT_EXTENSIONS
),
CRYPT_AsnDecodeExtension
,
sizeof
(
CERT_EXTENSION
),
TRUE
,
CRYPT_AsnDecodeExtension
,
sizeof
(
CERT_EXTENSION
),
TRUE
,
offsetof
(
CERT_EXTENSION
,
pszObjId
)
};
offsetof
(
CERT_EXTENSION
,
pszObjId
)
};
CERT_EXTENSIONS
*
exts
=
pvStructInfo
;
if
(
pvStructInfo
&&
!
(
dwFlags
&
CRYPT_DECODE_ALLOC_FLAG
))
exts
->
rgExtension
=
(
CERT_EXTENSION
*
)(
exts
+
1
);
ret
=
CRYPT_AsnDecodeArray
(
&
arrayDesc
,
pbEncoded
,
cbEncoded
,
ret
=
CRYPT_AsnDecodeArray
(
&
arrayDesc
,
pbEncoded
,
cbEncoded
,
dwFlags
,
pDecodePara
,
pvStructInfo
,
pcbStructInfo
,
NULL
);
dwFlags
,
pDecodePara
,
pvStructInfo
,
pcbStructInfo
,
NULL
);
}
}
...
@@ -2356,7 +2359,10 @@ static BOOL WINAPI CRYPT_AsnDecodeSMIMECapabilities(DWORD dwCertEncodingType,
...
@@ -2356,7 +2359,10 @@ static BOOL WINAPI CRYPT_AsnDecodeSMIMECapabilities(DWORD dwCertEncodingType,
sizeof
(
CRYPT_SMIME_CAPABILITIES
),
sizeof
(
CRYPT_SMIME_CAPABILITIES
),
CRYPT_AsnDecodeSMIMECapability
,
sizeof
(
CRYPT_SMIME_CAPABILITY
),
TRUE
,
CRYPT_AsnDecodeSMIMECapability
,
sizeof
(
CRYPT_SMIME_CAPABILITY
),
TRUE
,
offsetof
(
CRYPT_SMIME_CAPABILITY
,
pszObjId
)
};
offsetof
(
CRYPT_SMIME_CAPABILITY
,
pszObjId
)
};
CRYPT_SMIME_CAPABILITIES
*
capabilities
=
pvStructInfo
;
if
(
pvStructInfo
&&
!
(
dwFlags
&
CRYPT_DECODE_ALLOC_FLAG
))
capabilities
->
rgCapability
=
(
CRYPT_SMIME_CAPABILITY
*
)(
capabilities
+
1
);
ret
=
CRYPT_AsnDecodeArray
(
&
arrayDesc
,
pbEncoded
,
cbEncoded
,
ret
=
CRYPT_AsnDecodeArray
(
&
arrayDesc
,
pbEncoded
,
cbEncoded
,
dwFlags
,
pDecodePara
,
pvStructInfo
,
pcbStructInfo
,
NULL
);
dwFlags
,
pDecodePara
,
pvStructInfo
,
pcbStructInfo
,
NULL
);
}
}
...
@@ -2832,7 +2838,10 @@ static BOOL WINAPI CRYPT_AsnDecodePKCSAttributes(DWORD dwCertEncodingType,
...
@@ -2832,7 +2838,10 @@ static BOOL WINAPI CRYPT_AsnDecodePKCSAttributes(DWORD dwCertEncodingType,
sizeof
(
CRYPT_ATTRIBUTES
),
sizeof
(
CRYPT_ATTRIBUTES
),
CRYPT_AsnDecodePKCSAttributeInternal
,
sizeof
(
CRYPT_ATTRIBUTE
),
CRYPT_AsnDecodePKCSAttributeInternal
,
sizeof
(
CRYPT_ATTRIBUTE
),
TRUE
,
offsetof
(
CRYPT_ATTRIBUTE
,
pszObjId
)
};
TRUE
,
offsetof
(
CRYPT_ATTRIBUTE
,
pszObjId
)
};
CRYPT_ATTRIBUTES
*
attrs
=
pvStructInfo
;
if
(
pvStructInfo
&&
!
(
dwFlags
&
CRYPT_DECODE_ALLOC_FLAG
))
attrs
->
rgAttr
=
(
CRYPT_ATTRIBUTE
*
)(
attrs
+
1
);
ret
=
CRYPT_AsnDecodeArray
(
&
arrayDesc
,
pbEncoded
,
cbEncoded
,
ret
=
CRYPT_AsnDecodeArray
(
&
arrayDesc
,
pbEncoded
,
cbEncoded
,
dwFlags
,
pDecodePara
,
pvStructInfo
,
pcbStructInfo
,
NULL
);
dwFlags
,
pDecodePara
,
pvStructInfo
,
pcbStructInfo
,
NULL
);
}
}
...
@@ -3232,7 +3241,10 @@ static BOOL WINAPI CRYPT_AsnDecodeAuthorityInfoAccess(DWORD dwCertEncodingType,
...
@@ -3232,7 +3241,10 @@ static BOOL WINAPI CRYPT_AsnDecodeAuthorityInfoAccess(DWORD dwCertEncodingType,
sizeof
(
CERT_AUTHORITY_INFO_ACCESS
),
sizeof
(
CERT_AUTHORITY_INFO_ACCESS
),
CRYPT_AsnDecodeAccessDescription
,
sizeof
(
CERT_ACCESS_DESCRIPTION
),
CRYPT_AsnDecodeAccessDescription
,
sizeof
(
CERT_ACCESS_DESCRIPTION
),
TRUE
,
offsetof
(
CERT_ACCESS_DESCRIPTION
,
pszAccessMethod
)
};
TRUE
,
offsetof
(
CERT_ACCESS_DESCRIPTION
,
pszAccessMethod
)
};
CERT_AUTHORITY_INFO_ACCESS
*
info
=
pvStructInfo
;
if
(
pvStructInfo
&&
!
(
dwFlags
&
CRYPT_DECODE_ALLOC_FLAG
))
info
->
rgAccDescr
=
(
CERT_ACCESS_DESCRIPTION
*
)(
info
+
1
);
ret
=
CRYPT_AsnDecodeArray
(
&
arrayDesc
,
pbEncoded
,
cbEncoded
,
ret
=
CRYPT_AsnDecodeArray
(
&
arrayDesc
,
pbEncoded
,
cbEncoded
,
dwFlags
,
pDecodePara
,
pvStructInfo
,
pcbStructInfo
,
NULL
);
dwFlags
,
pDecodePara
,
pvStructInfo
,
pcbStructInfo
,
NULL
);
}
}
...
@@ -3653,6 +3665,10 @@ static BOOL WINAPI CRYPT_AsnDecodeCertPolicies(DWORD dwCertEncodingType,
...
@@ -3653,6 +3665,10 @@ static BOOL WINAPI CRYPT_AsnDecodeCertPolicies(DWORD dwCertEncodingType,
sizeof
(
CERT_POLICIES_INFO
),
sizeof
(
CERT_POLICIES_INFO
),
CRYPT_AsnDecodeCertPolicy
,
sizeof
(
CERT_POLICY_INFO
),
TRUE
,
CRYPT_AsnDecodeCertPolicy
,
sizeof
(
CERT_POLICY_INFO
),
TRUE
,
offsetof
(
CERT_POLICY_INFO
,
pszPolicyIdentifier
)
};
offsetof
(
CERT_POLICY_INFO
,
pszPolicyIdentifier
)
};
CERT_POLICIES_INFO
*
info
=
pvStructInfo
;
if
(
pvStructInfo
&&
!
(
dwFlags
&
CRYPT_DECODE_ALLOC_FLAG
))
info
->
rgPolicyInfo
=
(
CERT_POLICY_INFO
*
)(
info
+
1
);
ret
=
CRYPT_AsnDecodeArray
(
&
arrayDesc
,
pbEncoded
,
cbEncoded
,
ret
=
CRYPT_AsnDecodeArray
(
&
arrayDesc
,
pbEncoded
,
cbEncoded
,
dwFlags
,
pDecodePara
,
pvStructInfo
,
pcbStructInfo
,
NULL
);
dwFlags
,
pDecodePara
,
pvStructInfo
,
pcbStructInfo
,
NULL
);
...
@@ -3706,7 +3722,10 @@ static BOOL WINAPI CRYPT_AsnDecodeCertPolicyMappings(DWORD dwCertEncodingType,
...
@@ -3706,7 +3722,10 @@ static BOOL WINAPI CRYPT_AsnDecodeCertPolicyMappings(DWORD dwCertEncodingType,
sizeof
(
CERT_POLICY_MAPPING
),
sizeof
(
CERT_POLICY_MAPPING
),
CRYPT_AsnDecodeCertPolicyMapping
,
sizeof
(
CERT_POLICY_MAPPING
),
TRUE
,
CRYPT_AsnDecodeCertPolicyMapping
,
sizeof
(
CERT_POLICY_MAPPING
),
TRUE
,
offsetof
(
CERT_POLICY_MAPPING
,
pszIssuerDomainPolicy
)
};
offsetof
(
CERT_POLICY_MAPPING
,
pszIssuerDomainPolicy
)
};
CERT_POLICY_MAPPINGS_INFO
*
info
=
pvStructInfo
;
if
(
pvStructInfo
&&
!
(
dwFlags
&
CRYPT_DECODE_ALLOC_FLAG
))
info
->
rgPolicyMapping
=
(
CERT_POLICY_MAPPING
*
)(
info
+
1
);
ret
=
CRYPT_AsnDecodeArray
(
&
arrayDesc
,
pbEncoded
,
cbEncoded
,
ret
=
CRYPT_AsnDecodeArray
(
&
arrayDesc
,
pbEncoded
,
cbEncoded
,
dwFlags
,
pDecodePara
,
pvStructInfo
,
pcbStructInfo
,
NULL
);
dwFlags
,
pDecodePara
,
pvStructInfo
,
pcbStructInfo
,
NULL
);
}
}
...
@@ -5020,7 +5039,10 @@ static BOOL WINAPI CRYPT_AsnDecodeCRLDistPoints(DWORD dwCertEncodingType,
...
@@ -5020,7 +5039,10 @@ static BOOL WINAPI CRYPT_AsnDecodeCRLDistPoints(DWORD dwCertEncodingType,
sizeof
(
CRL_DIST_POINTS_INFO
),
sizeof
(
CRL_DIST_POINTS_INFO
),
CRYPT_AsnDecodeDistPoint
,
sizeof
(
CRL_DIST_POINT
),
TRUE
,
CRYPT_AsnDecodeDistPoint
,
sizeof
(
CRL_DIST_POINT
),
TRUE
,
offsetof
(
CRL_DIST_POINT
,
DistPointName
.
u
.
FullName
.
rgAltEntry
)
};
offsetof
(
CRL_DIST_POINT
,
DistPointName
.
u
.
FullName
.
rgAltEntry
)
};
CRL_DIST_POINTS_INFO
*
info
=
pvStructInfo
;
if
(
pvStructInfo
&&
!
(
dwFlags
&
CRYPT_DECODE_ALLOC_FLAG
))
info
->
rgDistPoint
=
(
CRL_DIST_POINT
*
)(
info
+
1
);
ret
=
CRYPT_AsnDecodeArray
(
&
arrayDesc
,
pbEncoded
,
cbEncoded
,
ret
=
CRYPT_AsnDecodeArray
(
&
arrayDesc
,
pbEncoded
,
cbEncoded
,
dwFlags
,
pDecodePara
,
pvStructInfo
,
pcbStructInfo
,
NULL
);
dwFlags
,
pDecodePara
,
pvStructInfo
,
pcbStructInfo
,
NULL
);
}
}
...
@@ -5049,7 +5071,10 @@ static BOOL WINAPI CRYPT_AsnDecodeEnhancedKeyUsage(DWORD dwCertEncodingType,
...
@@ -5049,7 +5071,10 @@ static BOOL WINAPI CRYPT_AsnDecodeEnhancedKeyUsage(DWORD dwCertEncodingType,
offsetof
(
CERT_ENHKEY_USAGE
,
rgpszUsageIdentifier
),
offsetof
(
CERT_ENHKEY_USAGE
,
rgpszUsageIdentifier
),
sizeof
(
CERT_ENHKEY_USAGE
),
sizeof
(
CERT_ENHKEY_USAGE
),
CRYPT_AsnDecodeOidInternal
,
sizeof
(
LPSTR
),
TRUE
,
0
};
CRYPT_AsnDecodeOidInternal
,
sizeof
(
LPSTR
),
TRUE
,
0
};
CERT_ENHKEY_USAGE
*
usage
=
pvStructInfo
;
if
(
pvStructInfo
&&
!
(
dwFlags
&
CRYPT_DECODE_ALLOC_FLAG
))
usage
->
rgpszUsageIdentifier
=
(
LPSTR
*
)(
usage
+
1
);
ret
=
CRYPT_AsnDecodeArray
(
&
arrayDesc
,
pbEncoded
,
cbEncoded
,
ret
=
CRYPT_AsnDecodeArray
(
&
arrayDesc
,
pbEncoded
,
cbEncoded
,
dwFlags
,
pDecodePara
,
pvStructInfo
,
pcbStructInfo
,
NULL
);
dwFlags
,
pDecodePara
,
pvStructInfo
,
pcbStructInfo
,
NULL
);
}
}
...
...
dlls/crypt32/tests/encode.c
View file @
9d63e6f9
...
@@ -2718,11 +2718,7 @@ static void test_decodeExtensions(DWORD dwEncoding)
...
@@ -2718,11 +2718,7 @@ static void test_decodeExtensions(DWORD dwEncoding)
{
{
ret
=
pCryptDecodeObjectEx
(
dwEncoding
,
X509_EXTENSIONS
,
ret
=
pCryptDecodeObjectEx
(
dwEncoding
,
X509_EXTENSIONS
,
exts
[
i
].
encoded
,
exts
[
i
].
encoded
[
1
]
+
2
,
0
,
NULL
,
buf
,
&
bufSize
);
exts
[
i
].
encoded
,
exts
[
i
].
encoded
[
1
]
+
2
,
0
,
NULL
,
buf
,
&
bufSize
);
if
(
!
i
)
ok
(
ret
,
"CryptDecodeObjectEx failed: %08x
\n
"
,
GetLastError
());
ok
(
ret
,
"CryptDecodeObjectEx failed: %08x
\n
"
,
GetLastError
());
else
todo_wine
ok
(
ret
,
"CryptDecodeObjectEx failed: %08x
\n
"
,
GetLastError
());
HeapFree
(
GetProcessHeap
(),
0
,
buf
);
HeapFree
(
GetProcessHeap
(),
0
,
buf
);
}
}
}
}
...
@@ -3626,7 +3622,6 @@ static void test_decodeCRLDistPoints(DWORD dwEncoding)
...
@@ -3626,7 +3622,6 @@ static void test_decodeCRLDistPoints(DWORD dwEncoding)
ret
=
pCryptDecodeObjectEx
(
dwEncoding
,
X509_CRL_DIST_POINTS
,
ret
=
pCryptDecodeObjectEx
(
dwEncoding
,
X509_CRL_DIST_POINTS
,
distPointWithUrlAndIssuer
,
distPointWithUrlAndIssuer
[
1
]
+
2
,
0
,
distPointWithUrlAndIssuer
,
distPointWithUrlAndIssuer
[
1
]
+
2
,
0
,
NULL
,
buf
,
&
size
);
NULL
,
buf
,
&
size
);
todo_wine
ok
(
ret
,
"CryptDecodeObjectEx failed: %08x
\n
"
,
GetLastError
());
ok
(
ret
,
"CryptDecodeObjectEx failed: %08x
\n
"
,
GetLastError
());
HeapFree
(
GetProcessHeap
(),
0
,
buf
);
HeapFree
(
GetProcessHeap
(),
0
,
buf
);
}
}
...
@@ -4778,7 +4773,6 @@ static void test_decodeEnhancedKeyUsage(DWORD dwEncoding)
...
@@ -4778,7 +4773,6 @@ static void test_decodeEnhancedKeyUsage(DWORD dwEncoding)
{
{
ret
=
pCryptDecodeObjectEx
(
dwEncoding
,
X509_ENHANCED_KEY_USAGE
,
ret
=
pCryptDecodeObjectEx
(
dwEncoding
,
X509_ENHANCED_KEY_USAGE
,
encodedUsage
,
sizeof
(
encodedUsage
),
0
,
NULL
,
buf
,
&
size
);
encodedUsage
,
sizeof
(
encodedUsage
),
0
,
NULL
,
buf
,
&
size
);
todo_wine
ok
(
ret
,
"CryptDecodeObjectEx failed: %08x
\n
"
,
GetLastError
());
ok
(
ret
,
"CryptDecodeObjectEx failed: %08x
\n
"
,
GetLastError
());
HeapFree
(
GetProcessHeap
(),
0
,
buf
);
HeapFree
(
GetProcessHeap
(),
0
,
buf
);
}
}
...
@@ -5266,7 +5260,6 @@ static void test_decodeAuthorityInfoAccess(DWORD dwEncoding)
...
@@ -5266,7 +5260,6 @@ static void test_decodeAuthorityInfoAccess(DWORD dwEncoding)
ret
=
pCryptDecodeObjectEx
(
dwEncoding
,
X509_AUTHORITY_INFO_ACCESS
,
ret
=
pCryptDecodeObjectEx
(
dwEncoding
,
X509_AUTHORITY_INFO_ACCESS
,
authorityInfoAccessWithUrlAndIPAddr
,
authorityInfoAccessWithUrlAndIPAddr
,
sizeof
(
authorityInfoAccessWithUrlAndIPAddr
),
0
,
NULL
,
buf
,
&
size
);
sizeof
(
authorityInfoAccessWithUrlAndIPAddr
),
0
,
NULL
,
buf
,
&
size
);
todo_wine
ok
(
ret
,
"CryptDecodeObjectEx failed: %x
\n
"
,
GetLastError
());
ok
(
ret
,
"CryptDecodeObjectEx failed: %x
\n
"
,
GetLastError
());
HeapFree
(
GetProcessHeap
(),
0
,
buf
);
HeapFree
(
GetProcessHeap
(),
0
,
buf
);
}
}
...
@@ -6231,7 +6224,6 @@ static void test_decodePKCSAttributes(DWORD dwEncoding)
...
@@ -6231,7 +6224,6 @@ static void test_decodePKCSAttributes(DWORD dwEncoding)
{
{
ret
=
pCryptDecodeObjectEx
(
dwEncoding
,
PKCS_ATTRIBUTES
,
ret
=
pCryptDecodeObjectEx
(
dwEncoding
,
PKCS_ATTRIBUTES
,
doublePKCSAttributes
,
sizeof
(
doublePKCSAttributes
),
0
,
NULL
,
buf
,
&
size
);
doublePKCSAttributes
,
sizeof
(
doublePKCSAttributes
),
0
,
NULL
,
buf
,
&
size
);
todo_wine
ok
(
ret
,
"CryptDecodeObjectEx failed: %x
\n
"
,
GetLastError
());
ok
(
ret
,
"CryptDecodeObjectEx failed: %x
\n
"
,
GetLastError
());
HeapFree
(
GetProcessHeap
(),
0
,
buf
);
HeapFree
(
GetProcessHeap
(),
0
,
buf
);
}
}
...
@@ -6402,7 +6394,6 @@ static void test_decodePKCSSMimeCapabilities(DWORD dwEncoding)
...
@@ -6402,7 +6394,6 @@ static void test_decodePKCSSMimeCapabilities(DWORD dwEncoding)
SetLastError
(
0xdeadbeef
);
SetLastError
(
0xdeadbeef
);
ret
=
pCryptDecodeObjectEx
(
dwEncoding
,
PKCS_SMIME_CAPABILITIES
,
ret
=
pCryptDecodeObjectEx
(
dwEncoding
,
PKCS_SMIME_CAPABILITIES
,
twoCapabilities
,
sizeof
(
twoCapabilities
),
0
,
NULL
,
ptr
,
&
size
);
twoCapabilities
,
sizeof
(
twoCapabilities
),
0
,
NULL
,
ptr
,
&
size
);
todo_wine
ok
(
ret
,
"CryptDecodeObjectEx failed: %08x
\n
"
,
GetLastError
());
ok
(
ret
,
"CryptDecodeObjectEx failed: %08x
\n
"
,
GetLastError
());
HeapFree
(
GetProcessHeap
(),
0
,
ptr
);
HeapFree
(
GetProcessHeap
(),
0
,
ptr
);
}
}
...
@@ -7576,7 +7567,6 @@ static void test_decodeCertPolicies(DWORD dwEncoding)
...
@@ -7576,7 +7567,6 @@ static void test_decodeCertPolicies(DWORD dwEncoding)
{
{
ret
=
pCryptDecodeObjectEx
(
dwEncoding
,
X509_CERT_POLICIES
,
ret
=
pCryptDecodeObjectEx
(
dwEncoding
,
X509_CERT_POLICIES
,
twoPolicies
,
sizeof
(
twoPolicies
),
0
,
NULL
,
info
,
&
size
);
twoPolicies
,
sizeof
(
twoPolicies
),
0
,
NULL
,
info
,
&
size
);
todo_wine
ok
(
ret
,
"CryptDecodeObjectEx failed: %08x
\n
"
,
GetLastError
());
ok
(
ret
,
"CryptDecodeObjectEx failed: %08x
\n
"
,
GetLastError
());
HeapFree
(
GetProcessHeap
(),
0
,
info
);
HeapFree
(
GetProcessHeap
(),
0
,
info
);
}
}
...
@@ -7733,7 +7723,6 @@ static void test_decodeCertPolicyMappings(DWORD dwEncoding)
...
@@ -7733,7 +7723,6 @@ static void test_decodeCertPolicyMappings(DWORD dwEncoding)
ret
=
pCryptDecodeObjectEx
(
dwEncoding
,
mappingOids
[
i
],
ret
=
pCryptDecodeObjectEx
(
dwEncoding
,
mappingOids
[
i
],
policyMappingWithTwoMappings
,
sizeof
(
policyMappingWithTwoMappings
),
0
,
policyMappingWithTwoMappings
,
sizeof
(
policyMappingWithTwoMappings
),
0
,
NULL
,
info
,
&
size
);
NULL
,
info
,
&
size
);
todo_wine
ok
(
ret
,
"CryptDecodeObjectEx failed: %08x
\n
"
,
GetLastError
());
ok
(
ret
,
"CryptDecodeObjectEx failed: %08x
\n
"
,
GetLastError
());
HeapFree
(
GetProcessHeap
(),
0
,
info
);
HeapFree
(
GetProcessHeap
(),
0
,
info
);
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment