Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
3f705af9
Commit
3f705af9
authored
Oct 24, 2008
by
Juan Lang
Committed by
Alexandre Julliard
Oct 27, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cryptui: Support importing certificate contexts.
parent
dd815611
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
11 deletions
+21
-11
main.c
dlls/cryptui/main.c
+20
-6
cryptui.c
dlls/cryptui/tests/cryptui.c
+1
-5
No files found.
dlls/cryptui/main.c
View file @
3f705af9
...
...
@@ -146,12 +146,11 @@ BOOL WINAPI CryptUIWizImport(DWORD dwFlags, HWND hwndParent, LPCWSTR pwszWizardT
BOOL
ret
;
HCERTSTORE
store
;
const
CERT_CONTEXT
*
cert
;
BOOL
freeCert
=
FALSE
;
TRACE
(
"(0x%08x, %p, %s, %p, %p)
\n
"
,
dwFlags
,
hwndParent
,
debugstr_w
(
pwszWizardTitle
),
pImportSrc
,
hDestCertStore
);
FIXME
(
"only certificate files are supported
\n
"
);
if
(
!
(
dwFlags
&
CRYPTUI_WIZ_NO_UI
))
FIXME
(
"UI not implemented
\n
"
);
if
(
!
pImportSrc
||
...
...
@@ -161,16 +160,30 @@ BOOL WINAPI CryptUIWizImport(DWORD dwFlags, HWND hwndParent, LPCWSTR pwszWizardT
return
FALSE
;
}
if
(
pImportSrc
->
dwSubjectChoice
!=
CRYPTUI_WIZ_IMPORT_SUBJECT_FILE
)
switch
(
pImportSrc
->
dwSubjectChoice
)
{
FIXME
(
"source type not implemented: %u
\n
"
,
pImportSrc
->
dwSubjectChoice
);
return
FALSE
;
}
case
CRYPTUI_WIZ_IMPORT_SUBJECT_FILE
:
if
(
!
(
cert
=
make_cert_from_file
(
pImportSrc
->
pwszFileName
)))
{
WARN
(
"unable to create certificate context
\n
"
);
return
FALSE
;
}
else
freeCert
=
TRUE
;
break
;
case
CRYPTUI_WIZ_IMPORT_SUBJECT_CERT_CONTEXT
:
cert
=
pImportSrc
->
pCertContext
;
if
(
!
cert
)
{
SetLastError
(
E_INVALIDARG
);
return
FALSE
;
}
break
;
default:
FIXME
(
"source type not implemented: %u
\n
"
,
pImportSrc
->
dwSubjectChoice
);
SetLastError
(
E_INVALIDARG
);
return
FALSE
;
}
if
(
hDestCertStore
)
store
=
hDestCertStore
;
else
{
...
...
@@ -185,6 +198,7 @@ BOOL WINAPI CryptUIWizImport(DWORD dwFlags, HWND hwndParent, LPCWSTR pwszWizardT
ret
=
CertAddCertificateContextToStore
(
store
,
cert
,
CERT_STORE_ADD_REPLACE_EXISTING
,
NULL
);
if
(
!
hDestCertStore
)
CertCloseStore
(
store
,
0
);
if
(
freeCert
)
CertFreeCertificateContext
(
cert
);
return
ret
;
}
dlls/cryptui/tests/cryptui.c
View file @
3f705af9
...
...
@@ -202,19 +202,16 @@ static void test_crypt_ui_wiz_import(void)
info
.
dwSize
=
sizeof
(
info
);
SetLastError
(
0xdeadbeef
);
ret
=
pCryptUIWizImport
(
CRYPTUI_WIZ_NO_UI
,
0
,
NULL
,
&
info
,
NULL
);
todo_wine
ok
(
!
ret
&&
GetLastError
()
==
E_INVALIDARG
,
"expected E_INVALIDARG, got %08x
\n
"
,
GetLastError
());
info
.
dwSubjectChoice
=
CRYPTUI_WIZ_IMPORT_SUBJECT_CERT_CONTEXT
;
SetLastError
(
0xdeadbeef
);
ret
=
pCryptUIWizImport
(
CRYPTUI_WIZ_NO_UI
,
0
,
NULL
,
&
info
,
NULL
);
todo_wine
ok
(
!
ret
&&
GetLastError
()
==
E_INVALIDARG
,
"expected E_INVALIDARG, got %08x
\n
"
,
GetLastError
());
SetLastError
(
0xdeadbeef
);
ret
=
pCryptUIWizImport
(
CRYPTUI_WIZ_NO_UI
|
CRYPTUI_WIZ_IMPORT_ALLOW_CERT
,
0
,
NULL
,
&
info
,
NULL
);
todo_wine
ok
(
!
ret
&&
GetLastError
()
==
E_INVALIDARG
,
"expected E_INVALIDARG, got %08x
\n
"
,
GetLastError
());
/* Imports the following cert--self-signed, with no basic constraints set--
...
...
@@ -287,10 +284,9 @@ static void test_crypt_ui_wiz_import(void)
}
ret
=
pCryptUIWizImport
(
CRYPTUI_WIZ_NO_UI
|
CRYPTUI_WIZ_IMPORT_NO_CHANGE_DEST_STORE
,
0
,
NULL
,
&
info
,
store
);
todo_wine
ok
(
ret
,
"CryptUIWizImport failed: %08x
\n
"
,
GetLastError
());
find_and_delete_cert_in_store
(
store
,
"memory"
,
info
.
u
.
pCertContext
,
"iTunesCert3"
,
TRU
E
);
"iTunesCert3"
,
FALS
E
);
CertFreeCertificateContext
(
info
.
u
.
pCertContext
);
CertCloseStore
(
store
,
0
);
...
...
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