[PATCH] lib: rsa: Extract public key from private key if keyfile argument is used

2021-07-28 Thread Chan, Donald
If the 'keyfile' (-G) argument is used, there is little value to require 'keydir' (-k) argument since the public key can also be extracted from the private key itself. Signed-off-by: Donald Chan --- lib/rsa/rsa-sign.c | 28 +--- 1 file changed, 21 insertions(+), 7 deletio

[PATCH] lib: rsa: rsa-sign: Minor bug in debug message

2021-07-19 Thread Chan, Donald
*sig_size isn't set until later so use the correct variables. Signed-off-by: Donald Chan --- lib/rsa/rsa-sign.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/rsa/rsa-sign.c b/lib/rsa/rsa-sign.c index f70f352311..5b85d61a13 100644 --- a/lib/rsa/rsa-sign.c +++ b/lib/rsa/

[PATCH] lib: rsa: Extract public key from private key if keyfile argument is used

2021-07-18 Thread Chan, Donald
If the 'keyfile' (-G) argument is used, there is little value to require 'keydir' (-k) argument since the public key can also be extracted from the private key itself. Signed-off-by: Donald Chan --- lib/rsa/rsa-sign.c | 28 +--- 1 file changed, 21 insertions(+), 7 dele

[PATCH] lib/rsa: Use EVP_PKEY instead of RSA

2021-04-02 Thread Chan, Donald
Most modern OpenSSL engines have methods overridden at the EVP level rather than at RSA level, to make these engines work properly with mkimage, the RSA signing code needs to switch to using EVP_* APIs as much as possible. Signed-off-by: Donald Chan --- lib/rsa/rsa-sign.c | 168 +