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
91fbdb56
Commit
91fbdb56
authored
Dec 02, 2009
by
Juan Lang
Committed by
Alexandre Julliard
Dec 03, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
crypt32: The KeyId member of an authority key identifier is an octet string, not an integer.
parent
aa737174
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
80 deletions
+4
-80
decode.c
dlls/crypt32/decode.c
+2
-39
encode.c
dlls/crypt32/encode.c
+2
-41
No files found.
dlls/crypt32/decode.c
View file @
91fbdb56
...
...
@@ -3106,43 +3106,6 @@ static BOOL CRYPT_AsnDecodeAltNameInternal(const BYTE *pbEncoded,
return
ret
;
}
/* Like CRYPT_AsnDecodeIntegerInternal, but swaps the bytes */
static
BOOL
CRYPT_AsnDecodeIntegerSwapBytes
(
const
BYTE
*
pbEncoded
,
DWORD
cbEncoded
,
DWORD
dwFlags
,
void
*
pvStructInfo
,
DWORD
*
pcbStructInfo
,
DWORD
*
pcbDecoded
)
{
BOOL
ret
;
TRACE
(
"(%p, %d, 0x%08x, %p, %d, %p)
\n
"
,
pbEncoded
,
cbEncoded
,
dwFlags
,
pvStructInfo
,
*
pcbStructInfo
,
pcbDecoded
);
/* Can't use the CRYPT_DECODE_NOCOPY_FLAG, because we modify the bytes in-
* place.
*/
ret
=
CRYPT_AsnDecodeIntegerInternal
(
pbEncoded
,
cbEncoded
,
dwFlags
&
~
CRYPT_DECODE_NOCOPY_FLAG
,
pvStructInfo
,
pcbStructInfo
,
pcbDecoded
);
if
(
ret
&&
pvStructInfo
)
{
CRYPT_DATA_BLOB
*
blob
=
pvStructInfo
;
if
(
blob
->
cbData
)
{
DWORD
i
;
BYTE
temp
;
for
(
i
=
0
;
i
<
blob
->
cbData
/
2
;
i
++
)
{
temp
=
blob
->
pbData
[
i
];
blob
->
pbData
[
i
]
=
blob
->
pbData
[
blob
->
cbData
-
i
-
1
];
blob
->
pbData
[
blob
->
cbData
-
i
-
1
]
=
temp
;
}
}
}
TRACE
(
"returning %d (%08x)
\n
"
,
ret
,
GetLastError
());
return
ret
;
}
static
BOOL
WINAPI
CRYPT_AsnDecodeAuthorityKeyId
(
DWORD
dwCertEncodingType
,
LPCSTR
lpszStructType
,
const
BYTE
*
pbEncoded
,
DWORD
cbEncoded
,
DWORD
dwFlags
,
PCRYPT_DECODE_PARA
pDecodePara
,
void
*
pvStructInfo
,
DWORD
*
pcbStructInfo
)
...
...
@@ -3153,7 +3116,7 @@ static BOOL WINAPI CRYPT_AsnDecodeAuthorityKeyId(DWORD dwCertEncodingType,
{
struct
AsnDecodeSequenceItem
items
[]
=
{
{
ASN_CONTEXT
|
0
,
offsetof
(
CERT_AUTHORITY_KEY_ID_INFO
,
KeyId
),
CRYPT_AsnDecode
IntegerSwapBytes
,
sizeof
(
CRYPT_DATA_BLOB
),
CRYPT_AsnDecode
OctetsInternal
,
sizeof
(
CRYPT_DATA_BLOB
),
TRUE
,
TRUE
,
offsetof
(
CERT_AUTHORITY_KEY_ID_INFO
,
KeyId
.
pbData
),
0
},
{
ASN_CONTEXT
|
ASN_CONSTRUCTOR
|
1
,
offsetof
(
CERT_AUTHORITY_KEY_ID_INFO
,
CertIssuer
),
...
...
@@ -3188,7 +3151,7 @@ static BOOL WINAPI CRYPT_AsnDecodeAuthorityKeyId2(DWORD dwCertEncodingType,
{
struct
AsnDecodeSequenceItem
items
[]
=
{
{
ASN_CONTEXT
|
0
,
offsetof
(
CERT_AUTHORITY_KEY_ID2_INFO
,
KeyId
),
CRYPT_AsnDecode
IntegerSwapBytes
,
sizeof
(
CRYPT_DATA_BLOB
),
CRYPT_AsnDecode
OctetsInternal
,
sizeof
(
CRYPT_DATA_BLOB
),
TRUE
,
TRUE
,
offsetof
(
CERT_AUTHORITY_KEY_ID2_INFO
,
KeyId
.
pbData
),
0
},
{
ASN_CONTEXT
|
ASN_CONSTRUCTOR
|
1
,
offsetof
(
CERT_AUTHORITY_KEY_ID2_INFO
,
AuthorityCertIssuer
),
...
...
dlls/crypt32/encode.c
View file @
91fbdb56
...
...
@@ -2438,45 +2438,6 @@ static BOOL WINAPI CRYPT_AsnEncodeAltNameEntry(DWORD dwCertEncodingType,
return
ret
;
}
static
BOOL
WINAPI
CRYPT_AsnEncodeIntegerSwapBytes
(
DWORD
dwCertEncodingType
,
LPCSTR
lpszStructType
,
const
void
*
pvStructInfo
,
DWORD
dwFlags
,
PCRYPT_ENCODE_PARA
pEncodePara
,
BYTE
*
pbEncoded
,
DWORD
*
pcbEncoded
)
{
BOOL
ret
;
__TRY
{
const
CRYPT_DATA_BLOB
*
blob
=
pvStructInfo
;
CRYPT_DATA_BLOB
newBlob
=
{
blob
->
cbData
,
NULL
};
ret
=
TRUE
;
if
(
newBlob
.
cbData
)
{
newBlob
.
pbData
=
CryptMemAlloc
(
newBlob
.
cbData
);
if
(
newBlob
.
pbData
)
{
DWORD
i
;
for
(
i
=
0
;
i
<
newBlob
.
cbData
;
i
++
)
newBlob
.
pbData
[
newBlob
.
cbData
-
i
-
1
]
=
blob
->
pbData
[
i
];
}
else
ret
=
FALSE
;
}
if
(
ret
)
ret
=
CRYPT_AsnEncodeInteger
(
dwCertEncodingType
,
lpszStructType
,
&
newBlob
,
dwFlags
,
pEncodePara
,
pbEncoded
,
pcbEncoded
);
CryptMemFree
(
newBlob
.
pbData
);
}
__EXCEPT_PAGE_FAULT
{
SetLastError
(
STATUS_ACCESS_VIOLATION
);
ret
=
FALSE
;
}
__ENDTRY
return
ret
;
}
static
BOOL
WINAPI
CRYPT_AsnEncodeAuthorityKeyId
(
DWORD
dwCertEncodingType
,
LPCSTR
lpszStructType
,
const
void
*
pvStructInfo
,
DWORD
dwFlags
,
PCRYPT_ENCODE_PARA
pEncodePara
,
BYTE
*
pbEncoded
,
DWORD
*
pcbEncoded
)
...
...
@@ -2495,7 +2456,7 @@ static BOOL WINAPI CRYPT_AsnEncodeAuthorityKeyId(DWORD dwCertEncodingType,
{
swapped
[
cSwapped
].
tag
=
ASN_CONTEXT
|
0
;
swapped
[
cSwapped
].
pvStructInfo
=
&
info
->
KeyId
;
swapped
[
cSwapped
].
encodeFunc
=
CRYPT_AsnEncode
IntegerSwapByte
s
;
swapped
[
cSwapped
].
encodeFunc
=
CRYPT_AsnEncode
Octet
s
;
items
[
cItem
].
pvStructInfo
=
&
swapped
[
cSwapped
];
items
[
cItem
].
encodeFunc
=
CRYPT_AsnEncodeSwapTag
;
cSwapped
++
;
...
...
@@ -2626,7 +2587,7 @@ static BOOL WINAPI CRYPT_AsnEncodeAuthorityKeyId2(DWORD dwCertEncodingType,
{
swapped
[
cSwapped
].
tag
=
ASN_CONTEXT
|
0
;
swapped
[
cSwapped
].
pvStructInfo
=
&
info
->
KeyId
;
swapped
[
cSwapped
].
encodeFunc
=
CRYPT_AsnEncode
IntegerSwapByte
s
;
swapped
[
cSwapped
].
encodeFunc
=
CRYPT_AsnEncode
Octet
s
;
items
[
cItem
].
pvStructInfo
=
&
swapped
[
cSwapped
];
items
[
cItem
].
encodeFunc
=
CRYPT_AsnEncodeSwapTag
;
cSwapped
++
;
...
...
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