Skip to contentSkip to conversation

RSA depends on DM

PATCH New Chris Kuethe 4 participants 11 messages Feb 3, 2015 – Feb 6, 2015

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 RSA depends on DM

Discovered while experimenting with signature checking on vexpress which doesn't typically use DM. Rather than complaining about unmet dependencies it might be better to enable those them.

---
 lib/rsa/Kconfig | 1 +
 1 file changed, 1 insertion(+)
lib/rsa/Kconfig +1 -0
index 1268a1b..4db5da4 100644
@@ -2,6 +2,7 @@ config RSA
  bool "Use RSA Library"
  select RSA_FREESCALE_EXP if FSL_CAAM
  select RSA_SOFTWARE_EXP if !RSA_FREESCALE_EXP
+ select DM
  help
   RSA support. This enables the RSA algorithm used for FIT image
   verification in U-Boot.
Signature · 5 lines
2.1.0


-- 
GDB has a 'break' feature; why doesn't it have 'fix' too?
#1 lore raw

PATCH 1/1 RSA depends on DM

+Masahiro

Hi Chris,

Quoted 13 lines · Chris Kuethe

Discovered while experimenting with signature checking on vexpress which doesn't typically use DM. Rather than complaining about unmet dependencies it might be better to enable those them.

---
 lib/rsa/Kconfig | 1 +
 1 file changed, 1 insertion(+)
lib/rsa/Kconfig +0 -0
index 1268a1b..4db5da4 100644

lib/rsa/Kconfig config RSA · line 8

Quoted 7 lines
lib/rsa/Kconfig +1 -0
@@ -2,6 +2,7 @@ config RSA
  bool "Use RSA Library"
  select RSA_FREESCALE_EXP if FSL_CAAM
  select RSA_SOFTWARE_EXP if !RSA_FREESCALE_EXP
+ select DM
  help
   RSA support. This enables the RSA algorithm used for FIT image
   verification in U-Boot.

I wonder whether 'depends on DM' might be better? It seems odd to have the tail wagging the dog.

Regards,
Simon

#2 lore raw

PATCH 1/1 RSA depends on DM

Quoted 29 lines · Simon Glass

+Masahiro

Hi Chris,

Quoted 13 lines · Chris Kuethe

Discovered while experimenting with signature checking on vexpress which doesn't typically use DM. Rather than complaining about unmet dependencies it might be better to enable those them.

---
 lib/rsa/Kconfig | 1 +
 1 file changed, 1 insertion(+)
lib/rsa/Kconfig +0 -0
index 1268a1b..4db5da4 100644

lib/rsa/Kconfig config RSA · line 8

Quoted 7 lines
lib/rsa/Kconfig +1 -0
@@ -2,6 +2,7 @@ config RSA
  bool "Use RSA Library"
  select RSA_FREESCALE_EXP if FSL_CAAM
  select RSA_SOFTWARE_EXP if !RSA_FREESCALE_EXP
+ select DM
  help
   RSA support. This enables the RSA algorithm used for FIT image
   verification in U-Boot.

I wonder whether 'depends on DM' might be better? It seems odd to have the tail wagging the dog.

Quoted 2 lines

Regards,
Simon

No, that would not be better because a few lines down, RSA_SOFTWARE_EXP and RSA_FREESCALE_EXP both say "depends on DM" but they don't actually enable it if they need it.

As a user, my expectation is that when I turn on some high level feature, that will enable all of its lower level dependencies. Would it be less strange to make FIT_SIGNATURE turn on DM instead of RSA?

Signature · 1 line
GDB has a 'break' feature; why doesn't it have 'fix' too?
#3 lore raw

PATCH 1/1 RSA depends on DM

Hi Chris,

Quoted 33 lines · Chris Kuethe
Quoted 29 lines · Simon Glass

+Masahiro

Hi Chris,

Quoted 13 lines · Chris Kuethe

