You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by GitBox <gi...@apache.org> on 2020/10/19 17:22:20 UTC

[GitHub] [mynewt-artifact] agross-korg opened a new pull request #29: image: Add support for section TLV

agross-korg opened a new pull request #29:
URL: https://github.com/apache/mynewt-artifact/pull/29


   This patch adds support for the section TLV.  The Section TLV is a protected
   TLV that supplies information about a specific elf section residing inside the
   image.  There are some cases where only a image file is available and the
   section information is required to do some post processing.  This TLV adds the
   ability to deal with post processing in the absence of elf files.
   
   Signed-off-by: Andy Gross <an...@juul.com>


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [mynewt-artifact] agross-korg commented on a change in pull request #29: image: Add support for section TLV

Posted by GitBox <gi...@apache.org>.
agross-korg commented on a change in pull request #29:
URL: https://github.com/apache/mynewt-artifact/pull/29#discussion_r508090054



##########
File path: image/image.go
##########
@@ -67,6 +67,7 @@ const (
 	IMAGE_TLV_ENC_EC256 = 0x32
 	IMAGE_TLV_AES_NONCE = 0x50
 	IMAGE_TLV_SECRET_ID = 0x60
+	IMAGE_TLV_SECTION = 0x70

Review comment:
       yeah good points on the TLV numbers.  What should we do for proprietary TLV numbers?  I wonder if we shouldnt set aside some proprietary range.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [mynewt-artifact] nkaje commented on a change in pull request #29: image: Add support for section TLV

Posted by GitBox <gi...@apache.org>.
nkaje commented on a change in pull request #29:
URL: https://github.com/apache/mynewt-artifact/pull/29#discussion_r509455744



##########
File path: image/image.go
##########
@@ -55,33 +55,39 @@ const (
  * Image trailer TLV types.
  */
 const (
-	IMAGE_TLV_KEYHASH   = 0x01
-	IMAGE_TLV_SHA256    = 0x10
-	IMAGE_TLV_RSA2048   = 0x20
-	IMAGE_TLV_ECDSA224  = 0x21
-	IMAGE_TLV_ECDSA256  = 0x22
-	IMAGE_TLV_RSA3072   = 0x23
-	IMAGE_TLV_ED25519   = 0x24
-	IMAGE_TLV_ENC_RSA   = 0x30
-	IMAGE_TLV_ENC_KEK   = 0x31
-	IMAGE_TLV_ENC_EC256 = 0x32
-	IMAGE_TLV_AES_NONCE = 0x50
-	IMAGE_TLV_SECRET_ID = 0x60
+	IMAGE_TLV_KEYHASH          = 0x01
+	IMAGE_TLV_SHA256           = 0x10
+	IMAGE_TLV_RSA2048          = 0x20
+	IMAGE_TLV_ECDSA224         = 0x21
+	IMAGE_TLV_ECDSA256         = 0x22
+	IMAGE_TLV_RSA3072          = 0x23
+	IMAGE_TLV_ED25519          = 0x24
+	IMAGE_TLV_ENC_RSA          = 0x30
+	IMAGE_TLV_ENC_KEK          = 0x31
+	IMAGE_TLV_ENC_EC256        = 0x32
+	IMAGE_TLV_AES_NONCE_LEGACY = 0x50
+	IMAGE_TLV_SECRET_ID_LEGACY = 0x60
+	IMAGE_TLV_AES_NONCE        = 0xa1

Review comment:
       Should we document why ranges 0x70 - 0xa0 not used? As it is used by MCUBoot?




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [mynewt-artifact] agross-korg commented on a change in pull request #29: image: Add support for section TLV

Posted by GitBox <gi...@apache.org>.
agross-korg commented on a change in pull request #29:
URL: https://github.com/apache/mynewt-artifact/pull/29#discussion_r509535877



##########
File path: image/image.go
##########
@@ -82,6 +83,7 @@ var imageTlvTypeNameMap = map[uint8]string{
 	IMAGE_TLV_ENC_EC256: "ENC_EC256",
 	IMAGE_TLV_AES_NONCE: "AES_NONCE",
 	IMAGE_TLV_SECRET_ID: "SEC_KEY_ID",
+	IMAGE_TLV_SECTION: "SECTION",

Review comment:
       done.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [mynewt-artifact] agross-korg commented on a change in pull request #29: image: Add support for section TLV

Posted by GitBox <gi...@apache.org>.
agross-korg commented on a change in pull request #29:
URL: https://github.com/apache/mynewt-artifact/pull/29#discussion_r509511141



##########
File path: image/image.go
##########
@@ -55,33 +55,39 @@ const (
  * Image trailer TLV types.
  */
 const (
-	IMAGE_TLV_KEYHASH   = 0x01
-	IMAGE_TLV_SHA256    = 0x10
-	IMAGE_TLV_RSA2048   = 0x20
-	IMAGE_TLV_ECDSA224  = 0x21
-	IMAGE_TLV_ECDSA256  = 0x22
-	IMAGE_TLV_RSA3072   = 0x23
-	IMAGE_TLV_ED25519   = 0x24
-	IMAGE_TLV_ENC_RSA   = 0x30
-	IMAGE_TLV_ENC_KEK   = 0x31
-	IMAGE_TLV_ENC_EC256 = 0x32
-	IMAGE_TLV_AES_NONCE = 0x50
-	IMAGE_TLV_SECRET_ID = 0x60
+	IMAGE_TLV_KEYHASH          = 0x01
+	IMAGE_TLV_SHA256           = 0x10
+	IMAGE_TLV_RSA2048          = 0x20
+	IMAGE_TLV_ECDSA224         = 0x21
+	IMAGE_TLV_ECDSA256         = 0x22
+	IMAGE_TLV_RSA3072          = 0x23
+	IMAGE_TLV_ED25519          = 0x24
+	IMAGE_TLV_ENC_RSA          = 0x30
+	IMAGE_TLV_ENC_KEK          = 0x31
+	IMAGE_TLV_ENC_EC256        = 0x32
+	IMAGE_TLV_AES_NONCE_LEGACY = 0x50
+	IMAGE_TLV_SECRET_ID_LEGACY = 0x60
+	IMAGE_TLV_AES_NONCE        = 0xa1

Review comment:
       The range is supposed to match mcuboot.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [mynewt-artifact] agross-korg commented on a change in pull request #29: image: Add support for section TLV

Posted by GitBox <gi...@apache.org>.
agross-korg commented on a change in pull request #29:
URL: https://github.com/apache/mynewt-artifact/pull/29#discussion_r509536323



##########
File path: image/image.go
##########
@@ -67,6 +67,7 @@ const (
 	IMAGE_TLV_ENC_EC256 = 0x32
 	IMAGE_TLV_AES_NONCE = 0x50
 	IMAGE_TLV_SECRET_ID = 0x60
+	IMAGE_TLV_SECTION = 0x70

Review comment:
       moved these to legacy numbers.  we'll keep them around until we update mcuboot locally and then remove them then.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [mynewt-artifact] utzig commented on a change in pull request #29: image: Add support for section TLV

Posted by GitBox <gi...@apache.org>.
utzig commented on a change in pull request #29:
URL: https://github.com/apache/mynewt-artifact/pull/29#discussion_r508078001



##########
File path: image/image.go
##########
@@ -67,6 +67,7 @@ const (
 	IMAGE_TLV_ENC_EC256 = 0x32
 	IMAGE_TLV_AES_NONCE = 0x50
 	IMAGE_TLV_SECRET_ID = 0x60
+	IMAGE_TLV_SECTION = 0x70

Review comment:
       This should be aligned if `go fmt`  was used! :-P

##########
File path: image/image.go
##########
@@ -82,6 +83,7 @@ var imageTlvTypeNameMap = map[uint8]string{
 	IMAGE_TLV_ENC_EC256: "ENC_EC256",
 	IMAGE_TLV_AES_NONCE: "AES_NONCE",
 	IMAGE_TLV_SECRET_ID: "SEC_KEY_ID",
+	IMAGE_TLV_SECTION: "SECTION",

Review comment:
       Need to align properly

##########
File path: image/image.go
##########
@@ -67,6 +67,7 @@ const (
 	IMAGE_TLV_ENC_EC256 = 0x32
 	IMAGE_TLV_AES_NONCE = 0x50
 	IMAGE_TLV_SECRET_ID = 0x60
+	IMAGE_TLV_SECTION = 0x70

Review comment:
       Btw, `0x50`, `0x60` and `0x70` are all downstream and not part of MCUboot. MCUboot already has its own `0x50` and `0x60` TLVs not related to these, so I just wonder when will the day come that you sync to MCUboot upstream and unexpected things happen! :-)




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [mynewt-artifact] agross-korg commented on a change in pull request #29: image: Add support for section TLV

Posted by GitBox <gi...@apache.org>.
agross-korg commented on a change in pull request #29:
URL: https://github.com/apache/mynewt-artifact/pull/29#discussion_r509536697



##########
File path: image/image.go
##########
@@ -55,33 +55,39 @@ const (
  * Image trailer TLV types.
  */
 const (
-	IMAGE_TLV_KEYHASH   = 0x01
-	IMAGE_TLV_SHA256    = 0x10
-	IMAGE_TLV_RSA2048   = 0x20
-	IMAGE_TLV_ECDSA224  = 0x21
-	IMAGE_TLV_ECDSA256  = 0x22
-	IMAGE_TLV_RSA3072   = 0x23
-	IMAGE_TLV_ED25519   = 0x24
-	IMAGE_TLV_ENC_RSA   = 0x30
-	IMAGE_TLV_ENC_KEK   = 0x31
-	IMAGE_TLV_ENC_EC256 = 0x32
-	IMAGE_TLV_AES_NONCE = 0x50
-	IMAGE_TLV_SECRET_ID = 0x60
+	IMAGE_TLV_KEYHASH          = 0x01
+	IMAGE_TLV_SHA256           = 0x10
+	IMAGE_TLV_RSA2048          = 0x20
+	IMAGE_TLV_ECDSA224         = 0x21
+	IMAGE_TLV_ECDSA256         = 0x22
+	IMAGE_TLV_RSA3072          = 0x23
+	IMAGE_TLV_ED25519          = 0x24
+	IMAGE_TLV_ENC_RSA          = 0x30
+	IMAGE_TLV_ENC_KEK          = 0x31
+	IMAGE_TLV_ENC_EC256        = 0x32
+	IMAGE_TLV_AES_NONCE_LEGACY = 0x50
+	IMAGE_TLV_SECRET_ID_LEGACY = 0x60
+	IMAGE_TLV_AES_NONCE        = 0xa1

Review comment:
       mcuboot drives the fixed TLV numbers.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [mynewt-artifact] agross-korg merged pull request #29: image: Add support for section TLV

Posted by GitBox <gi...@apache.org>.
agross-korg merged pull request #29:
URL: https://github.com/apache/mynewt-artifact/pull/29


   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org