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 2019/01/16 17:19:22 UTC

[GitHub] ccollins476ad commented on a change in pull request #258: larva: Replace `swapkey` with `swapisk`, `swapkek`

ccollins476ad commented on a change in pull request #258: larva: Replace `swapkey` with `swapisk`, `swapkek`
URL: https://github.com/apache/mynewt-newt/pull/258#discussion_r248374861
 
 

 ##########
 File path: artifact/image/keys_test.go
 ##########
 @@ -65,58 +67,29 @@ func signatureTest(t *testing.T, privateKey []byte) {
 	// much, since the header will be placed on it by the image
 	// tool.
 
-	simpleName := path.Join(tmpdir, "simple.bin")
-	hashedName := path.Join(tmpdir, "simple-hashed.bin")
-	signedName := path.Join(tmpdir, "simple-signed.bin")
-	keyName := path.Join(tmpdir, "private.pem")
-
-	tmp := make([]byte, 256)
-	for i := 0; i < len(tmp); i++ {
-		tmp[i] = byte(i & 0xFF)
-	}
-	err = ioutil.WriteFile(simpleName, tmp, 0644)
-	if err != nil {
-		t.Fatal(err)
+	body := make([]byte, 256)
+	for i := 0; i < len(body); i++ {
+		body[i] = byte(i & 0xFF)
 
 Review comment:
   Good spot.  Casting to `byte` will perform the desired truncation automatically.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on 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


With regards,
Apache Git Services