Discovered while experimenting with signature checking on vexpress which doesn't typically use DM. Rather than complaining about unmet dependencies it might be better to enable those them.

---
 lib/rsa/Kconfig | 1 +
 1 file changed, 1 insertion(+)
lib/rsa/Kconfig +0 -0
index 1268a1b..4db5da4 100644

lib/rsa/Kconfig config RSA · line 8

Quoted 7 lines
lib/rsa/Kconfig +1 -0
@@ -2,6 +2,7 @@ config RSA
  bool "Use RSA Library"
  select RSA_FREESCALE_EXP if FSL_CAAM
  select RSA_SOFTWARE_EXP if !RSA_FREESCALE_EXP
+ select DM
  help
   RSA support. This enables the RSA algorithm used for FIT image
   verification in U-Boot.

I wonder whether 'depends on DM' might be better? It seems odd to have the tail wagging the dog.

Quoted 2 lines

Regards,
Simon

Quoted 7 lines

No, that would not be better because a few lines down, RSA_SOFTWARE_EXP and RSA_FREESCALE_EXP both say "depends on DM" but they don't actually enable it if they need it.

As a user, my expectation is that when I turn on some high level feature, that will enable all of its lower level dependencies. Would it be less strange to make FIT_SIGNATURE turn on DM instead of RSA?

We certainly must avoid the build break.

My concern is that CONFIG_DM may introduce a run-time break. For example if you don't have pre-relocation malloc() available the board may not boot. Driver model is a fundamental core feature, and we are working to move everything over to it, but I'm not quite comfortable with forcing it on when someone changes a feature. It feel it would be better to not offer it.

I'm interested to hear other viewpoints though.

Perhaps soon we can enable CONFIG_DM globally but we are not there yet.

Regards,
Simon

#4 lore raw

PATCH 1/1 RSA depends on DM

Quoted 9 lines · Simon Glass

We certainly must avoid the build break.

My concern is that CONFIG_DM may introduce a run-time break. For example if you don't have pre-relocation malloc() available the board may not boot. Driver model is a fundamental core feature, and we are working to move everything over to it, but I'm not quite comfortable with forcing it on when someone changes a feature. It feel it would be better to not offer it.

Quoted 3 lines

I'm interested to hear other viewpoints though.

Perhaps soon we can enable CONFIG_DM globally but we are not there yet.

I appreciate the caution.

For now, vexpress works with qemu which means I can get back to playing with verified boot. I haven't checked to see if it's possible to make RSA not always require DM - I defer to those who know the code better than I do.

-C

Signature · 1 line
GDB has a 'break' feature; why doesn't it have 'fix' too?
#5 lore raw

PATCH 1/1 RSA depends on DM

In reply to Simon Glass

Of course there is the meta question of why RSA sig is still being used rather than ECDSA.

As a crypto plumber, I occationally wonder why we perpetuate need of large, slow RSA keys over ECC. Perhaps the patent concerns even with RFC 6090.

I will shut up and let you to your important work of getting all this wonderful support working in uboot.

Quoted 60 lines · Simon Glass

Hi Chris,

Quoted 31 lines · Chris Kuethe
Quoted 28 lines · Simon Glass

+Masahiro

Hi Chris,

Quoted 13 lines · Chris Kuethe

Discovered while experimenting with signature checking on vexpress which doesn't typically use DM. Rather than complaining about unmet dependencies it might be better to enable those them.

---
  lib/rsa/Kconfig | 1 +
  1 file changed, 1 insertion(+)
lib/rsa/Kconfig +0 -0
index 1268a1b..4db5da4 100644

lib/rsa/Kconfig config RSA · line 8

Quoted 7 lines
lib/rsa/Kconfig +1 -0
@@ -2,6 +2,7 @@ config RSA
   bool "Use RSA Library"
   select RSA_FREESCALE_EXP if FSL_CAAM
   select RSA_SOFTWARE_EXP if !RSA_FREESCALE_EXP
