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 @@
...
@@ -30,7 +30,7 @@
@ stdcall CertDuplicateStore(ptr)
@ stdcall CertDuplicateStore(ptr)
@ stdcall CertEnumCRLContextProperties(ptr long)
@ stdcall CertEnumCRLContextProperties(ptr long)
@ stdcall CertEnumCRLsInStore(ptr ptr)
@ stdcall CertEnumCRLsInStore(ptr ptr)
@ st
ub CertEnumCTLContextProperties
@ st
dcall CertEnumCTLContextProperties(ptr long)
@ stdcall CertEnumCTLsInStore(ptr ptr)
@ stdcall CertEnumCTLsInStore(ptr ptr)
@ stdcall CertEnumCertificateContextProperties(ptr long)
@ stdcall CertEnumCertificateContextProperties(ptr long)
@ stdcall CertEnumCertificatesInStore(long ptr)
@ stdcall CertEnumCertificatesInStore(long ptr)
...
...
dlls/crypt32/crypt32_private.h
View file @
f94d49dc
...
@@ -56,6 +56,7 @@ typedef BOOL (WINAPI *AddEncodedContextToStoreFunc)(HCERTSTORE hCertStore,
...
@@ -56,6 +56,7 @@ typedef BOOL (WINAPI *AddEncodedContextToStoreFunc)(HCERTSTORE hCertStore,
typedef
const
void
*
(
WINAPI
*
DuplicateContextFunc
)(
const
void
*
context
);
typedef
const
void
*
(
WINAPI
*
DuplicateContextFunc
)(
const
void
*
context
);
typedef
const
void
*
(
WINAPI
*
EnumContextsInStoreFunc
)(
HCERTSTORE
hCertStore
,
typedef
const
void
*
(
WINAPI
*
EnumContextsInStoreFunc
)(
HCERTSTORE
hCertStore
,
const
void
*
pPrevContext
);
const
void
*
pPrevContext
);
typedef
DWORD
(
WINAPI
*
EnumPropertiesFunc
)(
const
void
*
context
,
DWORD
dwPropId
);
typedef
BOOL
(
WINAPI
*
GetContextPropertyFunc
)(
const
void
*
context
,
typedef
BOOL
(
WINAPI
*
GetContextPropertyFunc
)(
const
void
*
context
,
DWORD
dwPropID
,
void
*
pvData
,
DWORD
*
pcbData
);
DWORD
dwPropID
,
void
*
pvData
,
DWORD
*
pcbData
);
typedef
BOOL
(
WINAPI
*
SetContextPropertyFunc
)(
const
void
*
context
,
typedef
BOOL
(
WINAPI
*
SetContextPropertyFunc
)(
const
void
*
context
,
...
@@ -73,6 +74,7 @@ typedef struct _WINE_CONTEXT_INTERFACE
...
@@ -73,6 +74,7 @@ typedef struct _WINE_CONTEXT_INTERFACE
AddEncodedContextToStoreFunc
addEncodedToStore
;
AddEncodedContextToStoreFunc
addEncodedToStore
;
DuplicateContextFunc
duplicate
;
DuplicateContextFunc
duplicate
;
EnumContextsInStoreFunc
enumContextsInStore
;
EnumContextsInStoreFunc
enumContextsInStore
;
EnumPropertiesFunc
enumProps
;
GetContextPropertyFunc
getProp
;
GetContextPropertyFunc
getProp
;
SetContextPropertyFunc
setProp
;
SetContextPropertyFunc
setProp
;
SerializeElementFunc
serialize
;
SerializeElementFunc
serialize
;
...
...
dlls/crypt32/serialize.c
View file @
f94d49dc
...
@@ -36,45 +36,29 @@ typedef struct _WINE_CERT_PROP_HEADER
...
@@ -36,45 +36,29 @@ typedef struct _WINE_CERT_PROP_HEADER
DWORD
cb
;
DWORD
cb
;
}
WINE_CERT_PROP_HEADER
,
*
PWINE_CERT_PROP_HEADER
;
}
WINE_CERT_PROP_HEADER
,
*
PWINE_CERT_PROP_HEADER
;
BOOL
WINAPI
CertSerializeCRLStoreElement
(
PCCRL_CONTEXT
pCrlContext
,
static
BOOL
CRYPT_SerializeStoreElement
(
const
void
*
context
,
DWORD
dwFlags
,
BYTE
*
pbElement
,
DWORD
*
pcbElement
)
const
BYTE
*
encodedContext
,
DWORD
cbEncodedContext
,
DWORD
contextPropID
,
{
PCWINE_CONTEXT_INTERFACE
contextInterface
,
DWORD
dwFlags
,
BYTE
*
pbElement
,
FIXME
(
"(%p, %08lx, %p, %p): stub
\n
"
,
pCrlContext
,
dwFlags
,
pbElement
,
DWORD
*
pcbElement
)
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
)
{
{
BOOL
ret
;
BOOL
ret
;
TRACE
(
"(%p, %
08lx, %p, %p)
\n
"
,
pCertContext
,
dwFlags
,
pbElement
,
TRACE
(
"(%p, %
p, %08lx, %p, %p)
\n
"
,
context
,
contextInterface
,
dwFlags
,
pcbElement
);
p
bElement
,
p
cbElement
);
if
(
pCertC
ontext
)
if
(
c
ontext
)
{
{
DWORD
bytesNeeded
=
sizeof
(
WINE_CERT_PROP_HEADER
)
+
DWORD
bytesNeeded
=
sizeof
(
WINE_CERT_PROP_HEADER
)
+
cbEncodedContext
;
pCertContext
->
cbCertEncoded
;
DWORD
prop
=
0
;
DWORD
prop
=
0
;
ret
=
TRUE
;
ret
=
TRUE
;
do
{
do
{
prop
=
CertEnumCertificateContextProperties
(
pCertC
ontext
,
prop
);
prop
=
contextInterface
->
enumProps
(
c
ontext
,
prop
);
if
(
prop
)
if
(
prop
)
{
{
DWORD
propSize
=
0
;
DWORD
propSize
=
0
;
ret
=
CertGetCertificateContextProperty
(
pCertContext
,
ret
=
contextInterface
->
getProp
(
context
,
prop
,
NULL
,
&
propSize
);
prop
,
NULL
,
&
propSize
);
if
(
ret
)
if
(
ret
)
bytesNeeded
+=
sizeof
(
WINE_CERT_PROP_HEADER
)
+
propSize
;
bytesNeeded
+=
sizeof
(
WINE_CERT_PROP_HEADER
)
+
propSize
;
}
}
...
@@ -99,13 +83,13 @@ BOOL WINAPI CertSerializeCertificateStoreElement(PCCERT_CONTEXT pCertContext,
...
@@ -99,13 +83,13 @@ BOOL WINAPI CertSerializeCertificateStoreElement(PCCERT_CONTEXT pCertContext,
prop
=
0
;
prop
=
0
;
do
{
do
{
prop
=
CertEnumCertificateContextProperties
(
pCertC
ontext
,
prop
);
prop
=
contextInterface
->
enumProps
(
c
ontext
,
prop
);
if
(
prop
)
if
(
prop
)
{
{
DWORD
propSize
=
0
;
DWORD
propSize
=
0
;
ret
=
CertGetCertificateContextProperty
(
pCertContext
,
ret
=
contextInterface
->
getProp
(
context
,
prop
,
NULL
,
prop
,
NULL
,
&
propSize
);
&
propSize
);
if
(
ret
)
if
(
ret
)
{
{
if
(
bufSize
<
propSize
)
if
(
bufSize
<
propSize
)
...
@@ -118,8 +102,8 @@ BOOL WINAPI CertSerializeCertificateStoreElement(PCCERT_CONTEXT pCertContext,
...
@@ -118,8 +102,8 @@ BOOL WINAPI CertSerializeCertificateStoreElement(PCCERT_CONTEXT pCertContext,
}
}
if
(
buf
)
if
(
buf
)
{
{
ret
=
CertGetCertificateContextProperty
(
ret
=
contextInterface
->
getProp
(
context
,
prop
,
buf
,
pCertContext
,
prop
,
buf
,
&
propSize
);
&
propSize
);
if
(
ret
)
if
(
ret
)
{
{
hdr
=
(
PWINE_CERT_PROP_HEADER
)
pbElement
;
hdr
=
(
PWINE_CERT_PROP_HEADER
)
pbElement
;
...
@@ -142,11 +126,11 @@ BOOL WINAPI CertSerializeCertificateStoreElement(PCCERT_CONTEXT pCertContext,
...
@@ -142,11 +126,11 @@ BOOL WINAPI CertSerializeCertificateStoreElement(PCCERT_CONTEXT pCertContext,
CryptMemFree
(
buf
);
CryptMemFree
(
buf
);
hdr
=
(
PWINE_CERT_PROP_HEADER
)
pbElement
;
hdr
=
(
PWINE_CERT_PROP_HEADER
)
pbElement
;
hdr
->
propID
=
CERT_CERT_PROP_
ID
;
hdr
->
propID
=
contextProp
ID
;
hdr
->
unknown
=
1
;
hdr
->
unknown
=
1
;
hdr
->
cb
=
pCertContext
->
cbCertEncoded
;
hdr
->
cb
=
cbEncodedContext
;
memcpy
(
pbElement
+
sizeof
(
WINE_CERT_PROP_HEADER
),
memcpy
(
pbElement
+
sizeof
(
WINE_CERT_PROP_HEADER
),
pCertContext
->
pbCertEncoded
,
pCertContext
->
cbCertEncoded
);
encodedContext
,
cbEncodedContext
);
}
}
}
}
else
else
...
@@ -154,6 +138,30 @@ BOOL WINAPI CertSerializeCertificateStoreElement(PCCERT_CONTEXT pCertContext,
...
@@ -154,6 +138,30 @@ BOOL WINAPI CertSerializeCertificateStoreElement(PCCERT_CONTEXT pCertContext,
return
ret
;
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
/* 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
* 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.
* 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 = {
...
@@ -47,6 +47,7 @@ static const WINE_CONTEXT_INTERFACE gCertInterface = {
(
AddEncodedContextToStoreFunc
)
CertAddEncodedCertificateToStore
,
(
AddEncodedContextToStoreFunc
)
CertAddEncodedCertificateToStore
,
(
DuplicateContextFunc
)
CertDuplicateCertificateContext
,
(
DuplicateContextFunc
)
CertDuplicateCertificateContext
,
(
EnumContextsInStoreFunc
)
CertEnumCertificatesInStore
,
(
EnumContextsInStoreFunc
)
CertEnumCertificatesInStore
,
(
EnumPropertiesFunc
)
CertEnumCertificateContextProperties
,
(
GetContextPropertyFunc
)
CertGetCertificateContextProperty
,
(
GetContextPropertyFunc
)
CertGetCertificateContextProperty
,
(
SetContextPropertyFunc
)
CertSetCertificateContextProperty
,
(
SetContextPropertyFunc
)
CertSetCertificateContextProperty
,
(
SerializeElementFunc
)
CertSerializeCertificateStoreElement
,
(
SerializeElementFunc
)
CertSerializeCertificateStoreElement
,
...
@@ -61,6 +62,7 @@ static const WINE_CONTEXT_INTERFACE gCRLInterface = {
...
@@ -61,6 +62,7 @@ static const WINE_CONTEXT_INTERFACE gCRLInterface = {
(
AddEncodedContextToStoreFunc
)
CertAddEncodedCRLToStore
,
(
AddEncodedContextToStoreFunc
)
CertAddEncodedCRLToStore
,
(
DuplicateContextFunc
)
CertDuplicateCRLContext
,
(
DuplicateContextFunc
)
CertDuplicateCRLContext
,
(
EnumContextsInStoreFunc
)
CertEnumCRLsInStore
,
(
EnumContextsInStoreFunc
)
CertEnumCRLsInStore
,
(
EnumPropertiesFunc
)
CertEnumCRLContextProperties
,
(
GetContextPropertyFunc
)
CertGetCRLContextProperty
,
(
GetContextPropertyFunc
)
CertGetCRLContextProperty
,
(
SetContextPropertyFunc
)
CertSetCRLContextProperty
,
(
SetContextPropertyFunc
)
CertSetCRLContextProperty
,
(
SerializeElementFunc
)
CertSerializeCRLStoreElement
,
(
SerializeElementFunc
)
CertSerializeCRLStoreElement
,
...
@@ -75,6 +77,7 @@ static const WINE_CONTEXT_INTERFACE gCTLInterface = {
...
@@ -75,6 +77,7 @@ static const WINE_CONTEXT_INTERFACE gCTLInterface = {
(
AddEncodedContextToStoreFunc
)
CertAddEncodedCTLToStore
,
(
AddEncodedContextToStoreFunc
)
CertAddEncodedCTLToStore
,
(
DuplicateContextFunc
)
CertDuplicateCTLContext
,
(
DuplicateContextFunc
)
CertDuplicateCTLContext
,
(
EnumContextsInStoreFunc
)
CertEnumCTLsInStore
,
(
EnumContextsInStoreFunc
)
CertEnumCTLsInStore
,
(
EnumPropertiesFunc
)
CertEnumCTLContextProperties
,
(
GetContextPropertyFunc
)
CertGetCTLContextProperty
,
(
GetContextPropertyFunc
)
CertGetCTLContextProperty
,
(
SetContextPropertyFunc
)
CertSetCTLContextProperty
,
(
SetContextPropertyFunc
)
CertSetCTLContextProperty
,
(
SerializeElementFunc
)
CertSerializeCTLStoreElement
,
(
SerializeElementFunc
)
CertSerializeCTLStoreElement
,
...
@@ -2240,6 +2243,13 @@ BOOL WINAPI CertControlStore(HCERTSTORE hCertStore, DWORD dwFlags,
...
@@ -2240,6 +2243,13 @@ BOOL WINAPI CertControlStore(HCERTSTORE hCertStore, DWORD dwFlags,
return
ret
;
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
,
BOOL
WINAPI
CertGetCTLContextProperty
(
PCCTL_CONTEXT
pCTLContext
,
DWORD
dwPropId
,
void
*
pvData
,
DWORD
*
pcbData
)
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