xref: /trunk/main/package/inc/PackageConstants.hxx (revision cdf0e10c)
1 /*************************************************************************
2  *
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * Copyright 2000, 2010 Oracle and/or its affiliates.
6  *
7  * OpenOffice.org - a multi-platform office productivity suite
8  *
9  * This file is part of OpenOffice.org.
10  *
11  * OpenOffice.org is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * OpenOffice.org is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU Lesser General Public License version 3 for more details
19  * (a copy is included in the LICENSE file that accompanied this code).
20  *
21  * You should have received a copy of the GNU Lesser General Public License
22  * version 3 along with OpenOffice.org.  If not, see
23  * <http://www.openoffice.org/license.html>
24  * for a copy of the LGPLv3 License.
25  *
26  ************************************************************************/
27 #ifndef _PACKAGE_CONSTANTS_HXX_
28 #define _PACKAGE_CONSTANTS_HXX_
29 
30 #include <sal/types.h>
31 
32 const sal_Int32 n_ConstBufferSize = 32768;
33 const sal_Int32 n_ConstMaxMemoryStreamSize = 20480;
34 
35 // by calculation of the digest we read 32 bytes more ( if available )
36 // it allows to ignore the padding if the stream is longer than n_ConstDigestDecrypt since we read at least two blocks more;
37 // if the stream is shorter or equal the padding will be done successfully
38 const sal_Int32 n_ConstDigestLength = 1024;
39 const sal_Int32 n_ConstDigestDecrypt = 1056; // 1024 + 32
40 
41 // the constants related to the manifest.xml entries
42 #define PKG_MNFST_MEDIATYPE   0
43 #define PKG_MNFST_VERSION     1
44 #define PKG_MNFST_FULLPATH    2
45 
46 #define PKG_MNFST_INIVECTOR   3
47 #define PKG_MNFST_SALT        4
48 #define PKG_MNFST_ITERATION   5
49 #define PKG_MNFST_UCOMPSIZE   6
50 #define PKG_MNFST_DIGEST      7
51 #define PKG_MNFST_ENCALG      8
52 #define PKG_MNFST_STARTALG    9
53 #define PKG_MNFST_DIGESTALG  10
54 #define PKG_MNFST_DERKEYSIZE 11
55 
56 #define PKG_SIZE_NOENCR_MNFST 3
57 #define PKG_SIZE_ENCR_MNFST   12
58 
59 // the properties related constants
60 #define ENCRYPTION_KEY_PROPERTY "EncryptionKey"
61 #define STORAGE_ENCRYPTION_KEYS_PROPERTY "StorageEncryptionKeys"
62 #define ENCRYPTION_ALGORITHMS_PROPERTY "EncryptionAlgorithms"
63 #define HAS_ENCRYPTED_ENTRIES_PROPERTY "HasEncryptedEntries"
64 #define HAS_NONENCRYPTED_ENTRIES_PROPERTY "HasNonEncryptedEntries"
65 #define IS_INCONSISTENT_PROPERTY "IsInconsistent"
66 #define MEDIATYPE_FALLBACK_USED_PROPERTY "MediaTypeFallbackUsed"
67 
68 
69 #endif
70 
71