nwztools: fix MW-WM1/A30 KAS, fix KAS length

Split WM1A/WM1Z because they don't have the same KAS. On newer devices, the KAS
is actually 64 bytes, not 60. The strange thing is that "get_dnk_nvp kas" returns
60 bytes whereas "get_dnk_prop kas" returns 64, not sure why.

Change-Id: I944d3d838209ba58388439af0cdf5d7c74f1f7fc
This commit is contained in:
Amaury Pouly 2020-06-13 16:15:34 +02:00
parent c8fa53050d
commit 76fbb33adf
7 changed files with 104 additions and 7 deletions

View file

@ -1877,7 +1877,9 @@ static unsigned long models_nwz_s770[] = { 0x16000001, 0x16000002, 0x16000004,
static unsigned long models_nw_s780[] = { 0x19000001, 0x19000002, 0x19000004,
0x19000005 };
static unsigned long models_nw_wm1[] = { 0x20000007, 0x21000008 };
static unsigned long models_nw_wm1a[] = { 0x20000007 };
static unsigned long models_nw_wm1z[] = { 0x21000008 };
static unsigned long models_nwz_x1000[] = { 0x5000002, 0x5000004, 0x5000005,
0x5020002, 0x5040002, 0x5020004, 0x5040004, 0x5020005, 0x5040005 };
@ -1927,7 +1929,8 @@ struct nwz_series_info_t nwz_series[NWZ_SERIES_COUNT] =
{ "nwz-s760", "NWZ-S760 Series", 10, models_nwz_s760, &nvp_index_f505c8 },
{ "nwz-s770", "NWZ-S770 Series", 8, models_nwz_s770, 0 },
{ "nw-s780", "NW-S780 Series", 4, models_nw_s780, &nvp_index_6485c8 },
{ "nw-wm1", "NW-WM1 Series", 2, models_nw_wm1, &nvp_index_398250 },
{ "nw-wm1a", "NW-WM1 Series", 1, models_nw_wm1a, &nvp_index_398250 },
{ "nw-wm1z", "NW-WM1 Series", 1, models_nw_wm1z, &nvp_index_398250 },
{ "nwz-x1000", "NWZ-X1000 Series", 9, models_nwz_x1000, &nvp_index_4edba7 },
{ "nw-zx100", "NW-ZX100 Series", 6, models_nw_zx100, &nvp_index_92faee },
{ "nw-zx300", "NW-ZX300 Series", 3, models_nw_zx300, &nvp_index_139d65 },

View file

@ -159,7 +159,7 @@ enum nwz_nvp_node_t
/* Number of models */
#define NWZ_MODEL_COUNT 197
/* Number of series */
#define NWZ_SERIES_COUNT 40
#define NWZ_SERIES_COUNT 41
/* NVP node info */
struct nwz_nvp_info_t

View file

@ -0,0 +1,92 @@
dbg,000
syi,001
ubp,002
fup,003
prk,004
hld,005
rtc,006
mid,007
pcd,008
ser,009
ufn,010
kas,011
shp,012
tst,013
gty,014
fmp,015
sdp,016
ncp,017
psk,018
nvr,077
she,084
btc,085
ins,089
ctr,090
sku,091
bpr,019
bfp,020
bfd,021
bml,022
apd,078
blf,079
slp,080
vrt,081
fni,082
sid,083
mso,086
cng,023
lyr,024
dbv,025
fur,026
ums,027
skd,028
ups,029
mdk,030
fvi,031
mac,032
fpi,033
tr0,034
tr1,035
e00,036
e01,037
e02,038
e03,039
e04,040
e05,041
e06,042
e07,043
e08,044
e09,045
e10,046
e11,047
e12,048
e13,049
e14,050
e15,051
e16,052
e17,053
e18,054
e19,055
e20,056
e21,057
e22,058
e23,059
e24,060
e25,061
e26,062
e27,063
e28,064
e29,065
e30,066
e31,067
clv,068
sps,069
rbt,070
edw,071
bti,072
hdi,073
lbi,074
fui,075
eri,076
pci,087
dbi,088

View file

@ -32,7 +32,8 @@ nwz-s750,NWZ-S750 Series,0x9000002,0x9000004,0x9000005,0xf000002,0xf000004
nwz-s760,NWZ-S760 Series,0x12000001,0x12000002,0x12000004,0x12000005,0x12000006,0x12010001,0x12010002,0x12010004,0x12010005,0x12010006
nwz-s770,NWZ-S770 Series,0x16000001,0x16000002,0x16000004,0x16000005,0x16010001,0x16010002,0x16010004,0x16010005
nw-s780,NW-S780 Series,0x19000001,0x19000002,0x19000004,0x19000005
nw-wm1,NW-WM1 Series,0x20000007,0x21000008
nw-wm1a,NW-WM1 Series,0x20000007
nw-wm1z,NW-WM1 Series,0x21000008
nwz-x1000,NWZ-X1000 Series,0x5000002,0x5000004,0x5000005,0x5020002,0x5040002,0x5020004,0x5040004,0x5020005,0x5040005
nw-zx100,NW-ZX100 Series,0x1c000007,0x1c000001,0x1c000002,0x1c000004,0x1c000005,0x1c000006
nw-zx300,NW-ZX300 Series,0x23000004,0x23000006,0x23000007

View file

@ -167,7 +167,7 @@ struct dnk_prop_t dnk_prop_list[] =
{ "destination", "Destination", 0x23, 8, 4, DNK_EXACT_LENGTH | DNK_UINT32},
{ "model_id", "Model ID", 0x23, 9, 4, DNK_EXACT_LENGTH | DNK_UINT32 | DNK_HEX},
{ "ufn", "Update filename", 0x23, 21, 8, DNK_STRING},
{ "kas", "Key and Signature", 0x23, 22, 60, DNK_STRING},
{ "kas", "Key and Signature", 0x23, 22, 64, DNK_STRING},
{ "devinfo", "Devide Info", 0x12, 0, 64, DNK_HEX},
/* there are more obscure commands:
* - 0x11 returns a 10-byte packet containing a 8-byte "LeftIdl8", scrambled

View file

@ -46,8 +46,9 @@ struct nwz_model_t g_model_list[] =
{ "nwz-s610", false, "fe14a16d7c5c52cf56846d04305f994c"},
/* The following models use a different encryption, but we put the KAS here
* to not forget them */
{ "nw-a30", false, "c40d91e7efff3e3aa5c8831dd85526fe4972086283419c8cd8fa3b7dcd39" },
{ "nw-wm1", false, "e8d171a5d92f35eed9658c03fb9f86a169591659851fd7c49525f587a70b" },
{ "nw-a30", false, "c40d91e7efff3e3aa5c8831dd85526fe4972086283419c8cd8fa3b7dcd39dee4" },
{ "nw-wm1a", false, "e8d171a5d92f35eed9658c03fb9f86a169591659851fd7c49525f587a70b526c" },
{ "nw-wm1z", false, "2b07114f06d0f63b8ef8e31c8bc9332c7bd70281f7f8d2f80dab58cd36f82c82" },
{ "nw-zx300", false, "3ab5bbcb999463c50aaa957496b066c6b76a25f4505bf5b42c0bc4815cbe3db6" },
{ "nw-nwa40", false, "a0d2b1317794074aff77dd2afb9c7aa6b28d6cf24a5e5eb60df87a87eb562de5" },
{ 0 }