Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
J
jami-libclient
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
savoirfairelinux
jami-libclient
Commits
d4ef85b8
Commit
d4ef85b8
authored
Apr 22, 2014
by
Emmanuel Lepage Vallee
Browse files
Options
Downloads
Patches
Plain Diff
[ #37142 ] Add some security framework widgets
parent
2837c50a
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/securityvalidationmodel.cpp
+14
-6
14 additions, 6 deletions
src/securityvalidationmodel.cpp
src/securityvalidationmodel.h
+14
-6
14 additions, 6 deletions
src/securityvalidationmodel.h
with
28 additions
and
12 deletions
src/securityvalidationmodel.cpp
+
14
−
6
View file @
d4ef85b8
...
@@ -19,6 +19,8 @@
...
@@ -19,6 +19,8 @@
#include
"account.h"
#include
"account.h"
#include
"visitors/pixmapmanipulationvisitor.h"
#include
"visitors/pixmapmanipulationvisitor.h"
#include
<QtAlgorithms>
const
QString
SecurityValidationModel
::
messages
[
static_cast
<
const
int
>
(
SecurityFlaw
::
COUNT
)]
=
{
const
QString
SecurityValidationModel
::
messages
[
static_cast
<
const
int
>
(
SecurityFlaw
::
COUNT
)]
=
{
QObject
::
tr
(
"Your communication negotation is secured, but not the media stream, please enable ZRTP or SDES"
),
QObject
::
tr
(
"Your communication negotation is secured, but not the media stream, please enable ZRTP or SDES"
),
QObject
::
tr
(
"TLS is disabled, the negotiation wont be encrypted. Your communication will be vulnerable to "
QObject
::
tr
(
"TLS is disabled, the negotiation wont be encrypted. Your communication will be vulnerable to "
...
@@ -45,17 +47,17 @@ SecurityValidationModel::maximumSecurityLevel = {{
...
@@ -45,17 +47,17 @@ SecurityValidationModel::maximumSecurityLevel = {{
/* TLS_DISABLED */
SecurityLevel
::
WEAK
,
/* TLS_DISABLED */
SecurityLevel
::
WEAK
,
/* CERTIFICATE_EXPIRED */
SecurityLevel
::
MEDIUM
,
/* CERTIFICATE_EXPIRED */
SecurityLevel
::
MEDIUM
,
/* CERTIFICATE_SELF_SIGNED */
SecurityLevel
::
MEDIUM
,
/* CERTIFICATE_SELF_SIGNED */
SecurityLevel
::
MEDIUM
,
/* CA_CERTIFICATE_MISSING */
SecurityLevel
::
PARTIAL
,
/* CA_CERTIFICATE_MISSING */
SecurityLevel
::
MEDIUM
,
/* END_CERTIFICATE_MISSING */
SecurityLevel
::
PARTIAL
,
/* END_CERTIFICATE_MISSING */
SecurityLevel
::
MEDIUM
,
/* PRIVATE_KEY_MISSING */
SecurityLevel
::
PARTIAL
,
/* PRIVATE_KEY_MISSING */
SecurityLevel
::
MEDIUM
,
/* CERTIFICATE_MISMATCH */
SecurityLevel
::
NONE
,
/* CERTIFICATE_MISMATCH */
SecurityLevel
::
NONE
,
/* CERTIFICATE_STORAGE_PERMISSION */
SecurityLevel
::
ACCEPTABLE
,
/* CERTIFICATE_STORAGE_PERMISSION */
SecurityLevel
::
ACCEPTABLE
,
/* CERTIFICATE_STORAGE_FOLDER */
SecurityLevel
::
ACCEPTABLE
,
/* CERTIFICATE_STORAGE_FOLDER */
SecurityLevel
::
ACCEPTABLE
,
/* CERTIFICATE_STORAGE_LOCATION */
SecurityLevel
::
ACCEPTABLE
,
/* CERTIFICATE_STORAGE_LOCATION */
SecurityLevel
::
ACCEPTABLE
,
/* OUTGOING_SERVER_MISMATCH */
SecurityLevel
::
ACCEPTABLE
,
/* OUTGOING_SERVER_MISMATCH */
SecurityLevel
::
ACCEPTABLE
,
/* VERIFY_INCOMING_DISABLED */
SecurityLevel
::
PARTIAL
,
/* VERIFY_INCOMING_DISABLED */
SecurityLevel
::
MEDIUM
,
/* VERIFY_ANSWER_DISABLED */
SecurityLevel
::
PARTIAL
,
/* VERIFY_ANSWER_DISABLED */
SecurityLevel
::
MEDIUM
,
/* REQUIRE_CERTIFICATE_DISABLED */
SecurityLevel
::
PARTIAL
,
/* REQUIRE_CERTIFICATE_DISABLED */
SecurityLevel
::
MEDIUM
,
/* MISSING_CERTIFICATE */
SecurityLevel
::
NONE
,
/* MISSING_CERTIFICATE */
SecurityLevel
::
NONE
,
/* MISSING_AUTHORITY */
SecurityLevel
::
WEAK
,
/* MISSING_AUTHORITY */
SecurityLevel
::
WEAK
,
}};
}};
...
@@ -181,8 +183,14 @@ void SecurityValidationModel::update()
...
@@ -181,8 +183,14 @@ void SecurityValidationModel::update()
m_lCurrentFlaws
<<
Flaw
(
SecurityFlaw
::
CERTIFICATE_STORAGE_LOCATION
,
cert
->
type
());
m_lCurrentFlaws
<<
Flaw
(
SecurityFlaw
::
CERTIFICATE_STORAGE_LOCATION
,
cert
->
type
());
}
}
}
}
qSort
(
m_lCurrentFlaws
);
emit
layoutChanged
();
emit
layoutChanged
();
}
}
QList
<
SecurityValidationModel
::
Flaw
>
SecurityValidationModel
::
currentFlaws
()
{
return
m_lCurrentFlaws
;
}
This diff is collapsed.
Click to expand it.
src/securityvalidationmodel.h
+
14
−
6
View file @
d4ef85b8
/****************************************************************************
/****************************************************************************
* Copyright (C) 2013-2014 by Savoir-Faire Linux
**
*
* Copyright (C) 2013-2014 by Savoir-Faire Linux
*
* Author : Emmanuel Lepage Vallee <emmanuel.lepage@savoirfairelinux.com> *
* Author : Emmanuel Lepage Vallee <emmanuel.lepage@savoirfairelinux.com> *
* *
* *
* This library is free software; you can redistribute it and/or *
* This library is free software; you can redistribute it and/or *
...
@@ -54,11 +54,10 @@ public:
...
@@ -54,11 +54,10 @@ public:
enum
class
SecurityLevel
{
enum
class
SecurityLevel
{
NONE
=
0
,
/* Security is not functional or severely defective */
NONE
=
0
,
/* Security is not functional or severely defective */
WEAK
=
1
,
/* There is some security, but way too many flaws */
WEAK
=
1
,
/* There is some security, but way too many flaws */
PARTIAL
=
2
,
/* There is some security, but there is too many flaws */
MEDIUM
=
2
,
/* The security is probably good enough, but there is issues */
MEDIUM
=
3
,
/* The security is probably good enough, but there is issues */
ACCEPTABLE
=
3
,
/* The security is most probably good enough, only minor issues */
ACCEPTABLE
=
4
,
/* The security is most probably good enough, only minor issues */
STRONG
=
4
,
/* All the non-information items are correct */
STRONG
=
5
,
/* All the non-information items are correct */
COMPLETE
=
5
,
/* Everything, even the recommendations, are correct */
VERY_STRONG
=
6
,
/* Everything, even the recommendations, are correct */
};
};
///The severity of a given flaw
///The severity of a given flaw
...
@@ -110,6 +109,12 @@ public:
...
@@ -110,6 +109,12 @@ public:
SecurityFlaw
flaw
;
SecurityFlaw
flaw
;
Severity
severity
;
Severity
severity
;
Certificate
::
Type
certType
;
Certificate
::
Type
certType
;
bool
operator
<
(
const
Flaw
&
r
)
const
{
return
(
(
int
)
severity
>
(
int
)
r
.
severity
);
}
bool
operator
>
(
const
Flaw
&
r
)
const
{
return
(
(
int
)
severity
<
(
int
)
r
.
severity
);
}
};
};
//Constructor
//Constructor
...
@@ -123,6 +128,9 @@ public:
...
@@ -123,6 +128,9 @@ public:
Qt
::
ItemFlags
flags
(
const
QModelIndex
&
index
)
const
;
Qt
::
ItemFlags
flags
(
const
QModelIndex
&
index
)
const
;
virtual
bool
setData
(
const
QModelIndex
&
index
,
const
QVariant
&
value
,
int
role
)
;
virtual
bool
setData
(
const
QModelIndex
&
index
,
const
QVariant
&
value
,
int
role
)
;
//Getter
QList
<
Flaw
>
currentFlaws
();
//Mutator
//Mutator
void
update
();
void
update
();
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment