Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Ubuntu 20.04 support #3625

Merged
merged 5 commits into from
Feb 5, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ Third party contributions are essential for making SDL great. However, we do hav
Currently supported:
* Ubuntu Linux 16.04 with GCC 5.4.x
* Ubuntu Linux 18.04 with GCC 7.3.x
* Ubuntu Linux 20.04 with GCC 9.3.x
* [C++11 standard](https://github.com/smartdevicelink/sdl_evolution/issues/132)

### Issues
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ Pull Requests Welcome!
Currently supported:
* Ubuntu Linux 16.04 with GCC 5.4.x
* Ubuntu Linux 18.04 with GCC 7.5.x
* Ubuntu Linux 20.04 with GCC 9.3.x
* [C++11 standard](https://github.com/smartdevicelink/sdl_evolution/issues/132)

## Getting Started
Expand Down
12 changes: 6 additions & 6 deletions src/3rd_party-static/gmock-1.7.0/fused-src/gtest/gtest.h
Original file line number Diff line number Diff line change
Expand Up @@ -1823,16 +1823,16 @@ using ::std::tuple_size;
# define GTEST_ATTRIBUTE_UNUSED_
#endif

// A macro to disallow operator=
// A macro to disallow copy operator=
// This should be used in the private: declarations for a class.
#define GTEST_DISALLOW_ASSIGN_(type)\
void operator=(type const &)
#define GTEST_DISALLOW_ASSIGN_(type) \
type& operator=(type const &) = delete

// A macro to disallow copy constructor and operator=
// This should be used in the private: declarations for a class.
#define GTEST_DISALLOW_COPY_AND_ASSIGN_(type)\
type(type const &);\
GTEST_DISALLOW_ASSIGN_(type)
#define GTEST_DISALLOW_COPY_AND_ASSIGN_(type) \
type(type const&) = delete; \
type& operator=(type const&) = delete

// Tell the compiler to warn about unused return values for functions declared
// with this macro. The macro should be used on function declarations
Expand Down
12 changes: 6 additions & 6 deletions src/3rd_party-static/gmock-1.7.0/gtest/fused-src/gtest/gtest.h
Original file line number Diff line number Diff line change
Expand Up @@ -1823,16 +1823,16 @@ using ::std::tuple_size;
# define GTEST_ATTRIBUTE_UNUSED_
#endif

// A macro to disallow operator=
// A macro to disallow copy operator=
// This should be used in the private: declarations for a class.
#define GTEST_DISALLOW_ASSIGN_(type)\
void operator=(type const &)
#define GTEST_DISALLOW_ASSIGN_(type) \
type& operator=(type const &) = delete

// A macro to disallow copy constructor and operator=
// This should be used in the private: declarations for a class.
#define GTEST_DISALLOW_COPY_AND_ASSIGN_(type)\
type(type const &);\
GTEST_DISALLOW_ASSIGN_(type)
#define GTEST_DISALLOW_COPY_AND_ASSIGN_(type) \
type(type const&) = delete; \
type& operator=(type const&) = delete

// Tell the compiler to warn about unused return values for functions declared
// with this macro. The macro should be used on function declarations
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -716,16 +716,16 @@ using ::std::tuple_size;
# define GTEST_ATTRIBUTE_UNUSED_
#endif

// A macro to disallow operator=
// A macro to disallow copy operator=
// This should be used in the private: declarations for a class.
#define GTEST_DISALLOW_ASSIGN_(type)\
void operator=(type const &)
#define GTEST_DISALLOW_ASSIGN_(type) \
type& operator=(type const &) = delete

// A macro to disallow copy constructor and operator=
// This should be used in the private: declarations for a class.
#define GTEST_DISALLOW_COPY_AND_ASSIGN_(type)\
type(type const &);\
GTEST_DISALLOW_ASSIGN_(type)
#define GTEST_DISALLOW_COPY_AND_ASSIGN_(type) \
type(type const&) = delete; \
type& operator=(type const&) = delete

// Tell the compiler to warn about unused return values for functions declared
// with this macro. The macro should be used on function declarations
Expand Down
21 changes: 17 additions & 4 deletions src/components/security_manager/src/crypto_manager_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -36,20 +36,21 @@
#include <openssl/err.h>
#include <openssl/pkcs12.h>
#include <openssl/ssl.h>

#include <stdio.h>

#include <algorithm>
#include <ctime>
#include <fstream>
#include <iostream>
#include "security_manager/security_manager.h"

#include "security_manager/security_manager.h"
#include "utils/atomic.h"
#include "utils/date_time.h"
#include "utils/logger.h"
#include "utils/macro.h"
#include "utils/scope_guard.h"

#define OPENSSL1_1_VERSION 0x1010000fL
#define TLS1_1_MINIMAL_VERSION 0x1000103fL
#define CONST_SSL_METHOD_MINIMAL_VERSION 0x00909000L

Expand Down Expand Up @@ -174,16 +175,22 @@ bool CryptoManagerImpl::Init() {
#endif
case TLSv1:
SDL_LOG_DEBUG("TLSv1 is used");
#if OPENSSL_VERSION_NUMBER < OPENSSL1_1_VERSION
method = is_server ? TLSv1_server_method() : TLSv1_client_method();
#else
method = is_server ? TLS_server_method() : TLS_client_method();
#endif
break;
case TLSv1_1:
SDL_LOG_DEBUG("TLSv1_1 is used");
#if OPENSSL_VERSION_NUMBER < TLS1_1_MINIMAL_VERSION
SDL_LOG_WARN(
"OpenSSL has no TLSv1.1 with version lower 1.0.1, set TLSv1.0");
method = is_server ? TLSv1_server_method() : TLSv1_client_method();
#else
#elif OPENSSL_VERSION_NUMBER < OPENSSL1_1_VERSION
method = is_server ? TLSv1_1_server_method() : TLSv1_1_client_method();
#else
method = is_server ? TLS_server_method() : TLS_client_method();
#endif
break;
case TLSv1_2:
Expand All @@ -192,13 +199,19 @@ bool CryptoManagerImpl::Init() {
SDL_LOG_WARN(
"OpenSSL has no TLSv1.2 with version lower 1.0.1, set TLSv1.0");
method = is_server ? TLSv1_server_method() : TLSv1_client_method();
#else
#elif OPENSSL_VERSION_NUMBER < OPENSSL1_1_VERSION
method = is_server ? TLSv1_2_server_method() : TLSv1_2_client_method();
#else
method = is_server ? TLS_server_method() : TLS_client_method();
#endif
break;
case DTLSv1:
SDL_LOG_DEBUG("DTLSv1 is used");
#if OPENSSL_VERSION_NUMBER < OPENSSL1_1_VERSION
method = is_server ? DTLSv1_server_method() : DTLSv1_client_method();
#else
method = is_server ? DTLS_server_method() : DTLS_client_method();
#endif
break;
default:
SDL_LOG_ERROR("Unknown protocol: "
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -413,7 +413,7 @@ TEST_P(SSLHandshakeTest, CAVerification_ServerSide) {
GTEST_TRACE(HandshakeProcedure_Success());
}

TEST_P(SSLHandshakeTest, CAVerification_ServerSide_NoCACertificate) {
TEST_P(SSLHandshakeTest, DISABLED_CAVerification_ServerSide_NoCACertificate) {
ASSERT_TRUE(InitServerManagers(
GetParam().server_protocol, "", "ALL", verify_peer, "unex"))
<< server_manager_->LastError();
Expand Down
Loading