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
f94d49dc
Commit
f94d49dc
authored
May 25, 2006
by
Juan Lang
Committed by
Alexandre Julliard
May 26, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
crypt32: Implement CertSerializeCRLStoreElement.
parent
44c3d328
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
55 additions
and
35 deletions
+55
-35
crypt32.spec
dlls/crypt32/crypt32.spec
+1
-1
crypt32_private.h
dlls/crypt32/crypt32_private.h
+2
-0
serialize.c
dlls/crypt32/serialize.c
+42
-34
store.c
dlls/crypt32/store.c
+10
-0
No files found.
dlls/crypt32/crypt32.spec
View file @
f94d49dc
...
...
@@ -30,7 +30,7 @@
@ stdcall CertDuplicateStore(ptr)
@ stdcall CertEnumCRLContextProperties(ptr long)
@ stdcall CertEnumCRLsInStore(ptr ptr)
@ st
ub CertEnumCTLContextProperties
@ st
dcall CertEnumCTLContextProperties(ptr long)
@ stdcall CertEnumCTLsInStore(ptr ptr)
@ stdcall CertEnumCertificateContextProperties(ptr long)
@ stdcall CertEnumCertificatesInStore(long ptr)
...
...
dlls/crypt32/crypt32_private.h
View file @
f94d49dc
...
...
@@ -56,6 +56,7 @@ typedef BOOL (WINAPI *AddEncodedContextToStoreFunc)(HCERTSTORE hCertStore,
typedef
const
void
*
(
WINAPI
*
DuplicateContextFunc
)(
const
void
*
context
);
typedef
const
void
*
(
WINAPI
*
EnumContextsInStoreFunc
)(
HCERTSTORE
hCertStore
,
const
void
*
pPrevContext
);
typedef
DWORD
(
WINAPI
*
EnumPropertiesFunc
)(
const
void
*
context
,
DWORD
dwPropId
);
typedef
BOOL
(
WINAPI
*
GetContextPropertyFunc
)(
const
void
*
context
,
DWORD
dwPropID
,
void
*
pvData
,
DWORD
*
pcbData
);
typedef
BOOL
(
WINAPI
*
SetContextPropertyFunc
)(
const
void
*
context
,
...
...
@@ -73,6 +74,7 @@ typedef struct _WINE_CONTEXT_INTERFACE
AddEncodedContextToStoreFunc
addEncodedToStore
;
DuplicateContextFunc
duplicate
;
EnumContextsInStoreFunc
enumContextsInStore
;
EnumPropertiesFunc
enumProps
;
GetContextPropertyFunc
getProp
;
SetContextPropertyFunc
setProp
;
SerializeElementFunc
serialize
;
...
...
dlls/crypt32/serialize.c
View file @
f94d49dc
...
...
@@ -36,45 +36,29 @@ typedef struct _WINE_CERT_PROP_HEADER
DWORD
cb
;
}
WINE_CERT_PROP_HEADER
,
*
PWINE_CERT_PROP_HEADER
;
BOOL
WINAPI
CertSerializeCRLStoreElement
(
PCCRL_CONTEXT
pCrlContext
,
DWORD
dwFlags
,
BYTE
*
pbElement
,
DWORD
*
pcbElement
)
{
FIXME
(
"(%p, %08lx, %p, %p): stub
\n
"
,
pCrlContext
,
dwFlags
,
pbElement
,
pcbElement
);
return
FALSE
;
}
BOOL
WINAPI
CertSerializeCTLStoreElement
(
PCCTL_CONTEXT
pCtlContext
,
DWORD
dwFlags
,
BYTE
*
pbElement
,
DWORD
*
pcbElement
)
{
FIXME
(
"(%p, %08lx, %p, %p): stub
\n
"
,
pCtlContext
,
dwFlags
,
pbElement
,
pcbElement
);
return
FALSE
;
}
BOOL
WINAPI
CertSerializeCertificateStoreElement
(
PCCERT_CONTEXT
pCertContext
,
DWORD
dwFlags
,
BYTE
*
pbElement
,
DWORD
*
pcbElement
)
static
BOOL
CRYPT_SerializeStoreElement
(
const
void
*
context
,
const
BYTE
*
encodedContext
,
DWORD
cbEncodedContext
,
DWORD
contextPropID
,
PCWINE_CONTEXT_INTERFACE
contextInterface
,
DWORD
dwFlags
,
BYTE
*
pbElement
,
DWORD
*
pcbElement
)
{
BOOL
ret
;
TRACE
(
"(%p, %
08lx, %p, %p)
\n
"
,
pCertContext
,
dwFlags
,
pbElement
,
pcbElement
);
TRACE
(
"(%p, %
p, %08lx, %p, %p)
\n
"
,
context
,
contextInterface
,
dwFlags
,
p
bElement
,
p
cbElement
);
if
(
pCertC
ontext
)
if
(
c
ontext
)
{
DWORD
bytesNeeded
=
sizeof
(
WINE_CERT_PROP_HEADER
)
+
pCertContext
->
cbCertEncoded
;
DWORD
bytesNeeded
=
sizeof
(
WINE_CERT_PROP_HEADER
)
+
cbEncodedContext
;
DWORD
prop
=
0
;
ret
=
TRUE
;
do
{
prop
=
CertEnumCertificateContextProperties
(
pCertC
ontext
,
prop
);
prop
=
contextInterface
->
enumProps
(
c
ontext
,
prop
);
if
(
prop
)
{
DWORD
propSize
=
0
;
ret
=
CertGetCertificateContextProperty
(
pCertContext
,
prop
,
NULL
,
&
propSize
);
ret
=
contextInterface
->
getProp
(
context
,
prop
,
NULL
,
&
propSize
);
if
(
ret
)
bytesNeeded
+=
sizeof
(
WINE_CERT_PROP_HEADER
)
+
propSize
;
}
...
...
@@ -99,13 +83,13 @@ BOOL WINAPI CertSerializeCertificateStoreElement(PCCERT_CONTEXT pCertContext,
prop
=
0
;
do
{
prop
=
CertEnumCertificateContextProperties
(
pCertC
ontext
,
prop
);
prop
=
contextInterface
->
enumProps
(
c
ontext
,
prop
);
if
(
prop
)
{
DWORD
propSize
=
0
;
ret
=
CertGetCertificateContextProperty
(
pCertContext
,
prop
,
NULL
,
&
propSize
);
ret
=
contextInterface
->
getProp
(
context
,
prop
,
NULL
,
&
propSize
);
if
(
ret
)
{
if
(
bufSize
<
propSize
)
...
...
@@ -118,8 +102,8 @@ BOOL WINAPI CertSerializeCertificateStoreElement(PCCERT_CONTEXT pCertContext,
}
if
(
buf
)
{
ret
=
CertGetCertificateContextProperty
(
pCertContext
,
prop
,
buf
,
&
propSize
);
ret
=
contextInterface
->
getProp
(
context
,
prop
,
buf
,
&
propSize
);
if
(
ret
)
{
hdr
=
(
PWINE_CERT_PROP_HEADER
)
pbElement
;
...
...
@@ -142,11 +126,11 @@ BOOL WINAPI CertSerializeCertificateStoreElement(PCCERT_CONTEXT pCertContext,
CryptMemFree
(
buf
);
hdr
=
(
PWINE_CERT_PROP_HEADER
)
pbElement
;
hdr
->
propID
=
CERT_CERT_PROP_
ID
;
hdr
->
propID
=
contextProp
ID
;
hdr
->
unknown
=
1
;
hdr
->
cb
=
pCertContext
->
cbCertEncoded
;
hdr
->
cb
=
cbEncodedContext
;
memcpy
(
pbElement
+
sizeof
(
WINE_CERT_PROP_HEADER
),
pCertContext
->
pbCertEncoded
,
pCertContext
->
cbCertEncoded
);
encodedContext
,
cbEncodedContext
);
}
}
else
...
...
@@ -154,6 +138,30 @@ BOOL WINAPI CertSerializeCertificateStoreElement(PCCERT_CONTEXT pCertContext,
return
ret
;
}
BOOL
WINAPI
CertSerializeCertificateStoreElement
(
PCCERT_CONTEXT
pCertContext
,
DWORD
dwFlags
,
BYTE
*
pbElement
,
DWORD
*
pcbElement
)
{
return
CRYPT_SerializeStoreElement
(
pCertContext
,
pCertContext
->
pbCertEncoded
,
pCertContext
->
cbCertEncoded
,
CERT_CERT_PROP_ID
,
pCertInterface
,
dwFlags
,
pbElement
,
pcbElement
);
}
BOOL
WINAPI
CertSerializeCRLStoreElement
(
PCCRL_CONTEXT
pCrlContext
,
DWORD
dwFlags
,
BYTE
*
pbElement
,
DWORD
*
pcbElement
)
{
return
CRYPT_SerializeStoreElement
(
pCrlContext
,
pCrlContext
->
pbCrlEncoded
,
pCrlContext
->
cbCrlEncoded
,
CERT_CRL_PROP_ID
,
pCRLInterface
,
dwFlags
,
pbElement
,
pcbElement
);
}
BOOL
WINAPI
CertSerializeCTLStoreElement
(
PCCTL_CONTEXT
pCtlContext
,
DWORD
dwFlags
,
BYTE
*
pbElement
,
DWORD
*
pcbElement
)
{
return
CRYPT_SerializeStoreElement
(
pCtlContext
,
pCtlContext
->
pbCtlEncoded
,
pCtlContext
->
cbCtlEncoded
,
CERT_CTL_PROP_ID
,
pCRLInterface
,
dwFlags
,
pbElement
,
pcbElement
);
}
/* Looks for the property with ID propID in the buffer buf. Returns a pointer
* to its header if a valid header is found, NULL if not. Valid means the
* length of thte property won't overrun buf, and the unknown field is 1.
...
...
dlls/crypt32/store.c
View file @
f94d49dc
...
...
@@ -47,6 +47,7 @@ static const WINE_CONTEXT_INTERFACE gCertInterface = {
(
AddEncodedContextToStoreFunc
)
CertAddEncodedCertificateToStore
,
(
DuplicateContextFunc
)
CertDuplicateCertificateContext
,
(
EnumContextsInStoreFunc
)
CertEnumCertificatesInStore
,
(
EnumPropertiesFunc
)
CertEnumCertificateContextProperties
,
(
GetContextPropertyFunc
)
CertGetCertificateContextProperty
,
(
SetContextPropertyFunc
)
CertSetCertificateContextProperty
,
(
SerializeElementFunc
)
CertSerializeCertificateStoreElement
,
...
...
@@ -61,6 +62,7 @@ static const WINE_CONTEXT_INTERFACE gCRLInterface = {
(
AddEncodedContextToStoreFunc
)
CertAddEncodedCRLToStore
,
(
DuplicateContextFunc
)
CertDuplicateCRLContext
,
(
EnumContextsInStoreFunc
)
CertEnumCRLsInStore
,
(
EnumPropertiesFunc
)
CertEnumCRLContextProperties
,
(
GetContextPropertyFunc
)
CertGetCRLContextProperty
,
(
SetContextPropertyFunc
)
CertSetCRLContextProperty
,
(
SerializeElementFunc
)
CertSerializeCRLStoreElement
,
...
...
@@ -75,6 +77,7 @@ static const WINE_CONTEXT_INTERFACE gCTLInterface = {
(
AddEncodedContextToStoreFunc
)
CertAddEncodedCTLToStore
,
(
DuplicateContextFunc
)
CertDuplicateCTLContext
,
(
EnumContextsInStoreFunc
)
CertEnumCTLsInStore
,
(
EnumPropertiesFunc
)
CertEnumCTLContextProperties
,
(
GetContextPropertyFunc
)
CertGetCTLContextProperty
,
(
SetContextPropertyFunc
)
CertSetCTLContextProperty
,
(
SerializeElementFunc
)
CertSerializeCTLStoreElement
,
...
...
@@ -2240,6 +2243,13 @@ BOOL WINAPI CertControlStore(HCERTSTORE hCertStore, DWORD dwFlags,
return
ret
;
}
DWORD
WINAPI
CertEnumCTLContextProperties
(
PCCTL_CONTEXT
pCTLContext
,
DWORD
dwPropId
)
{
FIXME
(
"(%p, %ld): stub
\n
"
,
pCTLContext
,
dwPropId
);
return
0
;
}
BOOL
WINAPI
CertGetCTLContextProperty
(
PCCTL_CONTEXT
pCTLContext
,
DWORD
dwPropId
,
void
*
pvData
,
DWORD
*
pcbData
)
{
...
...
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