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
93f4c49e
Commit
93f4c49e
authored
Dec 18, 2008
by
Juan Lang
Committed by
Alexandre Julliard
Dec 19, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cryptui: Remove code duplication in formatting an enhanced key usage value.
parent
d743ff88
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
61 deletions
+6
-61
main.c
dlls/cryptui/main.c
+6
-61
No files found.
dlls/cryptui/main.c
View file @
93f4c49e
...
...
@@ -1418,68 +1418,13 @@ struct prop_id_to_string_id
static
WCHAR
*
format_enhanced_key_usage_value
(
void
*
pb
,
DWORD
cb
)
{
static
const
WCHAR
sep
[]
=
{
','
,
' '
,
0
};
const
CERT_ENHKEY_USAGE
*
usage
=
(
const
CERT_ENHKEY_USAGE
*
)
pb
;
static
WCHAR
*
str
=
NULL
;
DWORD
i
,
chars
=
0
;
CERT_EXTENSION
ext
;
for
(
i
=
0
;
i
<
usage
->
cUsageIdentifier
;
i
++
)
{
PCCRYPT_OID_INFO
info
=
CryptFindOIDInfo
(
CRYPT_OID_INFO_OID_KEY
,
usage
->
rgpszUsageIdentifier
[
i
],
CRYPT_ENHKEY_USAGE_OID_GROUP_ID
);
if
(
info
)
{
chars
+=
strlenW
(
info
->
pwszName
);
if
(
i
<
usage
->
cUsageIdentifier
-
1
)
chars
+=
strlenW
(
sep
);
if
(
!
str
)
{
str
=
HeapAlloc
(
GetProcessHeap
(),
0
,
(
chars
+
1
)
*
sizeof
(
WCHAR
));
if
(
str
)
*
str
=
'\0'
;
}
else
str
=
HeapReAlloc
(
GetProcessHeap
(),
0
,
str
,
(
chars
+
1
)
*
sizeof
(
WCHAR
));
if
(
str
)
{
if
(
i
<
usage
->
cUsageIdentifier
-
1
)
strcatW
(
str
,
sep
);
strcatW
(
str
,
info
->
pwszName
);
}
}
else
{
chars
+=
strlen
(
usage
->
rgpszUsageIdentifier
[
i
]);
if
(
i
<
usage
->
cUsageIdentifier
-
1
)
chars
+=
strlenW
(
sep
);
if
(
!
str
)
{
str
=
HeapAlloc
(
GetProcessHeap
(),
0
,
(
chars
+
1
)
*
sizeof
(
WCHAR
));
if
(
str
)
*
str
=
'\0'
;
}
else
str
=
HeapReAlloc
(
GetProcessHeap
(),
0
,
str
,
(
chars
+
1
)
*
sizeof
(
WCHAR
));
if
(
str
)
{
WCHAR
*
dst
;
const
char
*
src
;
if
(
i
<
usage
->
cUsageIdentifier
-
1
)
strcatW
(
str
,
sep
);
for
(
src
=
usage
->
rgpszUsageIdentifier
[
i
],
dst
=
str
+
strlenW
(
str
);
*
src
;
src
++
,
dst
++
)
*
dst
=
*
src
;
*
dst
=
'\0'
;
}
}
}
return
str
;
ext
.
pszObjId
=
(
LPSTR
)
X509_ENHANCED_KEY_USAGE
;
ext
.
fCritical
=
FALSE
;
ext
.
Value
.
pbData
=
pb
;
ext
.
Value
.
cbData
=
cb
;
return
crypt_format_extension
(
&
ext
,
0
);
}
/* Logically the access state should also be checked, and IDC_EDITPROPERTIES
...
...
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