blob: 284605d20770e88c4a7c74ba1e492fa043f79db6 [file] [log] [blame]
Oscar Montemayor52219a62010-02-25 16:47:02 -08001/*
2 * Copyright (C) 2009 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17#include <stdio.h>
18
19#ifndef __ENCRYPTEDFS_PROVISIONING_H__
20#define __ENCRYPTEDFS_PROVISIONING_H__
21
22#define MODE_ENCRYPTED_FS_DISABLED 0
23#define MODE_ENCRYPTED_FS_ENABLED 1
24
25#define ENCRYPTED_FS_OK 0
26#define ENCRYPTED_FS_ERROR (-1)
27
28#define ENCRYPTED_FS_KEY_SIZE 16
29#define ENCRYPTED_FS_SALT_SIZE 16
30#define ENCRYPTED_FS_MAX_HASH_SIZE 128
31#define ENTROPY_MAX_SIZE 4096
32
33struct encrypted_fs_info {
34 int mode;
35 char key[ENCRYPTED_FS_KEY_SIZE];
36 char salt[ENCRYPTED_FS_SALT_SIZE];
37 int salt_length;
38 char hash[ENCRYPTED_FS_MAX_HASH_SIZE];
39 int hash_length;
40 char entropy[ENTROPY_MAX_SIZE];
41 int entropy_length;
42};
43
44typedef struct encrypted_fs_info encrypted_fs_info;
45
46int read_encrypted_fs_info(encrypted_fs_info *secure_fs_data);
47
48int restore_encrypted_fs_info(encrypted_fs_info *secure_data);
49
50#endif /* __ENCRYPTEDFS_PROVISIONING_H__ */
51