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
382d0679
Commit
382d0679
authored
Aug 30, 2006
by
James Hawkins
Committed by
Alexandre Julliard
Sep 07, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
crypt32: Simplify CRYPT_AsnDecodeUnicodeNameValueInternal, getting rid of a warning.
parent
a9670e37
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
51 additions
and
53 deletions
+51
-53
decode.c
dlls/crypt32/decode.c
+51
-53
No files found.
dlls/crypt32/decode.c
View file @
382d0679
...
@@ -1511,67 +1511,65 @@ static BOOL WINAPI CRYPT_AsnDecodeUnicodeNameValueInternal(
...
@@ -1511,67 +1511,65 @@ static BOOL WINAPI CRYPT_AsnDecodeUnicodeNameValueInternal(
break
;
break
;
default:
default:
SetLastError
(
CRYPT_E_ASN1_BADTAG
);
SetLastError
(
CRYPT_E_ASN1_BADTAG
);
return
FALSE
;
}
if
(
!
value
)
*
pcbStructInfo
=
bytesNeeded
;
else
if
(
*
pcbStructInfo
<
bytesNeeded
)
{
*
pcbStructInfo
=
bytesNeeded
;
SetLastError
(
ERROR_MORE_DATA
);
ret
=
FALSE
;
ret
=
FALSE
;
}
}
if
(
ret
)
else
{
{
if
(
!
value
)
*
pcbStructInfo
=
bytesNeeded
;
*
pcbStructInfo
=
bytesNeeded
;
value
->
dwValueType
=
valueType
;
else
if
(
*
pcbStructInfo
<
bytesNeeded
)
if
(
dataLen
)
{
*
pcbStructInfo
=
bytesNeeded
;
SetLastError
(
ERROR_MORE_DATA
);
ret
=
FALSE
;
}
else
{
{
*
pcbStructInfo
=
bytesNeeded
;
DWORD
i
;
value
->
dwValueType
=
valueType
;
LPWSTR
str
=
(
LPWSTR
)
value
->
Value
.
pbData
;
if
(
dataLen
)
{
DWORD
i
;
LPWSTR
str
=
(
LPWSTR
)
value
->
Value
.
pbData
;
assert
(
value
->
Value
.
pbData
);
assert
(
value
->
Value
.
pbData
);
switch
(
pbEncoded
[
0
])
switch
(
pbEncoded
[
0
])
{
case
ASN_NUMERICSTRING
:
case
ASN_PRINTABLESTRING
:
case
ASN_IA5STRING
:
case
ASN_T61STRING
:
case
ASN_VIDEOTEXSTRING
:
case
ASN_GRAPHICSTRING
:
case
ASN_VISIBLESTRING
:
case
ASN_GENERALSTRING
:
value
->
Value
.
cbData
=
dataLen
*
2
;
for
(
i
=
0
;
i
<
dataLen
;
i
++
)
str
[
i
]
=
pbEncoded
[
1
+
lenBytes
+
i
];
break
;
case
ASN_UNIVERSALSTRING
:
value
->
Value
.
cbData
=
dataLen
/
2
;
for
(
i
=
0
;
i
<
dataLen
/
4
;
i
++
)
str
[
i
]
=
(
pbEncoded
[
1
+
lenBytes
+
2
*
i
+
2
]
<<
8
)
|
pbEncoded
[
1
+
lenBytes
+
2
*
i
+
3
];
break
;
case
ASN_BMPSTRING
:
value
->
Value
.
cbData
=
dataLen
;
for
(
i
=
0
;
i
<
dataLen
/
2
;
i
++
)
str
[
i
]
=
(
pbEncoded
[
1
+
lenBytes
+
2
*
i
]
<<
8
)
|
pbEncoded
[
1
+
lenBytes
+
2
*
i
+
1
];
break
;
case
ASN_UTF8STRING
:
value
->
Value
.
cbData
=
MultiByteToWideChar
(
CP_UTF8
,
0
,
(
LPSTR
)
pbEncoded
+
1
+
lenBytes
,
dataLen
,
str
,
bytesNeeded
-
sizeof
(
CERT_NAME_VALUE
))
*
2
;
break
;
}
}
else
{
{
value
->
Value
.
cbData
=
0
;
case
ASN_NUMERICSTRING
:
value
->
Value
.
pbData
=
NULL
;
case
ASN_PRINTABLESTRING
:
case
ASN_IA5STRING
:
case
ASN_T61STRING
:
case
ASN_VIDEOTEXSTRING
:
case
ASN_GRAPHICSTRING
:
case
ASN_VISIBLESTRING
:
case
ASN_GENERALSTRING
:
value
->
Value
.
cbData
=
dataLen
*
2
;
for
(
i
=
0
;
i
<
dataLen
;
i
++
)
str
[
i
]
=
pbEncoded
[
1
+
lenBytes
+
i
];
break
;
case
ASN_UNIVERSALSTRING
:
value
->
Value
.
cbData
=
dataLen
/
2
;
for
(
i
=
0
;
i
<
dataLen
/
4
;
i
++
)
str
[
i
]
=
(
pbEncoded
[
1
+
lenBytes
+
2
*
i
+
2
]
<<
8
)
|
pbEncoded
[
1
+
lenBytes
+
2
*
i
+
3
];
break
;
case
ASN_BMPSTRING
:
value
->
Value
.
cbData
=
dataLen
;
for
(
i
=
0
;
i
<
dataLen
/
2
;
i
++
)
str
[
i
]
=
(
pbEncoded
[
1
+
lenBytes
+
2
*
i
]
<<
8
)
|
pbEncoded
[
1
+
lenBytes
+
2
*
i
+
1
];
break
;
case
ASN_UTF8STRING
:
value
->
Value
.
cbData
=
MultiByteToWideChar
(
CP_UTF8
,
0
,
(
LPSTR
)
pbEncoded
+
1
+
lenBytes
,
dataLen
,
str
,
bytesNeeded
-
sizeof
(
CERT_NAME_VALUE
))
*
2
;
break
;
}
}
}
}
else
{
value
->
Value
.
cbData
=
0
;
value
->
Value
.
pbData
=
NULL
;
}
}
}
}
}
return
ret
;
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