This repository has been archived by the owner on Oct 28, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Update ovsa_get_started.md Initial Changes for 2021.3 * Update ovsa_get_started.md Fixed Indentation * Update ovsa_get_started.md Added changes to command line options * changed dependent sw versions in the scripts * changes for 2021.3 * Update ovsa_get_started.md Fixing Indentation * Update ovsa_get_started.md Fixed Indentation * Add files via upload HW-SW TPM binding * Update fingerprint-changes.md * Update ovsa_get_started.md
- Loading branch information
1 parent
6eb8595
commit b102952
Showing
112 changed files
with
4,139 additions
and
4,627 deletions.
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,102 @@ | ||
#!/usr/bin/env python3 | ||
# | ||
# Copyright (c) 2020-2021 Intel Corporation | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
# | ||
|
||
import sys, json | ||
import sqlite3 | ||
from sqlite3 import Error | ||
import datetime | ||
|
||
def create_connection(db_file): | ||
|
||
""" create a database connection to the SQLite database | ||
specified by db_file | ||
:param db_file: database file | ||
:return: Connection object or None | ||
""" | ||
conn = None | ||
try: | ||
conn = sqlite3.connect(db_file) | ||
except Error as e: | ||
print(e) | ||
|
||
return conn | ||
|
||
def main(): | ||
# validate command line arguments | ||
if len(sys.argv) != 2: | ||
print('Invalid arguments. ovsa_create_db.py <db file>') | ||
return | ||
|
||
database = sys.argv[1] | ||
|
||
try: | ||
open(database) | ||
print("DB already exists!") | ||
except IOError as e: | ||
if (e.args[0] == 2): # DB does not exists | ||
print("Creating DB!") | ||
sqlite3.connect(database) | ||
else: | ||
print("Error: " + str(e)) | ||
exit() | ||
|
||
conn = create_connection(database) | ||
|
||
# create table customer_license_info | ||
sql_customer_license = """create table if not exists customer_license_info ( | ||
customer_license_id integer primary key autoincrement, | ||
license_guid text, | ||
model_guid text, | ||
isv_certificate text, | ||
customer_certificate text, | ||
license_type integer, | ||
limit_count integer, | ||
usage_count numeric, | ||
time_limit numeric, | ||
created_date numeric, | ||
updated_date numeric) """ | ||
print("Creating customer_license_info table...") | ||
conn.execute(sql_customer_license) | ||
|
||
# create table tcb_info | ||
sql_tcb_info = """create table if not exists tcb_info ( | ||
tcb_info_id integer primary key autoincrement, | ||
tcb_name text, | ||
version text, | ||
mrsigner_id text, | ||
mrenclave_id text, | ||
product_id text, | ||
svn text, | ||
hw_quote text, | ||
sw_quote text, | ||
hw_pubkey text, | ||
sw_pubkey text)""" | ||
print("Creating tcb_info table...") | ||
conn.execute(sql_tcb_info) | ||
|
||
#cur = conn.cursor() | ||
#cur.execute("SELECT name FROM sqlite_master WHERE type='table' ORDER BY name; ") | ||
#rows = cur.fetchall() | ||
#for row in rows: | ||
# print(row) | ||
|
||
conn.close | ||
|
||
|
||
|
||
if __name__ == "__main__": | ||
main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.