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
d791d36a
Commit
d791d36a
authored
Jun 20, 2018
by
Michael Müller
Committed by
Alexandre Julliard
Jun 20, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
crypt32: Implement decoding of X509_OBJECT_IDENTIFIER.
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
6de2e83e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
60 additions
and
0 deletions
+60
-0
decode.c
dlls/crypt32/decode.c
+45
-0
wincrypt.h
include/wincrypt.h
+15
-0
No files found.
dlls/crypt32/decode.c
View file @
d791d36a
...
...
@@ -5973,6 +5973,46 @@ BOOL CRYPT_AsnDecodePKCSEnvelopedData(const BYTE *pbEncoded, DWORD cbEncoded,
return
ret
;
}
static
BOOL
WINAPI
CRYPT_AsnDecodeObjectIdentifier
(
DWORD
dwCertEncodingType
,
LPCSTR
lpszStructType
,
const
BYTE
*
pbEncoded
,
DWORD
cbEncoded
,
DWORD
dwFlags
,
CRYPT_DECODE_PARA
*
pDecodePara
,
void
*
pvStructInfo
,
DWORD
*
pcbStructInfo
)
{
DWORD
bytesNeeded
=
0
;
BOOL
ret
;
__TRY
{
ret
=
CRYPT_AsnDecodeOidInternal
(
pbEncoded
,
cbEncoded
,
dwFlags
&
~
CRYPT_DECODE_ALLOC_FLAG
,
NULL
,
&
bytesNeeded
,
NULL
);
if
(
ret
)
{
if
(
!
pvStructInfo
)
*
pcbStructInfo
=
bytesNeeded
;
else
if
((
ret
=
CRYPT_DecodeEnsureSpace
(
dwFlags
,
pDecodePara
,
pvStructInfo
,
pcbStructInfo
,
bytesNeeded
)))
{
LPSTR
*
info
;
if
(
dwFlags
&
CRYPT_DECODE_ALLOC_FLAG
)
pvStructInfo
=
*
(
BYTE
**
)
pvStructInfo
;
info
=
pvStructInfo
;
*
info
=
(
void
*
)((
BYTE
*
)
info
+
sizeof
(
*
info
));
ret
=
CRYPT_AsnDecodeOidInternal
(
pbEncoded
,
cbEncoded
,
dwFlags
&
~
CRYPT_DECODE_ALLOC_FLAG
,
pvStructInfo
,
&
bytesNeeded
,
NULL
);
if
(
!
ret
&&
(
dwFlags
&
CRYPT_DECODE_ALLOC_FLAG
))
CRYPT_FreeSpace
(
pDecodePara
,
info
);
}
}
}
__EXCEPT_PAGE_FAULT
{
SetLastError
(
STATUS_ACCESS_VIOLATION
);
ret
=
FALSE
;
}
__ENDTRY
return
ret
;
}
static
CryptDecodeObjectExFunc
CRYPT_GetBuiltinDecoder
(
DWORD
dwCertEncodingType
,
LPCSTR
lpszStructType
)
{
...
...
@@ -6112,6 +6152,9 @@ static CryptDecodeObjectExFunc CRYPT_GetBuiltinDecoder(DWORD dwCertEncodingType,
case
LOWORD
(
CMS_SIGNER_INFO
):
decodeFunc
=
CRYPT_AsnDecodeCMSSignerInfo
;
break
;
case
LOWORD
(
X509_OBJECT_IDENTIFIER
):
decodeFunc
=
CRYPT_AsnDecodeObjectIdentifier
;
break
;
}
}
else
if
(
!
strcmp
(
lpszStructType
,
szOID_CERT_EXTENSIONS
))
...
...
@@ -6166,6 +6209,8 @@ static CryptDecodeObjectExFunc CRYPT_GetBuiltinDecoder(DWORD dwCertEncodingType,
decodeFunc
=
CRYPT_AsnDecodePolicyQualifierUserNotice
;
else
if
(
!
strcmp
(
lpszStructType
,
szOID_CTL
))
decodeFunc
=
CRYPT_AsnDecodeCTL
;
else
if
(
!
strcmp
(
lpszStructType
,
szOID_ECC_PUBLIC_KEY
))
decodeFunc
=
CRYPT_AsnDecodeObjectIdentifier
;
return
decodeFunc
;
}
...
...
include/wincrypt.h
View file @
d791d36a
...
...
@@ -288,6 +288,11 @@ typedef struct _CERT_KEY_ATTRIBUTES_INFO {
PCERT_PRIVATE_KEY_VALIDITY
pPrivateKeyUsagePeriod
;
}
CERT_KEY_ATTRIBUTES_INFO
,
*
PCERT_KEY_ATTRIBUTES_INFO
;
typedef
struct
_CERT_ECC_SIGNATURE
{
CRYPT_UINT_BLOB
r
;
CRYPT_UINT_BLOB
s
;
}
CERT_ECC_SIGNATURE
,
*
PCERT_ECC_SIGNATURE
;
/* byte 0 */
#define CERT_DIGITAL_SIGNATURE_KEY_USAGE 0x80
#define CERT_NON_REPUDIATION_KEY_USAGE 0x40
...
...
@@ -2878,6 +2883,12 @@ typedef struct _CTL_FIND_SUBJECT_PARA
#define szOID_X957 "1.2.840.10040"
#define szOID_X957_DSA "1.2.840.10040.4.1"
#define szOID_X957_SHA1DSA "1.2.840.10040.4.3"
#define szOID_ECC_PUBLIC_KEY "1.2.840.10045.2.1"
#define szOID_ECC_CURVE_P256 "1.2.840.10045.3.1.7"
#define szOID_ECDSA_SPECIFIED "1.2.840.10045.4.3"
#define szOID_ECDSA_SHA256 "1.2.840.10045.4.3.2"
#define szOID_ECDSA_SHA384 "1.2.840.10045.4.3.3"
#define szOID_ECDSA_SHA512 "1.2.840.10045.4.3.4"
#define szOID_DS "2.5"
#define szOID_DSALG "2.5.8"
#define szOID_DSALG_CRPT "2.5.8.1"
...
...
@@ -2919,6 +2930,8 @@ typedef struct _CTL_FIND_SUBJECT_PARA
#define szOID_OIWDIR_SIGN "1.3.14.7.2.3"
#define szOID_OIWDIR_md2 "1.3.14.7.2.2.1"
#define szOID_OIWDIR_md2RSA "1.3.14.7.2.3.1"
#define szOID_ECC_CURVE_P384 "1.3.132.0.34"
#define szOID_ECC_CURVE_P521 "1.3.132.0.35"
#define szOID_INFOSEC "2.16.840.1.101.2.1"
#define szOID_INFOSEC_sdnsSignature "2.16.840.1.101.2.1.1.1"
#define szOID_INFOSEC_mosaicSignature "2.16.840.1.101.2.1.1.2"
...
...
@@ -3223,6 +3236,7 @@ typedef struct _CTL_FIND_SUBJECT_PARA
#define X509_PKIX_POLICY_QUALIFIER_USERNOTICE ((LPCSTR)46)
#define X509_DH_PUBLICKEY X509_MULTI_BYTE_UINT
#define X509_DH_PARAMETERS ((LPCSTR)47)
#define X509_ECC_SIGNATURE ((LPCSTR)47)
#define PKCS_ATTRIBUTES ((LPCSTR)48)
#define PKCS_SORTED_CTL ((LPCSTR)49)
#define X942_DH_PARAMETERS ((LPCSTR)50)
...
...
@@ -3240,6 +3254,7 @@ typedef struct _CTL_FIND_SUBJECT_PARA
#define CMC_ADD_EXTENSIONS ((LPCSTR)62)
#define CMC_ADD_ATTRIBUTES ((LPCSTR)63)
#define X509_CERTIFICATE_TEMPLATE ((LPCSTR)64)
#define X509_OBJECT_IDENTIFIER ((LPCSTR)73)
#define PKCS7_SIGNER_INFO ((LPCSTR)500)
#define CMS_SIGNER_INFO ((LPCSTR)501)
...
...
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