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
c77defed
Commit
c77defed
authored
Jul 18, 2018
by
Michael Stefaniuc
Committed by
Alexandre Julliard
Jul 19, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wintrust: Use the ARRAY_SIZE() macro.
Signed-off-by:
Michael Stefaniuc
<
mstefani@winehq.org
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
6c6af641
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
34 additions
and
45 deletions
+34
-45
asn.c
dlls/wintrust/asn.c
+32
-41
softpub.c
dlls/wintrust/softpub.c
+2
-4
No files found.
dlls/wintrust/asn.c
View file @
c77defed
...
@@ -673,8 +673,8 @@ static BOOL WINAPI CRYPT_AsnEncodeAlgorithmIdWithNullParams(
...
@@ -673,8 +673,8 @@ static BOOL WINAPI CRYPT_AsnEncodeAlgorithmIdWithNullParams(
items
[
1
].
pvStructInfo
=
&
algo
->
Parameters
;
items
[
1
].
pvStructInfo
=
&
algo
->
Parameters
;
else
else
items
[
1
].
pvStructInfo
=
&
nullBlob
;
items
[
1
].
pvStructInfo
=
&
nullBlob
;
ret
=
CRYPT_AsnEncodeSequence
(
dwCertEncodingType
,
items
,
ret
=
CRYPT_AsnEncodeSequence
(
dwCertEncodingType
,
items
,
ARRAY_SIZE
(
items
),
sizeof
(
items
)
/
sizeof
(
items
[
0
]),
pbEncoded
,
pcbEncoded
);
pbEncoded
,
pcbEncoded
);
return
ret
;
return
ret
;
}
}
...
@@ -688,8 +688,8 @@ static BOOL WINAPI CRYPT_AsnEncodeAttributeTypeValue(DWORD dwCertEncodingType,
...
@@ -688,8 +688,8 @@ static BOOL WINAPI CRYPT_AsnEncodeAttributeTypeValue(DWORD dwCertEncodingType,
{
&
typeValue
->
Value
,
CRYPT_CopyEncodedBlob
,
0
},
{
&
typeValue
->
Value
,
CRYPT_CopyEncodedBlob
,
0
},
};
};
return
CRYPT_AsnEncodeSequence
(
X509_ASN_ENCODING
,
return
CRYPT_AsnEncodeSequence
(
X509_ASN_ENCODING
,
items
,
ARRAY_SIZE
(
items
),
items
,
sizeof
(
items
)
/
sizeof
(
items
[
0
]),
pbEncoded
,
pcbEncoded
);
pbEncoded
,
pcbEncoded
);
}
}
struct
SPCDigest
struct
SPCDigest
...
@@ -708,8 +708,8 @@ static BOOL WINAPI CRYPT_AsnEncodeSPCDigest(DWORD dwCertEncodingType,
...
@@ -708,8 +708,8 @@ static BOOL WINAPI CRYPT_AsnEncodeSPCDigest(DWORD dwCertEncodingType,
{
&
digest
->
Digest
,
CRYPT_CopyEncodedBlob
,
0
},
{
&
digest
->
Digest
,
CRYPT_CopyEncodedBlob
,
0
},
};
};
return
CRYPT_AsnEncodeSequence
(
X509_ASN_ENCODING
,
return
CRYPT_AsnEncodeSequence
(
X509_ASN_ENCODING
,
items
,
ARRAY_SIZE
(
items
),
items
,
sizeof
(
items
)
/
sizeof
(
items
[
0
]),
pbEncoded
,
pcbEncoded
);
pbEncoded
,
pcbEncoded
);
}
}
BOOL
WINAPI
WVTAsn1SpcIndirectDataContentEncode
(
DWORD
dwCertEncodingType
,
BOOL
WINAPI
WVTAsn1SpcIndirectDataContentEncode
(
DWORD
dwCertEncodingType
,
...
@@ -729,8 +729,8 @@ BOOL WINAPI WVTAsn1SpcIndirectDataContentEncode(DWORD dwCertEncodingType,
...
@@ -729,8 +729,8 @@ BOOL WINAPI WVTAsn1SpcIndirectDataContentEncode(DWORD dwCertEncodingType,
{
&
data
->
DigestAlgorithm
,
CRYPT_AsnEncodeSPCDigest
,
0
},
{
&
data
->
DigestAlgorithm
,
CRYPT_AsnEncodeSPCDigest
,
0
},
};
};
ret
=
CRYPT_AsnEncodeSequence
(
X509_ASN_ENCODING
,
ret
=
CRYPT_AsnEncodeSequence
(
X509_ASN_ENCODING
,
items
,
ARRAY_SIZE
(
items
),
items
,
sizeof
(
items
)
/
sizeof
(
items
[
0
]),
pbEncoded
,
pcbEncoded
);
pbEncoded
,
pcbEncoded
);
}
}
__EXCEPT_PAGE_FAULT
__EXCEPT_PAGE_FAULT
{
{
...
@@ -996,8 +996,8 @@ BOOL WINAPI WVTAsn1CatMemberInfoEncode(DWORD dwCertEncodingType,
...
@@ -996,8 +996,8 @@ BOOL WINAPI WVTAsn1CatMemberInfoEncode(DWORD dwCertEncodingType,
{
&
info
->
dwCertVersion
,
CRYPT_AsnEncodeInt
,
0
},
{
&
info
->
dwCertVersion
,
CRYPT_AsnEncodeInt
,
0
},
};
};
ret
=
CRYPT_AsnEncodeSequence
(
X509_ASN_ENCODING
,
ret
=
CRYPT_AsnEncodeSequence
(
X509_ASN_ENCODING
,
items
,
ARRAY_SIZE
(
items
),
items
,
sizeof
(
items
)
/
sizeof
(
items
[
0
]),
pbEncoded
,
pcbEncoded
);
pbEncoded
,
pcbEncoded
);
}
}
__EXCEPT_PAGE_FAULT
__EXCEPT_PAGE_FAULT
{
{
...
@@ -1025,8 +1025,8 @@ BOOL WINAPI WVTAsn1CatNameValueEncode(DWORD dwCertEncodingType,
...
@@ -1025,8 +1025,8 @@ BOOL WINAPI WVTAsn1CatNameValueEncode(DWORD dwCertEncodingType,
{
&
value
->
Value
,
CRYPT_AsnEncodeOctets
,
0
},
{
&
value
->
Value
,
CRYPT_AsnEncodeOctets
,
0
},
};
};
ret
=
CRYPT_AsnEncodeSequence
(
X509_ASN_ENCODING
,
ret
=
CRYPT_AsnEncodeSequence
(
X509_ASN_ENCODING
,
items
,
ARRAY_SIZE
(
items
),
items
,
sizeof
(
items
)
/
sizeof
(
items
[
0
]),
pbEncoded
,
pcbEncoded
);
pbEncoded
,
pcbEncoded
);
}
}
__EXCEPT_PAGE_FAULT
__EXCEPT_PAGE_FAULT
{
{
...
@@ -1084,8 +1084,8 @@ BOOL WINAPI WVTAsn1SpcFinancialCriteriaInfoEncode(DWORD dwCertEncodingType,
...
@@ -1084,8 +1084,8 @@ BOOL WINAPI WVTAsn1SpcFinancialCriteriaInfoEncode(DWORD dwCertEncodingType,
{
&
criteria
->
fMeetsCriteria
,
CRYPT_AsnEncodeBool
,
0
},
{
&
criteria
->
fMeetsCriteria
,
CRYPT_AsnEncodeBool
,
0
},
};
};
ret
=
CRYPT_AsnEncodeSequence
(
X509_ASN_ENCODING
,
ret
=
CRYPT_AsnEncodeSequence
(
X509_ASN_ENCODING
,
items
,
ARRAY_SIZE
(
items
),
items
,
sizeof
(
items
)
/
sizeof
(
items
[
0
]),
pbEncoded
,
pcbEncoded
);
pbEncoded
,
pcbEncoded
);
}
}
__EXCEPT_PAGE_FAULT
__EXCEPT_PAGE_FAULT
{
{
...
@@ -1808,9 +1808,8 @@ BOOL WINAPI WVTAsn1SpcPeImageDataDecode(DWORD dwCertEncodingType,
...
@@ -1808,9 +1808,8 @@ BOOL WINAPI WVTAsn1SpcPeImageDataDecode(DWORD dwCertEncodingType,
offsetof
(
SPC_PE_IMAGE_DATA
,
pFile
),
0
},
offsetof
(
SPC_PE_IMAGE_DATA
,
pFile
),
0
},
};
};
ret
=
CRYPT_AsnDecodeSequence
(
dwCertEncodingType
,
items
,
ret
=
CRYPT_AsnDecodeSequence
(
dwCertEncodingType
,
items
,
ARRAY_SIZE
(
items
),
sizeof
(
items
)
/
sizeof
(
items
[
0
]),
pbEncoded
,
cbEncoded
,
dwFlags
,
pbEncoded
,
cbEncoded
,
dwFlags
,
pvStructInfo
,
pcbStructInfo
,
NULL
);
pvStructInfo
,
pcbStructInfo
,
NULL
);
}
}
__EXCEPT_PAGE_FAULT
__EXCEPT_PAGE_FAULT
{
{
...
@@ -1995,9 +1994,8 @@ static BOOL WINAPI CRYPT_AsnDecodeAttributeTypeValue(DWORD dwCertEncodingType,
...
@@ -1995,9 +1994,8 @@ static BOOL WINAPI CRYPT_AsnDecodeAttributeTypeValue(DWORD dwCertEncodingType,
TRACE
(
"%p, %d, %08x, %p, %d
\n
"
,
pbEncoded
,
cbEncoded
,
dwFlags
,
TRACE
(
"%p, %d, %08x, %p, %d
\n
"
,
pbEncoded
,
cbEncoded
,
dwFlags
,
pvStructInfo
,
*
pcbStructInfo
);
pvStructInfo
,
*
pcbStructInfo
);
return
CRYPT_AsnDecodeSequence
(
dwCertEncodingType
,
items
,
return
CRYPT_AsnDecodeSequence
(
dwCertEncodingType
,
items
,
ARRAY_SIZE
(
items
),
sizeof
(
items
)
/
sizeof
(
items
[
0
]),
pbEncoded
,
cbEncoded
,
dwFlags
,
pbEncoded
,
cbEncoded
,
dwFlags
,
pvStructInfo
,
pcbStructInfo
,
pvStructInfo
,
pcbStructInfo
,
typeValue
?
typeValue
->
pszObjId
:
NULL
);
typeValue
?
typeValue
->
pszObjId
:
NULL
);
}
}
...
@@ -2019,9 +2017,8 @@ static BOOL WINAPI CRYPT_AsnDecodeAlgorithmId(DWORD dwCertEncodingType,
...
@@ -2019,9 +2017,8 @@ static BOOL WINAPI CRYPT_AsnDecodeAlgorithmId(DWORD dwCertEncodingType,
TRACE
(
"%p, %d, %08x, %p, %d
\n
"
,
pbEncoded
,
cbEncoded
,
dwFlags
,
TRACE
(
"%p, %d, %08x, %p, %d
\n
"
,
pbEncoded
,
cbEncoded
,
dwFlags
,
pvStructInfo
,
*
pcbStructInfo
);
pvStructInfo
,
*
pcbStructInfo
);
ret
=
CRYPT_AsnDecodeSequence
(
dwCertEncodingType
,
items
,
ret
=
CRYPT_AsnDecodeSequence
(
dwCertEncodingType
,
items
,
ARRAY_SIZE
(
items
),
sizeof
(
items
)
/
sizeof
(
items
[
0
]),
pbEncoded
,
cbEncoded
,
dwFlags
,
pbEncoded
,
cbEncoded
,
dwFlags
,
pvStructInfo
,
pcbStructInfo
,
algo
?
algo
->
pszObjId
:
NULL
);
pvStructInfo
,
pcbStructInfo
,
algo
?
algo
->
pszObjId
:
NULL
);
if
(
ret
&&
pvStructInfo
)
if
(
ret
&&
pvStructInfo
)
{
{
TRACE
(
"pszObjId is %p (%s)
\n
"
,
algo
->
pszObjId
,
TRACE
(
"pszObjId is %p (%s)
\n
"
,
algo
->
pszObjId
,
...
@@ -2048,9 +2045,8 @@ static BOOL WINAPI CRYPT_AsnDecodeSPCDigest(DWORD dwCertEncodingType,
...
@@ -2048,9 +2045,8 @@ static BOOL WINAPI CRYPT_AsnDecodeSPCDigest(DWORD dwCertEncodingType,
TRACE
(
"%p, %d, %08x, %p, %d
\n
"
,
pbEncoded
,
cbEncoded
,
dwFlags
,
TRACE
(
"%p, %d, %08x, %p, %d
\n
"
,
pbEncoded
,
cbEncoded
,
dwFlags
,
pvStructInfo
,
*
pcbStructInfo
);
pvStructInfo
,
*
pcbStructInfo
);
return
CRYPT_AsnDecodeSequence
(
dwCertEncodingType
,
items
,
return
CRYPT_AsnDecodeSequence
(
dwCertEncodingType
,
items
,
ARRAY_SIZE
(
items
),
sizeof
(
items
)
/
sizeof
(
items
[
0
]),
pbEncoded
,
cbEncoded
,
dwFlags
,
pbEncoded
,
cbEncoded
,
dwFlags
,
pvStructInfo
,
pcbStructInfo
,
pvStructInfo
,
pcbStructInfo
,
digest
?
digest
->
DigestAlgorithm
.
pszObjId
:
NULL
);
digest
?
digest
->
DigestAlgorithm
.
pszObjId
:
NULL
);
}
}
...
@@ -2076,9 +2072,8 @@ BOOL WINAPI WVTAsn1SpcIndirectDataContentDecode(DWORD dwCertEncodingType,
...
@@ -2076,9 +2072,8 @@ BOOL WINAPI WVTAsn1SpcIndirectDataContentDecode(DWORD dwCertEncodingType,
offsetof
(
SPC_INDIRECT_DATA_CONTENT
,
DigestAlgorithm
.
pszObjId
),
0
},
offsetof
(
SPC_INDIRECT_DATA_CONTENT
,
DigestAlgorithm
.
pszObjId
),
0
},
};
};
ret
=
CRYPT_AsnDecodeSequence
(
dwCertEncodingType
,
items
,
ret
=
CRYPT_AsnDecodeSequence
(
dwCertEncodingType
,
items
,
ARRAY_SIZE
(
items
),
sizeof
(
items
)
/
sizeof
(
items
[
0
]),
pbEncoded
,
cbEncoded
,
dwFlags
,
pbEncoded
,
cbEncoded
,
dwFlags
,
pvStructInfo
,
pcbStructInfo
,
NULL
);
pvStructInfo
,
pcbStructInfo
,
NULL
);
}
}
__EXCEPT_PAGE_FAULT
__EXCEPT_PAGE_FAULT
{
{
...
@@ -2174,9 +2169,8 @@ BOOL WINAPI WVTAsn1SpcSpOpusInfoDecode(DWORD dwCertEncodingType,
...
@@ -2174,9 +2169,8 @@ BOOL WINAPI WVTAsn1SpcSpOpusInfoDecode(DWORD dwCertEncodingType,
offsetof
(
SPC_SP_OPUS_INFO
,
pPublisherInfo
),
0
},
offsetof
(
SPC_SP_OPUS_INFO
,
pPublisherInfo
),
0
},
};
};
ret
=
CRYPT_AsnDecodeSequence
(
dwCertEncodingType
,
items
,
ret
=
CRYPT_AsnDecodeSequence
(
dwCertEncodingType
,
items
,
ARRAY_SIZE
(
items
),
sizeof
(
items
)
/
sizeof
(
items
[
0
]),
pbEncoded
,
cbEncoded
,
dwFlags
,
pbEncoded
,
cbEncoded
,
dwFlags
,
pvStructInfo
,
pcbStructInfo
,
NULL
);
pvStructInfo
,
pcbStructInfo
,
NULL
);
}
}
__EXCEPT_PAGE_FAULT
__EXCEPT_PAGE_FAULT
{
{
...
@@ -2256,9 +2250,8 @@ BOOL WINAPI WVTAsn1CatMemberInfoDecode(DWORD dwCertEncodingType,
...
@@ -2256,9 +2250,8 @@ BOOL WINAPI WVTAsn1CatMemberInfoDecode(DWORD dwCertEncodingType,
FALSE
,
FALSE
,
0
,
0
},
FALSE
,
FALSE
,
0
,
0
},
};
};
ret
=
CRYPT_AsnDecodeSequence
(
dwCertEncodingType
,
items
,
ret
=
CRYPT_AsnDecodeSequence
(
dwCertEncodingType
,
items
,
ARRAY_SIZE
(
items
),
sizeof
(
items
)
/
sizeof
(
items
[
0
]),
pbEncoded
,
cbEncoded
,
dwFlags
,
pbEncoded
,
cbEncoded
,
dwFlags
,
pvStructInfo
,
pcbStructInfo
,
NULL
);
pvStructInfo
,
pcbStructInfo
,
NULL
);
}
}
__EXCEPT_PAGE_FAULT
__EXCEPT_PAGE_FAULT
{
{
...
@@ -2292,9 +2285,8 @@ BOOL WINAPI WVTAsn1CatNameValueDecode(DWORD dwCertEncodingType,
...
@@ -2292,9 +2285,8 @@ BOOL WINAPI WVTAsn1CatNameValueDecode(DWORD dwCertEncodingType,
offsetof
(
CAT_NAMEVALUE
,
Value
.
pbData
),
0
},
offsetof
(
CAT_NAMEVALUE
,
Value
.
pbData
),
0
},
};
};
ret
=
CRYPT_AsnDecodeSequence
(
dwCertEncodingType
,
items
,
ret
=
CRYPT_AsnDecodeSequence
(
dwCertEncodingType
,
items
,
ARRAY_SIZE
(
items
),
sizeof
(
items
)
/
sizeof
(
items
[
0
]),
pbEncoded
,
cbEncoded
,
dwFlags
,
pbEncoded
,
cbEncoded
,
dwFlags
,
pvStructInfo
,
pcbStructInfo
,
NULL
);
pvStructInfo
,
pcbStructInfo
,
NULL
);
}
}
__EXCEPT_PAGE_FAULT
__EXCEPT_PAGE_FAULT
{
{
...
@@ -2367,9 +2359,8 @@ BOOL WINAPI WVTAsn1SpcFinancialCriteriaInfoDecode(DWORD dwCertEncodingType,
...
@@ -2367,9 +2359,8 @@ BOOL WINAPI WVTAsn1SpcFinancialCriteriaInfoDecode(DWORD dwCertEncodingType,
fMeetsCriteria
),
FALSE
,
FALSE
,
0
,
0
},
fMeetsCriteria
),
FALSE
,
FALSE
,
0
,
0
},
};
};
ret
=
CRYPT_AsnDecodeSequence
(
dwCertEncodingType
,
items
,
ret
=
CRYPT_AsnDecodeSequence
(
dwCertEncodingType
,
items
,
ARRAY_SIZE
(
items
),
sizeof
(
items
)
/
sizeof
(
items
[
0
]),
pbEncoded
,
cbEncoded
,
dwFlags
,
pbEncoded
,
cbEncoded
,
dwFlags
,
pvStructInfo
,
pcbStructInfo
,
NULL
);
pvStructInfo
,
pcbStructInfo
,
NULL
);
}
}
__EXCEPT_PAGE_FAULT
__EXCEPT_PAGE_FAULT
{
{
...
...
dlls/wintrust/softpub.c
View file @
c77defed
...
@@ -522,11 +522,9 @@ static LPCSTR filetime_to_str(const FILETIME *time)
...
@@ -522,11 +522,9 @@ static LPCSTR filetime_to_str(const FILETIME *time)
if
(
!
time
)
return
NULL
;
if
(
!
time
)
return
NULL
;
GetLocaleInfoA
(
LOCALE_SYSTEM_DEFAULT
,
LOCALE_SSHORTDATE
,
dateFmt
,
GetLocaleInfoA
(
LOCALE_SYSTEM_DEFAULT
,
LOCALE_SSHORTDATE
,
dateFmt
,
ARRAY_SIZE
(
dateFmt
));
sizeof
(
dateFmt
)
/
sizeof
(
dateFmt
[
0
]));
FileTimeToSystemTime
(
time
,
&
sysTime
);
FileTimeToSystemTime
(
time
,
&
sysTime
);
GetDateFormatA
(
LOCALE_SYSTEM_DEFAULT
,
0
,
&
sysTime
,
dateFmt
,
date
,
GetDateFormatA
(
LOCALE_SYSTEM_DEFAULT
,
0
,
&
sysTime
,
dateFmt
,
date
,
ARRAY_SIZE
(
date
));
sizeof
(
date
)
/
sizeof
(
date
[
0
]));
return
date
;
return
date
;
}
}
...
...
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