From 80797c5d293d97eec6a5ab3db36667ef37f1652a Mon Sep 17 00:00:00 2001 From: Baikal Electronics Date: Fri, 19 Aug 2022 19:38:17 +0300 Subject: [PATCH] comment openssl functions in image-host, increase relocations table size, remove CONFIG_SYS_MONITOR_BASE define --- configs/baikal_bfk3_defconfig | 4 ++-- include/configs/baikal_mips.h | 1 - tools/image-host.c | 27 ++++++++++++++++++--------- 3 files changed, 20 insertions(+), 12 deletions(-) diff --git a/configs/baikal_bfk3_defconfig b/configs/baikal_bfk3_defconfig index 0b9d8a6749..485006476e 100644 --- a/configs/baikal_bfk3_defconfig +++ b/configs/baikal_bfk3_defconfig @@ -106,7 +106,7 @@ CONFIG_ENV_ADDR=0x9C0C0000 CONFIG_ENV_OFFSET=0x000C0000 CONFIG_ENV_SIZE=0x00010000 CONFIG_ENV_SECT_SIZE=0x00010000 -CONFIG_MIPS_RELOCATION_TABLE_SIZE=0x8700 +CONFIG_MIPS_RELOCATION_TABLE_SIZE=0x9000 CONFIG_SYS_LOAD_ADDR=0x80100000 CONFIG_TOOLS_LIBCRYPTO=n -CONFIG_SYS_CLK_FREQ=1200000000 \ No newline at end of file +CONFIG_SYS_CLK_FREQ=1200000000 diff --git a/include/configs/baikal_mips.h b/include/configs/baikal_mips.h index ad4ac148c5..87a3f0b5b6 100644 --- a/include/configs/baikal_mips.h +++ b/include/configs/baikal_mips.h @@ -28,7 +28,6 @@ extern unsigned long baikal_clk_freq; * U-Boot initial parameters *----------------------------------------------- */ -#define CONFIG_SYS_MONITOR_BASE CONFIG_SYS_TEXT_BASE #define CONFIG_SYS_MONITOR_LEN (1 << 20) /* 1 MB */ #define CONFIG_SYS_BOOTPARAMS_LEN (128 << 10) /* 128 KB */ #define CONFIG_SYS_BOOTM_LEN 0x01000000 diff --git a/tools/image-host.c b/tools/image-host.c index 698adfb3e1..e3ea82a1e2 100644 --- a/tools/image-host.c +++ b/tools/image-host.c @@ -14,8 +14,10 @@ #include #include +/* #include #include +*/ #define IMAGE_PRE_LOAD_PATH "/image/pre-load/sig" @@ -1122,6 +1124,8 @@ static int fit_config_add_verification_data(const char *keydir, * 2) get public key (X509_get_pubkey) * 3) provide der format (d2i_RSAPublicKey) */ + +/* static int read_pub_key(const char *keydir, const void *name, unsigned char **pubkey, int *pubkey_len) { @@ -1134,7 +1138,7 @@ static int read_pub_key(const char *keydir, const void *name, memset(path, 0, 1024); snprintf(path, sizeof(path), "%s/%s.crt", keydir, (char *)name); - /* Open certificate file */ + // Open certificate file f = fopen(path, "r"); if (!f) { fprintf(stderr, "Couldn't open RSA certificate: '%s': %s\n", @@ -1142,7 +1146,7 @@ static int read_pub_key(const char *keydir, const void *name, return -EACCES; } - /* Read the certificate */ + // Read the certificate cert = NULL; if (!PEM_read_X509(f, &cert, NULL, NULL)) { printf("Couldn't read certificate"); @@ -1150,7 +1154,7 @@ static int read_pub_key(const char *keydir, const void *name, goto err_cert; } - /* Get the public key from the certificate. */ + // Get the public key from the certificate. key = X509_get_pubkey(cert); if (!key) { printf("Couldn't read public key\n"); @@ -1158,7 +1162,7 @@ static int read_pub_key(const char *keydir, const void *name, goto err_pubkey; } - /* Get DER form */ + // Get DER form ret = i2d_PublicKey(key, pubkey); if (ret < 0) { printf("Couldn't get DER form\n"); @@ -1175,14 +1179,16 @@ err_cert: fclose(f); return ret; } +*/ int fit_pre_load_data(const char *keydir, void *keydest, void *fit) { int pre_load_noffset; const void *algo_name; const void *key_name; - unsigned char *pubkey = NULL; - int ret, pubkey_len; + //unsigned char *pubkey = NULL; + //int pubkey_len; + int ret; if (!keydir || !keydest || !fit) return 0; @@ -1209,18 +1215,21 @@ int fit_pre_load_data(const char *keydir, void *keydest, void *fit) goto out; } - /* Read public key */ + ret = 0; + + /* + // Read public key ret = read_pub_key(keydir, key_name, &pubkey, &pubkey_len); if (ret < 0) goto out; - /* Add the public key to the device tree */ + // Add the public key to the device tree ret = fdt_setprop(keydest, pre_load_noffset, "public-key", pubkey, pubkey_len); if (ret) printf("Can't set public-key in node %s (ret = %d)\n", IMAGE_PRE_LOAD_PATH, ret); - + */ out: return ret; } -- 2.39.5