Add mynewt testplan

Signed-off-by: Fabio Utzig <utzig@apache.org>
This commit is contained in:
Fabio Utzig 2017-07-27 20:50:50 -03:00 committed by David Brown
parent 9a95b9691f
commit d7f6c765d0
23 changed files with 22294 additions and 0 deletions

157
doc/testplan-mynewt.md Normal file
View File

@ -0,0 +1,157 @@
## mcuboot test plan
The current target for running the tests is the Freedom K64F board.
### Basic sign support (RSA/EC/EC256)
For each supported signing algorithm, check that non-signed, and signed
with wrong key images are not swapped to, and image signed with correct key
is swapped to.
For the 3 algorithms supported, rsa, ec and ec256, two files are provided:
key_<sign-algo>.pem, key_<sign-algo>_2.pem. And a keys file with the C public
key data for key_<sign-algo>.pem.
Build and load mcuboot:
* `newt build k64f_boot_<sign-algo>`
* `newt load k64f_boot_<sign-algo>`
Build and load good image in slot 0:
* `newt create-image k64f_blinky 1.0.1 key_<sign-algo>.pem`
* `newt load k64f_blinky`
NOTE: If testing RSA/PSS `newt create-image` needs to be passed in the extra
flag `--rsa-pss` eg:
`newt create-image k64f_blinky 1.0.1 key_rsa.pem --rsa-pss`
Build and load image in slot 1 with no signing, signed with
key_<sign-algo>_2.pem and signed with key_<sign-algo>.pem. Mark each one as
test image and check that swap only happens for image signed with
key_<sign-algo>.pem. Both others should be erased.
* `newt create-image k64f_blinky2 1.0.2 <one-of-the-sign-keys-or-none>`
* `newtmgr image upload k64f_blinky2`
* `newtmgr image list`
* `newtmgr image test <hash of slot 1>`
### Image signed with more than one key
FIXME: this is currently not functional, skip this section!
Build and load mcuboot:
* `newt build k64f_boot_rsa_ec`
* `newt load k64f_boot_rsa_ec`
Build and load good image in slot 0:
* `newt create-image k64f_blinky 1.0.1 key_rsa.pem`
* `newt load k64f_blinky`
Build and load image in slot 1 with no signing, signed with
key_<sign-algo>_2.pem and signed with key_<sign-algo>.pem. Mark each one as
test image and check that swap only happens for image signed with
key_<sign-algo>.pem. Both others should be erased.
Use all of this options:
* `newt create-image k64f_blinky2 1.0.2`
And load
* `newtmgr image upload k64f_blinky2`
* `newtmgr image list`
* `newtmgr image test <hash of slot 1>`
### Overwrite only functionality
Build/load mcuboot:
* `newt build k64f_boot_rsa_noswap`
* `newt load k64f_boot_rsa_noswap`
Build/load blinky to slot 0:
* `newt create-image k64f_blinky 1.0.1 key_rsa.pem`
* `newt load k64f_blinky`
Build/load blinky2 both with bad and good key, followed by a permanent swap
request:
* `newt create-image k64f_blinky2 1.0.2 <bad and good rsa keys>.pem`
* `newtmgr image upload k64f_blinky2`
* `newtmgr image list`
* `newtmgr image confirm <hash of slot 1>`
This should not swap and delete the image in slot 1 when signed with the wrong
key, otherwise the image in slot 1 should be *moved* to slot 0 and slot 1 should
be empty.
### Validate slot 0 option
Build/load mcuboot:
* `newt build k64f_boot_rsa_validate0`
* `newt load k64f_boot_rsa_validate0`
Build non-signed image:
* `newt create-image k64f_blinky 1.0.1`
* `newt load k64f_blinky`
* Reset and no image should be run
Build signed image with invalid key:
* `newt create-image k64f_blinky 1.0.1 key_rsa_2.pem`
* `newt load k64f_blinky`
* Reset and no image should be run
Build signed image with *valid* key:
* `newt create-image k64f_blinky 1.0.1 key_rsa.pem`
* `newt load k64f_blinky`
* Reset and image *should* run
### Swap with random failures
DISCLAIMER: be careful with copy/paste of commands, this test uses another
target/app!
Build/load mcuboot:
* `newt build k64f_boot_rsa`
* `newt load k64f_boot_rsa`
Build/load slinky to slot 0:
* `newt create-image k64f_slinky 1.0.1 key_rsa.pem`
* `newt load k64f_slinky`
Build/load slinky2 to slot 1:
* `newt create-image k64f_slinky2 1.0.2 key_rsa.pem`
* `newtmgr image upload k64f_slinky2`
Confirm that both images are installed, request a permanent request to the
image in slot 1 and check that it works.
* `newtmgr image list`
* `newtmgr image confirm <hash of slot 1>`
If everything works, now proceed with requests for permanent swap to the image
in slot 1 and do random swaps (as much as you like!). When the swap finishes
confirm that the swap was finished with the previous slot 1 image now in
slot 0 and vice-versa.
### Help
* Mass erase MCU
$ pyocd-flashtool -ce
* Flashing image in slot 1:
$ pyocd-flashtool -se --address 0x80000 ${IMG_FILE} bin

