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
598e0a8f
Commit
598e0a8f
authored
Aug 06, 2009
by
Juan Lang
Committed by
Alexandre Julliard
Aug 07, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wintrust: Implement WVTAsn1SpcSpOpusInfoDecode.
parent
6bcdc69e
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
60 additions
and
13 deletions
+60
-13
asn.c
dlls/wintrust/asn.c
+60
-9
asn.c
dlls/wintrust/tests/asn.c
+0
-4
No files found.
dlls/wintrust/asn.c
View file @
598e0a8f
...
...
@@ -2079,15 +2079,6 @@ BOOL WINAPI WVTAsn1SpcIndirectDataContentDecode(DWORD dwCertEncodingType,
return
ret
;
}
BOOL
WINAPI
WVTAsn1SpcSpOpusInfoDecode
(
DWORD
dwCertEncodingType
,
LPCSTR
lpszStructType
,
const
BYTE
*
pbEncoded
,
DWORD
cbEncoded
,
DWORD
dwFlags
,
void
*
pvStructInfo
,
DWORD
*
pcbStructInfo
)
{
FIXME
(
"%p, %d, %08x, %p, %d
\n
"
,
pbEncoded
,
cbEncoded
,
dwFlags
,
pvStructInfo
,
*
pcbStructInfo
);
return
FALSE
;
}
static
BOOL
WINAPI
CRYPT_AsnDecodeBMPString
(
DWORD
dwCertEncodingType
,
LPCSTR
lpszStructType
,
const
BYTE
*
pbEncoded
,
DWORD
cbEncoded
,
DWORD
dwFlags
,
void
*
pvStructInfo
,
DWORD
*
pcbStructInfo
)
...
...
@@ -2126,6 +2117,66 @@ static BOOL WINAPI CRYPT_AsnDecodeBMPString(DWORD dwCertEncodingType,
return
ret
;
}
static
BOOL
WINAPI
CRYPT_AsnDecodeProgramName
(
DWORD
dwCertEncodingType
,
LPCSTR
lpszStructType
,
const
BYTE
*
pbEncoded
,
DWORD
cbEncoded
,
DWORD
dwFlags
,
void
*
pvStructInfo
,
DWORD
*
pcbStructInfo
)
{
BOOL
ret
=
FALSE
;
DWORD
dataLen
;
TRACE
(
"(%p, %d, %08x, %p, %d)
\n
"
,
pbEncoded
,
cbEncoded
,
dwFlags
,
pvStructInfo
,
pvStructInfo
?
*
pcbStructInfo
:
0
);
if
((
ret
=
CRYPT_GetLen
(
pbEncoded
,
cbEncoded
,
&
dataLen
)))
{
BYTE
lenBytes
=
GET_LEN_BYTES
(
pbEncoded
[
1
]);
ret
=
CRYPT_AsnDecodeBMPString
(
dwCertEncodingType
,
lpszStructType
,
pbEncoded
+
1
+
lenBytes
,
dataLen
,
dwFlags
,
pvStructInfo
,
pcbStructInfo
);
}
return
ret
;
}
BOOL
WINAPI
WVTAsn1SpcSpOpusInfoDecode
(
DWORD
dwCertEncodingType
,
LPCSTR
lpszStructType
,
const
BYTE
*
pbEncoded
,
DWORD
cbEncoded
,
DWORD
dwFlags
,
void
*
pvStructInfo
,
DWORD
*
pcbStructInfo
)
{
BOOL
ret
=
FALSE
;
TRACE
(
"%p, %d, %08x, %p, %d
\n
"
,
pbEncoded
,
cbEncoded
,
dwFlags
,
pvStructInfo
,
*
pcbStructInfo
);
__TRY
{
struct
AsnDecodeSequenceItem
items
[]
=
{
{
ASN_CONSTRUCTOR
|
ASN_CONTEXT
,
offsetof
(
SPC_SP_OPUS_INFO
,
pwszProgramName
),
CRYPT_AsnDecodeProgramName
,
sizeof
(
LPCWSTR
),
TRUE
,
TRUE
,
offsetof
(
SPC_SP_OPUS_INFO
,
pwszProgramName
),
0
},
{
ASN_CONSTRUCTOR
|
ASN_CONTEXT
|
1
,
offsetof
(
SPC_SP_OPUS_INFO
,
pMoreInfo
),
CRYPT_AsnDecodeSPCLinkPointer
,
sizeof
(
PSPC_LINK
),
TRUE
,
TRUE
,
offsetof
(
SPC_SP_OPUS_INFO
,
pMoreInfo
),
0
},
{
ASN_CONSTRUCTOR
|
ASN_CONTEXT
|
2
,
offsetof
(
SPC_SP_OPUS_INFO
,
pPublisherInfo
),
CRYPT_AsnDecodeSPCLinkPointer
,
sizeof
(
PSPC_LINK
),
TRUE
,
TRUE
,
offsetof
(
SPC_SP_OPUS_INFO
,
pPublisherInfo
),
0
},
};
ret
=
CRYPT_AsnDecodeSequence
(
dwCertEncodingType
,
items
,
sizeof
(
items
)
/
sizeof
(
items
[
0
]),
pbEncoded
,
cbEncoded
,
dwFlags
,
pvStructInfo
,
pcbStructInfo
,
NULL
);
}
__EXCEPT_PAGE_FAULT
{
SetLastError
(
STATUS_ACCESS_VIOLATION
);
}
__ENDTRY
TRACE
(
"returning %d
\n
"
,
ret
);
return
ret
;
}
static
BOOL
CRYPT_AsnDecodeInteger
(
const
BYTE
*
pbEncoded
,
DWORD
cbEncoded
,
DWORD
dwFlags
,
void
*
pvStructInfo
,
DWORD
*
pcbStructInfo
)
{
...
...
dlls/wintrust/tests/asn.c
View file @
598e0a8f
...
...
@@ -878,7 +878,6 @@ static void test_decodeSpOpusInfo(void)
ret
=
pCryptDecodeObjectEx
(
X509_ASN_ENCODING
,
SPC_SP_OPUS_INFO_STRUCT
,
emptySequence
,
sizeof
(
emptySequence
),
CRYPT_DECODE_ALLOC_FLAG
,
NULL
,
&
info
,
&
size
);
todo_wine
ok
(
ret
,
"CryptDecodeObjectEx failed: %08x
\n
"
,
GetLastError
());
if
(
ret
)
{
...
...
@@ -890,7 +889,6 @@ static void test_decodeSpOpusInfo(void)
ret
=
pCryptDecodeObjectEx
(
X509_ASN_ENCODING
,
SPC_SP_OPUS_INFO_STRUCT
,
spOpusInfoWithProgramName
,
sizeof
(
spOpusInfoWithProgramName
),
CRYPT_DECODE_ALLOC_FLAG
,
NULL
,
&
info
,
&
size
);
todo_wine
ok
(
ret
,
"CryptDecodeObjectEx failed: %08x
\n
"
,
GetLastError
());
if
(
ret
)
{
...
...
@@ -903,7 +901,6 @@ static void test_decodeSpOpusInfo(void)
ret
=
pCryptDecodeObjectEx
(
X509_ASN_ENCODING
,
SPC_SP_OPUS_INFO_STRUCT
,
spOpusInfoWithMoreInfo
,
sizeof
(
spOpusInfoWithMoreInfo
),
CRYPT_DECODE_ALLOC_FLAG
,
NULL
,
&
info
,
&
size
);
todo_wine
ok
(
ret
,
"CryptDecodeObjectEx failed: %08x
\n
"
,
GetLastError
());
if
(
ret
)
{
...
...
@@ -922,7 +919,6 @@ static void test_decodeSpOpusInfo(void)
ret
=
pCryptDecodeObjectEx
(
X509_ASN_ENCODING
,
SPC_SP_OPUS_INFO_STRUCT
,
spOpusInfoWithPublisherInfo
,
sizeof
(
spOpusInfoWithPublisherInfo
),
CRYPT_DECODE_ALLOC_FLAG
,
NULL
,
&
info
,
&
size
);
todo_wine
ok
(
ret
,
"CryptDecodeObjectEx failed: %08x
\n
"
,
GetLastError
());
if
(
ret
)
{
...
...
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