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
07794d58
Commit
07794d58
authored
Oct 23, 2007
by
Juan Lang
Committed by
Alexandre Julliard
Oct 24, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cryptnet: Implement CertDllVerifyRevocation.
parent
45f260e3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
121 additions
and
3 deletions
+121
-3
cryptnet_main.c
dlls/cryptnet/cryptnet_main.c
+121
-3
No files found.
dlls/cryptnet/cryptnet_main.c
View file @
07794d58
...
...
@@ -1326,6 +1326,13 @@ BOOL WINAPI CryptRetrieveObjectByUrlW(LPCWSTR pszURL, LPCSTR pszObjectOid,
return
ret
;
}
typedef
struct
_OLD_CERT_REVOCATION_STATUS
{
DWORD
cbSize
;
DWORD
dwIndex
;
DWORD
dwError
;
DWORD
dwReason
;
}
OLD_CERT_REVOCATION_STATUS
,
*
POLD_CERT_REVOCATION_STATUS
;
/***********************************************************************
* CertDllVerifyRevocation (CRYPTNET.@)
*/
...
...
@@ -1333,7 +1340,118 @@ BOOL WINAPI CertDllVerifyRevocation(DWORD dwEncodingType, DWORD dwRevType,
DWORD
cContext
,
PVOID
rgpvContext
[],
DWORD
dwFlags
,
PCERT_REVOCATION_PARA
pRevPara
,
PCERT_REVOCATION_STATUS
pRevStatus
)
{
FIXME
(
"(%08x, %d, %d, %p, %08x, %p, %p): stub
\n
"
,
dwEncodingType
,
dwRevType
,
cContext
,
rgpvContext
,
dwFlags
,
pRevPara
,
pRevStatus
);
return
FALSE
;
DWORD
error
=
0
,
i
;
BOOL
ret
;
TRACE
(
"(%08x, %d, %d, %p, %08x, %p, %p)
\n
"
,
dwEncodingType
,
dwRevType
,
cContext
,
rgpvContext
,
dwFlags
,
pRevPara
,
pRevStatus
);
if
(
pRevStatus
->
cbSize
!=
sizeof
(
OLD_CERT_REVOCATION_STATUS
)
&&
pRevStatus
->
cbSize
!=
sizeof
(
CERT_REVOCATION_STATUS
))
{
SetLastError
(
E_INVALIDARG
);
return
FALSE
;
}
memset
(
&
pRevStatus
->
dwIndex
,
0
,
pRevStatus
->
cbSize
-
sizeof
(
DWORD
));
if
(
dwRevType
!=
CERT_CONTEXT_REVOCATION_TYPE
)
{
error
=
CRYPT_E_NO_REVOCATION_CHECK
;
ret
=
FALSE
;
}
else
{
ret
=
TRUE
;
for
(
i
=
0
;
ret
&&
i
<
cContext
;
i
++
)
{
DWORD
cbUrlArray
;
ret
=
CryptGetObjectUrl
(
URL_OID_CERTIFICATE_CRL_DIST_POINT
,
rgpvContext
[
i
],
0
,
NULL
,
&
cbUrlArray
,
NULL
,
NULL
,
NULL
);
if
(
!
ret
&&
GetLastError
()
==
CRYPT_E_NOT_FOUND
)
{
error
=
CRYPT_E_NO_REVOCATION_CHECK
;
pRevStatus
->
dwIndex
=
i
;
}
else
if
(
ret
)
{
CRYPT_URL_ARRAY
*
urlArray
=
CryptMemAlloc
(
cbUrlArray
);
if
(
urlArray
)
{
DWORD
j
,
retrievalFlags
=
0
,
startTime
,
endTime
,
timeout
;
ret
=
CryptGetObjectUrl
(
URL_OID_CERTIFICATE_CRL_DIST_POINT
,
rgpvContext
[
i
],
0
,
urlArray
,
&
cbUrlArray
,
NULL
,
NULL
,
NULL
);
if
(
dwFlags
&
CERT_VERIFY_CACHE_ONLY_BASED_REVOCATION
)
retrievalFlags
|=
CRYPT_CACHE_ONLY_RETRIEVAL
;
if
(
dwFlags
&
CERT_VERIFY_REV_ACCUMULATIVE_TIMEOUT_FLAG
&&
pRevPara
->
cbSize
>=
offsetof
(
CERT_REVOCATION_PARA
,
dwUrlRetrievalTimeout
)
+
sizeof
(
DWORD
))
{
startTime
=
GetTickCount
();
endTime
=
startTime
+
pRevPara
->
dwUrlRetrievalTimeout
;
timeout
=
pRevPara
->
dwUrlRetrievalTimeout
;
}
else
endTime
=
timeout
=
0
;
for
(
j
=
0
;
ret
&&
j
<
urlArray
->
cUrl
;
j
++
)
{
PCCRL_CONTEXT
crl
;
ret
=
CryptRetrieveObjectByUrlW
(
urlArray
->
rgwszUrl
[
j
],
CONTEXT_OID_CRL
,
retrievalFlags
,
timeout
,
(
void
**
)
&
crl
,
NULL
,
NULL
,
NULL
,
NULL
);
if
(
ret
)
{
PCRL_ENTRY
entry
=
NULL
;
CertFindCertificateInCRL
(
(
PCCERT_CONTEXT
)
rgpvContext
[
i
],
crl
,
0
,
NULL
,
&
entry
);
if
(
entry
)
{
error
=
CRYPT_E_REVOKED
;
pRevStatus
->
dwIndex
=
i
;
ret
=
FALSE
;
}
else
if
(
timeout
)
{
DWORD
time
=
GetTickCount
();
if
((
int
)(
endTime
-
time
)
<=
0
)
{
error
=
ERROR_TIMEOUT
;
pRevStatus
->
dwIndex
=
i
;
ret
=
FALSE
;
}
else
timeout
=
endTime
-
time
;
}
CertFreeCRLContext
(
crl
);
}
else
error
=
CRYPT_E_REVOCATION_OFFLINE
;
}
CryptMemFree
(
urlArray
);
}
else
{
error
=
ERROR_OUTOFMEMORY
;
pRevStatus
->
dwIndex
=
i
;
ret
=
FALSE
;
}
}
else
pRevStatus
->
dwIndex
=
i
;
}
}
if
(
!
ret
)
{
SetLastError
(
error
);
pRevStatus
->
dwError
=
error
;
}
TRACE
(
"returning %d (%08x)
\n
"
,
ret
,
error
);
return
ret
;
}
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