Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initial commit of rimage tool #1

Merged
merged 99 commits into from
Nov 18, 2019
Merged
Changes from 1 commit
Commits
Show all changes
99 commits
Select commit Hold shift + click to select a range
b537522
rimage: import rimage image creation and signing tool
lrgirdwo Feb 13, 2018
5f7a3a3
rimage: elf: validate module sections internally.
lrgirdwo Feb 21, 2018
3d247c1
rimage: fix elf section collision detection.
lrgirdwo Feb 22, 2018
c5bd37f
rimage: add unsigned firmware support
xiulipan Feb 22, 2018
9b0ead7
rimage: validate manifest segments
lrgirdwo Feb 27, 2018
b54a48d
rimage: read the fixup text size form ELF
xiulipan Mar 2, 2018
8ce5f8e
rimage: manifest: Move text offset into non immutable ROM structure.
lrgirdwo Mar 19, 2018
273f73f
cnl: core: Add support for xcc
lrgirdwo Mar 30, 2018
269a477
rimage: display ELF section names.
lrgirdwo Apr 6, 2018
0f3b399
rimage: fix formatting and alignment of manifest section printf
lrgirdwo Apr 8, 2018
8d8de88
rimage: add support to build and sign runtime modules
lrgirdwo Apr 12, 2018
b199485
FIX: Remove unused variable.
wangyan42164 Apr 16, 2018
8aedb1c
rimage: openssl: fix build for openssl 1.1.0
lrgirdwo May 10, 2018
3530b55
rimage: fix wrong error message
xiulipan May 11, 2018
82f6d74
rimage: add error handler for localtime call
xiulipan May 11, 2018
82f6bfb
rimage: openssl: add compatibility for openssl 1.1.0
xiulipan May 14, 2018
220a743
Removing unneeded XTOS sections from boot_ldr and main fw.
May 22, 2018
d99e6d5
rimage: add correct FW version to binary
tlauda Jun 4, 2018
81eba29
rimage: add support for automatic MEU signing
tlauda Jun 4, 2018
c91c6f9
rimage: fix function returns address of local variable bug
xiulipan Jun 29, 2018
513c47f
rimage: adding an include for all gcc version build
keqiaozhang Jul 2, 2018
4e9ef23
icl: initial support
jajanusz Aug 31, 2018
fd628ec
autoconf: optional implicit-fallthrough
jajanusz Sep 11, 2018
202c655
debugability: rimage: extract .static_log_entries from elf
akloniex Sep 25, 2018
15d5a95
rimage: add initial support for sue creek.
lrgirdwo Sep 28, 2018
4582729
rimage: rename the old css_header and fw_image_manifest
zhuyingjiang Oct 15, 2018
2d9af17
rimage: modify the API to version 1.8
zhuyingjiang Oct 18, 2018
75b6586
rimage: add firmware 1.5 manifest header
zhuyingjiang Oct 18, 2018
dd81092
rimage: add firmware 1.5 manifest binary descryptor
zhuyingjiang Oct 15, 2018
f76b24b
rimage: debugability: include fw_version in .ldc file
akloniex Oct 29, 2018
fb5e8ac
rimage: manifest: rename old manifest to 1.8
zhuyingjiang Nov 5, 2018
75533a6
rimage: manifest: add 1.5 manifest define
zhuyingjiang Nov 5, 2018
91b9179
rimage: manifest: add manifest APIs
zhuyingjiang Nov 5, 2018
641fab2
rimage: add 1.5 rimage defines
zhuyingjiang Nov 5, 2018
ccdfa79
rimage: add 1.5 rimage package API
zhuyingjiang Nov 5, 2018
5674674
rimage: add build scripts to build 1.5 image
zhuyingjiang Nov 5, 2018
864cc7e
change the 1.8 and 1.5 header defines
zhuyingjiang Nov 8, 2018
f5711ff
uapi: split ipc.h and abi.h into small files.
lrgirdwo Nov 5, 2018
2a7f0c0
rimage: fix possible buffer overflow
tlauda Nov 28, 2018
6847aba
rimage: make sure cavs1.5 manifest uses correct file offsets.
lrgirdwo Nov 24, 2018
90d7501
rimage: Add support for Sue creek
lrgirdwo Nov 30, 2018
52b1710
rimage: make block divisible by 4
bardliao Dec 23, 2018
93b0d29
rimage: remove config.h dependency
jajanusz Jan 11, 2019
4e3ead0
cmake: add rimage build
jajanusz Jan 11, 2019
cd6f24a
buildsystem: remove autotools from sof
jajanusz Jan 15, 2019
cf665a0
rimage: Use fw.h instead of duplicating the code
dbaluta Jan 28, 2019
139c3b4
rimage: Fix file_format.h include guard
dbaluta Jan 28, 2019
5c7e400
rimage: import elf.h
jajanusz Jan 30, 2019
c80037b
rimage: elf.h: use stdint
jajanusz Jan 30, 2019
552fc49
rimage: use local elf.h
jajanusz Jan 30, 2019
93c5742
rimage: fix for gcc8.1 -Wstringop-truncation
jajanusz Jan 30, 2019
e771e65
rimage: cast size_t to correct format types
jajanusz Jan 30, 2019
13f74da
rimage: use time_t for localtime
jajanusz Jan 30, 2019
24259d7
rimage: use fopen binary mode
jajanusz Jan 30, 2019
b05f9bd
sue: use rimage for image building
lyakh Jan 7, 2019
b656186
rimage: Refine sof fw blk type
dbaluta Feb 1, 2019
42aca3d
rimage: Describe memory as an array of zones
dbaluta Feb 1, 2019
57d567c
rimage: make a "Module reading" view similar to "Module writing" view
abonislawski Mar 5, 2019
842b860
rimage: Fix code alignment and indentation issues
DianaGabriela27 Mar 6, 2019
97ec5ba
rimage: Remove explicit comparisons to NULL in the rimage/*.c files
DianaGabriela27 Mar 6, 2019
7a80259
rimage: Remove blank lines before/after braces
DianaGabriela27 Mar 6, 2019
a97804f
rimage: Split lines over 80 characters
DianaGabriela27 Mar 6, 2019
f955645
rimage: elf: Break down multiple assignment
DianaGabriela27 Mar 6, 2019
2861df6
rimage: Remove multiple blank lines
DianaGabriela27 Mar 6, 2019
8902341
rimage: file_simple: Move open brace to next line
DianaGabriela27 Mar 6, 2019
d4949bf
rimage: file_simple: Remove unnecessary spaces after cast
DianaGabriela27 Mar 6, 2019
bb795ae
rimage: Align block comments on each line
DianaGabriela27 Mar 6, 2019
30b4568
rimage: manifest: Remove braces for single statement blocks
DianaGabriela27 Mar 6, 2019
167282b
rimage: add option to set imr type
jajanusz Apr 11, 2019
91d1b29
uapi: replace sof_man_get_module with SOF_MAN_MODULE_OFFSET
jajanusz May 14, 2019
a38e400
rimage: Add support for imx8
dbaluta Feb 1, 2019
9ce99db
include: split uapi headers into more directories
jajanusz May 31, 2019
bcf7e66
rimage: add spdx identifier for elf.h
jajanusz Jun 1, 2019
a44fb2c
rimage: change license to bsd
jajanusz Jun 1, 2019
b737019
cmake: add spdx license identifier
jajanusz Jun 1, 2019
865f311
rimage: fix possible strcpy and sprintf overflows
jajanusz Jun 6, 2019
ccce099
rimage: ignore sections not used by bootloader
jajanusz Jun 10, 2019
55d7954
rimage: make .static_log_entries optional section
abonislawski Jun 19, 2019
dad03fc
rimage: change error to warning if section not found
abonislawski Jun 19, 2019
43e08a0
rimage: xcc module offset option
jajanusz Aug 23, 2019
009cd50
rimage: tgl machine definition
jajanusz Aug 23, 2019
b0d68a6
manifest: add v2.5 definitions
jajanusz Sep 30, 2019
3084369
rimage: rename ri_hash
jajanusz Sep 30, 2019
1fabda9
rimage: rename module_sha functions
jajanusz Sep 30, 2019
d33ced6
rimage: add SHA384 hashing
jajanusz Sep 30, 2019
3bf866a
rimage: image manifest v2.5
jajanusz Sep 30, 2019
2fd9912
rimage: manifest v2.5 for MEU
jajanusz Sep 30, 2019
dd77445
rimage: update tgl
jajanusz Sep 30, 2019
f3be41d
rimage: add support for jsl
xiulipan Oct 30, 2019
27a9e91
Rename rimage to src and move headers into src/include/rimage
dcpleung Nov 12, 2019
0b34af2
Add a minimal set of necessary SOF headers
dcpleung Nov 12, 2019
e944529
Do not include version.h
dcpleung Sep 26, 2019
d821534
Remove PEM_KEY_PREFIX and always requires key as cmd argument
dcpleung Sep 26, 2019
5bf839e
Make log dictionary output optional
dcpleung Sep 27, 2019
606b4f0
Add .gitignore
dcpleung Sep 27, 2019
41cba2f
Take firmware version and build ID as command line arguments
dcpleung Sep 27, 2019
0d33e87
Enable autotools to build rimage
dcpleung Sep 24, 2019
f6bf4b0
Add files created after running autoreconf
dcpleung Nov 12, 2019
f2e9281
Add building instructions to README.md
dcpleung Nov 12, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
rimage: openssl: add compatibility for openssl 1.1.0
Add compatibility support for openssl 1.0.2 support alongsid with
openssl 1.1.0

References:
https://wiki.openssl.org/index.php/OpenSSL_1.1.0_Changes
Compatibility Layer

Signed-off-by: Pan Xiuli <xiuli.pan@linux.intel.com>
xiulipan authored and dcpleung committed Nov 12, 2019
commit 82f6bfba4ef87fa56833f3e7b16c4caa3b367659
26 changes: 26 additions & 0 deletions rimage/hash.c
Original file line number Diff line number Diff line change
@@ -30,6 +30,32 @@
#include "file_format.h"
#include "manifest.h"

#if OPENSSL_VERSION_NUMBER < 0x10100000L
void EVP_MD_CTX_free(EVP_MD_CTX *ctx);
EVP_MD_CTX *EVP_MD_CTX_new(void);

static void *OPENSSL_zalloc(size_t num)
{
void *ret = OPENSSL_malloc(num);

if (ret != NULL)
memset(ret, 0, num);
return ret;
}

EVP_MD_CTX *EVP_MD_CTX_new(void)
{
return OPENSSL_zalloc(sizeof(EVP_MD_CTX));
}

void EVP_MD_CTX_free(EVP_MD_CTX *ctx)
{
EVP_MD_CTX_cleanup(ctx);
OPENSSL_free(ctx);
}
#endif


#define DEBUG_HASH 0

void module_sha256_create(struct image *image)
16 changes: 16 additions & 0 deletions rimage/pkcs1_5.c
Original file line number Diff line number Diff line change
@@ -30,6 +30,22 @@
#include "css.h"
#include "manifest.h"

#if OPENSSL_VERSION_NUMBER < 0x10100000L
void RSA_get0_key(const RSA *r,
const BIGNUM **n, const BIGNUM **e, const BIGNUM **d);

void RSA_get0_key(const RSA *r,
const BIGNUM **n, const BIGNUM **e, const BIGNUM **d)
{
if (n != NULL)
*n = r->n;
if (e != NULL)
*e = r->e;
if (d != NULL)
*d = r->d;
}
#endif

#define DEBUG_PKCS 0

static void bytes_swap(uint8_t *ptr, uint32_t size)