91
testplan/mynewt/Makefile Normal file
View File

@ -0,0 +1,91 @@
BLINKY := k64f_blinky
BLINKY2 := k64f_blinky2
SLINKY := k64f_slinky
SLINKY2 := k64f_slinky2
BOOT_RSA := k64f_boot_rsa
BOOT_RSA_PSS := k64f_boot_rsa_pss
BOOT_EC := k64f_boot_ec
BOOT_EC256 := k64f_boot_ec256
BOOT_RSA_EC := k64f_boot_rsa_ec
BOOT_RSA_VALIDATE0 := k64f_boot_rsa_validate0
BOOT_RSA_NOSWAP := k64f_boot_rsa_noswap
RSA_KEY_1 := key_rsa.pem
RSA_KEY_2 := key_rsa_2.pem
BLINKY2_IMG := bin/targets/$(BLINKY2)/app/apps/blinky/blinky.img
FLASH_ERASE := pyocd-flashtool -ce
NEWTMGR_CONN := --conn k64f
NEWTMGR_IMG := newtmgr $(NEWTMGR_CONN) image
all: build-apps build-mcuboot
build-blinky:
@echo "* Building blinky for slot 0... \c"
@newt build -q $(BLINKY)
@echo "ok"
build-blinky2:
@echo "* Building blinky2 for slot 1... \c"
@newt build -q $(BLINKY2)
@echo "ok"
build-slinky:
@echo "* Building slinky for slot 0... \c"
@newt build -q $(SLINKY)
@echo "ok"
build-slinky2:
@echo "* Building slinky2 for slot 1... \c"
@newt build -q $(SLINKY2)
@echo "ok"
build-boot-rsa:
@echo "* Building mcuboot with RSA... \c"
@newt build -q $(BOOT_RSA)
@echo "ok"
build-boot-rsa-pss:
@echo "* Building mcuboot with RSA/PSS... \c"
@newt build -q $(BOOT_RSA_PSS)
@echo "ok"
build-boot-ec:
@echo "* Building mcuboot with EC... \c"
@newt build -q $(BOOT_EC)
@echo "ok"
build-boot-ec256:
@echo "* Building mcuboot with EC256... \c"
@newt build -q $(BOOT_EC256)
@echo "ok"
# FIXME: multi-key signing does not work yet...
build-boot-rsa-ec:
@echo "* Building mcuboot with RSA + EC... \c"
@newt build -q $(BOOT_RSA_EC)
@echo "ok"
build-boot-rsa-validate0:
@echo "* Building mcuboot with slot 0 validation... \c"
@newt build -q $(BOOT_RSA_VALIDATE0)
@echo "ok"
build-boot-rsa-noswap:
@echo "* Building mcuboot with overwrite only upgrade... \c"
@newt build -q $(BOOT_RSA_NOSWAP)
@echo "ok"
build-apps: build-blinky build-blinky2 build-slinky build-slinky2
build-mcuboot: build-boot-rsa build-boot-rsa-pss build-boot-ec \
build-boot-ec256 build-boot-rsa-validate0 build-boot-rsa-noswap
clean:
rm -rf bin/
.PHONY: all clean

View File

@ -0,0 +1,35 @@
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you 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.
#
pkg.name: apps/blinky
pkg.type: app
pkg.description: Basic example application which blinks an LED.
pkg.author: "Apache Mynewt <dev@mynewt.incubator.apache.org>"
pkg.homepage: "http://mynewt.apache.org/"
pkg.keywords:
pkg.deps:
- "@mcuboot/boot/bootutil"
- "@apache-mynewt-core/kernel/os"
- "@apache-mynewt-core/hw/hal"
- "@apache-mynewt-core/sys/console/full"
- "@apache-mynewt-core/mgmt/newtmgr"
- "@apache-mynewt-core/mgmt/newtmgr/transport/nmgr_shell"
- "@apache-mynewt-core/mgmt/imgmgr"
- "@apache-mynewt-core/sys/log/stub"

View File

@ -0,0 +1,78 @@
/**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you 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.
*/
#include <assert.h>
#include <string.h>
#include "sysinit/sysinit.h"
#include "os/os.h"
#include "bsp/bsp.h"
#include "hal/hal_gpio.h"
#ifdef ARCH_sim
#include "mcu/mcu_sim.h"
#endif
#define BLINKY_PRIO (8)
#define BLINKY_STACK_SIZE OS_STACK_ALIGN(128)
static struct os_task task1;
static volatile int g_task1_loops;
/* For LED toggling */
int g_led_pin;
static void
blinky_handler(void *arg)
{
while (1) {
++g_task1_loops;
os_time_delay(OS_TICKS_PER_SEC / MYNEWT_VAL(BLINKY_TICKS_PER_SEC));
/* Toggle the LED */
hal_gpio_toggle(g_led_pin);
}
}
int
main(int argc, char **argv)
{
os_stack_t *pstack;
#ifdef ARCH_sim
mcu_sim_parse_args(argc, argv);
#endif
sysinit();
g_led_pin = LED_BLINK_PIN;
hal_gpio_init_out(g_led_pin, 1);
pstack = malloc(sizeof(os_stack_t) * BLINKY_STACK_SIZE);
assert(pstack);
os_task_init(&task1, "blinky", blinky_handler, NULL,
BLINKY_PRIO, OS_WAIT_FOREVER, pstack, BLINKY_STACK_SIZE);
while (1) {
os_eventq_run(os_eventq_dflt_get());
}
return 0;
}

View File

@ -0,0 +1,8 @@
syscfg.defs:
BLINKY_TICKS_PER_SEC:
value: 1
syscfg.vals:
REBOOT_LOG_ENTRY_COUNT: 0
REBOOT_LOG_CONSOLE: 0
SHELL_TASK: 1

View File

@ -0,0 +1,39 @@
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you 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.
#
pkg.name: apps/slinky
pkg.type: app
pkg.description: "Example application which uses a variety of mynewt features."
pkg.author: "Apache Mynewt <dev@mynewt.apache.org>"
pkg.homepage: "http://mynewt.apache.org/"
pkg.keywords:
pkg.deps:
- "@mcuboot/boot/bootutil"
- "@apache-mynewt-core/test/flash_test"
- "@apache-mynewt-core/mgmt/imgmgr"
- "@apache-mynewt-core/mgmt/newtmgr"
- "@apache-mynewt-core/mgmt/newtmgr/transport/nmgr_shell"
- "@apache-mynewt-core/kernel/os"
- "@apache-mynewt-core/sys/shell"
- "@apache-mynewt-core/sys/config"
- "@apache-mynewt-core/sys/console/full"
- "@apache-mynewt-core/sys/id"
- "@apache-mynewt-core/sys/log/full"
- "@apache-mynewt-core/sys/stats/full"

View File

