diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Kconfig | 8 | ||||
-rw-r--r-- | lib/Makefile | 2 | ||||
-rw-r--r-- | lib/rsa/rsa-sign.c | 13 | ||||
-rw-r--r-- | lib/rsa/rsa-verify.c | 2 |
4 files changed, 22 insertions, 3 deletions
diff --git a/lib/Kconfig b/lib/Kconfig index ad4d75e0a4..fdcf7ea405 100644 --- a/lib/Kconfig +++ b/lib/Kconfig @@ -40,6 +40,14 @@ config CC_OPTIMIZE_LIBS_FOR_SPEED If unsure, say N. +config CHARSET + bool + default y if UT_UNICODE || EFI_LOADER || UFS + help + Enables support for various conversions between different + character sets, such as between unicode representations and + different 'code pages'. + config DYNAMIC_CRC_TABLE bool "Enable Dynamic tables for CRC" help diff --git a/lib/Makefile b/lib/Makefile index 5cd0c9c638..07c2ccd7cf 100644 --- a/lib/Makefile +++ b/lib/Makefile @@ -25,7 +25,7 @@ obj-$(CONFIG_AES) += aes/ obj-$(CONFIG_$(SPL_TPL_)BINMAN_FDT) += binman.o ifndef API_BUILD -ifneq ($(CONFIG_UT_UNICODE)$(CONFIG_EFI_LOADER),) +ifneq ($(CONFIG_CHARSET),) obj-y += charset.o endif endif diff --git a/lib/rsa/rsa-sign.c b/lib/rsa/rsa-sign.c index f4ed11e74a..085dc89bf7 100644 --- a/lib/rsa/rsa-sign.c +++ b/lib/rsa/rsa-sign.c @@ -338,6 +338,7 @@ static int rsa_init(void) static int rsa_engine_init(const char *engine_id, ENGINE **pe) { + const char *key_pass; ENGINE *e; int ret; @@ -362,10 +363,20 @@ static int rsa_engine_init(const char *engine_id, ENGINE **pe) goto err_set_rsa; } + key_pass = getenv("MKIMAGE_SIGN_PIN"); + if (key_pass) { + if (!ENGINE_ctrl_cmd_string(e, "PIN", key_pass, 0)) { + fprintf(stderr, "Couldn't set PIN\n"); + ret = -1; + goto err_set_pin; + } + } + *pe = e; return 0; +err_set_pin: err_set_rsa: ENGINE_finish(e); err_engine_init: @@ -473,7 +484,7 @@ static int rsa_sign_with_key(EVP_PKEY *pkey, struct padding_algo *padding_algo, #endif EVP_MD_CTX_destroy(context); - debug("Got signature: %d bytes, expected %zu\n", *sig_size, size); + debug("Got signature: %zu bytes, expected %d\n", size, EVP_PKEY_size(pkey)); *sigp = sig; *sig_size = size; diff --git a/lib/rsa/rsa-verify.c b/lib/rsa/rsa-verify.c index bb8cc61d94..3840764e42 100644 --- a/lib/rsa/rsa-verify.c +++ b/lib/rsa/rsa-verify.c @@ -556,7 +556,7 @@ int rsa_verify(struct image_sign_info *info, */ if (info->checksum->checksum_len > info->crypto->key_len) { - debug("%s: invlaid checksum-algorithm %s for %s\n", + debug("%s: invalid checksum-algorithm %s for %s\n", __func__, info->checksum->name, info->crypto->name); return -EINVAL; } |