Open bamstwn opened 6 years ago
can you please share the exact steps you are using to reproduce this (including the version of the TD-W8980 v1 image)?
BgIAAACkAABSU0ExAAQAAAEAAQD54+t3X+bMvuKUfm03w6prR+S+BRjefof9XuPFVew1mftBLi4IPmBc8fb5XJXSusmDXHa/SmSaH4dvNWE5xUuvzc9p2sWxczWEvGqAi4rNk82WtKn4JUgJoalOBOwLavO2ilq4MIcBNi4bYJ6s0vU243zlgFW7p29IsA64d3LY6Q==
./extract-sign.sh TD-W8980v1.bin
#!/bin/sh
IMG="${1}"
for i in ${IMG} ; do echo "--- $i ---"
if [ -f "$i" ]; then
# value per line) and reverse all lines
sig=$(xxd -s +208 -l 128 -c 1 -plain "$i" | tac)
# convert hex string to binary and let openssl extract
# the signed content
echo -n $sig | xxd -revert -plain | openssl rsautl \
-hexdump -verify -pubin \
-inkey tp-link_pubkey.bin.ms_publickeyblob \
-keyform MS\ PUBLICKEYBLOB
fi done
3. result
--- TD-W8980v1.bin --- unable to load Public Key
the documentation states that the given public key is base64 encoded:
[...] contains the base64 encoded public key of the pair [...]
so please base64-decode the public key and save the decoded (binary) result as tp-link_pubkey.bin.ms_publickeyblob
OK, run base64-decode with base64 -d < pub.b64 > tp-link_pubkey.bin.ms_publickeyblob
.
Decode (binary) results like this:
Run this code again ./extract-sign.sh TD-W8980v1.bin
Result:
--- TD-W8980v1.bin ---
RSA operation error
3074271432:error:0407006A:rsa routines:RSA_padding_check_PKCS1_type_1:block type is not 01:rsa_pk1.c:100:
3074271432:error:04067072:rsa routines:RSA_EAY_PUBLIC_DECRYPT:padding check failed:rsa_eay.c:721:
i have same error with tplink 850v2 cannot extract signature
I try to extracts the signature input from official TP-Link images with your shell script but it says "unable to load Public Key", what's wrong? I use TD-W8980v1 image when try.