Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
biboumi
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
98
Issues
98
List
Boards
Labels
Service Desk
Milestones
Merge Requests
12
Merge Requests
12
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
louiz’
biboumi
Commits
a13285d0
Commit
a13285d0
authored
Feb 10, 2016
by
louiz’
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rename BasicCredentialManager
parent
0a352e55
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
15 deletions
+15
-15
louloulibs/network/credentials_manager.cpp
louloulibs/network/credentials_manager.cpp
+12
-12
louloulibs/network/credentials_manager.hpp
louloulibs/network/credentials_manager.hpp
+2
-2
louloulibs/network/tcp_socket_handler.hpp
louloulibs/network/tcp_socket_handler.hpp
+1
-1
No files found.
louloulibs/network/credentials_manager.cpp
View file @
a13285d0
...
...
@@ -21,10 +21,10 @@ static const std::vector<std::string> default_cert_files = {
"/etc/ca-certificates/extracted/tls-ca-bundle.pem"
};
Botan
::
Certificate_Store_In_Memory
Basic
_Credentials_
Manager
::
certificate_store
;
bool
Basic
_Credentials_
Manager
::
certs_loaded
=
false
;
Botan
::
Certificate_Store_In_Memory
Basic
Credentials
Manager
::
certificate_store
;
bool
Basic
Credentials
Manager
::
certs_loaded
=
false
;
Basic
_Credentials_Manager
::
Basic_Credentials_
Manager
(
const
TCPSocketHandler
*
const
socket_handler
)
:
Basic
CredentialsManager
::
BasicCredentials
Manager
(
const
TCPSocketHandler
*
const
socket_handler
)
:
Botan
::
Credentials_Manager
(),
socket_handler
(
socket_handler
),
trusted_fingerprint
{}
...
...
@@ -32,14 +32,14 @@ Basic_Credentials_Manager::Basic_Credentials_Manager(const TCPSocketHandler* con
this
->
load_certs
();
}
void
Basic
_Credentials_
Manager
::
set_trusted_fingerprint
(
const
std
::
string
&
fingerprint
)
void
Basic
Credentials
Manager
::
set_trusted_fingerprint
(
const
std
::
string
&
fingerprint
)
{
this
->
trusted_fingerprint
=
fingerprint
;
}
void
Basic
_Credentials_
Manager
::
verify_certificate_chain
(
const
std
::
string
&
type
,
const
std
::
string
&
purported_hostname
,
const
std
::
vector
<
Botan
::
X509_Certificate
>&
certs
)
void
Basic
Credentials
Manager
::
verify_certificate_chain
(
const
std
::
string
&
type
,
const
std
::
string
&
purported_hostname
,
const
std
::
vector
<
Botan
::
X509_Certificate
>&
certs
)
{
log_debug
(
"Checking remote certificate ("
<<
type
<<
") for hostname "
<<
purported_hostname
);
try
...
...
@@ -62,10 +62,10 @@ void Basic_Credentials_Manager::verify_certificate_chain(const std::string& type
}
}
void
Basic
_Credentials_
Manager
::
load_certs
()
void
Basic
Credentials
Manager
::
load_certs
()
{
// Only load the certificates the first time
if
(
Basic
_Credentials_
Manager
::
certs_loaded
)
if
(
Basic
Credentials
Manager
::
certs_loaded
)
return
;
const
std
::
string
conf_path
=
Config
::
get
(
"ca_file"
,
""
);
std
::
vector
<
std
::
string
>
paths
;
...
...
@@ -82,7 +82,7 @@ void Basic_Credentials_Manager::load_certs()
while
(
!
bundle
.
end_of_data
()
&&
bundle
.
check_available
(
27
))
{
const
Botan
::
X509_Certificate
cert
(
bundle
);
Basic
_Credentials_
Manager
::
certificate_store
.
add_certificate
(
cert
);
Basic
Credentials
Manager
::
certificate_store
.
add_certificate
(
cert
);
}
// Only use the first file that can successfully be read.
goto
success
;
...
...
@@ -95,10 +95,10 @@ void Basic_Credentials_Manager::load_certs()
// If we could not open one of the files, print a warning
log_warning
(
"The CA could not be loaded, TLS negociation will probably fail."
);
success:
Basic
_Credentials_
Manager
::
certs_loaded
=
true
;
Basic
Credentials
Manager
::
certs_loaded
=
true
;
}
std
::
vector
<
Botan
::
Certificate_Store
*>
Basic
_Credentials_
Manager
::
trusted_certificate_authorities
(
const
std
::
string
&
,
const
std
::
string
&
)
std
::
vector
<
Botan
::
Certificate_Store
*>
Basic
Credentials
Manager
::
trusted_certificate_authorities
(
const
std
::
string
&
,
const
std
::
string
&
)
{
return
{
&
this
->
certificate_store
};
}
...
...
louloulibs/network/credentials_manager.hpp
View file @
a13285d0
...
...
@@ -10,10 +10,10 @@
class
TCPSocketHandler
;
class
Basic
_Credentials_
Manager
:
public
Botan
::
Credentials_Manager
class
Basic
Credentials
Manager
:
public
Botan
::
Credentials_Manager
{
public:
Basic
_Credentials_
Manager
(
const
TCPSocketHandler
*
const
socket_handler
);
Basic
Credentials
Manager
(
const
TCPSocketHandler
*
const
socket_handler
);
void
verify_certificate_chain
(
const
std
::
string
&
type
,
const
std
::
string
&
purported_hostname
,
const
std
::
vector
<
Botan
::
X509_Certificate
>&
)
override
final
;
...
...
louloulibs/network/tcp_socket_handler.hpp
View file @
a13285d0
...
...
@@ -249,7 +249,7 @@ private:
static
Botan
::
TLS
::
Policy
policy
;
static
Botan
::
TLS
::
Session_Manager_In_Memory
session_manager
;
protected:
Basic
_Credentials_
Manager
credential_manager
;
Basic
Credentials
Manager
credential_manager
;
private:
/**
* We use a unique_ptr because we may not want to create the object at
...
...
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