Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
2e0aa941
Commit
2e0aa941
authored
Jul 12, 2023
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cryptnet: Use nameless unions/structs.
parent
a5ab9465
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
16 deletions
+15
-16
cryptnet_main.c
dlls/cryptnet/cryptnet_main.c
+15
-16
No files found.
dlls/cryptnet/cryptnet_main.c
View file @
2e0aa941
...
@@ -18,7 +18,6 @@
...
@@ -18,7 +18,6 @@
*
*
*/
*/
#define NONAMELESSUNION
#define CERT_REVOCATION_PARA_HAS_EXTRA_FIELDS
#define CERT_REVOCATION_PARA_HAS_EXTRA_FIELDS
#include <share.h>
#include <share.h>
...
@@ -136,11 +135,11 @@ static BOOL WINAPI CRYPT_GetUrlFromCertificateIssuer(LPCSTR pszUrlOid,
...
@@ -136,11 +135,11 @@ static BOOL WINAPI CRYPT_GetUrlFromCertificateIssuer(LPCSTR pszUrlOid,
if
(
aia
->
rgAccDescr
[
i
].
AccessLocation
.
dwAltNameChoice
==
if
(
aia
->
rgAccDescr
[
i
].
AccessLocation
.
dwAltNameChoice
==
CERT_ALT_NAME_URL
)
CERT_ALT_NAME_URL
)
{
{
if
(
aia
->
rgAccDescr
[
i
].
AccessLocation
.
u
.
pwszURL
)
if
(
aia
->
rgAccDescr
[
i
].
AccessLocation
.
pwszURL
)
{
{
cUrl
++
;
cUrl
++
;
bytesNeeded
+=
sizeof
(
LPWSTR
)
+
bytesNeeded
+=
sizeof
(
LPWSTR
)
+
(
lstrlenW
(
aia
->
rgAccDescr
[
i
].
AccessLocation
.
u
.
(
lstrlenW
(
aia
->
rgAccDescr
[
i
].
AccessLocation
.
pwszURL
)
+
1
)
*
sizeof
(
WCHAR
);
pwszURL
)
+
1
)
*
sizeof
(
WCHAR
);
}
}
}
}
...
@@ -178,10 +177,10 @@ static BOOL WINAPI CRYPT_GetUrlFromCertificateIssuer(LPCSTR pszUrlOid,
...
@@ -178,10 +177,10 @@ static BOOL WINAPI CRYPT_GetUrlFromCertificateIssuer(LPCSTR pszUrlOid,
if
(
aia
->
rgAccDescr
[
i
].
AccessLocation
.
dwAltNameChoice
if
(
aia
->
rgAccDescr
[
i
].
AccessLocation
.
dwAltNameChoice
==
CERT_ALT_NAME_URL
)
==
CERT_ALT_NAME_URL
)
{
{
if
(
aia
->
rgAccDescr
[
i
].
AccessLocation
.
u
.
pwszURL
)
if
(
aia
->
rgAccDescr
[
i
].
AccessLocation
.
pwszURL
)
{
{
lstrcpyW
(
nextUrl
,
lstrcpyW
(
nextUrl
,
aia
->
rgAccDescr
[
i
].
AccessLocation
.
u
.
pwszURL
);
aia
->
rgAccDescr
[
i
].
AccessLocation
.
pwszURL
);
pUrlArray
->
rgwszUrl
[
pUrlArray
->
cUrl
++
]
=
pUrlArray
->
rgwszUrl
[
pUrlArray
->
cUrl
++
]
=
nextUrl
;
nextUrl
;
nextUrl
+=
(
lstrlenW
(
nextUrl
)
+
1
);
nextUrl
+=
(
lstrlenW
(
nextUrl
)
+
1
);
...
@@ -237,17 +236,17 @@ static BOOL CRYPT_GetUrlFromCRLDistPointsExt(const CRYPT_DATA_BLOB *value,
...
@@ -237,17 +236,17 @@ static BOOL CRYPT_GetUrlFromCRLDistPointsExt(const CRYPT_DATA_BLOB *value,
{
{
DWORD
j
;
DWORD
j
;
CERT_ALT_NAME_INFO
*
name
=
CERT_ALT_NAME_INFO
*
name
=
&
info
->
rgDistPoint
[
i
].
DistPointName
.
u
.
FullName
;
&
info
->
rgDistPoint
[
i
].
DistPointName
.
FullName
;
for
(
j
=
0
;
j
<
name
->
cAltEntry
;
j
++
)
for
(
j
=
0
;
j
<
name
->
cAltEntry
;
j
++
)
if
(
name
->
rgAltEntry
[
j
].
dwAltNameChoice
==
if
(
name
->
rgAltEntry
[
j
].
dwAltNameChoice
==
CERT_ALT_NAME_URL
)
CERT_ALT_NAME_URL
)
{
{
if
(
name
->
rgAltEntry
[
j
].
u
.
pwszURL
)
if
(
name
->
rgAltEntry
[
j
].
pwszURL
)
{
{
cUrl
++
;
cUrl
++
;
bytesNeeded
+=
sizeof
(
LPWSTR
)
+
bytesNeeded
+=
sizeof
(
LPWSTR
)
+
(
lstrlenW
(
name
->
rgAltEntry
[
j
].
u
.
pwszURL
)
+
1
)
(
lstrlenW
(
name
->
rgAltEntry
[
j
].
pwszURL
)
+
1
)
*
sizeof
(
WCHAR
);
*
sizeof
(
WCHAR
);
}
}
}
}
...
@@ -281,20 +280,20 @@ static BOOL CRYPT_GetUrlFromCRLDistPointsExt(const CRYPT_DATA_BLOB *value,
...
@@ -281,20 +280,20 @@ static BOOL CRYPT_GetUrlFromCRLDistPointsExt(const CRYPT_DATA_BLOB *value,
{
{
DWORD
j
;
DWORD
j
;
CERT_ALT_NAME_INFO
*
name
=
CERT_ALT_NAME_INFO
*
name
=
&
info
->
rgDistPoint
[
i
].
DistPointName
.
u
.
FullName
;
&
info
->
rgDistPoint
[
i
].
DistPointName
.
FullName
;
for
(
j
=
0
;
j
<
name
->
cAltEntry
;
j
++
)
for
(
j
=
0
;
j
<
name
->
cAltEntry
;
j
++
)
if
(
name
->
rgAltEntry
[
j
].
dwAltNameChoice
==
if
(
name
->
rgAltEntry
[
j
].
dwAltNameChoice
==
CERT_ALT_NAME_URL
)
CERT_ALT_NAME_URL
)
{
{
if
(
name
->
rgAltEntry
[
j
].
u
.
pwszURL
)
if
(
name
->
rgAltEntry
[
j
].
pwszURL
)
{
{
lstrcpyW
(
nextUrl
,
lstrcpyW
(
nextUrl
,
name
->
rgAltEntry
[
j
].
u
.
pwszURL
);
name
->
rgAltEntry
[
j
].
pwszURL
);
pUrlArray
->
rgwszUrl
[
pUrlArray
->
cUrl
++
]
=
pUrlArray
->
rgwszUrl
[
pUrlArray
->
cUrl
++
]
=
nextUrl
;
nextUrl
;
nextUrl
+=
nextUrl
+=
(
lstrlenW
(
name
->
rgAltEntry
[
j
].
u
.
pwszURL
)
+
1
);
(
lstrlenW
(
name
->
rgAltEntry
[
j
].
pwszURL
)
+
1
);
}
}
}
}
}
}
...
@@ -449,7 +448,7 @@ static BOOL CRYPT_GetObjectFromFile(HANDLE hFile, PCRYPT_BLOB_ARRAY pObject)
...
@@ -449,7 +448,7 @@ static BOOL CRYPT_GetObjectFromFile(HANDLE hFile, PCRYPT_BLOB_ARRAY pObject)
if
((
ret
=
GetFileSizeEx
(
hFile
,
&
size
)))
if
((
ret
=
GetFileSizeEx
(
hFile
,
&
size
)))
{
{
if
(
size
.
u
.
HighPart
)
if
(
size
.
HighPart
)
{
{
WARN
(
"file too big
\n
"
);
WARN
(
"file too big
\n
"
);
SetLastError
(
ERROR_INVALID_DATA
);
SetLastError
(
ERROR_INVALID_DATA
);
...
@@ -459,10 +458,10 @@ static BOOL CRYPT_GetObjectFromFile(HANDLE hFile, PCRYPT_BLOB_ARRAY pObject)
...
@@ -459,10 +458,10 @@ static BOOL CRYPT_GetObjectFromFile(HANDLE hFile, PCRYPT_BLOB_ARRAY pObject)
{
{
CRYPT_DATA_BLOB
blob
;
CRYPT_DATA_BLOB
blob
;
blob
.
pbData
=
CryptMemAlloc
(
size
.
u
.
LowPart
);
blob
.
pbData
=
CryptMemAlloc
(
size
.
LowPart
);
if
(
blob
.
pbData
)
if
(
blob
.
pbData
)
{
{
ret
=
ReadFile
(
hFile
,
blob
.
pbData
,
size
.
u
.
LowPart
,
&
blob
.
cbData
,
ret
=
ReadFile
(
hFile
,
blob
.
pbData
,
size
.
LowPart
,
&
blob
.
cbData
,
NULL
);
NULL
);
if
(
ret
)
if
(
ret
)
{
{
...
@@ -2125,7 +2124,7 @@ static DWORD verify_cert_revocation_from_aia_ext(const CRYPT_DATA_BLOB *value, c
...
@@ -2125,7 +2124,7 @@ static DWORD verify_cert_revocation_from_aia_ext(const CRYPT_DATA_BLOB *value, c
{
{
if
(
aia
->
rgAccDescr
[
i
].
AccessLocation
.
dwAltNameChoice
==
CERT_ALT_NAME_URL
)
if
(
aia
->
rgAccDescr
[
i
].
AccessLocation
.
dwAltNameChoice
==
CERT_ALT_NAME_URL
)
{
{
const
WCHAR
*
url
=
aia
->
rgAccDescr
[
i
].
AccessLocation
.
u
.
pwszURL
;
const
WCHAR
*
url
=
aia
->
rgAccDescr
[
i
].
AccessLocation
.
pwszURL
;
TRACE
(
"OCSP URL = %s
\n
"
,
debugstr_w
(
url
));
TRACE
(
"OCSP URL = %s
\n
"
,
debugstr_w
(
url
));
error
=
verify_cert_revocation_with_ocsp
(
cert
,
url
,
pRevPara
,
next_update
);
error
=
verify_cert_revocation_with_ocsp
(
cert
,
url
,
pRevPara
,
next_update
);
}
}
...
...
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