Add support for D-Link COVR-X1860

Thx for that build. I will try it tomorrow. And yes, I still need wire guard.

I realized I have to use the new DSA for VLANs on the D-Link device. My old OpenWrt routers with the IPQ chipsets are using the swconfig.

I have to figure out how to configure the new routers.

Yes, it’s working, see Add support for D-Link COVR-X1860 - #93 by RolandoMagico

1 Like

Can upload this file? I'm use this https://github.com/0xricksanchez/dlink-decrypt
Install python
Crypto
pycryptodome

Not sure if this is a correct way to do it. The last commit in the mentioned repository was end of last year, the decryption tool from @s_2 was created beginning of this year if I remember correctly.

Can you try downloading and compiling https://github.com/s-2/firmware-utils/tree/dlink-sge-image_2k23?
This is the tool I used

That tool can be used as well, but the keys are slightly different now than for the initial COVR-P2500. The RSA signature is not required for decryption, but the vendor key (stored in self.key in that code) should be he9-4+M!)d6=m~#$%,q2a3d1n&2*z#^81860 for the COVR-X1860.

In line 103 of dlink_dec.py, replace with

self.key = bytes(b"he9-4+M!)d6=m~#$%,q2a3d1n&2*z#^81860")

or something (not actually tested if this is correct Python syntax, maybe also needs to be truncated?).

I have no idea why some of the images fail decrypting (looks like unneeded additional / wrong padding, but have not investigated further). Also not sure if it affects the tool from ricksanchez as well, feel free to find out :slightly_smiling_face:

C:\Users\rychu\Downloads\dlink\dlink-decrypt-master>python ./dlink-dec.py -i Ory.bin -o 1800decry.bin
[] Calculating key...
[!] Failed!
Traceback (most recent call last):
File "C:\Users\rychu\Downloads\dlink\dlink-decrypt-master\dlink-dec.py", line 188, in
main()
File "C:\Users\rychu\Downloads\dlink\dlink-decrypt-master\dlink-dec.py", line 176, in main
dlink = DcryptLink(cli_args.inp, cli_args.out, cli_args.mode)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\rychu\Downloads\dlink\dlink-decrypt-master\dlink-dec.py", line 34, in init
self.setup()
File "C:\Users\rychu\Downloads\dlink\dlink-decrypt-master\dlink-dec.py", line 37, in setup
self.set_key()
File "C:\Users\rychu\Downloads\dlink\dlink-decrypt-master\dlink-dec.py", line 105, in set_key
self.verify(self.key, bytes.fromhex("C05FBF1936C99429CE2A0781F08D6AD8"))
File "C:\Users\rychu\Downloads\dlink\dlink-decrypt-master\dlink-dec.py", line 66, in verify
raise ValueError
ValueError replace
before
C:\Users\rychu\Downloads\dlink\dlink-decrypt-master>python ./dlink-dec.py -i Ory.bin -o 1800decry.bin
[
] Calculating key...
[+] OK!
[] Checking magic bytes...
[+] OK!
[
] Verifying SHA512 message digest of encrypted payload...
[+] OK!
[*] Verifying SHA512 message digests of decrypted payload...
[!] Failed!
[!] Failed!

looks like the following line verifies the generated key against a hardcoded expected result, so just drop that verify line.

Thx again for your additional build. I flashed it and tried to install the ipk package via luci upload. I get following error:


Did I miss something?

@LateAsUsual
I also tried to configure my VLANs with DSA and followed the official OpenWRT guide. I failed again on the last step.
I manually added VLAN devices for my br-lan. (VLAN ID 1 and VLAN ID 7)


After that I configured the br-lan bridge and added all ports:
dsa_02
In the bridge VLAN filtering I added following VLANs:

After save and apply it fails:

I want to bridge the wan and lan port for my regular home lan. On the wan port I need to send tagged packets with VLAN ID7 for my ISP. My switch in the basement than handles the VLAN ID7 packets to the VDSL modem and the internet traffic back to the same port as untagged packets. That works fine with my old router and swconfig.

The ISP is Telekom, I assume? If so, these instructions worked for me: https://gist.github.com/madduci/8b8637b922e433d617261373220be44c?permalink_comment_id=4511212#gistcomment-4511212

1 Like

Thx, I'll try that! And yes, it's the Telekom.

Thx for answer but i have another problem i ll try in windows 7....
c:\Users\rychu\Downloads\dlink\dlink-decrypt-master>python ./dlink-dec.py -i Ory.bin -o 1800decry.bin
[] Calculating key...
[
] Checking magic bytes...
[+] OK!
[*] Verifying SHA512 message digest of encrypted payload...
[+] OK!
[!] Failed!

Harder than I thought. You can probably install all dependencies manually, everything should be present in the kmods archive of my build.
But it’s probably easier to use the images from @Ditti4 where rhe dependencies can be resolved automatically

1 Like

Hi @all,
I have successfully flashed openwrt on my two APs. However, something went wrong with the second attempt and now it is no longer accessible.
Reset does not seem to work. How can I recovern the AP?
Do I need to flash over serial and how?

Is recovery still working? Set the IP of your computer To 192.168.0.10, keep the reset button pressed while powering on the device and check if you can reach http://192.168.0.1 with a browser.
If it works, you can flash the recovery image there.

No is not working, can not ping 192.168.0.1

Looks like the exact same implementation as in my tool, the encrypted payload digest is still okay, but the decrypted image is weird in terms of padding, no idea what D-Link did to generate this... :man_shrugging:

I remember from DAP-X1860 that ping didn't work but the recovery web interface was working anyway, can you check?
What was the last thing you did with the device when it was working?

sysupgrade -f openwrt-ramips-mt7621-dlink_covr-x1860-a1-squashfs-recovery.bin was the last I did

I wouldn't want to go back to the original, but unfortunately the mesh doesn't want to work, it's greyed out when creating and I can't rewrite the ssid..