LibreOffice Module package (master) 1
PackageConstants.hxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 */
19#ifndef INCLUDED_PACKAGE_INC_PACKAGECONSTANTS_HXX
20#define INCLUDED_PACKAGE_INC_PACKAGECONSTANTS_HXX
21
22#include <sal/types.h>
23#include <rtl/ustring.hxx>
24
25const sal_Int32 n_ConstBufferSize = 32768;
26
27// by calculation of the digest we read 32 bytes more ( if available )
28// it allows to ignore the padding if the stream is longer than n_ConstDigestDecrypt since we read at least two blocks more;
29// if the stream is shorter or equal the padding will be done successfully
30const sal_Int32 n_ConstDigestLength = 1024;
31const sal_Int32 n_ConstDigestDecrypt = 1056; // 1024 + 32
32
33// the constants related to the manifest.xml entries
34#define PKG_MNFST_FULLPATH 0 //FullPath (Put full-path property first for MBA)
35#define PKG_MNFST_VERSION 1 //Version
36#define PKG_MNFST_MEDIATYPE 2 //MediaType
37
38#define PKG_MNFST_INIVECTOR 3 //InitialisationVector
39#define PKG_MNFST_SALT 4 //Salt
40#define PKG_MNFST_ITERATION 5 //IterationCount
41#define PKG_MNFST_UCOMPSIZE 6 //Size
42#define PKG_MNFST_DIGEST 7 //Digest
43#define PKG_MNFST_ENCALG 8 //EncryptionAlgorithm
44#define PKG_MNFST_STARTALG 9 //StartKeyAlgorithm
45#define PKG_MNFST_DIGESTALG 10 //DigestAlgorithm
46#define PKG_MNFST_DERKEYSIZE 11 //DerivedKeySize
47
48#define PKG_SIZE_NOENCR_MNFST 3
49#define PKG_SIZE_ENCR_MNFST 12
50
51// the properties related constants
52inline constexpr OUStringLiteral ENCRYPTION_KEY_PROPERTY = u"EncryptionKey";
53inline constexpr OUStringLiteral STORAGE_ENCRYPTION_KEYS_PROPERTY = u"StorageEncryptionKeys";
54inline constexpr OUStringLiteral ENCRYPTION_ALGORITHMS_PROPERTY = u"EncryptionAlgorithms";
55inline constexpr OUStringLiteral ENCRYPTION_GPG_PROPERTIES = u"EncryptionGpGProperties";
56#define HAS_ENCRYPTED_ENTRIES_PROPERTY "HasEncryptedEntries"
57#define HAS_NONENCRYPTED_ENTRIES_PROPERTY "HasNonEncryptedEntries"
58#define IS_INCONSISTENT_PROPERTY "IsInconsistent"
59inline constexpr OUStringLiteral MEDIATYPE_FALLBACK_USED_PROPERTY = u"MediaTypeFallbackUsed";
60
61#endif
62
63/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
constexpr OUStringLiteral ENCRYPTION_ALGORITHMS_PROPERTY
constexpr OUStringLiteral MEDIATYPE_FALLBACK_USED_PROPERTY
const sal_Int32 n_ConstDigestDecrypt
const sal_Int32 n_ConstDigestLength
constexpr OUStringLiteral STORAGE_ENCRYPTION_KEYS_PROPERTY
const sal_Int32 n_ConstBufferSize
constexpr OUStringLiteral ENCRYPTION_GPG_PROPERTIES
constexpr OUStringLiteral ENCRYPTION_KEY_PROPERTY
float u