- 14 Jul, 2013 38 commits
-
-
Marek Vasut authored
In case the memory allocation fails in the command parser, there will might remain some allocated memory upon return. Fix this. Signed-off-by:
Marek Vasut <marex@denx.de>
-
Marek Vasut authored
No functional change in the code, just reorder the functions so they are not in such a state of chaos. Signed-off-by:
Marek Vasut <marex@denx.de>
-
Marek Vasut authored
The variable was initialized and reinitialized twice as a remnant of the rework, initialize it only once. Signed-off-by:
Marek Vasut <marex@denx.de>
-
Marek Vasut authored
There is no need to pass the IV explicitly as another argument, the function can pull this information from the image context. Signed-off-by:
Marek Vasut <marex@denx.de>
-
Marek Vasut authored
Update the checksum of the command right after we have all necessary information filled in it instead of doing it late in the function that encrypts the command. Signed-off-by:
Marek Vasut <marex@denx.de>
-
Marek Vasut authored
Split the code that encrypts portions of the image and the code that assembles the resulting image in memory. Signed-off-by:
Marek Vasut <marex@denx.de>
-
Marek Vasut authored
We need to store image digest in image context to let it traverse between the image creation function and image write function. Signed-off-by:
Marek Vasut <marex@denx.de>
-
Marek Vasut authored
Store image dictionary in image context, as this is where it should be according to the documentation. We also need it here to let it traverse between the image creation function and image write function. Signed-off-by:
Marek Vasut <marex@denx.de>
-
Marek Vasut authored
This patch pulls out the function calls that dump the final image at the end of function that creates the image. This will now allow easy separation of them into self-standing function. Signed-off-by:
Marek Vasut <marex@denx.de>
-
Marek Vasut authored
The encryption of command data corrupted the contents of the structure. To prevent that, store the encrypted command data in a separate entry in the command context structure. Signed-off-by:
Marek Vasut <marex@denx.de>
-
Marek Vasut authored
This instruction does nothing and is easy to implement. Signed-off-by:
Marek Vasut <marex@denx.de>
-
Marek Vasut authored
When loading the IVT, make a local copy of it instead of pointing directly onto the static structure. This makes it easier to operate with the file buffers associated with LOAD command in mostly uniform manner. Signed-off-by:
Marek Vasut <marex@denx.de>
-
Marek Vasut authored
The TAG command has to be encrypted using IV from the header, so reinit the AES with the IV for each section. Signed-off-by:
Marek Vasut <marex@denx.de>
-
Marek Vasut authored
This patch fixes the generation of section header block for multiple sections. Before this patch, only one section was always generated, which was incorrect. Signed-off-by:
Marek Vasut <marex@denx.de>
-
Marek Vasut authored
Move the function lower in mxssb.c so there is no longer need for forward declaration of sb_load_file(). Signed-off-by:
Marek Vasut <marex@denx.de>
-
Marek Vasut authored
Move the loading of a file associated with a LOAD instruction into sb_tag_to_command, since this is where the LOAD instruction is filled. This will allow us to keep the handling of LOAD instruction in one place. Signed-off-by:
Marek Vasut <marex@denx.de>
-
Marek Vasut authored
The command stream now only contains the filename as it should. The IVTs are currently handled via little hack, but this will change once there is a proper file parser. Signed-off-by:
Marek Vasut <marex@denx.de>
-
Marek Vasut authored
The image tree will be free'd in main(), so there is no need to worry about freeing it here. Signed-off-by:
Marek Vasut <marex@denx.de>
-
Marek Vasut authored
The cmd allocation in sb_tag_to_command() is no longer needed. It was needed temporarily for compatibility reasons during the transition, but this is resolved now. Signed-off-by:
Marek Vasut <marex@denx.de>
-
Marek Vasut authored
The TAG instruction is wholy filled later and the LOAD instruction fields need to be updated after a file was loaded. Thus, clean up bogus assignments into fields of these instructions. Signed-off-by:
Marek Vasut <marex@denx.de>
-
Marek Vasut authored
The sb_load_binary() call is now redundant, since the files are now loaded while preparing the SB image header. Reduce this to a stub function that fills the sb instruction stream. Signed-off-by:
Marek Vasut <marex@denx.de>
-
Marek Vasut authored
Pull the SB command blocks from the image tree. Signed-off-by:
Marek Vasut <marex@denx.de>
-
Marek Vasut authored
Pull out the section header information from the SB image tree. This allows us to remove some ad-hoc calls. Signed-off-by:
Marek Vasut <marex@denx.de>
-
Marek Vasut authored
The section offset computation has to be done after the SB image header is filled in. Moreover, the TAG command can be filled in only afterwards as well, since it's almost exact copy of the section header. Implement a function that fixes up the section headers and TAG commands. Signed-off-by:
Marek Vasut <marex@denx.de>
-
Marek Vasut authored
Pass the sb_image_ctx context into the cryptographic functions instead of passing the standalone cryptographic structures. This makes the code a little cleaner. Signed-off-by:
Marek Vasut <marex@denx.de>
-
Marek Vasut authored
Swap the malloc upwards as it can now no longer depends on SB header crypto init which filled the SB header with additional data. Now the SB header crypto operation and malloc of the image are truly separate entities. This also groups the SB header crypto operation together nicely. Signed-off-by:
Marek Vasut <marex@denx.de>
-
Marek Vasut authored
Calculate the size of the section block while reading it. This value can be later reused when calculating the placement of the final image blocks. Signed-off-by:
Marek Vasut <marex@denx.de>
-
Marek Vasut authored
This patch loads a file associated with a LOAD command and puts it correctly into the tree-like structure representing the SB image. Note that the loading operation is now done twice, but this will be fixed shortly. Signed-off-by:
Marek Vasut <marex@denx.de>
-
Marek Vasut authored
Rework the mechanism behind generating the SB image header generation. This also puts down the groundwork for further rework of the mechanism for contructing the image. The basic idea here is to parse the whole image, construct a tree-like structure in RAM that represents the image and operate with it throughout the whole life-cycle of the program. Right now, this only serves the purpose of filling the SB image header, but this will change in subsequent patches. NOTE that this patch introduces a lot of FIXMEs, since this is a huge rework of the whole tool. This patch revealed a lot of weak spots too. Signed-off-by:
Marek Vasut <marex@denx.de>
-
Marek Vasut authored
There is only one SB image header, so make it part of the image context instead of having separate variable for this purpose. Moreover, it's now possible to constify the SB header template. Signed-off-by:
Marek Vasut <marex@denx.de>
-
Marek Vasut authored
The program uses many variables throughout it's operation, implement a program context structure to hold these variables. Signed-off-by:
Marek Vasut <marex@denx.de>
-
Marek Vasut authored
Do not abuse the start of image directly as the CBC-MAC IV, but create separate overlaid field for this purpose. Signed-off-by:
Marek Vasut <marex@denx.de>
-
Marek Vasut authored
Implement a function that allocates space for an instructions and fills in the fields on a per-command basis. Note that some commands are still not implemented. Signed-off-by:
Marek Vasut <marex@denx.de>
-
Marek Vasut authored
Certain fields of the SB header are only available since v1.1 of the SB file format, document that. Signed-off-by:
Marek Vasut <marex@denx.de>
-
Marek Vasut authored
This patch adds all possible command flags that can be used with the SB file format. Signed-off-by:
Marek Vasut <marex@denx.de>
-
Marek Vasut authored
Add details about the fields for all the commands, moreover align the names of the fields with the documentation where it was not confusing. Signed-off-by:
Marek Vasut <marex@denx.de>
-
Marek Vasut authored
Fill in the full table of SB command tags as they are listed in the SB image specification. Signed-off-by:
Marek Vasut <marex@denx.de>
-
Marek Vasut authored
The SB image format specification calls the command identifier a tag, so align the source this way. Also rename the commands so they match the SB format specification. Signed-off-by:
Marek Vasut <marex@denx.de>
-
- 05 Jun, 2013 2 commits
-
-
Marek Vasut authored
This will allow GCC to lint the sources even more. Signed-off-by:
Marek Vasut <marex@denx.de>
-
Marek Vasut authored
The type must be unsigned int, otherwise gcc -Wextra produces a warning. Signed-off-by:
Marek Vasut <marex@denx.de>
-