* [PATCH] image-fit: ignore rsa by image selection
@ 2021-03-11 17:07 Denis Osterland-Heim
2021-03-15 8:46 ` Sascha Hauer
0 siblings, 1 reply; 2+ messages in thread
From: Denis Osterland-Heim @ 2021-03-11 17:07 UTC (permalink / raw)
To: barebox
From: Denis Osterland-Heim <Denis.Osterland@diehl.com>
For hash algorithm selection, only the first argument of the tuple is
needed. The ',' is included to avoid false-positive matches.
Signed-off-by: Denis Osterland-Heim <Denis.Osterland@diehl.com>
---
common/image-fit.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/common/image-fit.c b/common/image-fit.c
index 538e61f51..2c5ef7f68 100644
--- a/common/image-fit.c
+++ b/common/image-fit.c
@@ -230,11 +230,9 @@ static struct digest *fit_alloc_digest(struct device_node *sig_node,
return ERR_PTR(-EINVAL);
}
-if (strcmp(algo_name, "sha1,rsa2048") == 0) {
+if (strncmp(algo_name, "sha1,", 5) == 0) {
algo = HASH_ALGO_SHA1;
-} else if (strcmp(algo_name, "sha256,rsa2048") == 0) {
-algo = HASH_ALGO_SHA256;
-} else if (strcmp(algo_name, "sha256,rsa4096") == 0) {
+} else if (strncmp(algo_name, "sha256,", 7) == 0) {
algo = HASH_ALGO_SHA256;
} else{
pr_err("unknown algo %s\n", algo_name);
--
2.30.2
Diehl Connectivity Solutions GmbH
Geschäftsführung: Horst Leonberger
Sitz der Gesellschaft: Nürnberg - Registergericht: Amtsgericht
Nürnberg: HRB 32315
________________________________
Der Inhalt der vorstehenden E-Mail ist nicht rechtlich bindend. Diese E-Mail enthaelt vertrauliche und/oder rechtlich geschuetzte Informationen.
Informieren Sie uns bitte, wenn Sie diese E-Mail faelschlicherweise erhalten haben. Bitte loeschen Sie in diesem Fall die Nachricht.
Jede unerlaubte Form der Reproduktion, Bekanntgabe, Aenderung, Verteilung und/oder Publikation dieser E-Mail ist strengstens untersagt.
- Informationen zum Datenschutz, insbesondere zu Ihren Rechten, erhalten Sie unter:
https://www.diehl.com/group/de/transparenz-und-informationspflichten/
The contents of the above mentioned e-mail is not legally binding. This e-mail contains confidential and/or legally protected information. Please inform us if you have received this e-mail by
mistake and delete it in such a case. Each unauthorized reproduction, disclosure, alteration, distribution and/or publication of this e-mail is strictly prohibited.
- For general information on data protection and your respective rights please visit:
https://www.diehl.com/group/en/transparency-and-information-obligations/
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] image-fit: ignore rsa by image selection
2021-03-11 17:07 [PATCH] image-fit: ignore rsa by image selection Denis Osterland-Heim
@ 2021-03-15 8:46 ` Sascha Hauer
0 siblings, 0 replies; 2+ messages in thread
From: Sascha Hauer @ 2021-03-15 8:46 UTC (permalink / raw)
To: Denis Osterland-Heim; +Cc: barebox
On Thu, Mar 11, 2021 at 05:07:21PM +0000, Denis Osterland-Heim wrote:
> From: Denis Osterland-Heim <Denis.Osterland@diehl.com>
>
> For hash algorithm selection, only the first argument of the tuple is
> needed. The ',' is included to avoid false-positive matches.
>
> Signed-off-by: Denis Osterland-Heim <Denis.Osterland@diehl.com>
> ---
> common/image-fit.c | 6 ++----
> 1 file changed, 2 insertions(+), 4 deletions(-)
Applied, thanks
Sascha
>
> diff --git a/common/image-fit.c b/common/image-fit.c
> index 538e61f51..2c5ef7f68 100644
> --- a/common/image-fit.c
> +++ b/common/image-fit.c
> @@ -230,11 +230,9 @@ static struct digest *fit_alloc_digest(struct device_node *sig_node,
> return ERR_PTR(-EINVAL);
> }
>
> -if (strcmp(algo_name, "sha1,rsa2048") == 0) {
> +if (strncmp(algo_name, "sha1,", 5) == 0) {
> algo = HASH_ALGO_SHA1;
> -} else if (strcmp(algo_name, "sha256,rsa2048") == 0) {
> -algo = HASH_ALGO_SHA256;
> -} else if (strcmp(algo_name, "sha256,rsa4096") == 0) {
> +} else if (strncmp(algo_name, "sha256,", 7) == 0) {
> algo = HASH_ALGO_SHA256;
> } else{
> pr_err("unknown algo %s\n", algo_name);
> --
> 2.30.2
>
> Diehl Connectivity Solutions GmbH
> Geschäftsführung: Horst Leonberger
> Sitz der Gesellschaft: Nürnberg - Registergericht: Amtsgericht
> Nürnberg: HRB 32315
>
> ________________________________
>
> Der Inhalt der vorstehenden E-Mail ist nicht rechtlich bindend. Diese E-Mail enthaelt vertrauliche und/oder rechtlich geschuetzte Informationen.
> Informieren Sie uns bitte, wenn Sie diese E-Mail faelschlicherweise erhalten haben. Bitte loeschen Sie in diesem Fall die Nachricht.
> Jede unerlaubte Form der Reproduktion, Bekanntgabe, Aenderung, Verteilung und/oder Publikation dieser E-Mail ist strengstens untersagt.
>
> - Informationen zum Datenschutz, insbesondere zu Ihren Rechten, erhalten Sie unter:
>
> https://www.diehl.com/group/de/transparenz-und-informationspflichten/
>
> The contents of the above mentioned e-mail is not legally binding. This e-mail contains confidential and/or legally protected information. Please inform us if you have received this e-mail by
> mistake and delete it in such a case. Each unauthorized reproduction, disclosure, alteration, distribution and/or publication of this e-mail is strictly prohibited.
>
> - For general information on data protection and your respective rights please visit:
>
> https://www.diehl.com/group/en/transparency-and-information-obligations/
>
>
>
> _______________________________________________
> barebox mailing list
> barebox@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/barebox
>
--
Pengutronix e.K. | |
Steuerwalder Str. 21 | http://www.pengutronix.de/ |
31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-03-15 8:51 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-11 17:07 [PATCH] image-fit: ignore rsa by image selection Denis Osterland-Heim
2021-03-15 8:46 ` Sascha Hauer
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox