mirror of
https://github.com/badaix/snapcast.git
synced 2025-04-29 18:27:12 +02:00
Add OpenSSL include dir
This commit is contained in:
parent
c1bbfdf167
commit
f50a03ba1e
5 changed files with 50 additions and 44 deletions
4
.github/workflows/ci.yml
vendored
4
.github/workflows/ci.yml
vendored
|
@ -238,7 +238,9 @@ jobs:
|
||||||
- name: print environment
|
- name: print environment
|
||||||
run: env
|
run: env
|
||||||
- name: dependencies
|
- name: dependencies
|
||||||
run: brew install pkgconfig libsoxr flac libvorbis opus ccache expat
|
run: |
|
||||||
|
brew update
|
||||||
|
brew install pkgconfig libsoxr flac libvorbis opus ccache expat
|
||||||
- name: cache boost
|
- name: cache boost
|
||||||
id: cache-boost
|
id: cache-boost
|
||||||
uses: actions/cache@v4
|
uses: actions/cache@v4
|
||||||
|
|
|
@ -4,6 +4,8 @@ if(NOT WIN32 AND NOT ANDROID)
|
||||||
list(APPEND SOURCES daemon.cpp)
|
list(APPEND SOURCES daemon.cpp)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
include_directories(${SOXR_INCLUDE_DIRS} ${OPENSSL_INCLUDE_DIR})
|
||||||
|
|
||||||
if(SOXR_FOUND)
|
if(SOXR_FOUND)
|
||||||
include_directories(${SOXR_INCLUDE_DIRS})
|
include_directories(${SOXR_INCLUDE_DIRS})
|
||||||
endif(SOXR_FOUND)
|
endif(SOXR_FOUND)
|
||||||
|
@ -15,3 +17,5 @@ if(ANDROID)
|
||||||
elseif(SOXR_FOUND)
|
elseif(SOXR_FOUND)
|
||||||
target_link_libraries(common ${SOXR_LIBRARIES})
|
target_link_libraries(common ${SOXR_LIBRARIES})
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
target_link_libraries(common OpenSSL::Crypto OpenSSL::SSL)
|
||||||
|
|
|
@ -39,7 +39,7 @@ static inline bool is_base64(unsigned char c)
|
||||||
return ((isalnum(c) != 0) || (c == '+') || (c == '/'));
|
return ((isalnum(c) != 0) || (c == '+') || (c == '/'));
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string base64_encode(const unsigned char* bytes_to_encode, unsigned int in_len)
|
std::string base64_encode(const unsigned char* bytes_to_encode, size_t in_len)
|
||||||
{
|
{
|
||||||
std::string ret;
|
std::string ret;
|
||||||
int i = 0;
|
int i = 0;
|
||||||
|
@ -90,7 +90,7 @@ std::string base64_encode(const std::string& text)
|
||||||
|
|
||||||
std::string base64_decode(const std::string& encoded_string)
|
std::string base64_decode(const std::string& encoded_string)
|
||||||
{
|
{
|
||||||
int in_len = encoded_string.size();
|
size_t in_len = encoded_string.size();
|
||||||
int i = 0;
|
int i = 0;
|
||||||
int in_ = 0;
|
int in_ = 0;
|
||||||
unsigned char char_array_4[4], char_array_3[3];
|
unsigned char char_array_4[4], char_array_3[3];
|
||||||
|
@ -103,7 +103,7 @@ std::string base64_decode(const std::string& encoded_string)
|
||||||
if (i == 4)
|
if (i == 4)
|
||||||
{
|
{
|
||||||
for (i = 0; i < 4; i++)
|
for (i = 0; i < 4; i++)
|
||||||
char_array_4[i] = base64_chars.find(char_array_4[i]);
|
char_array_4[i] = static_cast<unsigned char>(base64_chars.find(char_array_4[i]));
|
||||||
|
|
||||||
char_array_3[0] = (char_array_4[0] << 2) + ((char_array_4[1] & 0x30) >> 4);
|
char_array_3[0] = (char_array_4[0] << 2) + ((char_array_4[1] & 0x30) >> 4);
|
||||||
char_array_3[1] = ((char_array_4[1] & 0xf) << 4) + ((char_array_4[2] & 0x3c) >> 2);
|
char_array_3[1] = ((char_array_4[1] & 0xf) << 4) + ((char_array_4[2] & 0x3c) >> 2);
|
||||||
|
@ -122,7 +122,7 @@ std::string base64_decode(const std::string& encoded_string)
|
||||||
char_array_4[j] = 0;
|
char_array_4[j] = 0;
|
||||||
|
|
||||||
for (j = 0; j < 4; j++)
|
for (j = 0; j < 4; j++)
|
||||||
char_array_4[j] = base64_chars.find(char_array_4[j]);
|
char_array_4[j] = static_cast<unsigned char>(base64_chars.find(char_array_4[j]));
|
||||||
|
|
||||||
char_array_3[0] = (char_array_4[0] << 2) + ((char_array_4[1] & 0x30) >> 4);
|
char_array_3[0] = (char_array_4[0] << 2) + ((char_array_4[1] & 0x30) >> 4);
|
||||||
char_array_3[1] = ((char_array_4[1] & 0xf) << 4) + ((char_array_4[2] & 0x3c) >> 2);
|
char_array_3[1] = ((char_array_4[1] & 0xf) << 4) + ((char_array_4[2] & 0x3c) >> 2);
|
||||||
|
@ -136,7 +136,7 @@ std::string base64_decode(const std::string& encoded_string)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
std::string base64url_encode(const unsigned char* bytes_to_encode, unsigned int in_len)
|
std::string base64url_encode(const unsigned char* bytes_to_encode, size_t in_len)
|
||||||
{
|
{
|
||||||
std::string res = base64_encode(bytes_to_encode, in_len);
|
std::string res = base64_encode(bytes_to_encode, in_len);
|
||||||
std::replace(res.begin(), res.end(), '+', '-');
|
std::replace(res.begin(), res.end(), '+', '-');
|
||||||
|
|
|
@ -20,10 +20,10 @@
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
std::string base64_encode(const unsigned char* bytes_to_encode, unsigned int in_len);
|
std::string base64_encode(const unsigned char* bytes_to_encode, size_t in_len);
|
||||||
std::string base64_encode(const std::string& text);
|
std::string base64_encode(const std::string& text);
|
||||||
std::string base64_decode(const std::string& encoded_string);
|
std::string base64_decode(const std::string& encoded_string);
|
||||||
|
|
||||||
std::string base64url_encode(const unsigned char* bytes_to_encode, unsigned int in_len);
|
std::string base64url_encode(const unsigned char* bytes_to_encode, size_t in_len);
|
||||||
std::string base64url_encode(const std::string& text);
|
std::string base64url_encode(const std::string& text);
|
||||||
std::string base64url_decode(const std::string& encoded_string);
|
std::string base64url_decode(const std::string& encoded_string);
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
set(CATCH_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR})
|
set(CATCH_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR})
|
||||||
add_library(Catch INTERFACE)
|
add_library(Catch INTERFACE)
|
||||||
target_include_directories(
|
target_include_directories(
|
||||||
Catch INTERFACE ${CATCH_INCLUDE_DIR} ${CMAKE_SOURCE_DIR} ${Boost_INCLUDE_DIR})
|
Catch INTERFACE ${CATCH_INCLUDE_DIR} ${CMAKE_SOURCE_DIR} ${Boost_INCLUDE_DIR} ${OPENSSL_INCLUDE_DIR})
|
||||||
|
|
||||||
set(TEST_LIBRARIES Catch)
|
set(TEST_LIBRARIES Catch)
|
||||||
if(ANDROID)
|
if(ANDROID)
|
||||||
|
|
Loading…
Add table
Reference in a new issue