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
0a866d0e
Commit
0a866d0e
authored
Jan 29, 2010
by
Michael Stefaniuc
Committed by
Alexandre Julliard
Jan 29, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
crypt32: Avoid using HIWORD() on a string pointer.
The stray IS_INTRESOURCE() is applied to a true resource. The other strings are OIDs and not resources.
parent
1dcbbfe1
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
27 additions
and
21 deletions
+27
-21
chain.c
dlls/crypt32/chain.c
+1
-1
crypt32_private.h
dlls/crypt32/crypt32_private.h
+4
-0
decode.c
dlls/crypt32/decode.c
+1
-1
encode.c
dlls/crypt32/encode.c
+1
-1
object.c
dlls/crypt32/object.c
+1
-1
oid.c
dlls/crypt32/oid.c
+6
-6
store.c
dlls/crypt32/store.c
+1
-1
chain.c
dlls/crypt32/tests/chain.c
+12
-10
No files found.
dlls/crypt32/chain.c
View file @
0a866d0e
...
...
@@ -3380,7 +3380,7 @@ BOOL WINAPI CertVerifyCertificateChainPolicy(LPCSTR szPolicyOID,
TRACE
(
"(%s, %p, %p, %p)
\n
"
,
debugstr_a
(
szPolicyOID
),
pChainContext
,
pPolicyPara
,
pPolicyStatus
);
if
(
!
HIWOR
D
(
szPolicyOID
))
if
(
IS_INTOI
D
(
szPolicyOID
))
{
switch
(
LOWORD
(
szPolicyOID
))
{
...
...
dlls/crypt32/crypt32_private.h
View file @
0a866d0e
...
...
@@ -405,4 +405,8 @@ void ContextList_Free(struct ContextList *list);
#define ALIGN_DWORD_PTR(x) (((x) + sizeof(DWORD_PTR) - 1) & ~(sizeof(DWORD_PTR) - 1))
#define POINTER_ALIGN_DWORD_PTR(p) ((LPVOID)ALIGN_DWORD_PTR((DWORD_PTR)(p)))
/* Check if the OID is a small int
*/
#define IS_INTOID(x) (((ULONG_PTR)(x) >> 16) == 0)
#endif
dlls/crypt32/decode.c
View file @
0a866d0e
...
...
@@ -5578,7 +5578,7 @@ static CryptDecodeObjectExFunc CRYPT_GetBuiltinDecoder(DWORD dwCertEncodingType,
SetLastError
(
ERROR_FILE_NOT_FOUND
);
return
NULL
;
}
if
(
!
HIWOR
D
(
lpszStructType
))
if
(
IS_INTOI
D
(
lpszStructType
))
{
switch
(
LOWORD
(
lpszStructType
))
{
...
...
dlls/crypt32/encode.c
View file @
0a866d0e
...
...
@@ -4305,7 +4305,7 @@ static CryptEncodeObjectExFunc CRYPT_GetBuiltinEncoder(DWORD dwCertEncodingType,
return
NULL
;
}
if
(
!
HIWOR
D
(
lpszStructType
))
if
(
IS_INTOI
D
(
lpszStructType
))
{
switch
(
LOWORD
(
lpszStructType
))
{
...
...
dlls/crypt32/object.c
View file @
0a866d0e
...
...
@@ -2525,7 +2525,7 @@ static CryptFormatObjectFunc CRYPT_GetBuiltinFormatFunction(DWORD encodingType,
SetLastError
(
ERROR_FILE_NOT_FOUND
);
return
NULL
;
}
if
(
!
HIWOR
D
(
lpszStructType
))
if
(
IS_INTOI
D
(
lpszStructType
))
{
switch
(
LOWORD
(
lpszStructType
))
{
...
...
dlls/crypt32/oid.c
View file @
0a866d0e
...
...
@@ -170,7 +170,7 @@ static char *CRYPT_GetKeyName(DWORD dwEncodingType, LPCSTR pszFuncName,
* "EncodingType 2" would be expected if it were a mask. Instead native
* stores values in "EncodingType 3".
*/
if
(
!
HIWOR
D
(
pszOID
))
if
(
IS_INTOI
D
(
pszOID
))
{
snprintf
(
numericOID
,
sizeof
(
numericOID
),
"#%d"
,
LOWORD
(
pszOID
));
oid
=
numericOID
;
...
...
@@ -255,7 +255,7 @@ BOOL WINAPI CryptInstallOIDFunctionAddress(HMODULE hModule,
{
struct
OIDFunction
*
func
;
if
(
HIWOR
D
(
rgFuncEntry
[
i
].
pszOID
))
if
(
!
IS_INTOI
D
(
rgFuncEntry
[
i
].
pszOID
))
func
=
CryptMemAlloc
(
sizeof
(
struct
OIDFunction
)
+
strlen
(
rgFuncEntry
[
i
].
pszOID
)
+
1
);
else
...
...
@@ -263,7 +263,7 @@ BOOL WINAPI CryptInstallOIDFunctionAddress(HMODULE hModule,
if
(
func
)
{
func
->
encoding
=
GET_CERT_ENCODING_TYPE
(
dwEncodingType
);
if
(
HIWOR
D
(
rgFuncEntry
[
i
].
pszOID
))
if
(
!
IS_INTOI
D
(
rgFuncEntry
[
i
].
pszOID
))
{
LPSTR
oid
;
...
...
@@ -402,9 +402,9 @@ BOOL WINAPI CryptGetOIDFunctionAddress(HCRYPTOIDFUNCSET hFuncSet,
{
if
(
function
->
encoding
==
GET_CERT_ENCODING_TYPE
(
dwEncodingType
))
{
if
(
HIWOR
D
(
pszOID
))
if
(
!
IS_INTOI
D
(
pszOID
))
{
if
(
HIWOR
D
(
function
->
entry
.
pszOID
)
&&
if
(
!
IS_INTOI
D
(
function
->
entry
.
pszOID
)
&&
!
strcasecmp
(
function
->
entry
.
pszOID
,
pszOID
))
{
*
ppvFuncAddr
=
function
->
entry
.
pvFuncAddr
;
...
...
@@ -1398,7 +1398,7 @@ static void init_oid_info(void)
for
(
i
=
0
;
i
<
sizeof
(
oidInfoConstructors
)
/
sizeof
(
oidInfoConstructors
[
0
]);
i
++
)
{
if
(
HIWORD
(
oidInfoConstructors
[
i
].
pwszName
))
if
(
!
IS_INTRESOURCE
(
oidInfoConstructors
[
i
].
pwszName
))
{
struct
OIDInfo
*
info
;
...
...
dlls/crypt32/store.c
View file @
0a866d0e
...
...
@@ -745,7 +745,7 @@ HCERTSTORE WINAPI CertOpenStore(LPCSTR lpszStoreProvider,
TRACE
(
"(%s, %08x, %08lx, %08x, %p)
\n
"
,
debugstr_a
(
lpszStoreProvider
),
dwMsgAndCertEncodingType
,
hCryptProv
,
dwFlags
,
pvPara
);
if
(
!
HIWOR
D
(
lpszStoreProvider
))
if
(
IS_INTOI
D
(
lpszStoreProvider
))
{
switch
(
LOWORD
(
lpszStoreProvider
))
{
...
...
dlls/crypt32/tests/chain.c
View file @
0a866d0e
...
...
@@ -58,6 +58,8 @@ static VOID (WINAPI *pCertFreeCertificateChain)(PCCERT_CHAIN_CONTEXT);
static
VOID
(
WINAPI
*
pCertFreeCertificateChainEngine
)(
HCERTCHAINENGINE
);
static
BOOL
(
WINAPI
*
pCertVerifyCertificateChainPolicy
)(
LPCSTR
,
PCCERT_CHAIN_CONTEXT
,
PCERT_CHAIN_POLICY_PARA
,
PCERT_CHAIN_POLICY_STATUS
);
#define IS_INTOID(x) (((ULONG_PTR)(x) >> 16) == 0)
static
void
testCreateCertChainEngine
(
void
)
{
...
...
@@ -3883,19 +3885,19 @@ static void checkChainPolicyStatus(LPCSTR policy, const ChainPolicyCheck *check,
if
(
check
->
todo
&
TODO_POLICY
)
todo_wine
ok
(
ret
,
"%s[%d]: CertVerifyCertificateChainPolicy failed: %08x
\n
"
,
HIWORD
(
policy
)
?
policy
:
num_to_str
(
LOWORD
(
policy
))
,
IS_INTOID
(
policy
)
?
num_to_str
(
LOWORD
(
policy
))
:
policy
,
testIndex
,
GetLastError
());
else
{
if
(
!
ret
&&
GetLastError
()
==
ERROR_FILE_NOT_FOUND
)
{
skip
(
"%d: missing policy %s, skipping test
\n
"
,
testIndex
,
HIWORD
(
policy
)
?
policy
:
num_to_str
(
LOWORD
(
policy
))
);
IS_INTOID
(
policy
)
?
num_to_str
(
LOWORD
(
policy
))
:
policy
);
pCertFreeCertificateChain
(
chain
);
return
;
}
ok
(
ret
,
"%s[%d]: CertVerifyCertificateChainPolicy failed: %08x
\n
"
,
HIWORD
(
policy
)
?
policy
:
num_to_str
(
LOWORD
(
policy
))
,
testIndex
,
IS_INTOID
(
policy
)
?
num_to_str
(
LOWORD
(
policy
))
:
policy
,
testIndex
,
GetLastError
());
}
if
(
ret
)
...
...
@@ -3906,7 +3908,7 @@ static void checkChainPolicyStatus(LPCSTR policy, const ChainPolicyCheck *check,
(
check
->
brokenStatus
&&
broken
(
policyStatus
.
dwError
==
check
->
brokenStatus
->
dwError
)),
"%s[%d]: expected %08x, got %08x
\n
"
,
HIWORD
(
policy
)
?
policy
:
num_to_str
(
LOWORD
(
policy
))
,
IS_INTOID
(
policy
)
?
num_to_str
(
LOWORD
(
policy
))
:
policy
,
testIndex
,
check
->
status
.
dwError
,
policyStatus
.
dwError
);
else
ok
(
policyStatus
.
dwError
==
check
->
status
.
dwError
||
...
...
@@ -3914,12 +3916,12 @@ static void checkChainPolicyStatus(LPCSTR policy, const ChainPolicyCheck *check,
(
check
->
brokenStatus
&&
broken
(
policyStatus
.
dwError
==
check
->
brokenStatus
->
dwError
)),
"%s[%d]: expected %08x, got %08x
\n
"
,
HIWORD
(
policy
)
?
policy
:
num_to_str
(
LOWORD
(
policy
))
,
IS_INTOID
(
policy
)
?
num_to_str
(
LOWORD
(
policy
))
:
policy
,
testIndex
,
check
->
status
.
dwError
,
policyStatus
.
dwError
);
if
(
policyStatus
.
dwError
!=
check
->
status
.
dwError
)
{
skip
(
"%s[%d]: error %08x doesn't match expected %08x, not checking indexes
\n
"
,
HIWORD
(
policy
)
?
policy
:
num_to_str
(
LOWORD
(
policy
))
,
IS_INTOID
(
policy
)
?
num_to_str
(
LOWORD
(
policy
))
:
policy
,
testIndex
,
policyStatus
.
dwError
,
check
->
status
.
dwError
);
pCertFreeCertificateChain
(
chain
);
return
;
...
...
@@ -3930,7 +3932,7 @@ static void checkChainPolicyStatus(LPCSTR policy, const ChainPolicyCheck *check,
(
check
->
brokenStatus
&&
broken
(
policyStatus
.
lChainIndex
==
check
->
brokenStatus
->
lChainIndex
)),
"%s[%d]: expected %d, got %d
\n
"
,
HIWORD
(
policy
)
?
policy
:
num_to_str
(
LOWORD
(
policy
))
,
IS_INTOID
(
policy
)
?
num_to_str
(
LOWORD
(
policy
))
:
policy
,
testIndex
,
check
->
status
.
lChainIndex
,
policyStatus
.
lChainIndex
);
else
...
...
@@ -3938,7 +3940,7 @@ static void checkChainPolicyStatus(LPCSTR policy, const ChainPolicyCheck *check,
(
check
->
brokenStatus
&&
broken
(
policyStatus
.
lChainIndex
==
check
->
brokenStatus
->
lChainIndex
)),
"%s[%d]: expected %d, got %d
\n
"
,
HIWORD
(
policy
)
?
policy
:
num_to_str
(
LOWORD
(
policy
))
,
IS_INTOID
(
policy
)
?
num_to_str
(
LOWORD
(
policy
))
:
policy
,
testIndex
,
check
->
status
.
lChainIndex
,
policyStatus
.
lChainIndex
);
if
(
check
->
todo
&
TODO_ELEMENTS
)
...
...
@@ -3947,7 +3949,7 @@ static void checkChainPolicyStatus(LPCSTR policy, const ChainPolicyCheck *check,
(
check
->
brokenStatus
&&
broken
(
policyStatus
.
lElementIndex
==
check
->
brokenStatus
->
lElementIndex
)),
"%s[%d]: expected %d, got %d
\n
"
,
HIWORD
(
policy
)
?
policy
:
num_to_str
(
LOWORD
(
policy
))
,
IS_INTOID
(
policy
)
?
num_to_str
(
LOWORD
(
policy
))
:
policy
,
testIndex
,
check
->
status
.
lElementIndex
,
policyStatus
.
lElementIndex
);
else
...
...
@@ -3955,7 +3957,7 @@ static void checkChainPolicyStatus(LPCSTR policy, const ChainPolicyCheck *check,
(
check
->
brokenStatus
&&
broken
(
policyStatus
.
lElementIndex
==
check
->
brokenStatus
->
lElementIndex
)),
"%s[%d]: expected %d, got %d
\n
"
,
HIWORD
(
policy
)
?
policy
:
num_to_str
(
LOWORD
(
policy
))
,
IS_INTOID
(
policy
)
?
num_to_str
(
LOWORD
(
policy
))
:
policy
,
testIndex
,
check
->
status
.
lElementIndex
,
policyStatus
.
lElementIndex
);
}
...
...
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