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
5900ab14
Commit
5900ab14
authored
Jul 30, 2007
by
Juan Lang
Committed by
Alexandre Julliard
Jul 31, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
crypt32: Separate decoding PKCS signer info into internal and external versions.
parent
d6150a79
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
65 additions
and
29 deletions
+65
-29
decode.c
dlls/crypt32/decode.c
+65
-29
No files found.
dlls/crypt32/decode.c
View file @
5900ab14
...
...
@@ -3800,6 +3800,49 @@ static BOOL WINAPI CRYPT_AsnDecodeIssuerSerialNumber(DWORD dwCertEncodingType,
return
ret
;
}
static
BOOL
WINAPI
CRYPT_AsnDecodePKCSSignerInfoInternal
(
DWORD
dwCertEncodingType
,
LPCSTR
lpszStructType
,
const
BYTE
*
pbEncoded
,
DWORD
cbEncoded
,
DWORD
dwFlags
,
PCRYPT_DECODE_PARA
pDecodePara
,
void
*
pvStructInfo
,
DWORD
*
pcbStructInfo
)
{
CMSG_SIGNER_INFO
*
info
=
(
CMSG_SIGNER_INFO
*
)
pvStructInfo
;
struct
AsnDecodeSequenceItem
items
[]
=
{
{
ASN_INTEGER
,
offsetof
(
CMSG_SIGNER_INFO
,
dwVersion
),
CRYPT_AsnDecodeInt
,
sizeof
(
DWORD
),
FALSE
,
FALSE
,
0
,
0
},
{
ASN_SEQUENCEOF
,
offsetof
(
CMSG_SIGNER_INFO
,
Issuer
),
CRYPT_AsnDecodeIssuerSerialNumber
,
sizeof
(
CERT_ISSUER_SERIAL_NUMBER
),
FALSE
,
TRUE
,
offsetof
(
CMSG_SIGNER_INFO
,
Issuer
.
pbData
),
0
},
{
ASN_SEQUENCEOF
,
offsetof
(
CMSG_SIGNER_INFO
,
HashAlgorithm
),
CRYPT_AsnDecodeAlgorithmId
,
sizeof
(
CRYPT_ALGORITHM_IDENTIFIER
),
FALSE
,
TRUE
,
offsetof
(
CMSG_SIGNER_INFO
,
HashAlgorithm
.
pszObjId
),
0
},
{
ASN_CONSTRUCTOR
|
ASN_CONTEXT
|
0
,
offsetof
(
CMSG_SIGNER_INFO
,
AuthAttrs
),
CRYPT_AsnDecodePKCSAttributesInternal
,
sizeof
(
CRYPT_ATTRIBUTES
),
TRUE
,
TRUE
,
offsetof
(
CMSG_SIGNER_INFO
,
AuthAttrs
.
rgAttr
),
0
},
{
ASN_SEQUENCEOF
,
offsetof
(
CMSG_SIGNER_INFO
,
HashEncryptionAlgorithm
),
CRYPT_AsnDecodeAlgorithmId
,
sizeof
(
CRYPT_ALGORITHM_IDENTIFIER
),
FALSE
,
TRUE
,
offsetof
(
CMSG_SIGNER_INFO
,
HashEncryptionAlgorithm
.
pszObjId
),
0
},
{
ASN_OCTETSTRING
,
offsetof
(
CMSG_SIGNER_INFO
,
EncryptedHash
),
CRYPT_AsnDecodeOctetsInternal
,
sizeof
(
CRYPT_DER_BLOB
),
FALSE
,
TRUE
,
offsetof
(
CMSG_SIGNER_INFO
,
EncryptedHash
.
pbData
),
0
},
{
ASN_CONSTRUCTOR
|
ASN_CONTEXT
|
1
,
offsetof
(
CMSG_SIGNER_INFO
,
UnauthAttrs
),
CRYPT_AsnDecodePKCSAttributesInternal
,
sizeof
(
CRYPT_ATTRIBUTES
),
TRUE
,
TRUE
,
offsetof
(
CMSG_SIGNER_INFO
,
UnauthAttrs
.
rgAttr
),
0
},
};
BOOL
ret
;
TRACE
(
"%p, %d, %08x, %p, %p, %d
\n
"
,
pbEncoded
,
cbEncoded
,
dwFlags
,
pDecodePara
,
pvStructInfo
,
*
pcbStructInfo
);
ret
=
CRYPT_AsnDecodeSequence
(
dwCertEncodingType
,
items
,
sizeof
(
items
)
/
sizeof
(
items
[
0
]),
pbEncoded
,
cbEncoded
,
dwFlags
,
pDecodePara
,
pvStructInfo
,
pcbStructInfo
,
info
?
info
->
Issuer
.
pbData
:
NULL
);
return
ret
;
}
static
BOOL
WINAPI
CRYPT_AsnDecodePKCSSignerInfo
(
DWORD
dwCertEncodingType
,
LPCSTR
lpszStructType
,
const
BYTE
*
pbEncoded
,
DWORD
cbEncoded
,
DWORD
dwFlags
,
PCRYPT_DECODE_PARA
pDecodePara
,
void
*
pvStructInfo
,
DWORD
*
pcbStructInfo
)
...
...
@@ -3811,35 +3854,28 @@ static BOOL WINAPI CRYPT_AsnDecodePKCSSignerInfo(DWORD dwCertEncodingType,
__TRY
{
struct
AsnDecodeSequenceItem
items
[]
=
{
{
ASN_INTEGER
,
offsetof
(
CMSG_SIGNER_INFO
,
dwVersion
),
CRYPT_AsnDecodeInt
,
sizeof
(
DWORD
),
FALSE
,
FALSE
,
0
,
0
},
{
ASN_SEQUENCEOF
,
offsetof
(
CMSG_SIGNER_INFO
,
Issuer
),
CRYPT_AsnDecodeIssuerSerialNumber
,
sizeof
(
CERT_ISSUER_SERIAL_NUMBER
),
FALSE
,
TRUE
,
offsetof
(
CMSG_SIGNER_INFO
,
Issuer
.
pbData
),
0
},
{
ASN_SEQUENCEOF
,
offsetof
(
CMSG_SIGNER_INFO
,
HashAlgorithm
),
CRYPT_AsnDecodeAlgorithmId
,
sizeof
(
CRYPT_ALGORITHM_IDENTIFIER
),
FALSE
,
TRUE
,
offsetof
(
CMSG_SIGNER_INFO
,
HashAlgorithm
.
pszObjId
),
0
},
{
ASN_CONSTRUCTOR
|
ASN_CONTEXT
|
0
,
offsetof
(
CMSG_SIGNER_INFO
,
AuthAttrs
),
CRYPT_AsnDecodePKCSAttributesInternal
,
sizeof
(
CRYPT_ATTRIBUTES
),
TRUE
,
TRUE
,
offsetof
(
CMSG_SIGNER_INFO
,
AuthAttrs
.
rgAttr
),
0
},
{
ASN_SEQUENCEOF
,
offsetof
(
CMSG_SIGNER_INFO
,
HashEncryptionAlgorithm
),
CRYPT_AsnDecodeAlgorithmId
,
sizeof
(
CRYPT_ALGORITHM_IDENTIFIER
),
FALSE
,
TRUE
,
offsetof
(
CMSG_SIGNER_INFO
,
HashEncryptionAlgorithm
.
pszObjId
),
0
},
{
ASN_OCTETSTRING
,
offsetof
(
CMSG_SIGNER_INFO
,
EncryptedHash
),
CRYPT_AsnDecodeOctetsInternal
,
sizeof
(
CRYPT_DER_BLOB
),
FALSE
,
TRUE
,
offsetof
(
CMSG_SIGNER_INFO
,
EncryptedHash
.
pbData
),
0
},
{
ASN_CONSTRUCTOR
|
ASN_CONTEXT
|
1
,
offsetof
(
CMSG_SIGNER_INFO
,
UnauthAttrs
),
CRYPT_AsnDecodePKCSAttributesInternal
,
sizeof
(
CRYPT_ATTRIBUTES
),
TRUE
,
TRUE
,
offsetof
(
CMSG_SIGNER_INFO
,
UnauthAttrs
.
rgAttr
),
0
},
};
ret
=
CRYPT_AsnDecodePKCSSignerInfoInternal
(
dwCertEncodingType
,
lpszStructType
,
pbEncoded
,
cbEncoded
,
dwFlags
&
~
CRYPT_DECODE_ALLOC_FLAG
,
NULL
,
NULL
,
pcbStructInfo
);
if
(
ret
&&
pvStructInfo
)
{
ret
=
CRYPT_DecodeEnsureSpace
(
dwFlags
,
pDecodePara
,
pvStructInfo
,
pcbStructInfo
,
*
pcbStructInfo
);
if
(
ret
)
{
CMSG_SIGNER_INFO
*
info
;
ret
=
CRYPT_AsnDecodeSequence
(
dwCertEncodingType
,
items
,
sizeof
(
items
)
/
sizeof
(
items
[
0
]),
pbEncoded
,
cbEncoded
,
dwFlags
,
pDecodePara
,
pvStructInfo
,
pcbStructInfo
,
NULL
);
if
(
dwFlags
&
CRYPT_DECODE_ALLOC_FLAG
)
pvStructInfo
=
*
(
BYTE
**
)
pvStructInfo
;
info
=
(
CMSG_SIGNER_INFO
*
)
pvStructInfo
;
info
->
Issuer
.
pbData
=
((
BYTE
*
)
info
+
sizeof
(
CMSG_SIGNER_INFO
));
ret
=
CRYPT_AsnDecodePKCSSignerInfoInternal
(
dwCertEncodingType
,
lpszStructType
,
pbEncoded
,
cbEncoded
,
dwFlags
&
~
CRYPT_DECODE_ALLOC_FLAG
,
NULL
,
pvStructInfo
,
pcbStructInfo
);
}
}
}
__EXCEPT_PAGE_FAULT
{
...
...
@@ -3856,7 +3892,7 @@ static BOOL WINAPI CRYPT_DecodeSignerArray(DWORD dwCertEncodingType,
{
BOOL
ret
;
struct
AsnArrayDescriptor
arrayDesc
=
{
ASN_CONSTRUCTOR
|
ASN_SETOF
,
CRYPT_AsnDecodePKCSSignerInfo
,
sizeof
(
CMSG_SIGNER_INFO
),
TRUE
,
CRYPT_AsnDecodePKCSSignerInfo
Internal
,
sizeof
(
CMSG_SIGNER_INFO
),
TRUE
,
offsetof
(
CMSG_SIGNER_INFO
,
Issuer
.
pbData
)
};
struct
GenericArray
*
array
=
(
struct
GenericArray
*
)
pvStructInfo
;
...
...
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