Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright (c) 2009-2010 The Chromium OS Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef CRYPTOHOME_COMMON_H_ | |
| 6 #define CRYPTOHOME_COMMON_H_ | |
| 7 | |
| 8 extern "C" { | |
| 9 #include <ecryptfs.h> | |
| 10 } | |
| 11 | |
| 12 namespace cryptohome { | |
| 13 | |
| 14 // The default symmetric key size for cryptohome is the ecryptfs default | |
| 15 #define CRYPTOHOME_DEFAULT_KEY_SIZE ECRYPTFS_MAX_KEY_BYTES | |
| 16 #define CRYPTOHOME_DEFAULT_KEY_SIGNATURE_SIZE ECRYPTFS_SIG_SIZE | |
| 17 #define CRYPTOHOME_DEFAULT_KEY_SALT_SIZE ECRYPTFS_SALT_SIZE | |
| 18 #define CRYPTOHOME_AES_KEY_BYTES ECRYPTFS_AES_KEY_BYTES | |
| 19 // The default salt length for the user salt | |
| 20 #define CRYPTOHOME_DEFAULT_SALT_LENGTH 16 | |
| 21 // Macros for min and max | |
| 22 #define CRYPTOHOME_MIN(X, Y) (((X) < (Y)) ? (X) : (Y)) | |
|
mschilder
2010/05/27 04:20:18
These are scary of course, double eval of argument
| |
| 23 #define CRYPTOHOME_MAX(X, Y) (((X) > (Y)) ? (X) : (Y)) | |
| 24 | |
| 25 struct VaultKeysetHeader { | |
| 26 char signature[2]; | |
| 27 unsigned char major_version; | |
| 28 unsigned char minor_version; | |
| 29 } __attribute__((__packed__)); | |
| 30 typedef struct VaultKeysetHeader VaultKeysetHeader; | |
| 31 | |
| 32 struct VaultKeysetKeys { | |
| 33 unsigned char fek[CRYPTOHOME_DEFAULT_KEY_SIZE]; | |
| 34 unsigned char fek_sig[CRYPTOHOME_DEFAULT_KEY_SIGNATURE_SIZE]; | |
| 35 unsigned char fek_salt[CRYPTOHOME_DEFAULT_KEY_SALT_SIZE]; | |
| 36 unsigned char fnek[CRYPTOHOME_DEFAULT_KEY_SIZE]; | |
| 37 unsigned char fnek_sig[CRYPTOHOME_DEFAULT_KEY_SIGNATURE_SIZE]; | |
| 38 unsigned char fnek_salt[CRYPTOHOME_DEFAULT_KEY_SALT_SIZE]; | |
| 39 } __attribute__((__packed__)); | |
| 40 typedef struct VaultKeysetKeys VaultKeysetKeys; | |
| 41 | |
| 42 } // cryptohome | |
| 43 | |
| 44 #endif // CRYPTOHOME_COMMON_H_ | |
| OLD | NEW |