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
4ccafdcb
Commit
4ccafdcb
authored
Nov 06, 2009
by
Juan Lang
Committed by
Alexandre Julliard
Nov 09, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
crypt32: Fix encoding cert issuer/subject unique ids.
parent
acfa433f
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
23 deletions
+19
-23
encode.c
dlls/crypt32/encode.c
+19
-19
encode.c
dlls/crypt32/tests/encode.c
+0
-4
No files found.
dlls/crypt32/encode.c
View file @
4ccafdcb
...
...
@@ -506,37 +506,37 @@ static BOOL WINAPI CRYPT_AsnEncodeCertInfo(DWORD dwCertEncodingType,
{
&
info
->
SubjectPublicKeyInfo
,
CRYPT_AsnEncodePubKeyInfoNoNull
,
0
},
{
0
}
};
struct
AsnConstructedItem
constructed
[
3
]
=
{
{
0
}
};
DWORD
cItem
=
7
,
cConstructed
=
0
;
struct
AsnConstructedItem
constructed
=
{
0
};
struct
AsnEncodeTagSwappedItem
swapped
[
2
]
=
{
{
0
}
};
DWORD
cItem
=
7
,
cSwapped
=
0
;
if
(
info
->
IssuerUniqueId
.
cbData
)
{
constructed
[
cConstructed
].
tag
=
1
;
constructed
[
cConstruct
ed
].
pvStructInfo
=
&
info
->
IssuerUniqueId
;
constructed
[
cConstruct
ed
].
encodeFunc
=
CRYPT_AsnEncodeBits
;
items
[
cItem
].
pvStructInfo
=
&
constructed
[
cConstruct
ed
];
items
[
cItem
].
encodeFunc
=
CRYPT_AsnEncode
Constructed
;
c
Construct
ed
++
;
swapped
[
cSwapped
].
tag
=
ASN_CONTEXT
|
1
;
swapped
[
cSwapp
ed
].
pvStructInfo
=
&
info
->
IssuerUniqueId
;
swapped
[
cSwapp
ed
].
encodeFunc
=
CRYPT_AsnEncodeBits
;
items
[
cItem
].
pvStructInfo
=
&
swapped
[
cSwapp
ed
];
items
[
cItem
].
encodeFunc
=
CRYPT_AsnEncode
SwapTag
;
c
Swapp
ed
++
;
cItem
++
;
}
if
(
info
->
SubjectUniqueId
.
cbData
)
{
constructed
[
cConstructed
].
tag
=
2
;
constructed
[
cConstruct
ed
].
pvStructInfo
=
&
info
->
SubjectUniqueId
;
constructed
[
cConstruct
ed
].
encodeFunc
=
CRYPT_AsnEncodeBits
;
items
[
cItem
].
pvStructInfo
=
&
constructed
[
cConstruct
ed
];
items
[
cItem
].
encodeFunc
=
CRYPT_AsnEncode
Constructed
;
c
Construct
ed
++
;
swapped
[
cSwapped
].
tag
=
ASN_CONTEXT
|
2
;
swapped
[
cSwapp
ed
].
pvStructInfo
=
&
info
->
SubjectUniqueId
;
swapped
[
cSwapp
ed
].
encodeFunc
=
CRYPT_AsnEncodeBits
;
items
[
cItem
].
pvStructInfo
=
&
swapped
[
cSwapp
ed
];
items
[
cItem
].
encodeFunc
=
CRYPT_AsnEncode
SwapTag
;
c
Swapp
ed
++
;
cItem
++
;
}
if
(
info
->
cExtension
)
{
constructed
[
cConstructed
]
.
tag
=
3
;
constructed
[
cConstructed
]
.
pvStructInfo
=
&
info
->
cExtension
;
constructed
[
cConstructed
]
.
encodeFunc
=
CRYPT_AsnEncodeExtensions
;
items
[
cItem
].
pvStructInfo
=
&
constructed
[
cConstructed
]
;
constructed
.
tag
=
3
;
constructed
.
pvStructInfo
=
&
info
->
cExtension
;
constructed
.
encodeFunc
=
CRYPT_AsnEncodeExtensions
;
items
[
cItem
].
pvStructInfo
=
&
constructed
;
items
[
cItem
].
encodeFunc
=
CRYPT_AsnEncodeConstructed
;
cConstructed
++
;
cItem
++
;
}
...
...
dlls/crypt32/tests/encode.c
View file @
4ccafdcb
...
...
@@ -2979,11 +2979,9 @@ static void test_encodeCertToBeSigned(DWORD dwEncoding)
ok
(
ret
,
"CryptEncodeObjectEx failed: %08x
\n
"
,
GetLastError
());
if
(
buf
)
{
todo_wine
{
ok
(
size
==
sizeof
(
v1CertWithIssuerUniqueId
),
"Wrong size %d
\n
"
,
size
);
ok
(
!
memcmp
(
buf
,
v1CertWithIssuerUniqueId
,
size
),
"Got unexpected value
\n
"
);
}
LocalFree
(
buf
);
}
/* Test v1 cert with an issuer name, a subject name, and a serial number */
...
...
@@ -3031,7 +3029,6 @@ static void test_encodeCertToBeSigned(DWORD dwEncoding)
ok
(
size
==
sizeof
(
v1CertWithSubjectIssuerSerialAndIssuerUniqueId
)
||
size
==
sizeof
(
v1CertWithSubjectIssuerSerialAndIssuerUniqueIdNoNull
),
"Wrong size %d
\n
"
,
size
);
todo_wine
{
if
(
size
==
sizeof
(
v1CertWithSubjectIssuerSerialAndIssuerUniqueId
))
ok
(
!
memcmp
(
buf
,
v1CertWithSubjectIssuerSerialAndIssuerUniqueId
,
size
),
"unexpected value
\n
"
);
...
...
@@ -3040,7 +3037,6 @@ static void test_encodeCertToBeSigned(DWORD dwEncoding)
ok
(
!
memcmp
(
buf
,
v1CertWithSubjectIssuerSerialAndIssuerUniqueIdNoNull
,
size
),
"unexpected value
\n
"
);
}
LocalFree
(
buf
);
}
/* Remove the public key, and add a subject key identifier extension */
...
...
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