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
9d4ab487
Commit
9d4ab487
authored
Nov 20, 2008
by
Juan Lang
Committed by
Alexandre Julliard
Nov 21, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
crypt32: Formatted bits are always in a single line, regardless of dwFormatStrType.
parent
57fde4e8
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
31 deletions
+14
-31
object.c
dlls/crypt32/object.c
+14
-31
No files found.
dlls/crypt32/object.c
View file @
9d4ab487
...
@@ -604,7 +604,6 @@ static BOOL WINAPI CRYPT_FormatHexString(DWORD dwCertEncodingType,
...
@@ -604,7 +604,6 @@ static BOOL WINAPI CRYPT_FormatHexString(DWORD dwCertEncodingType,
#define MAX_STRING_RESOURCE_LEN 128
#define MAX_STRING_RESOURCE_LEN 128
static
const
WCHAR
crlf
[]
=
{
'\r'
,
'\n'
,
0
};
static
const
WCHAR
commaSpace
[]
=
{
','
,
' '
,
0
};
static
const
WCHAR
commaSpace
[]
=
{
','
,
' '
,
0
};
struct
BitToString
struct
BitToString
...
@@ -614,30 +613,18 @@ struct BitToString
...
@@ -614,30 +613,18 @@ struct BitToString
WCHAR
str
[
MAX_STRING_RESOURCE_LEN
];
WCHAR
str
[
MAX_STRING_RESOURCE_LEN
];
};
};
static
BOOL
CRYPT_FormatBits
(
DWORD
dwFormatStrType
,
BYTE
bits
,
static
BOOL
CRYPT_FormatBits
(
BYTE
bits
,
const
struct
BitToString
*
map
,
const
struct
BitToString
*
map
,
DWORD
mapEntries
,
void
*
pbFormat
,
DWORD
mapEntries
,
void
*
pbFormat
,
DWORD
*
pcbFormat
,
BOOL
*
first
)
DWORD
*
pcbFormat
,
BOOL
*
first
)
{
{
LPCWSTR
sep
;
DWORD
bytesNeeded
=
sizeof
(
WCHAR
);
DWORD
sepLen
,
bytesNeeded
=
sizeof
(
WCHAR
);
int
i
;
int
i
;
BOOL
ret
=
TRUE
,
localFirst
=
*
first
;
BOOL
ret
=
TRUE
,
localFirst
=
*
first
;
if
(
dwFormatStrType
&
CRYPT_FORMAT_STR_MULTI_LINE
)
{
sep
=
crlf
;
sepLen
=
strlenW
(
crlf
)
*
sizeof
(
WCHAR
);
}
else
{
sep
=
commaSpace
;
sepLen
=
strlenW
(
commaSpace
)
*
sizeof
(
WCHAR
);
}
for
(
i
=
0
;
i
<
mapEntries
;
i
++
)
for
(
i
=
0
;
i
<
mapEntries
;
i
++
)
if
(
bits
&
map
[
i
].
bit
)
if
(
bits
&
map
[
i
].
bit
)
{
{
if
(
!
localFirst
)
if
(
!
localFirst
)
bytesNeeded
+=
s
epLen
;
bytesNeeded
+=
s
trlenW
(
commaSpace
)
*
sizeof
(
WCHAR
)
;
localFirst
=
FALSE
;
localFirst
=
FALSE
;
bytesNeeded
+=
strlenW
(
map
[
i
].
str
)
*
sizeof
(
WCHAR
);
bytesNeeded
+=
strlenW
(
map
[
i
].
str
)
*
sizeof
(
WCHAR
);
}
}
...
@@ -664,8 +651,8 @@ static BOOL CRYPT_FormatBits(DWORD dwFormatStrType, BYTE bits,
...
@@ -664,8 +651,8 @@ static BOOL CRYPT_FormatBits(DWORD dwFormatStrType, BYTE bits,
{
{
if
(
!
localFirst
)
if
(
!
localFirst
)
{
{
strcpyW
(
str
,
sep
);
strcpyW
(
str
,
commaSpace
);
str
+=
s
epLen
/
sizeof
(
WCHAR
);
str
+=
s
trlenW
(
commaSpace
);
}
}
localFirst
=
FALSE
;
localFirst
=
FALSE
;
strcpyW
(
str
,
map
[
i
].
str
);
strcpyW
(
str
,
map
[
i
].
str
);
...
@@ -753,15 +740,13 @@ static BOOL WINAPI CRYPT_FormatKeyUsage(DWORD dwCertEncodingType,
...
@@ -753,15 +740,13 @@ static BOOL WINAPI CRYPT_FormatKeyUsage(DWORD dwCertEncodingType,
keyUsageByte1Map
[
i
].
str
,
MAX_STRING_RESOURCE_LEN
);
keyUsageByte1Map
[
i
].
str
,
MAX_STRING_RESOURCE_LEN
);
stringsLoaded
=
TRUE
;
stringsLoaded
=
TRUE
;
}
}
CRYPT_FormatBits
(
dwFormatStrType
,
bits
->
pbData
[
0
],
CRYPT_FormatBits
(
bits
->
pbData
[
0
],
keyUsageByte0Map
,
keyUsageByte0Map
,
sizeof
(
keyUsageByte0Map
)
/
sizeof
(
keyUsageByte0Map
[
0
]),
sizeof
(
keyUsageByte0Map
)
/
sizeof
(
keyUsageByte0Map
[
0
]),
NULL
,
&
bitStringLen
,
&
first
);
NULL
,
&
bitStringLen
,
&
first
);
bytesNeeded
+=
bitStringLen
;
bytesNeeded
+=
bitStringLen
;
if
(
bits
->
cbData
==
2
)
if
(
bits
->
cbData
==
2
)
{
{
CRYPT_FormatBits
(
dwFormatStrType
,
bits
->
pbData
[
1
],
CRYPT_FormatBits
(
bits
->
pbData
[
1
],
keyUsageByte1Map
,
keyUsageByte1Map
,
sizeof
(
keyUsageByte1Map
)
/
sizeof
(
keyUsageByte1Map
[
0
]),
sizeof
(
keyUsageByte1Map
)
/
sizeof
(
keyUsageByte1Map
[
0
]),
NULL
,
&
bitStringLen
,
&
first
);
NULL
,
&
bitStringLen
,
&
first
);
bytesNeeded
+=
bitStringLen
;
bytesNeeded
+=
bitStringLen
;
...
@@ -784,16 +769,14 @@ static BOOL WINAPI CRYPT_FormatKeyUsage(DWORD dwCertEncodingType,
...
@@ -784,16 +769,14 @@ static BOOL WINAPI CRYPT_FormatKeyUsage(DWORD dwCertEncodingType,
bitStringLen
=
bytesNeeded
;
bitStringLen
=
bytesNeeded
;
first
=
TRUE
;
first
=
TRUE
;
CRYPT_FormatBits
(
dwFormatStrType
,
bits
->
pbData
[
0
],
CRYPT_FormatBits
(
bits
->
pbData
[
0
],
keyUsageByte0Map
,
keyUsageByte0Map
,
sizeof
(
keyUsageByte0Map
)
/
sizeof
(
keyUsageByte0Map
[
0
]),
sizeof
(
keyUsageByte0Map
)
/
sizeof
(
keyUsageByte0Map
[
0
]),
str
,
&
bitStringLen
,
&
first
);
str
,
&
bitStringLen
,
&
first
);
str
+=
bitStringLen
/
sizeof
(
WCHAR
)
-
1
;
str
+=
bitStringLen
/
sizeof
(
WCHAR
)
-
1
;
if
(
bits
->
cbData
==
2
)
if
(
bits
->
cbData
==
2
)
{
{
bitStringLen
=
bytesNeeded
;
bitStringLen
=
bytesNeeded
;
CRYPT_FormatBits
(
dwFormatStrType
,
bits
->
pbData
[
1
],
CRYPT_FormatBits
(
bits
->
pbData
[
1
],
keyUsageByte1Map
,
keyUsageByte1Map
,
sizeof
(
keyUsageByte1Map
)
/
sizeof
(
keyUsageByte1Map
[
0
]),
sizeof
(
keyUsageByte1Map
)
/
sizeof
(
keyUsageByte1Map
[
0
]),
str
,
&
bitStringLen
,
&
first
);
str
,
&
bitStringLen
,
&
first
);
str
+=
bitStringLen
/
sizeof
(
WCHAR
)
-
1
;
str
+=
bitStringLen
/
sizeof
(
WCHAR
)
-
1
;
...
@@ -812,6 +795,8 @@ static BOOL WINAPI CRYPT_FormatKeyUsage(DWORD dwCertEncodingType,
...
@@ -812,6 +795,8 @@ static BOOL WINAPI CRYPT_FormatKeyUsage(DWORD dwCertEncodingType,
return
ret
;
return
ret
;
}
}
static
const
WCHAR
crlf
[]
=
{
'\r'
,
'\n'
,
0
};
static
WCHAR
subjectTypeHeader
[
MAX_STRING_RESOURCE_LEN
];
static
WCHAR
subjectTypeHeader
[
MAX_STRING_RESOURCE_LEN
];
static
WCHAR
subjectTypeCA
[
MAX_STRING_RESOURCE_LEN
];
static
WCHAR
subjectTypeCA
[
MAX_STRING_RESOURCE_LEN
];
static
WCHAR
subjectTypeEndCert
[
MAX_STRING_RESOURCE_LEN
];
static
WCHAR
subjectTypeEndCert
[
MAX_STRING_RESOURCE_LEN
];
...
@@ -2123,8 +2108,7 @@ static BOOL WINAPI CRYPT_FormatNetscapeCertType(DWORD dwCertEncodingType,
...
@@ -2123,8 +2108,7 @@ static BOOL WINAPI CRYPT_FormatNetscapeCertType(DWORD dwCertEncodingType,
netscapeCertTypeMap
[
i
].
str
,
MAX_STRING_RESOURCE_LEN
);
netscapeCertTypeMap
[
i
].
str
,
MAX_STRING_RESOURCE_LEN
);
stringsLoaded
=
TRUE
;
stringsLoaded
=
TRUE
;
}
}
CRYPT_FormatBits
(
dwFormatStrType
,
bits
->
pbData
[
0
],
CRYPT_FormatBits
(
bits
->
pbData
[
0
],
netscapeCertTypeMap
,
netscapeCertTypeMap
,
sizeof
(
netscapeCertTypeMap
)
/
sizeof
(
netscapeCertTypeMap
[
0
]),
sizeof
(
netscapeCertTypeMap
)
/
sizeof
(
netscapeCertTypeMap
[
0
]),
NULL
,
&
bitStringLen
,
&
first
);
NULL
,
&
bitStringLen
,
&
first
);
bytesNeeded
+=
bitStringLen
;
bytesNeeded
+=
bitStringLen
;
...
@@ -2146,8 +2130,7 @@ static BOOL WINAPI CRYPT_FormatNetscapeCertType(DWORD dwCertEncodingType,
...
@@ -2146,8 +2130,7 @@ static BOOL WINAPI CRYPT_FormatNetscapeCertType(DWORD dwCertEncodingType,
bitStringLen
=
bytesNeeded
;
bitStringLen
=
bytesNeeded
;
first
=
TRUE
;
first
=
TRUE
;
CRYPT_FormatBits
(
dwFormatStrType
,
bits
->
pbData
[
0
],
CRYPT_FormatBits
(
bits
->
pbData
[
0
],
netscapeCertTypeMap
,
netscapeCertTypeMap
,
sizeof
(
netscapeCertTypeMap
)
/
sizeof
(
netscapeCertTypeMap
[
0
]),
sizeof
(
netscapeCertTypeMap
)
/
sizeof
(
netscapeCertTypeMap
[
0
]),
str
,
&
bitStringLen
,
&
first
);
str
,
&
bitStringLen
,
&
first
);
str
+=
bitStringLen
/
sizeof
(
WCHAR
)
-
1
;
str
+=
bitStringLen
/
sizeof
(
WCHAR
)
-
1
;
...
...
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