+ select DM
   help
    RSA support. This enables the RSA algorithm used for FIT image
    verification in U-Boot.

I wonder whether 'depends on DM' might be better? It seems odd to have the tail wagging the dog.

Quoted 2 lines

Regards,
Simon

Quoted 7 lines

No, that would not be better because a few lines down, RSA_SOFTWARE_EXP and RSA_FREESCALE_EXP both say "depends on DM" but they don't actually enable it if they need it.

As a user, my expectation is that when I turn on some high level feature, that will enable all of its lower level dependencies. Would it be less strange to make FIT_SIGNATURE turn on DM instead of RSA?

We certainly must avoid the build break.

My concern is that CONFIG_DM may introduce a run-time break. For example if you don't have pre-relocation malloc() available the board may not boot. Driver model is a fundamental core feature, and we are working to move everything over to it, but I'm not quite comfortable with forcing it on when someone changes a feature. It feel it would be better to not offer it.

I'm interested to hear other viewpoints though.

Perhaps soon we can enable CONFIG_DM globally but we are not there yet.

Regards,
Simon
_______________________________________________
U-Boot mailing list
U-Boot at lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot

#6 lore raw

PATCH 1/1 RSA depends on DM

In reply to Simon Glass

Hello Simon,

Quoted 40 lines · Simon Glass

Hi Chris,

Quoted 37 lines · Chris Kuethe
Quoted 29 lines · Simon Glass

+Masahiro

Hi Chris,

Quoted 13 lines · Chris Kuethe

Discovered while experimenting with signature checking on vexpress which doesn't typically use DM. Rather than complaining about unmet dependencies it might be better to enable those them.

---
 lib/rsa/Kconfig | 1 +
 1 file changed, 1 insertion(+)
lib/rsa/Kconfig +0 -0
index 1268a1b..4db5da4 100644

lib/rsa/Kconfig config RSA · line 8

Quoted 7 lines
lib/rsa/Kconfig +1 -0
@@ -2,6 +2,7 @@ config RSA
  bool "Use RSA Library"
  select RSA_FREESCALE_EXP if FSL_CAAM
  select RSA_SOFTWARE_EXP if !RSA_FREESCALE_EXP
+ select DM
  help
   RSA support. This enables the RSA algorithm used for FIT image
   verification in U-Boot.

I wonder whether 'depends on DM' might be better? It seems odd to have the tail wagging the dog.

Quoted 2 lines

Regards,
Simon

No, that would not be better because a few lines down, RSA_SOFTWARE_EXP and RSA_FREESCALE_EXP both say "depends on DM" but they don't actually enable it if they need it.

Quoted 7 lines
Quoted 3 lines

As a user, my expectation is that when I turn on some high level feature, that will enable all of its lower level dependencies. Would it be less strange to make FIT_SIGNATURE turn on DM instead of RSA?

We certainly must avoid the build break.

My concern is that CONFIG_DM may introduce a run-time break.

I can tell it does. :)

Quoted 7 lines

For example if you don't have pre-relocation malloc() available the board may not boot. Driver model is a fundamental core feature, and we are working to move everything over to it, but I'm not quite comfortable with forcing it on when someone changes a feature. It feel it would be better to not offer it.

I'm interested to hear other viewpoints though.

Agreed for me: no board should have DM enabled 'behind its back'.

