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
150ddd6b
Commit
150ddd6b
authored
Aug 28, 2007
by
Juan Lang
Committed by
Alexandre Julliard
Aug 29, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wintrust: Test and implement pfnAddStore2Chain.
parent
3db50276
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
71 additions
and
14 deletions
+71
-14
register.c
dlls/wintrust/register.c
+1
-1
softpub.c
dlls/wintrust/tests/softpub.c
+47
-13
wintrust_main.c
dlls/wintrust/wintrust_main.c
+22
-0
wintrust_priv.h
dlls/wintrust/wintrust_priv.h
+1
-0
No files found.
dlls/wintrust/register.c
View file @
150ddd6b
...
...
@@ -836,7 +836,7 @@ BOOL WINAPI WintrustLoadFunctionPointers( GUID* pgActionID,
/* Get the function pointers from the registry, where applicable */
pPfns
->
pfnAlloc
=
WINTRUST_Alloc
;
pPfns
->
pfnFree
=
WINTRUST_Free
;
pPfns
->
pfnAddStore2Chain
=
NULL
;
pPfns
->
pfnAddStore2Chain
=
WINTRUST_AddStore
;
pPfns
->
pfnAddSgnr2Chain
=
NULL
;
pPfns
->
pfnAddCert2Chain
=
NULL
;
pPfns
->
pfnAddPrivData2Chain
=
NULL
;
...
...
dlls/wintrust/tests/softpub.c
View file @
150ddd6b
...
...
@@ -74,6 +74,52 @@ typedef struct _SAFE_PROVIDER_FUNCTIONS
SAFE_PROVIDER_CLEANUP_CALL
pfnCleanupPolicy
;
}
SAFE_PROVIDER_FUNCTIONS
;
static
const
BYTE
v1CertWithPubKey
[]
=
{
0x30
,
0x81
,
0x95
,
0x02
,
0x01
,
0x01
,
0x30
,
0x02
,
0x06
,
0x00
,
0x30
,
0x15
,
0x31
,
0x13
,
0x30
,
0x11
,
0x06
,
0x03
,
0x55
,
0x04
,
0x03
,
0x13
,
0x0a
,
0x4a
,
0x75
,
0x61
,
0x6e
,
0x20
,
0x4c
,
0x61
,
0x6e
,
0x67
,
0x00
,
0x30
,
0x22
,
0x18
,
0x0f
,
0x31
,
0x36
,
0x30
,
0x31
,
0x30
,
0x31
,
0x30
,
0x31
,
0x30
,
0x30
,
0x30
,
0x30
,
0x30
,
0x30
,
0x5a
,
0x18
,
0x0f
,
0x31
,
0x36
,
0x30
,
0x31
,
0x30
,
0x31
,
0x30
,
0x31
,
0x30
,
0x30
,
0x30
,
0x30
,
0x30
,
0x30
,
0x5a
,
0x30
,
0x15
,
0x31
,
0x13
,
0x30
,
0x11
,
0x06
,
0x03
,
0x55
,
0x04
,
0x03
,
0x13
,
0x0a
,
0x4a
,
0x75
,
0x61
,
0x6e
,
0x20
,
0x4c
,
0x61
,
0x6e
,
0x67
,
0x00
,
0x30
,
0x22
,
0x30
,
0x0d
,
0x06
,
0x09
,
0x2a
,
0x86
,
0x48
,
0x86
,
0xf7
,
0x0d
,
0x01
,
0x01
,
0x01
,
0x05
,
0x00
,
0x03
,
0x11
,
0x00
,
0x00
,
0x01
,
0x02
,
0x03
,
0x04
,
0x05
,
0x06
,
0x07
,
0x08
,
0x09
,
0x0a
,
0x0b
,
0x0c
,
0x0d
,
0x0e
,
0x0f
,
0xa3
,
0x16
,
0x30
,
0x14
,
0x30
,
0x12
,
0x06
,
0x03
,
0x55
,
0x1d
,
0x13
,
0x01
,
0x01
,
0xff
,
0x04
,
0x08
,
0x30
,
0x06
,
0x01
,
0x01
,
0xff
,
0x02
,
0x01
,
0x01
};
static
void
test_utils
(
SAFE_PROVIDER_FUNCTIONS
*
funcs
)
{
CRYPT_PROVIDER_DATA
data
=
{
0
};
HCERTSTORE
store
;
BOOL
ret
;
/* Crash
ret = funcs->pfnAddStore2Chain(NULL, NULL);
ret = funcs->pfnAddStore2Chain(&data, NULL);
*/
store
=
CertOpenStore
(
CERT_STORE_PROV_MEMORY
,
X509_ASN_ENCODING
,
0
,
CERT_STORE_CREATE_NEW_FLAG
,
NULL
);
if
(
store
)
{
ret
=
funcs
->
pfnAddStore2Chain
(
&
data
,
store
);
ok
(
ret
,
"pfnAddStore2Chain failed: %08x
\n
"
,
GetLastError
());
ok
(
data
.
chStores
==
1
,
"Expected 1 store, got %d
\n
"
,
data
.
chStores
);
ok
(
data
.
pahStores
!=
NULL
,
"Expected pahStores to be allocated
\n
"
);
if
(
data
.
pahStores
)
{
ok
(
data
.
pahStores
[
0
]
==
store
,
"Unexpected store
\n
"
);
CertCloseStore
(
data
.
pahStores
[
0
],
0
);
funcs
->
pfnFree
(
data
.
pahStores
);
data
.
pahStores
=
NULL
;
data
.
chStores
=
0
;
CertCloseStore
(
store
,
0
);
store
=
NULL
;
}
}
else
skip
(
"CertOpenStore failed: %08x
\n
"
,
GetLastError
());
}
static
void
testInitialize
(
SAFE_PROVIDER_FUNCTIONS
*
funcs
,
GUID
*
actionID
)
{
HRESULT
ret
;
...
...
@@ -115,19 +161,6 @@ static void testInitialize(SAFE_PROVIDER_FUNCTIONS *funcs, GUID *actionID)
}
}
static
const
BYTE
v1CertWithPubKey
[]
=
{
0x30
,
0x81
,
0x95
,
0x02
,
0x01
,
0x01
,
0x30
,
0x02
,
0x06
,
0x00
,
0x30
,
0x15
,
0x31
,
0x13
,
0x30
,
0x11
,
0x06
,
0x03
,
0x55
,
0x04
,
0x03
,
0x13
,
0x0a
,
0x4a
,
0x75
,
0x61
,
0x6e
,
0x20
,
0x4c
,
0x61
,
0x6e
,
0x67
,
0x00
,
0x30
,
0x22
,
0x18
,
0x0f
,
0x31
,
0x36
,
0x30
,
0x31
,
0x30
,
0x31
,
0x30
,
0x31
,
0x30
,
0x30
,
0x30
,
0x30
,
0x30
,
0x30
,
0x5a
,
0x18
,
0x0f
,
0x31
,
0x36
,
0x30
,
0x31
,
0x30
,
0x31
,
0x30
,
0x31
,
0x30
,
0x30
,
0x30
,
0x30
,
0x30
,
0x30
,
0x5a
,
0x30
,
0x15
,
0x31
,
0x13
,
0x30
,
0x11
,
0x06
,
0x03
,
0x55
,
0x04
,
0x03
,
0x13
,
0x0a
,
0x4a
,
0x75
,
0x61
,
0x6e
,
0x20
,
0x4c
,
0x61
,
0x6e
,
0x67
,
0x00
,
0x30
,
0x22
,
0x30
,
0x0d
,
0x06
,
0x09
,
0x2a
,
0x86
,
0x48
,
0x86
,
0xf7
,
0x0d
,
0x01
,
0x01
,
0x01
,
0x05
,
0x00
,
0x03
,
0x11
,
0x00
,
0x00
,
0x01
,
0x02
,
0x03
,
0x04
,
0x05
,
0x06
,
0x07
,
0x08
,
0x09
,
0x0a
,
0x0b
,
0x0c
,
0x0d
,
0x0e
,
0x0f
,
0xa3
,
0x16
,
0x30
,
0x14
,
0x30
,
0x12
,
0x06
,
0x03
,
0x55
,
0x1d
,
0x13
,
0x01
,
0x01
,
0xff
,
0x04
,
0x08
,
0x30
,
0x06
,
0x01
,
0x01
,
0xff
,
0x02
,
0x01
,
0x01
};
static
void
testObjTrust
(
SAFE_PROVIDER_FUNCTIONS
*
funcs
,
GUID
*
actionID
)
{
HRESULT
ret
;
...
...
@@ -216,6 +249,7 @@ START_TEST(softpub)
skip
(
"WintrustLoadFunctionPointers failed
\n
"
);
else
{
test_utils
(
&
funcs
);
testInitialize
(
&
funcs
,
&
generic_verify_v2
);
testObjTrust
(
&
funcs
,
&
generic_verify_v2
);
}
...
...
dlls/wintrust/wintrust_main.c
View file @
150ddd6b
...
...
@@ -230,3 +230,25 @@ void WINAPI WINTRUST_Free(void *p)
{
HeapFree
(
GetProcessHeap
(),
0
,
p
);
}
BOOL
WINAPI
WINTRUST_AddStore
(
CRYPT_PROVIDER_DATA
*
data
,
HCERTSTORE
store
)
{
BOOL
ret
=
FALSE
;
if
(
data
->
chStores
)
data
->
pahStores
=
WINTRUST_ReAlloc
(
data
->
pahStores
,
(
data
->
chStores
+
1
)
*
sizeof
(
HCERTSTORE
));
else
{
data
->
pahStores
=
WINTRUST_Alloc
(
sizeof
(
HCERTSTORE
));
data
->
chStores
=
0
;
}
if
(
data
->
pahStores
)
{
data
->
pahStores
[
data
->
chStores
++
]
=
CertDuplicateStore
(
store
);
ret
=
TRUE
;
}
else
SetLastError
(
ERROR_OUTOFMEMORY
);
return
ret
;
}
dlls/wintrust/wintrust_priv.h
View file @
150ddd6b
...
...
@@ -21,5 +21,6 @@
void
*
WINAPI
WINTRUST_Alloc
(
DWORD
cb
);
void
*
WINAPI
WINTRUST_ReAlloc
(
void
*
ptr
,
DWORD
cb
);
void
WINAPI
WINTRUST_Free
(
void
*
p
);
BOOL
WINAPI
WINTRUST_AddStore
(
CRYPT_PROVIDER_DATA
*
data
,
HCERTSTORE
store
);
#endif
/* ndef __WINTRUST_PRIV_H__ */
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