diff mbox series

[v4,24/29] lib/crypto: Adapt mscode_parser to MbedTLS

Message ID 20240702182325.2904421-25-raymond.mao@linaro.org
State Changes Requested
Delegated to: Tom Rini
Headers show
Series Integrate MbedTLS v3.6 LTS with U-Boot | expand

Commit Message

Raymond Mao July 2, 2024, 6:23 p.m. UTC
Previous patch has introduced MbedTLS porting layer for mscode parser,
here to adjust the header and makefiles accordingly.

Signed-off-by: Raymond Mao <raymond.mao@linaro.org>
---
Changes in v2
- Move the porting layer to MbedTLS dir.
Changes in v3
- Update commit message.
Changes in v4
- Control building legacy library via '_LEGACY' Kconfig.
- Minor fix of the include directories.

 include/crypto/mscode.h | 4 ++++
 lib/crypto/Makefile     | 2 +-
 2 files changed, 5 insertions(+), 1 deletion(-)

Comments

Ilias Apalodimas July 30, 2024, 8:03 a.m. UTC | #1
Hi Raymond,

On Tue, 2 Jul 2024 at 21:33, Raymond Mao <raymond.mao@linaro.org> wrote:
>
> Previous patch has introduced MbedTLS porting layer for mscode parser,
> here to adjust the header and makefiles accordingly.
>
> Signed-off-by: Raymond Mao <raymond.mao@linaro.org>
> ---
> Changes in v2
> - Move the porting layer to MbedTLS dir.
> Changes in v3
> - Update commit message.
> Changes in v4
> - Control building legacy library via '_LEGACY' Kconfig.
> - Minor fix of the include directories.
>
>  include/crypto/mscode.h | 4 ++++
>  lib/crypto/Makefile     | 2 +-
>  2 files changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/include/crypto/mscode.h b/include/crypto/mscode.h
> index 551058b96e6..678e69001b9 100644
> --- a/include/crypto/mscode.h
> +++ b/include/crypto/mscode.h
> @@ -9,6 +9,10 @@
>  #ifndef __UBOOT__
>  #include <crypto/hash_info.h>
>  #endif
> +#if CONFIG_IS_ENABLED(MBEDTLS_LIB_X509)
> +#include <mbedtls/asn1.h>
> +#include <mbedtls/oid.h>
> +#endif
>
>  struct pefile_context {
>  #ifndef __UBOOT__
> diff --git a/lib/crypto/Makefile b/lib/crypto/Makefile
> index 428dcba0a6b..9bbd8b48d77 100644
> --- a/lib/crypto/Makefile
> +++ b/lib/crypto/Makefile
> @@ -63,7 +63,7 @@ obj-$(CONFIG_$(SPL_)PKCS7_VERIFY) += pkcs7_verify.o
>  #
>  # Signed PE binary-wrapped key handling
>  #
> -obj-$(CONFIG_$(SPL_)MSCODE_PARSER) += mscode.o
> +obj-$(CONFIG_$(SPL_)MSCODE_PARSER_LEGACY) += mscode.o

The change it self is correct. But patches should be self contained as
much as possible without breaking the compilation or functionality.
IOW I think this should be in a different patch where the
MSCODE_PARSER_LEGACY is introduced.

Cheers
/Ilias
>
>  mscode-y := \
>         mscode_parser.o \
> --
> 2.25.1
>
Raymond Mao July 30, 2024, 2:07 p.m. UTC | #2
Hi Ilias,

On Tue, 30 Jul 2024 at 04:04, Ilias Apalodimas <ilias.apalodimas@linaro.org>
wrote:

> Hi Raymond,
>
> On Tue, 2 Jul 2024 at 21:33, Raymond Mao <raymond.mao@linaro.org> wrote:
> >
> > Previous patch has introduced MbedTLS porting layer for mscode parser,
> > here to adjust the header and makefiles accordingly.
> >
> > Signed-off-by: Raymond Mao <raymond.mao@linaro.org>
> > ---
> > Changes in v2
> > - Move the porting layer to MbedTLS dir.
> > Changes in v3
> > - Update commit message.
> > Changes in v4
> > - Control building legacy library via '_LEGACY' Kconfig.
> > - Minor fix of the include directories.
> >
> >  include/crypto/mscode.h | 4 ++++
> >  lib/crypto/Makefile     | 2 +-
> >  2 files changed, 5 insertions(+), 1 deletion(-)
> >
> > diff --git a/include/crypto/mscode.h b/include/crypto/mscode.h
> > index 551058b96e6..678e69001b9 100644
> > --- a/include/crypto/mscode.h
> > +++ b/include/crypto/mscode.h
> > @@ -9,6 +9,10 @@
> >  #ifndef __UBOOT__
> >  #include <crypto/hash_info.h>
> >  #endif
> > +#if CONFIG_IS_ENABLED(MBEDTLS_LIB_X509)
> > +#include <mbedtls/asn1.h>
> > +#include <mbedtls/oid.h>
> > +#endif
> >
> >  struct pefile_context {
> >  #ifndef __UBOOT__
> > diff --git a/lib/crypto/Makefile b/lib/crypto/Makefile
> > index 428dcba0a6b..9bbd8b48d77 100644
> > --- a/lib/crypto/Makefile
> > +++ b/lib/crypto/Makefile
> > @@ -63,7 +63,7 @@ obj-$(CONFIG_$(SPL_)PKCS7_VERIFY) += pkcs7_verify.o
> >  #
> >  # Signed PE binary-wrapped key handling
> >  #
> > -obj-$(CONFIG_$(SPL_)MSCODE_PARSER) += mscode.o
> > +obj-$(CONFIG_$(SPL_)MSCODE_PARSER_LEGACY) += mscode.o
>
> The change it self is correct. But patches should be self contained as
> much as possible without breaking the compilation or functionality.
> IOW I think this should be in a different patch where the
> MSCODE_PARSER_LEGACY is introduced.
>
> No worries, I can move them into the same patch.

Regards,
Raymond
diff mbox series

Patch

diff --git a/include/crypto/mscode.h b/include/crypto/mscode.h
index 551058b96e6..678e69001b9 100644
--- a/include/crypto/mscode.h
+++ b/include/crypto/mscode.h
@@ -9,6 +9,10 @@ 
 #ifndef __UBOOT__
 #include <crypto/hash_info.h>
 #endif
+#if CONFIG_IS_ENABLED(MBEDTLS_LIB_X509)
+#include <mbedtls/asn1.h>
+#include <mbedtls/oid.h>
+#endif
 
 struct pefile_context {
 #ifndef __UBOOT__
diff --git a/lib/crypto/Makefile b/lib/crypto/Makefile
index 428dcba0a6b..9bbd8b48d77 100644
--- a/lib/crypto/Makefile
+++ b/lib/crypto/Makefile
@@ -63,7 +63,7 @@  obj-$(CONFIG_$(SPL_)PKCS7_VERIFY) += pkcs7_verify.o
 #
 # Signed PE binary-wrapped key handling
 #
-obj-$(CONFIG_$(SPL_)MSCODE_PARSER) += mscode.o
+obj-$(CONFIG_$(SPL_)MSCODE_PARSER_LEGACY) += mscode.o
 
 mscode-y := \
 	mscode_parser.o \