mirror of https://github.com/infosecn1nja/C3.git
Fix o365 channels for clang
parent
e8468a5697
commit
76d816ee4f
|
@ -33,7 +33,7 @@ namespace FSecure::C3::Interfaces::Channels
|
|||
|
||||
/// Get channel capability.
|
||||
/// @returns ByteView view of channel capability.
|
||||
static ByteView GetCapability();
|
||||
static const char* GetCapability();
|
||||
|
||||
protected:
|
||||
/// Remove one item from server.
|
||||
|
@ -53,7 +53,7 @@ namespace FSecure::C3::Interfaces::Channels
|
|||
{
|
||||
auto fileList = ListData();
|
||||
for (auto& element : fileList.at(OBF("value")))
|
||||
RemoveItem(element.at(OBF("id")).get<std::string>());
|
||||
RemoveItem(element.at(OBF("id")));
|
||||
}
|
||||
|
||||
/// Requests a new access token using the refresh token
|
||||
|
@ -171,7 +171,7 @@ std::atomic<std::chrono::steady_clock::time_point> FSecure::C3::Interfaces::Chan
|
|||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
template <typename Derived>
|
||||
FSecure::ByteView FSecure::C3::Interfaces::Channels::Office365<Derived>::GetCapability()
|
||||
const char* FSecure::C3::Interfaces::Channels::Office365<Derived>::GetCapability()
|
||||
{
|
||||
return R"_(
|
||||
{
|
||||
|
|
|
@ -21,6 +21,13 @@ FSecure::Crypto::String FSecure::C3::Interfaces::Channels::OneDrive365RestFile::
|
|||
FSecure::Crypto::String FSecure::C3::Interfaces::Channels::OneDrive365RestFile::TokenEndpoint = OBF("https://login.windows.net/organizations/oauth2/v2.0/token");
|
||||
FSecure::Crypto::String FSecure::C3::Interfaces::Channels::OneDrive365RestFile::Scope = OBF("files.readwrite.all");
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
FSecure::C3::Interfaces::Channels::OneDrive365RestFile::OneDrive365RestFile(ByteView arguments)
|
||||
: Office365<OneDrive365RestFile>(arguments)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
size_t FSecure::C3::Interfaces::Channels::OneDrive365RestFile::OnSendToChannel(ByteView data)
|
||||
{
|
||||
|
|
|
@ -7,8 +7,9 @@ namespace FSecure::C3::Interfaces::Channels
|
|||
class OneDrive365RestFile : public Channel<OneDrive365RestFile>, public Office365<OneDrive365RestFile>
|
||||
{
|
||||
public:
|
||||
/// Use Office365 constructor.
|
||||
using Office365<OneDrive365RestFile>::Office365;
|
||||
/// Public constructor.
|
||||
/// @param arguments factory arguments.
|
||||
OneDrive365RestFile(ByteView arguments);
|
||||
|
||||
/// OnSend callback implementation.
|
||||
/// @param blob data to send to Channel.
|
||||
|
|
|
@ -20,6 +20,13 @@ FSecure::Crypto::String FSecure::C3::Interfaces::Channels::Outlook365RestTask::L
|
|||
FSecure::Crypto::String FSecure::C3::Interfaces::Channels::Outlook365RestTask::TokenEndpoint = OBF("https://login.windows.net/organizations/oauth2/v2.0/token/");
|
||||
FSecure::Crypto::String FSecure::C3::Interfaces::Channels::Outlook365RestTask::Scope = OBF("https://outlook.office365.com/.default");
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
FSecure::C3::Interfaces::Channels::Outlook365RestTask::Outlook365RestTask(ByteView arguments)
|
||||
: Office365<Outlook365RestTask>(arguments)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
size_t FSecure::C3::Interfaces::Channels::Outlook365RestTask::OnSendToChannel(ByteView data)
|
||||
{
|
||||
|
|
|
@ -8,8 +8,9 @@ namespace FSecure::C3::Interfaces::Channels
|
|||
class Outlook365RestTask : public Channel<Outlook365RestTask>, public Office365<Outlook365RestTask>
|
||||
{
|
||||
public:
|
||||
/// Use Office365 constructor.
|
||||
using Office365<Outlook365RestTask>::Office365;
|
||||
/// Public constructor.
|
||||
/// @param arguments factory arguments.
|
||||
Outlook365RestTask(ByteView arguments);
|
||||
|
||||
/// OnSend callback implementation.
|
||||
/// @param blob data to send to Channel.
|
||||
|
|
|
@ -8,6 +8,12 @@ FSecure::Crypto::String::String(std::string_view sv)
|
|||
|
||||
}
|
||||
|
||||
FSecure::Crypto::String::String(const char* str)
|
||||
: String(std::string_view{ str })
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
FSecure::SecureString FSecure::Crypto::String::Decrypt()
|
||||
{
|
||||
auto tmp = m_Data.empty() ? ByteVector{} : DecryptFromAnonymous(m_Data, m_Key);
|
||||
|
|
|
@ -12,6 +12,7 @@ namespace FSecure::Crypto
|
|||
public:
|
||||
String() = default;
|
||||
String(std::string_view sv);
|
||||
String(const char* str); // for clang
|
||||
String& operator=(std::string_view sv);
|
||||
SecureString Decrypt();
|
||||
|
||||
|
|
Loading…
Reference in New Issue