blob: 89ca27745764b25ef0412f6c876cc22999a9f419 [file] [log] [blame]
Shawn Willden128ffe02014-08-06 12:31:33 -06001/*
2 * Copyright 2014 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
Shawn Willden301646f2014-08-08 21:44:10 -060017#ifndef SYSTEM_KEYMASTER_GOOGLE_SOFT_KEYMASTER_H_
18#define SYSTEM_KEYMASTER_GOOGLE_SOFT_KEYMASTER_H_
Shawn Willden128ffe02014-08-06 12:31:33 -060019
20#include "google_keymaster.h"
21
22namespace keymaster {
23
24class GoogleSoftKeymaster : public GoogleKeymaster {
25 public:
26 bool is_enforced(keymaster_tag_t /* tag */) { return false; }
27 keymaster_key_origin_t origin() { return KM_ORIGIN_SOFTWARE; }
28
29 private:
30 static uint8_t master_key_[];
31
32 uint8_t* MasterKey() { return master_key_; }
33
34 size_t MasterKeyLength() { return 16; }
35
36 void GetNonce(uint8_t* nonce, size_t length) {
37 for (size_t i = 0; i < length; ++i)
38 nonce[i] = 0;
39 }
40};
41
42uint8_t GoogleSoftKeymaster::master_key_[16] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
43
44} // namespace
45
Shawn Willden301646f2014-08-08 21:44:10 -060046#endif // SYSTEM_KEYMASTER_GOOGLE_SOFT_KEYMASTER_H_