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
5d4d5b16
Commit
5d4d5b16
authored
Aug 01, 2008
by
Juan Lang
Committed by
Alexandre Julliard
Aug 04, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
crypt32: More fully implement CryptSIPRetrieveSubjectGuid.
parent
7d78d394
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
80 additions
and
9 deletions
+80
-9
sip.c
dlls/crypt32/sip.c
+80
-9
No files found.
dlls/crypt32/sip.c
View file @
5d4d5b16
...
...
@@ -318,6 +318,9 @@ BOOL WINAPI CryptSIPRetrieveSubjectGuid
static
const
WORD
dosHdr
=
IMAGE_DOS_SIGNATURE
;
static
const
BYTE
cabHdr
[]
=
{
'M'
,
'S'
,
'C'
,
'F'
};
BYTE
hdr
[
SIP_MAX_MAGIC_NUMBER
];
WCHAR
szFullKey
[
0x100
];
LONG
r
=
ERROR_SUCCESS
;
HKEY
key
;
TRACE
(
"(%s %p %p)
\n
"
,
wine_dbgstr_w
(
FileName
),
hFileIn
,
pgSubject
);
...
...
@@ -369,16 +372,84 @@ BOOL WINAPI CryptSIPRetrieveSubjectGuid
goto
cleanup
;
}
/* FIXME
* There is a lot more to be checked:
* - Check for the keys CryptSIPDllIsMyFileType and CryptSIPDllIsMyFileType2
* under HKLM\Software\Microsoft\Cryptography\OID\EncodingType 0. Here are
* functions listed that need check if a SIP Provider can deal with the
* given file.
*/
/* Check for supported functions using CryptSIPDllIsMyFileType */
/* max length of szFullKey depends on our code only, so we won't overrun */
lstrcpyW
(
szFullKey
,
szOID
);
lstrcatW
(
szFullKey
,
szIsMyFile
);
r
=
RegOpenKeyExW
(
HKEY_LOCAL_MACHINE
,
szFullKey
,
0
,
KEY_READ
,
&
key
);
if
(
r
==
ERROR_SUCCESS
)
{
DWORD
index
=
0
,
size
;
WCHAR
subKeyName
[
MAX_PATH
];
do
{
size
=
sizeof
(
subKeyName
)
/
sizeof
(
subKeyName
[
0
]);
r
=
RegEnumKeyExW
(
key
,
index
++
,
subKeyName
,
&
size
,
NULL
,
NULL
,
NULL
,
NULL
);
if
(
r
==
ERROR_SUCCESS
)
{
HKEY
subKey
;
r
=
RegOpenKeyExW
(
key
,
subKeyName
,
0
,
KEY_READ
,
&
subKey
);
if
(
r
==
ERROR_SUCCESS
)
{
HMODULE
lib
;
pfnIsFileSupported
isMy
=
CRYPT_LoadSIPFuncFromKey
(
subKey
,
&
lib
);
if
(
isMy
)
{
bRet
=
isMy
(
hFile
,
pgSubject
);
FreeLibrary
(
lib
);
}
RegCloseKey
(
subKey
);
}
}
}
while
(
!
bRet
&&
r
==
ERROR_SUCCESS
);
RegCloseKey
(
key
);
}
/* Let's set the most common error for now */
SetLastError
(
TRUST_E_SUBJECT_FORM_UNKNOWN
);
/* Check for supported functions using CryptSIPDllIsMyFileType2 */
if
(
!
bRet
)
{
lstrcpyW
(
szFullKey
,
szOID
);
lstrcatW
(
szFullKey
,
szIsMyFile2
);
r
=
RegOpenKeyExW
(
HKEY_LOCAL_MACHINE
,
szFullKey
,
0
,
KEY_READ
,
&
key
);
if
(
r
==
ERROR_SUCCESS
)
{
DWORD
index
=
0
,
size
;
WCHAR
subKeyName
[
MAX_PATH
];
do
{
size
=
sizeof
(
subKeyName
)
/
sizeof
(
subKeyName
[
0
]);
r
=
RegEnumKeyExW
(
key
,
index
++
,
subKeyName
,
&
size
,
NULL
,
NULL
,
NULL
,
NULL
);
if
(
r
==
ERROR_SUCCESS
)
{
HKEY
subKey
;
r
=
RegOpenKeyExW
(
key
,
subKeyName
,
0
,
KEY_READ
,
&
subKey
);
if
(
r
==
ERROR_SUCCESS
)
{
HMODULE
lib
;
pfnIsFileSupportedName
isMy2
=
CRYPT_LoadSIPFuncFromKey
(
subKey
,
&
lib
);
if
(
isMy2
)
{
bRet
=
isMy2
((
LPWSTR
)
FileName
,
pgSubject
);
FreeLibrary
(
lib
);
}
RegCloseKey
(
subKey
);
}
}
}
while
(
!
bRet
&&
r
==
ERROR_SUCCESS
);
RegCloseKey
(
key
);
}
}
if
(
!
bRet
)
SetLastError
(
TRUST_E_SUBJECT_FORM_UNKNOWN
);
cleanup:
/* If we didn't open this one we shouldn't close it (hFile is a copy),
...
...
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