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
9b87b610
Commit
9b87b610
authored
Sep 15, 2019
by
Alex Henrie
Committed by
Alexandre Julliard
Sep 16, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
crypt32: Factor out sprintf calls in trust_status_to_str (scan-build).
Signed-off-by:
Alex Henrie
<
alexhenrie24@gmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
533e90ba
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
48 deletions
+34
-48
rootstore.c
dlls/crypt32/rootstore.c
+34
-48
No files found.
dlls/crypt32/rootstore.c
View file @
9b87b610
...
@@ -156,55 +156,41 @@ static BOOL import_base64_certs_from_fp(FILE *fp, HCERTSTORE store)
...
@@ -156,55 +156,41 @@ static BOOL import_base64_certs_from_fp(FILE *fp, HCERTSTORE store)
static
const
char
*
trust_status_to_str
(
DWORD
status
)
static
const
char
*
trust_status_to_str
(
DWORD
status
)
{
{
static
const
struct
{
DWORD
flag
;
char
text
[
32
];
}
messages
[]
=
{
{
CERT_TRUST_IS_NOT_TIME_VALID
,
"expired"
},
{
CERT_TRUST_IS_NOT_TIME_NESTED
,
"bad time nesting"
},
{
CERT_TRUST_IS_REVOKED
,
"revoked"
},
{
CERT_TRUST_IS_NOT_SIGNATURE_VALID
,
"bad signature"
},
{
CERT_TRUST_IS_NOT_VALID_FOR_USAGE
,
"bad usage"
},
{
CERT_TRUST_IS_UNTRUSTED_ROOT
,
"untrusted root"
},
{
CERT_TRUST_REVOCATION_STATUS_UNKNOWN
,
"unknown revocation status"
},
{
CERT_TRUST_IS_CYCLIC
,
"cyclic chain"
},
{
CERT_TRUST_INVALID_EXTENSION
,
"unsupported critical extension"
},
{
CERT_TRUST_INVALID_POLICY_CONSTRAINTS
,
"bad policy"
},
{
CERT_TRUST_INVALID_BASIC_CONSTRAINTS
,
"bad basic constraints"
},
{
CERT_TRUST_INVALID_NAME_CONSTRAINTS
,
"bad name constraints"
},
{
CERT_TRUST_HAS_NOT_SUPPORTED_NAME_CONSTRAINT
,
"unsupported name constraint"
},
{
CERT_TRUST_HAS_NOT_DEFINED_NAME_CONSTRAINT
,
"undefined name constraint"
},
{
CERT_TRUST_HAS_NOT_PERMITTED_NAME_CONSTRAINT
,
"disallowed name constraint"
},
{
CERT_TRUST_HAS_EXCLUDED_NAME_CONSTRAINT
,
"excluded name constraint"
},
{
CERT_TRUST_IS_OFFLINE_REVOCATION
,
"revocation server offline"
},
{
CERT_TRUST_NO_ISSUANCE_CHAIN_POLICY
,
"no issuance policy"
},
};
static
char
buf
[
1024
];
static
char
buf
[
1024
];
int
pos
=
0
;
int
i
,
pos
=
0
;
if
(
status
&
CERT_TRUST_IS_NOT_TIME_VALID
)
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
messages
);
i
++
)
pos
+=
snprintf
(
buf
+
pos
,
sizeof
(
buf
)
-
pos
,
"
\n\t
expired"
);
{
if
(
status
&
CERT_TRUST_IS_NOT_TIME_NESTED
)
if
(
status
&
messages
[
i
].
flag
)
pos
+=
snprintf
(
buf
+
pos
,
sizeof
(
buf
)
-
pos
,
"
\n\t
bad time nesting"
);
pos
+=
sprintf
(
buf
+
pos
,
"
\n\t
%s"
,
messages
[
i
].
text
);
if
(
status
&
CERT_TRUST_IS_REVOKED
)
}
pos
+=
snprintf
(
buf
+
pos
,
sizeof
(
buf
)
-
pos
,
"
\n\t
revoked"
);
if
(
status
&
CERT_TRUST_IS_NOT_SIGNATURE_VALID
)
pos
+=
snprintf
(
buf
+
pos
,
sizeof
(
buf
)
-
pos
,
"
\n\t
bad signature"
);
if
(
status
&
CERT_TRUST_IS_NOT_VALID_FOR_USAGE
)
pos
+=
snprintf
(
buf
+
pos
,
sizeof
(
buf
)
-
pos
,
"
\n\t
bad usage"
);
if
(
status
&
CERT_TRUST_IS_UNTRUSTED_ROOT
)
pos
+=
snprintf
(
buf
+
pos
,
sizeof
(
buf
)
-
pos
,
"
\n\t
untrusted root"
);
if
(
status
&
CERT_TRUST_REVOCATION_STATUS_UNKNOWN
)
pos
+=
snprintf
(
buf
+
pos
,
sizeof
(
buf
)
-
pos
,
"
\n\t
unknown revocation status"
);
if
(
status
&
CERT_TRUST_IS_CYCLIC
)
pos
+=
snprintf
(
buf
+
pos
,
sizeof
(
buf
)
-
pos
,
"
\n\t
cyclic chain"
);
if
(
status
&
CERT_TRUST_INVALID_EXTENSION
)
pos
+=
snprintf
(
buf
+
pos
,
sizeof
(
buf
)
-
pos
,
"
\n\t
unsupported critical extension"
);
if
(
status
&
CERT_TRUST_INVALID_POLICY_CONSTRAINTS
)
pos
+=
snprintf
(
buf
+
pos
,
sizeof
(
buf
)
-
pos
,
"
\n\t
bad policy"
);
if
(
status
&
CERT_TRUST_INVALID_BASIC_CONSTRAINTS
)
pos
+=
snprintf
(
buf
+
pos
,
sizeof
(
buf
)
-
pos
,
"
\n\t
bad basic constraints"
);
if
(
status
&
CERT_TRUST_INVALID_NAME_CONSTRAINTS
)
pos
+=
snprintf
(
buf
+
pos
,
sizeof
(
buf
)
-
pos
,
"
\n\t
bad name constraints"
);
if
(
status
&
CERT_TRUST_HAS_NOT_SUPPORTED_NAME_CONSTRAINT
)
pos
+=
snprintf
(
buf
+
pos
,
sizeof
(
buf
)
-
pos
,
"
\n\t
unsupported name constraint"
);
if
(
status
&
CERT_TRUST_HAS_NOT_DEFINED_NAME_CONSTRAINT
)
pos
+=
snprintf
(
buf
+
pos
,
sizeof
(
buf
)
-
pos
,
"
\n\t
undefined name constraint"
);
if
(
status
&
CERT_TRUST_HAS_NOT_PERMITTED_NAME_CONSTRAINT
)
pos
+=
snprintf
(
buf
+
pos
,
sizeof
(
buf
)
-
pos
,
"
\n\t
disallowed name constraint"
);
if
(
status
&
CERT_TRUST_HAS_EXCLUDED_NAME_CONSTRAINT
)
pos
+=
snprintf
(
buf
+
pos
,
sizeof
(
buf
)
-
pos
,
"
\n\t
excluded name constraint"
);
if
(
status
&
CERT_TRUST_IS_OFFLINE_REVOCATION
)
pos
+=
snprintf
(
buf
+
pos
,
sizeof
(
buf
)
-
pos
,
"
\n\t
revocation server offline"
);
if
(
status
&
CERT_TRUST_NO_ISSUANCE_CHAIN_POLICY
)
pos
+=
snprintf
(
buf
+
pos
,
sizeof
(
buf
)
-
pos
,
"
\n\t
no issuance policy"
);
return
buf
;
return
buf
;
}
}
...
...
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