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
5af64e48
Commit
5af64e48
authored
Jun 03, 2005
by
Juan Lang
Committed by
Alexandre Julliard
Jun 03, 2005
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rearrange Crypt{De|En}codeObjectEx to make error handling more
natural.
parent
8cf6accf
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
46 additions
and
48 deletions
+46
-48
encode.c
dlls/crypt32/encode.c
+46
-48
No files found.
dlls/crypt32/encode.c
View file @
5af64e48
...
...
@@ -313,20 +313,14 @@ BOOL WINAPI CryptEncodeObject(DWORD dwCertEncodingType, LPCSTR lpszStructType,
return
ret
;
}
static
BOOL
CRYPT_EncodeInt
(
DWORD
dwCertEncodingType
,
const
void
*
pvStructInfo
,
DWORD
dwFlags
,
PCRYPT_ENCODE_PARA
pEncodePara
,
BYTE
*
pbEncoded
,
DWORD
*
pcbEncoded
)
static
BOOL
WINAPI
CRYPT_AsnEncodeInt
(
DWORD
dwCertEncodingType
,
LPCSTR
lpszStructType
,
const
void
*
pvStructInfo
,
DWORD
dwFlags
,
PCRYPT_ENCODE_PARA
pEncodePara
,
BYTE
*
pbEncoded
,
DWORD
*
pcbEncoded
)
{
INT
val
,
i
;
BYTE
significantBytes
,
padByte
=
0
,
bytesNeeded
;
BOOL
neg
=
FALSE
,
pad
=
FALSE
;
if
((
dwCertEncodingType
&
CERT_ENCODING_TYPE_MASK
)
!=
X509_ASN_ENCODING
&&
(
dwCertEncodingType
&
CMSG_ENCODING_TYPE_MASK
)
!=
PKCS_7_ASN_ENCODING
)
{
SetLastError
(
ERROR_FILE_NOT_FOUND
);
return
FALSE
;
}
if
(
!
pvStructInfo
)
{
SetLastError
(
ERROR_INVALID_PARAMETER
);
...
...
@@ -403,7 +397,9 @@ BOOL WINAPI CryptEncodeObjectEx(DWORD dwCertEncodingType, LPCSTR lpszStructType,
const
void
*
pvStructInfo
,
DWORD
dwFlags
,
PCRYPT_ENCODE_PARA
pEncodePara
,
BYTE
*
pbEncoded
,
DWORD
*
pcbEncoded
)
{
BOOL
ret
=
FALSE
,
encoded
=
FALSE
;
BOOL
ret
=
FALSE
;
HMODULE
lib
=
NULL
;
CryptEncodeObjectExFunc
encodeFunc
=
NULL
;
TRACE
(
"(0x%08lx, %s, %p, 0x%08lx, %p, %p, %p): semi-stub
\n
"
,
dwCertEncodingType
,
HIWORD
(
lpszStructType
)
?
debugstr_a
(
lpszStructType
)
:
...
...
@@ -418,30 +414,30 @@ BOOL WINAPI CryptEncodeObjectEx(DWORD dwCertEncodingType, LPCSTR lpszStructType,
if
(
!
HIWORD
(
lpszStructType
))
{
switch
(
LOWORD
(
lpszStructType
))
if
((
dwCertEncodingType
&
CERT_ENCODING_TYPE_MASK
)
==
X509_ASN_ENCODING
||
(
dwCertEncodingType
&
CMSG_ENCODING_TYPE_MASK
)
==
PKCS_7_ASN_ENCODING
)
{
case
(
WORD
)
X509_INTEGER
:
ret
=
CRYPT_EncodeInt
(
dwCertEncodingType
,
pvStructInfo
,
dwFlags
,
pEncodePara
,
pbEncoded
,
pcbEncoded
);
break
;
default:
FIXME
(
"%d: unimplemented
\n
"
,
LOWORD
(
lpszStructType
));
switch
(
LOWORD
(
lpszStructType
))
{
case
(
WORD
)
X509_INTEGER
:
encodeFunc
=
CRYPT_AsnEncodeInt
;
break
;
default:
FIXME
(
"%d: unimplemented
\n
"
,
LOWORD
(
lpszStructType
));
}
}
}
if
(
!
encoded
)
{
HMODULE
lib
;
CryptEncodeObjectExFunc
pCryptEncodeObjectEx
=
(
CryptEncodeObjectExFunc
)
CRYPT_GetFunc
(
dwCertEncodingType
,
if
(
!
encodeFunc
)
encodeFunc
=
(
CryptEncodeObjectExFunc
)
CRYPT_GetFunc
(
dwCertEncodingType
,
lpszStructType
,
"CryptEncodeObjectEx"
,
&
lib
);
if
(
pCryptEncodeObjectEx
)
{
ret
=
pCryptEncodeObjectEx
(
dwCertEncodingType
,
lpszStructType
,
pvStructInfo
,
dwFlags
,
pEncodePara
,
pbEncoded
,
pcbEncoded
);
FreeLibrary
(
lib
);
}
}
if
(
encodeFunc
)
ret
=
encodeFunc
(
dwCertEncodingType
,
lpszStructType
,
pvStructInfo
,
dwFlags
,
pEncodePara
,
pbEncoded
,
pcbEncoded
);
else
SetLastError
(
ERROR_FILE_NOT_FOUND
);
if
(
lib
)
FreeLibrary
(
lib
);
return
ret
;
}
...
...
@@ -493,7 +489,9 @@ BOOL WINAPI CryptDecodeObjectEx(DWORD dwCertEncodingType, LPCSTR lpszStructType,
const
BYTE
*
pbEncoded
,
DWORD
cbEncoded
,
DWORD
dwFlags
,
PCRYPT_DECODE_PARA
pDecodePara
,
void
*
pvStructInfo
,
DWORD
*
pcbStructInfo
)
{
BOOL
ret
=
FALSE
,
decoded
=
FALSE
;
BOOL
ret
=
FALSE
;
HMODULE
lib
=
NULL
;
CryptDecodeObjectExFunc
decodeFunc
=
NULL
;
FIXME
(
"(0x%08lx, %s, %p, %ld, 0x%08lx, %p, %p, %p): stub
\n
"
,
dwCertEncodingType
,
HIWORD
(
lpszStructType
)
?
debugstr_a
(
lpszStructType
)
:
...
...
@@ -508,26 +506,26 @@ BOOL WINAPI CryptDecodeObjectEx(DWORD dwCertEncodingType, LPCSTR lpszStructType,
if
(
!
HIWORD
(
lpszStructType
))
{
switch
(
LOWORD
(
lpszStructType
))
if
((
dwCertEncodingType
&
CERT_ENCODING_TYPE_MASK
)
==
X509_ASN_ENCODING
||
(
dwCertEncodingType
&
CMSG_ENCODING_TYPE_MASK
)
==
PKCS_7_ASN_ENCODING
)
{
default:
FIXME
(
"%d: unimplemented
\n
"
,
LOWORD
(
lpszStructType
));
switch
(
LOWORD
(
lpszStructType
))
{
default:
FIXME
(
"%d: unimplemented
\n
"
,
LOWORD
(
lpszStructType
));
}
}
}
if
(
!
decoded
)
{
HMODULE
lib
;
CryptDecodeObjectExFunc
pCryptDecodeObjectEx
=
(
CryptDecodeObjectExFunc
)
CRYPT_GetFunc
(
dwCertEncodingType
,
if
(
!
decodeFunc
)
decodeFunc
=
(
CryptDecodeObjectExFunc
)
CRYPT_GetFunc
(
dwCertEncodingType
,
lpszStructType
,
"CryptDecodeObjectEx"
,
&
lib
);
if
(
pCryptDecodeObjectEx
)
{
ret
=
pCryptDecodeObjectEx
(
dwCertEncodingType
,
lpszStructType
,
pbEncoded
,
cbEncoded
,
dwFlags
,
pDecodePara
,
pvStructInfo
,
pcbStructInfo
);
FreeLibrary
(
lib
);
}
}
if
(
decodeFunc
)
ret
=
decodeFunc
(
dwCertEncodingType
,
lpszStructType
,
pbEncoded
,
cbEncoded
,
dwFlags
,
pDecodePara
,
pvStructInfo
,
pcbStructInfo
);
else
SetLastError
(
ERROR_FILE_NOT_FOUND
);
if
(
lib
)
FreeLibrary
(
lib
);
return
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