If RSA depends on DM, then the make menuconfig user should be unable to select RSA unless and until (s)he has selected DM (and the RSA help should make it clear that the board must support DM, and that just enabling CONFIG_DM probably won't be enough).

Quoted 4 lines

Perhaps soon we can enable CONFIG_DM globally but we are not there yet.

Regards,
Simon

Amicalement,

Signature · 1 line
Albert.
#7 lore raw

PATCH 1/1 RSA depends on DM

Hi Chris,

Quoted 59 lines · Albert ARIBAUD

Hello Simon,

Quoted 40 lines · Simon Glass

Hi Chris,

Quoted 37 lines · Chris Kuethe
Quoted 29 lines · Simon Glass

+Masahiro

Hi Chris,

Quoted 13 lines · Chris Kuethe

Discovered while experimenting with signature checking on vexpress which doesn't typically use DM. Rather than complaining about unmet dependencies it might be better to enable those them.

---
 lib/rsa/Kconfig | 1 +
 1 file changed, 1 insertion(+)
lib/rsa/Kconfig +0 -0
index 1268a1b..4db5da4 100644

lib/rsa/Kconfig config RSA · line 8

Quoted 7 lines
lib/rsa/Kconfig +1 -0
@@ -2,6 +2,7 @@ config RSA
  bool "Use RSA Library"
  select RSA_FREESCALE_EXP if FSL_CAAM
  select RSA_SOFTWARE_EXP if !RSA_FREESCALE_EXP
+ select DM
  help
   RSA support. This enables the RSA algorithm used for FIT image
   verification in U-Boot.

I wonder whether 'depends on DM' might be better? It seems odd to have the tail wagging the dog.

Quoted 2 lines

Regards,
Simon

No, that would not be better because a few lines down, RSA_SOFTWARE_EXP and RSA_FREESCALE_EXP both say "depends on DM" but they don't actually enable it if they need it.

Quoted 7 lines
Quoted 3 lines

As a user, my expectation is that when I turn on some high level feature, that will enable all of its lower level dependencies. Would it be less strange to make FIT_SIGNATURE turn on DM instead of RSA?

We certainly must avoid the build break.

My concern is that CONFIG_DM may introduce a run-time break.

I can tell it does. :)

Quoted 6 lines

For example if you don't have pre-relocation malloc() available the board may not boot. Driver model is a fundamental core feature, and we are working to move everything over to it, but I'm not quite comfortable with forcing it on when someone changes a feature. It feel it would be better to not offer it.

Quoted 10 lines
Quoted 1 line

I'm interested to hear other viewpoints though.

Agreed for me: no board should have DM enabled 'behind its back'.

If RSA depends on DM, then the make menuconfig user should be unable to select RSA unless and until (s)he has selected DM (and the RSA help should make it clear that the board must support DM, and that just enabling CONFIG_DM probably won't be enough).

Quoted 1 line

Perhaps soon we can enable CONFIG_DM globally but we are not there yet.

Can you please adjust your patch to depend on DM rather than select it?

It was me that requested that RSA should require DM, because we should not be adding new driver frameworks that don't use DM.

Regards,
Simon

#8 lore raw

PATCH 1/1 RSA depends on DM

Discovered while experimenting with signature checking on vexpress which doesn't typically use DM.

---
 Kconfig | 1 +
 1 file changed, 1 insertion(+)
Kconfig +1 -0
index fed488f..8090790 100644
@@ -118,6 +118,7 @@ config FIT_VERBOSE
 config FIT_SIGNATURE
  bool "Enable signature verification of FIT uImages"
  depends on FIT
+ depends on DM
  select RSA
  help
   This option enables signature verification of FIT uImages,
Signature · 5 lines
2.1.0


-- 
GDB has a 'break' feature; why doesn't it have 'fix' too?
#9 lore raw

PATCH 1/1 RSA depends on DM

Quoted 5 lines · Chris Kuethe

Discovered while experimenting with signature checking on vexpress which doesn't typically use DM.

---
 Kconfig | 1 +
 1 file changed, 1 insertion(+)
#10 lore raw

PATCH 1/1 RSA depends on DM

Quoted 8 lines · Simon Glass
Quoted 5 lines · Chris Kuethe

Discovered while experimenting with signature checking on vexpress which doesn't typically use DM.

---
 Kconfig | 1 +
 1 file changed, 1 insertion(+)

Applied to u-boot-dm, thanks!