@ -0,0 +1,296 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you 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.
*/
#include "syscfg/syscfg.h"
#include "sysinit/sysinit.h"
#include "sysflash/sysflash.h"
#include <os/os.h>
#include <bsp/bsp.h>
#include <hal/hal_gpio.h>
#include <hal/hal_flash.h>
#include <console/console.h>
#include <shell/shell.h>
#include <log/log.h>
#include <stats/stats.h>
#include <config/config.h>
#include "flash_map/flash_map.h"
#include <hal/hal_system.h>
#if MYNEWT_VAL(SPLIT_LOADER)
#include "split/split.h"
#endif
#include <newtmgr/newtmgr.h>
#include <bootutil/image.h>
#include <bootutil/bootutil.h>
#include <imgmgr/imgmgr.h>
#include <assert.h>
#include <string.h>
#include <reboot/log_reboot.h>
#include <os/os_time.h>
#include <id/id.h>
#ifdef ARCH_sim
#include <mcu/mcu_sim.h>
#endif
/* Task 1 */
#define TASK1_PRIO (8)
#define TASK1_STACK_SIZE OS_STACK_ALIGN(192)
#define MAX_CBMEM_BUF 600
static struct os_task task1;
static volatile int g_task1_loops;
/* Task 2 */
#define TASK2_PRIO (9)
#define TASK2_STACK_SIZE OS_STACK_ALIGN(64)
static struct os_task task2;
static struct log my_log;
static volatile int g_task2_loops;
/* Global test semaphore */
static struct os_sem g_test_sem;
/* For LED toggling */
static int g_led_pin;
STATS_SECT_START(gpio_stats)
STATS_SECT_ENTRY(toggles)
STATS_SECT_END
static STATS_SECT_DECL(gpio_stats) g_stats_gpio_toggle;
static STATS_NAME_START(gpio_stats)
STATS_NAME(gpio_stats, toggles)
STATS_NAME_END(gpio_stats)
static char *test_conf_get(int argc, char **argv, char *val, int max_len);
static int test_conf_set(int argc, char **argv, char *val);
static int test_conf_commit(void);
static int test_conf_export(void (*export_func)(char *name, char *val),
enum conf_export_tgt tgt);
static struct conf_handler test_conf_handler = {
.ch_name = "test",
.ch_get = test_conf_get,
.ch_set = test_conf_set,
.ch_commit = test_conf_commit,
.ch_export = test_conf_export
};
static uint8_t test8;
static uint8_t test8_shadow;
static char test_str[32];
static uint32_t cbmem_buf[MAX_CBMEM_BUF];
static struct cbmem cbmem;
static char *
test_conf_get(int argc, char **argv, char *buf, int max_len)
{
if (argc == 1) {
if (!strcmp(argv[0], "8")) {
return conf_str_from_value(CONF_INT8, &test8, buf, max_len);
} else if (!strcmp(argv[0], "str")) {
return test_str;
}
}
return NULL;
}
static int
test_conf_set(int argc, char **argv, char *val)
{
if (argc == 1) {
if (!strcmp(argv[0], "8")) {
return CONF_VALUE_SET(val, CONF_INT8, test8_shadow);
} else if (!strcmp(argv[0], "str")) {
return CONF_VALUE_SET(val, CONF_STRING, test_str);
}
}
return OS_ENOENT;
}
static int
test_conf_commit(void)
{
test8 = test8_shadow;
return 0;
}
static int
test_conf_export(void (*func)(char *name, char *val), enum conf_export_tgt tgt)
{
char buf[4];
conf_str_from_value(CONF_INT8, &test8, buf, sizeof(buf));
func("test/8", buf);
func("test/str", test_str);
return 0;
}
static void
task1_handler(void *arg)
{
struct os_task *t;
int prev_pin_state, curr_pin_state;
struct image_version ver;
/* Set the led pin for the E407 devboard */
g_led_pin = LED_BLINK_PIN;
hal_gpio_init_out(g_led_pin, 1);
if (imgr_my_version(&ver) == 0) {
console_printf("\nSlinky %u.%u.%u.%u\n",
ver.iv_major, ver.iv_minor, ver.iv_revision,
(unsigned int)ver.iv_build_num);
} else {
console_printf("\nSlinky\n");
}
while (1) {
t = os_sched_get_current_task();
assert(t->t_func == task1_handler);
++g_task1_loops;
/* Wait one second */
os_time_delay(OS_TICKS_PER_SEC / MYNEWT_VAL(BLINKY_TICKS_PER_SEC));
/* Toggle the LED */
prev_pin_state = hal_gpio_read(g_led_pin);
curr_pin_state = hal_gpio_toggle(g_led_pin);
LOG_INFO(&my_log, LOG_MODULE_DEFAULT, "GPIO toggle from %u to %u",
prev_pin_state, curr_pin_state);
STATS_INC(g_stats_gpio_toggle, toggles);
/* Release semaphore to task 2 */
os_sem_release(&g_test_sem);
}
}
static void
task2_handler(void *arg)
{
struct os_task *t;
while (1) {
/* just for debug; task 2 should be the running task */
t = os_sched_get_current_task();
assert(t->t_func == task2_handler);
/* Increment # of times we went through task loop */
++g_task2_loops;
/* Wait for semaphore from ISR */
os_sem_pend(&g_test_sem, OS_TIMEOUT_NEVER);
}
}
/**
* init_tasks
*
* Called by main.c after sysinit(). This function performs initializations
* that are required before tasks are running.
*
* @return int 0 success; error otherwise.
*/
static void
init_tasks(void)
{
os_stack_t *pstack;
/* Initialize global test semaphore */
os_sem_init(&g_test_sem, 0);
pstack = malloc(sizeof(os_stack_t)*TASK1_STACK_SIZE);
assert(pstack);
os_task_init(&task1, "task1", task1_handler, NULL,
TASK1_PRIO, OS_WAIT_FOREVER, pstack, TASK1_STACK_SIZE);
pstack = malloc(sizeof(os_stack_t)*TASK2_STACK_SIZE);
assert(pstack);
os_task_init(&task2, "task2", task2_handler, NULL,
TASK2_PRIO, OS_WAIT_FOREVER, pstack, TASK2_STACK_SIZE);
}
int read_random_data(void);
/**
* main
*
* The main task for the project. This function initializes the packages, calls
* init_tasks to initialize additional tasks (and possibly other objects),
* then starts serving events from default event queue.
*
* @return int NOTE: this function should never return!
*/
int
main(int argc, char **argv)
{
int rc;
#ifdef ARCH_sim
mcu_sim_parse_args(argc, argv);
#endif
sysinit();
rc = conf_register(&test_conf_handler);
assert(rc == 0);
cbmem_init(&cbmem, cbmem_buf, MAX_CBMEM_BUF);
log_register("log", &my_log, &log_cbmem_handler, &cbmem, LOG_SYSLEVEL);
stats_init(STATS_HDR(g_stats_gpio_toggle),
STATS_SIZE_INIT_PARMS(g_stats_gpio_toggle, STATS_SIZE_32),
STATS_NAME_INIT_PARMS(gpio_stats));
stats_register("gpio_toggle", STATS_HDR(g_stats_gpio_toggle));
conf_load();
reboot_start(hal_reset_cause());
(void) read_random_data();
init_tasks();
/* If this app is acting as the loader in a split image setup, jump into
* the second stage application instead of starting the OS.
*/
#if MYNEWT_VAL(SPLIT_LOADER)
{
void *entry;
rc = split_app_go(&entry, true);
if(rc == 0) {
hal_system_restart(entry);
}
}
#endif
/*
* As the last thing, process events from default event queue.
*/
while (1) {
os_eventq_run(os_eventq_dflt_get());
}
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,34 @@
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you 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.
#
syscfg.defs:
BLINKY_TICKS_PER_SEC:
value: 1
syscfg.vals:
SHELL_TASK: 1
STATS_NAMES: 1
REBOOT_LOG_FCB: 1
LOG_FCB: 1
CONFIG_FCB: 1
STATS_CLI: 1
LOG_CLI: 1
CONFIG_CLI: 1
STATS_NEWTMGR: 1
LOG_NEWTMGR: 1
CONFIG_NEWTMGR: 1

View File

@ -0,0 +1,5 @@
-----BEGIN EC PRIVATE KEY-----
MGgCAQEEHKDCA+0fUA9P6MkTZvGlO4IN8kQfMbD4xyt619WgBwYFK4EEACGhPAM6
AASgjFrWmCAa1bnE/X+l0wjKAJFexpJJzhjFZBftv2PQzbj3/yklNVp6IDDJJpWy
V9FGDWkYE8l9sw==
-----END EC PRIVATE KEY-----

View File

@ -0,0 +1,5 @@
-----BEGIN EC PRIVATE KEY-----
MHcCAQEEINtq7Uc92lGcI9pcfwU7IEWfjtYKMpG3iSLy8vdn3p0poAoGCCqGSM49
AwEHoUQDQgAEbmhhf9fiyT20CixtsNDO/lS4lq38YIeJQektIcg+HV7Dd/1iX7v7
2hCnWiOq/AG13HM9N8FFj5A7Zv0rlWacyQ==
-----END EC PRIVATE KEY-----

View File

@ -0,0 +1,5 @@
-----BEGIN EC PRIVATE KEY-----
MHcCAQEEICDt9+UM3LnshnbYzo73AGTWav9ZmRYDydJAarzx4Og8oAoGCCqGSM49
AwEHoUQDQgAEDv6jJOUwhCpzEH3T7yWlAOZRTLIlC0q/JMHyJR0PkPMS+eyq7fEp
hOnAXbCNx5PLyVLR2NSnOU1A6QiLHW1j0A==
-----END EC PRIVATE KEY-----

View File

@ -0,0 +1,5 @@
-----BEGIN EC PRIVATE KEY-----
MGgCAQEEHCN8/JmSnXMbwvimYU61t5J3BqSog3UD9rszWEugBwYFK4EEACGhPAM6
AATihCbugkqIXekQOh7iZZZPghfS/bQID5ad8FRY1xnL5rBd2nR7gFqTXxV9M9t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5vXEmPmqk9qYxmKIr5MLM9229gWCCGt7wWdH5Xt0AT7ZUvxwyKnaS/QimOVU2X1t
3lpGMTJkRq5bxMUUbC1n9e6o/GFrlmtLjCTYgRLOBKNy36bxxZnOZw==
-----END RSA PRIVATE KEY-----

View File

@ -0,0 +1,3 @@
pkg.name: keys/ec
pkg.author: "Apache Mynewt <dev@mynewt.apache.org>"
pkg.homepage: "http://mynewt.apache.org/"

View File

@ -0,0 +1,18 @@
#include <bootutil/sign_key.h>
static unsigned char key[] = {
0x30, 0x4e, 0x30, 0x10, 0x06, 0x07, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x02,
0x01, 0x06, 0x05, 0x2b, 0x81, 0x04, 0x00, 0x21, 0x03, 0x3a, 0x00, 0x04,
0xa0, 0x8c, 0x5a, 0xd6, 0x98, 0x20, 0x1a, 0xd5, 0xb9, 0xc4, 0xfd, 0x7f,
0xa5, 0xd3, 0x08, 0xca, 0x00, 0x91, 0x5e, 0xc6, 0x92, 0x49, 0xce, 0x18,
0xc5, 0x64, 0x17, 0xed, 0xbf, 0x63, 0xd0, 0xcd, 0xb8, 0xf7, 0xff, 0x29,
0x25, 0x35, 0x5a, 0x7a, 0x20, 0x30, 0xc9, 0x26, 0x95, 0xb2, 0x57, 0xd1,
0x46, 0x0d, 0x69, 0x18, 0x13, 0xc9, 0x7d, 0xb3
};
static unsigned int key_len = 80;
const struct bootutil_key bootutil_keys[] = {
[0] = {
.key = key,
.len = &key_len,
},
};
const int bootutil_key_cnt = 1;

View File

@ -0,0 +1,3 @@
pkg.name: keys/ec256
pkg.author: "Apache Mynewt <dev@mynewt.apache.org>"
pkg.homepage: "http://mynewt.apache.org/"

View File

@ -0,0 +1,19 @@
#include <bootutil/sign_key.h>
static unsigned char key[] = {
0x30, 0x59, 0x30, 0x13, 0x06, 0x07, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x02,
0x01, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x03, 0x01, 0x07, 0x03,
0x42, 0x00, 0x04, 0x6e, 0x68, 0x61, 0x7f, 0xd7, 0xe2, 0xc9, 0x3d, 0xb4,
0x0a, 0x2c, 0x6d, 0xb0, 0xd0, 0xce, 0xfe, 0x54, 0xb8, 0x96, 0xad, 0xfc,
0x60, 0x87, 0x89, 0x41, 0xe9, 0x2d, 0x21, 0xc8, 0x3e, 0x1d, 0x5e, 0xc3,
0x77, 0xfd, 0x62, 0x5f, 0xbb, 0xfb, 0xda, 0x10, 0xa7, 0x5a, 0x23, 0xaa,
0xfc, 0x01, 0xb5, 0xdc, 0x73, 0x3d, 0x37, 0xc1, 0x45, 0x8f, 0x90, 0x3b,
0x66, 0xfd, 0x2b, 0x95, 0x66, 0x9c, 0xc9
};
static unsigned int key_len = 91;
const struct bootutil_key bootutil_keys[] = {
[0] = {
.key = key,
.len = &key_len,
},
};
const int bootutil_key_cnt = 1;

View File

@ -0,0 +1,12 @@
pkg.name: keys
pkg.author: "Apache Mynewt <dev@mynewt.apache.org>"
pkg.homepage: "http://mynewt.apache.org/"
pkg.deps.BOOTUTIL_SIGN_RSA:
- keys/rsa
pkg.deps.BOOTUTIL_SIGN_EC:
- keys/ec
pkg.deps.BOOTUTIL_SIGN_EC256:
- keys/ec256

View File

@ -0,0 +1,3 @@
pkg.name: keys/rsa
pkg.author: "Apache Mynewt <dev@mynewt.apache.org>"
pkg.homepage: "http://mynewt.apache.org/"

View File

@ -0,0 +1,34 @@
#include <bootutil/sign_key.h>
static unsigned char key[] = {
0x30, 0x82, 0x01, 0x0a, 0x02, 0x82, 0x01, 0x01, 0x00, 0xe2, 0x48, 0x5f,
0x31, 0x08, 0x50, 0x2e, 0x4f, 0x6d, 0xbf, 0xcd, 0xd0, 0x09, 0xf1, 0x5c,
0xd6, 0x08, 0xe9, 0x84, 0xcf, 0x75, 0x2c, 0x88, 0x07, 0xcc, 0x0e, 0xf9,
0x53, 0xae, 0x4a, 0x9a, 0x93, 0xb4, 0x1b, 0x55, 0x43, 0x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x8a, 0x2a, 0xa8, 0xa0, 0x1c, 0xb8, 0x8a, 0x61, 0xaf, 0x32,
0x3d, 0x41, 0xe9, 0xf6, 0xb1, 0xa2, 0x73, 0xc2, 0xff, 0xd1, 0x32, 0x55,
0x1f, 0xda, 0x09, 0x23, 0xc1, 0x83, 0x51, 0xe1, 0x4f, 0xd5, 0x65, 0x3e,
0x97, 0x02, 0x03, 0x01, 0x00, 0x01
};
static unsigned int key_len = 270;
const struct bootutil_key bootutil_keys[] = {
[0] = {
.key = key,
.len = &key_len,
},
};
const int bootutil_key_cnt = 1;

View File

@ -0,0 +1,36 @@
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you 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.
#
project.name: "mcuboot-test"
project.repositories:
- apache-mynewt-core
- mcuboot
repository.apache-mynewt-core:
type: github
vers: 0-dev
user: apache
repo: mynewt-core
repository.mcuboot:
type: github
vers: 0-dev
user: runtimeco
repo: mcuboot