Closed Jurrie closed 4 years ago
Hi,
Also, when I change a setting to the exact same value, the checksum becomes different
This is likely caused by fixed-length null-terminated strings. Suppose a settings group contains an 8-character string, which is currently set to "foobar". The null byte occipies the 7th byte, but the 8th byte could be anything. The strings "foobar\x00\xff", "foobar\x00\x5a" or "foobar\x00\x00" all have the same meaning. Currently, bcm2cfg
doesn't keep the junk past the end of the null terminator, replacing it with \xff
, so reading and writing the file without changing anything could alter the file contents (and thus the checksum).
Is it possible I have a newer, unsupported firmware? I'm on hardware version 3.12.1 and software version 9.12.8006. Or is the EVW321B not supported at all?
Your issue is likely caused by a bad settings group specification in nonvoldef.cc
, which corrupts the file, causing it to be rejected by the device. Please send me your GatewaySettings.bin
file, and I'll see what I can do!
I've updated the code to keep the junk at the end of strings. Can you verify that the device now accepts a modified GatewaySettings.bin
file?
Indeed the checksum now stays the same if I change a setting to the same value. Unfortunately, my modem will still not accept the changed GatewaySettings.bin
.
When I diff the hexdumps of my original GatewaySettings.bin
and the modified-to-same-value GatewaySettings.bin
, I see that the files are completely different. Output of bcm2cfg info
is the same. Is this to be expected?
Ah, it sounded a lot like bad padding, and indeed the profile definition used ANSI X9.23 padding, whereas the file you sent me, and the sample that I have from an EVW32C both use PKCS #7. I've reverted the commit that keeps a string's junk for now. Please try if the device now accepts a file, where you set an option to its original value (like in the rg.syslog_email
example).
Output of bcm2cfg info is the same. Is this to be expected?
bcm2cfg info
doesn't tell you everything, since it doesn't print the data blobs whose meaning is unknown at this point (those having an empty name in nonvoldef.cc
). Using bcm2cfg -v info
will print these too.
The device now did accept a GatewaySettings.bin
. Even better: it also accepts one with settings modified to different values. So I guess this is fixed now!
On a side note: previously I was warned that both userif
and firewall
groups were unparsable. But now, I only get that warning for firewall
. The userif
group seems to be parsed now; I can see and update the settings just fine.
On a side note: previously I was warned that both
userif
andfirewall
groups were unparsable. But now, I only get that warning forfirewall
. Theuserif
group seems to be parsed now; I can see and update the settings just fine.
I've modified the group definition in one of the latest commits!
Hello,
I have a EVW321B (which I assume should work with the EVW32C profile?) and I'm trying bcm2cfg on it. I downloaded the GatewaySettings.bin file, and ran
bcm2cfg info
on it. It fails to parse group 'userif' and group 'firewall'.Also, when I change a setting to the exact same value, the checksum becomes different, and the modem will not restore that GatewaySettings.bin:
On a side note, when I change line nonvoldef.cc:192 from
NV_VAR(nv_u32, "ssh_inactivity_timeout"),
toNV_VAR(nv_data, "", 1),
the group 'userif' is parsed and I can get and set settings contained in that group. The above behavior does not change however, and the modem will still not restore my GatewaySettings.bin.Is it possible I have a newer, unsupported firmware? I'm on hardware version 3.12.1 and software version 9.12.8006. Or is the EVW321B not supported at all?
With kind regards,
Jurrie