This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

[参考译文] CC3235SF:在为 MCU 提供签名时获取 FS_wrong_signature

Guru**** 651100 points
Other Parts Discussed in Thread: CC3220SF, CC3235SF
请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

https://e2e.ti.com/support/wireless-connectivity/wi-fi-group/wifi/f/wi-fi-forum/1183306/cc3235sf-getting-fs_wrong_signature-when-providing-the-signature-for-the-mcu

器件型号:CC3235SF
主题中讨论的其他器件:CC3220SF

你好!

我想在对闪存进行编程时使用加密私钥。 由于我无法使用 SLImageCreator 工具找到输入/读取密码的方法、因此我单独制作了签名、并 在加载 MCU 时将签名作为输入。

 
#Get the MCU signature
  openssl dgst -sha256 -binary -sign "$SSKey" -passin pass:$Password \
  -out "mcu.signed.bin"  "mcu.bin"
 
#Add the MCU 
  project add_file  --name "$ProjName"  --overwrite  --file "$Dir/mcu.bin"  --mcu --flags secure,publicwrite \
  --sign "$Dir/mcu.signed.bin"  --cert "$SSCert"
 
#Program the Device
  "$ImageCreatorPath/SLImageCreator.exe" \
  project program  --name "$ProjName"    --dev
  
但是、这会产生错误:"sl_wrong_signatic"。 我目前正在使用虚拟证书目录、当私钥未加密时、它工作正常。
我已经尝试添加"-c"、将"SHA256"替换为"SHA1"(即使这不起作用)、将"二进制"替换为"十六进制"、并将密钥转换为"openssl pkcs8 -topk8"(在 DER 中加密密钥的唯一方法)。 所有这些测试似乎都进一步中断了。
我在另一篇文章(针对 CC3220SF)中读到、自 SLImageCreator 自动生成的签名是使用以下命令创建的:
OpenSSL> dgst -binary -sha1 -sign <file-location>\<private_key>.pem \
-out <file-location>\<output>.sig <file-location>\<input>.txt
 
从 Toby Pan。 但我想对于 CC3235SF、它应该是"SHA256"。
我想知道我是否正确理解了这一点、是否缺少了什么、以及为什么它不起作用。
提前非常感谢!
 
此致、
David
  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    解决了!

    最终在另一个帖子 OtherPost 中找到错误 。 显然 、需要采取额外步骤来创建可被器件识别的自定义签名。

     openssl dgst -sha256 -binary "$File" > "$File.tmp";  cat "$File" >> "$File.tmp"
     openssl dgst -sha256 -binary -sign "$Key"  \
     -out "$File.signed"  "$File.tmp"
     

    首先、将哈希添加到与".tmp"保存的初始文件前面、然后使用密钥对其进行加密以提供签名。 我认为这些事情可以一步完成、但我错了。 它现在一直在工作、希望这对某人有所帮助! )

    此致

    David