summaryrefslogtreecommitdiff
path: root/onlineupdate
diff options
context:
space:
mode:
authorMarkus Mohrhard <markus.mohrhard@googlemail.com>2017-05-21 00:38:10 +0200
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2017-05-21 02:29:21 +0200
commit20d04d6938a104124ac06271f17978a290cccf6c (patch)
tree59f5510e7a423fde2f99b35aa783920d717783ed /onlineupdate
parent3964bfa04f5aa09a9199225a8763cdec74d92ee3 (diff)
take the certifcate info from the update config
Change-Id: I15856f21d19b45ec50bd3d63d2e526c9e8db450d
Diffstat (limited to 'onlineupdate')
-rw-r--r--onlineupdate/CustomTarget_generated.mk4
-rwxr-xr-xonlineupdate/source/update/updater/gen_cert_header.py7
2 files changed, 7 insertions, 4 deletions
diff --git a/onlineupdate/CustomTarget_generated.mk b/onlineupdate/CustomTarget_generated.mk
index 0c0f230387a8..346629976328 100644
--- a/onlineupdate/CustomTarget_generated.mk
+++ b/onlineupdate/CustomTarget_generated.mk
@@ -15,13 +15,13 @@ $(onlineupdate_INC)/primaryCert.h : \
$(SRCDIR)/onlineupdate/source/update/updater/gen_cert_header.py
$(call gb_Output_announce,$(subst $(WORKDIR)/,,$@),build,,1)
mkdir -p $(dir $@)
- $(call gb_ExternalExecutable_get_command,python) $(SRCDIR)/onlineupdate/source/update/updater/gen_cert_header.py "primaryCertData" /lo/users/moggi/NSSDBDir/master-daily.der > $(onlineupdate_INC)/primaryCert.h #"$(UPDATE_CONFIG)"
+ $(call gb_ExternalExecutable_get_command,python) $(SRCDIR)/onlineupdate/source/update/updater/gen_cert_header.py "primaryCertData" $(UPDATE_CONFIG) > $(onlineupdate_INC)/primaryCert.h #"$(UPDATE_CONFIG)"
$(onlineupdate_INC)/secondaryCert.h : \
$(SRCDIR)/onlineupdate/source/update/updater/gen_cert_header.py
$(call gb_Output_announce,$(subst $(WORKDIR)/,,$@),build,,1)
mkdir -p $(dir $@)
- $(call gb_ExternalExecutable_get_command,python) $(SRCDIR)/onlineupdate/source/update/updater/gen_cert_header.py "secondaryCertData" /lo/users/moggi/NSSDBDir/master-daily.der > $(onlineupdate_INC)/secondaryCert.h #"$(UPDATE_CONFIG)"
+ $(call gb_ExternalExecutable_get_command,python) $(SRCDIR)/onlineupdate/source/update/updater/gen_cert_header.py "secondaryCertData" $(UPDATE_CONFIG) > $(onlineupdate_INC)/secondaryCert.h #"$(UPDATE_CONFIG)"
$(call gb_CustomTarget_get_target,onlineupdate/generated) : \
$(onlineupdate_INC)/primaryCert.h \
diff --git a/onlineupdate/source/update/updater/gen_cert_header.py b/onlineupdate/source/update/updater/gen_cert_header.py
index 5b70758db3f2..8fedcd9bcf62 100755
--- a/onlineupdate/source/update/updater/gen_cert_header.py
+++ b/onlineupdate/source/update/updater/gen_cert_header.py
@@ -2,6 +2,7 @@
import sys
import binascii
+import configparser
def file_byte_generator(filename):
with open(filename, "rb") as f:
@@ -17,6 +18,8 @@ def create_header(array_name, in_filename):
if __name__ == '__main__':
if len(sys.argv) < 3:
- print('ERROR: usage: gen_cert_header.py array_name in_filename')
+ print('ERROR: usage: gen_cert_header.py array_name update_config_file')
sys.exit(1);
- sys.exit(create_header(sys.argv[1], sys.argv[2]))
+ config = configparser.ConfigParser()
+ config.read(sys.argv[2])
+ sys.exit(create_header(sys.argv[1], config['Updater']['certificate-der']))