/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* * This file is part of the LibreOffice project. * * 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/.
*/
namespace comphelper::xml
{ // Generate some 'chaff' of varying length to be the body of an // XML comment to put at the start of encrypted content to make // document content a little less predictable. // See SvXMLExport::addChaffWhenEncryptedStorage
OString makeXMLChaff()
{
sal_Int8 n;
(void)rtl_random_getBytes(nullptr, &n, 1);
sal_Int32 nLength = 1024+n; // coverity[tainted_data] - 1024 deliberate random minus max -127/plus max 128
std::vector<sal_uInt8> aChaff(nLength);
(void)rtl_random_getBytes(nullptr, aChaff.data(), nLength);
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.