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
7850caa7
Commit
7850caa7
authored
Aug 24, 2007
by
Juan Lang
Committed by
Alexandre Julliard
Aug 27, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wintrust: Test and implement SoftpubInitialize.
parent
bb963cc9
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
174 additions
and
3 deletions
+174
-3
Makefile.in
dlls/wintrust/Makefile.in
+1
-0
softpub.c
dlls/wintrust/softpub.c
+37
-0
Makefile.in
dlls/wintrust/tests/Makefile.in
+3
-2
softpub.c
dlls/wintrust/tests/softpub.c
+132
-0
wintrust.spec
dlls/wintrust/wintrust.spec
+1
-1
No files found.
dlls/wintrust/Makefile.in
View file @
7850caa7
...
...
@@ -11,6 +11,7 @@ C_SRCS = \
asn.c
\
crypt.c
\
register.c
\
softpub.c
\
wintrust_main.c
RC_SRCS
=
\
...
...
dlls/wintrust/softpub.c
0 → 100644
View file @
7850caa7
/*
* Copyright 2007 Juan Lang
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include <stdarg.h>
#include "windef.h"
#include "winbase.h"
#include "wintrust.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
wintrust
);
HRESULT
WINAPI
SoftpubInitialize
(
CRYPT_PROVIDER_DATA
*
data
)
{
HRESULT
ret
=
S_FALSE
;
TRACE
(
"(%p)
\n
"
,
data
);
if
(
data
->
padwTrustStepErrors
&&
!
data
->
padwTrustStepErrors
[
TRUSTERROR_STEP_FINAL_WVTINIT
])
ret
=
S_OK
;
TRACE
(
"returning %08x
\n
"
,
ret
);
return
ret
;
}
dlls/wintrust/tests/Makefile.in
View file @
7850caa7
...
...
@@ -3,12 +3,13 @@ TOPOBJDIR = ../../..
SRCDIR
=
@srcdir@
VPATH
=
@srcdir@
TESTDLL
=
wintrust.dll
IMPORTS
=
crypt32 user32 advapi32 kernel32
IMPORTS
=
wintrust
crypt32 user32 advapi32 kernel32
CTESTS
=
\
asn.c
\
crypt.c
\
register.c
register.c
\
softpub.c
@MAKE_TEST_RULES@
...
...
dlls/wintrust/tests/softpub.c
0 → 100644
View file @
7850caa7
/*
* wintrust softpub functions tests
*
* Copyright 2007 Juan Lang
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include <assert.h>
#include <stdio.h>
#include <stdarg.h>
#include <windef.h>
#include <winbase.h>
#include <winerror.h>
#include <wintrust.h>
#include <softpub.h>
#include <mssip.h>
#include <winuser.h>
#include "wine/test.h"
/* Just in case we're being built with borked headers, redefine function
* pointers to have the correct calling convention.
*/
typedef
void
*
(
WINAPI
*
SAFE_MEM_ALLOC
)(
DWORD
);
typedef
void
(
WINAPI
*
SAFE_MEM_FREE
)(
void
*
);
typedef
BOOL
(
WINAPI
*
SAFE_ADD_STORE
)(
CRYPT_PROVIDER_DATA
*
,
HCERTSTORE
);
typedef
BOOL
(
WINAPI
*
SAFE_ADD_SGNR
)(
CRYPT_PROVIDER_DATA
*
,
BOOL
,
DWORD
,
struct
_CRYPT_PROVIDER_SGNR
*
);
typedef
BOOL
(
WINAPI
*
SAFE_ADD_CERT
)(
CRYPT_PROVIDER_DATA
*
,
DWORD
,
BOOL
,
DWORD
,
PCCERT_CONTEXT
);
typedef
BOOL
(
WINAPI
*
SAFE_ADD_PRIVDATA
)(
CRYPT_PROVIDER_DATA
*
,
CRYPT_PROVIDER_PRIVDATA
*
);
typedef
HRESULT
(
WINAPI
*
SAFE_PROVIDER_INIT_CALL
)(
CRYPT_PROVIDER_DATA
*
);
typedef
HRESULT
(
WINAPI
*
SAFE_PROVIDER_OBJTRUST_CALL
)(
CRYPT_PROVIDER_DATA
*
);
typedef
HRESULT
(
WINAPI
*
SAFE_PROVIDER_SIGTRUST_CALL
)(
CRYPT_PROVIDER_DATA
*
);
typedef
HRESULT
(
WINAPI
*
SAFE_PROVIDER_CERTTRUST_CALL
)(
CRYPT_PROVIDER_DATA
*
);
typedef
HRESULT
(
WINAPI
*
SAFE_PROVIDER_FINALPOLICY_CALL
)(
CRYPT_PROVIDER_DATA
*
);
typedef
HRESULT
(
WINAPI
*
SAFE_PROVIDER_TESTFINALPOLICY_CALL
)(
CRYPT_PROVIDER_DATA
*
);
typedef
HRESULT
(
WINAPI
*
SAFE_PROVIDER_CLEANUP_CALL
)(
CRYPT_PROVIDER_DATA
*
);
typedef
BOOL
(
WINAPI
*
SAFE_PROVIDER_CERTCHKPOLICY_CALL
)(
CRYPT_PROVIDER_DATA
*
,
DWORD
,
BOOL
,
DWORD
);
typedef
struct
_SAFE_PROVIDER_FUNCTIONS
{
DWORD
cbStruct
;
SAFE_MEM_ALLOC
pfnAlloc
;
SAFE_MEM_FREE
pfnFree
;
SAFE_ADD_STORE
pfnAddStore2Chain
;
SAFE_ADD_SGNR
pfnAddSgnr2Chain
;
SAFE_ADD_CERT
pfnAddCert2Chain
;
SAFE_ADD_PRIVDATA
pfnAddPrivData2Chain
;
SAFE_PROVIDER_INIT_CALL
pfnInitialize
;
SAFE_PROVIDER_OBJTRUST_CALL
pfnObjectTrust
;
SAFE_PROVIDER_SIGTRUST_CALL
pfnSignatureTrust
;
SAFE_PROVIDER_CERTTRUST_CALL
pfnCertificateTrust
;
SAFE_PROVIDER_FINALPOLICY_CALL
pfnFinalPolicy
;
SAFE_PROVIDER_CERTCHKPOLICY_CALL
pfnCertCheckPolicy
;
SAFE_PROVIDER_TESTFINALPOLICY_CALL
pfnTestFinalPolicy
;
struct
_CRYPT_PROVUI_FUNCS
*
psUIpfns
;
SAFE_PROVIDER_CLEANUP_CALL
pfnCleanupPolicy
;
}
SAFE_PROVIDER_FUNCTIONS
;
static
void
testInitialize
(
SAFE_PROVIDER_FUNCTIONS
*
funcs
,
GUID
*
actionID
)
{
HRESULT
ret
;
CRYPT_PROVIDER_DATA
data
=
{
0
};
WINTRUST_DATA
wintrust_data
=
{
0
};
if
(
!
funcs
->
pfnInitialize
)
{
skip
(
"missing pfnInitialize
\n
"
);
return
;
}
/* Crashes
ret = funcs->pfnInitialize(NULL);
*/
memset
(
&
data
,
0
,
sizeof
(
data
));
ret
=
funcs
->
pfnInitialize
(
&
data
);
ok
(
ret
==
S_FALSE
,
"Expected S_FALSE, got %08x
\n
"
,
ret
);
data
.
padwTrustStepErrors
=
funcs
->
pfnAlloc
(
TRUSTERROR_MAX_STEPS
*
sizeof
(
DWORD
));
/* Without wintrust data set, crashes when padwTrustStepErrors is set */
data
.
pWintrustData
=
&
wintrust_data
;
if
(
data
.
padwTrustStepErrors
)
{
/* Apparently, cdwTrustStepErrors does not need to be set. */
ret
=
funcs
->
pfnInitialize
(
&
data
);
ok
(
ret
==
S_OK
,
"Expected S_OK, got %08x
\n
"
,
ret
);
data
.
cdwTrustStepErrors
=
1
;
ret
=
funcs
->
pfnInitialize
(
&
data
);
ok
(
ret
==
S_OK
,
"Expected S_OK, got %08x
\n
"
,
ret
);
memset
(
data
.
padwTrustStepErrors
,
0xba
,
TRUSTERROR_MAX_STEPS
*
sizeof
(
DWORD
));
ret
=
funcs
->
pfnInitialize
(
&
data
);
ok
(
ret
==
S_FALSE
,
"Expected S_FALSE, got %08x
\n
"
,
ret
);
data
.
padwTrustStepErrors
[
TRUSTERROR_STEP_FINAL_WVTINIT
]
=
0
;
ret
=
funcs
->
pfnInitialize
(
&
data
);
ok
(
ret
==
S_OK
,
"Expected S_OK, got %08x
\n
"
,
ret
);
funcs
->
pfnFree
(
data
.
padwTrustStepErrors
);
}
}
START_TEST
(
softpub
)
{
static
GUID
generic_verify_v2
=
WINTRUST_ACTION_GENERIC_VERIFY_V2
;
SAFE_PROVIDER_FUNCTIONS
funcs
=
{
sizeof
(
SAFE_PROVIDER_FUNCTIONS
),
0
};
BOOL
ret
;
ret
=
WintrustLoadFunctionPointers
(
&
generic_verify_v2
,
(
CRYPT_PROVIDER_FUNCTIONS
*
)
&
funcs
);
if
(
!
ret
)
skip
(
"WintrustLoadFunctionPointers failed
\n
"
);
else
{
testInitialize
(
&
funcs
,
&
generic_verify_v2
);
}
}
dlls/wintrust/wintrust.spec
View file @
7850caa7
...
...
@@ -64,7 +64,7 @@
@ stdcall SoftpubDllUnregisterServer()
@ stub SoftpubDumpStructure
@ stub SoftpubFreeDefUsageCallData
@ st
ub SoftpubInitialize
@ st
dcall SoftpubInitialize(ptr)
@ stub SoftpubLoadDefUsageCallData
@ stub SoftpubLoadMessage
@ stub SoftpubLoadSignature
...
...
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