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
c3bc7f2c
Commit
c3bc7f2c
authored
Jan 19, 2011
by
Juan Lang
Committed by
Alexandre Julliard
Jan 20, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
crypt32: Simplify a function.
parent
59bcbb2d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
31 deletions
+26
-31
str.c
dlls/crypt32/str.c
+26
-31
No files found.
dlls/crypt32/str.c
View file @
c3bc7f2c
...
...
@@ -786,46 +786,41 @@ static BOOL CRYPT_EncodeValueWithType(DWORD dwCertEncodingType,
if
(
value
->
end
>
value
->
start
)
{
LONG
i
;
LPWSTR
ptr
;
nameValue
.
Value
.
pbData
=
CryptMemAlloc
((
value
->
end
-
value
->
start
)
*
sizeof
(
WCHAR
));
if
(
!
nameValue
.
Value
.
pbData
)
{
SetLastError
(
ERROR_OUTOFMEMORY
);
ret
=
FALSE
;
}
}
if
(
ret
)
{
if
(
value
->
end
>
value
->
start
)
{
LONG
i
;
LPWSTR
ptr
=
(
LPWSTR
)
nameValue
.
Value
.
pbData
;
for
(
i
=
0
;
i
<
value
->
end
-
value
->
start
;
i
++
)
{
*
ptr
++
=
value
->
start
[
i
];
if
(
value
->
start
[
i
]
==
'"'
)
i
++
;
}
nameValue
.
Value
.
cbData
=
(
LPBYTE
)
ptr
-
nameValue
.
Value
.
pbData
;
return
FALSE
;
}
ret
=
CryptEncodeObjectEx
(
dwCertEncodingType
,
X509_UNICODE_NAME_VALUE
,
&
nameValue
,
CRYPT_ENCODE_ALLOC_FLAG
,
NULL
,
&
output
->
pbData
,
&
output
->
cbData
);
if
(
!
ret
&&
ppszError
)
ptr
=
(
LPWSTR
)
nameValue
.
Value
.
pbData
;
for
(
i
=
0
;
i
<
value
->
end
-
value
->
start
;
i
++
)
{
if
(
type
==
CERT_RDN_NUMERIC_STRING
&&
GetLastError
()
==
CRYPT_E_INVALID_NUMERIC_STRING
)
*
ppszError
=
value
->
start
+
output
->
cbData
;
else
if
(
type
==
CERT_RDN_PRINTABLE_STRING
&&
GetLastError
()
==
CRYPT_E_INVALID_PRINTABLE_STRING
)
*
ppszError
=
value
->
start
+
output
->
cbData
;
else
if
(
type
==
CERT_RDN_IA5_STRING
&&
GetLastError
()
==
CRYPT_E_INVALID_IA5_STRING
)
*
ppszError
=
value
->
start
+
output
->
cbData
;
*
ptr
++
=
value
->
start
[
i
];
if
(
value
->
start
[
i
]
==
'"'
)
i
++
;
}
CryptMemFree
(
nameValue
.
Value
.
pbData
);
nameValue
.
Value
.
cbData
=
(
LPBYTE
)
ptr
-
nameValue
.
Value
.
pbData
;
}
ret
=
CryptEncodeObjectEx
(
dwCertEncodingType
,
X509_UNICODE_NAME_VALUE
,
&
nameValue
,
CRYPT_ENCODE_ALLOC_FLAG
,
NULL
,
&
output
->
pbData
,
&
output
->
cbData
);
if
(
!
ret
&&
ppszError
)
{
if
(
type
==
CERT_RDN_NUMERIC_STRING
&&
GetLastError
()
==
CRYPT_E_INVALID_NUMERIC_STRING
)
*
ppszError
=
value
->
start
+
output
->
cbData
;
else
if
(
type
==
CERT_RDN_PRINTABLE_STRING
&&
GetLastError
()
==
CRYPT_E_INVALID_PRINTABLE_STRING
)
*
ppszError
=
value
->
start
+
output
->
cbData
;
else
if
(
type
==
CERT_RDN_IA5_STRING
&&
GetLastError
()
==
CRYPT_E_INVALID_IA5_STRING
)
*
ppszError
=
value
->
start
+
output
->
cbData
;
}
CryptMemFree
(
nameValue
.
Value
.
pbData
);
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