libreoffice-online/fuzzer/Common.cpp
Miklos Vajna f543a1da9d fuzzer: initialize client context of the ssl manager
clientsession_fuzzer: ./net/Ssl.hpp:114: static ssl::CertificateVerification ssl::Manager::getClientVerification(): Assertion `isClientContextInitialized() && "client context must be initialized"' failed.
    #8 0x55885edfdc36 in ssl::Manager::getClientVerification() /home/vmiklos/git/collaboraonline/online-fuzz/./net/Ssl.hpp:114:9
    #9 0x55885eded51b in ClientSession::loadDocument(char const*, int, StringVector const&, std::shared_ptr<DocumentBroker> const&) /home/vmiklos/git/collaboraonline/online-fuzz/wsd/ClientSession.cpp:1276:13
    #10 0x55885edd3436 in ClientSession::_handleInput(char const*, int) /home/vmiklos/git/collaboraonline/online-fuzz/wsd/ClientSession.cpp:686:16
    #11 0x55885f1fd1ca in Session::handleMessage(std::vector<char, std::allocator<char>> const&) /home/vmiklos/git/collaboraonline/online-fuzz/common/Session.cpp:288:13

Signed-off-by: Miklos Vajna <vmiklos@collabora.com>
Change-Id: If7f346af0e6293bf042c9b211e4efe2dfedbd642
2024-07-08 15:34:51 +01:00

36 lines
955 B
C++

/*
* Copyright the Collabora Online contributors.
*
* SPDX-License-Identifier: MPL-2.0
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
#include <fuzzer/Common.hpp>
#include <map>
#include <string>
#include "config.h"
#include <Log.hpp>
#include <Ssl.hpp>
namespace fuzzer
{
bool DoInitialization()
{
std::string logLevel("fatal");
bool withColor = false;
bool logToFile = false;
std::map<std::string, std::string> logProperties;
Log::initialize("wsd", logLevel, withColor, logToFile, logProperties);
ssl::Manager::initializeClientContext(
/*certificateFile=*/"", /*privateKeyFile=*/"", /*caLocation=*/"",
/*cipherList=*/"", ssl::CertificateVerification::Required);
return true;
}
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */