I have a BRT-AC828 with Firmware version 3.0.0.4.382_70348 and like others I've run into the problem that recent versions of OpenVPN client (compiled with OpenSSL 3.x) fail to connect to the OpenVPN server in my router.
According to https://github.com/RMerl/asuswrt-merlin.ng/commit/cbae028cd8ed3a5853eb4ddf275fb3e0e3a75bc2 the fix was really easy, just replace sha1 with sha256 in pkitool.
So this sounded like a good reason to actually try to compile firmware from source code. I followed the instructions from README.TXT and created a Debian Jessie VM (matches Ubuntu 16.04 pretty decently), installed the build dependencies, cd-ed into release/src-qca-ipq806x and ran 'make brt-ac828'. First try failed. Second try failed as the instructions missed the tcl build dependency. Third try was successful but if I would upload that to my router, I wouldn't know if I was running Asus' or my own firmware.
So for the 4th try, I modified "src/router/extendno.conf" to EXTENDNO=diederik-sha256-1 and applied the aforementioned patch to pkitool. That built succeeded too, but upon trying to upload it to my router, I got this error message
So I went for a 5th try where I only applied Merlin's patch. I should still be able to determine whether I was running my own compiled firmware as it should then return "sha256WithRSAEncryption". Built of the firmware was successful again and now also the upload to my router succeeded \o/
So my first question is then: How or where can change the version number so it's easy to determine what version of "my" code I'm running, but still gets accepted when uploading it to my router?
My assumption here is that maybe my new version number was 'wrong' and therefor rejected. I think a numbering scheme with <CCYYMMDD>-<seq-nr> could be useful, but I'm open to (other) suggestions.
I'm quite certain that I was running my own compiled firmware:
By making a change in OpenVPN's config and back again, so nothing changed, I saw that new files were generated in "/etc/openvpn/server1/". So I exported a new ovpn file, loaded that onto my phone and tried to connect to my router with OpenVPN client ... which failed. Grepping ca.crt showed that the Signature algorithm was still sha1.
Did I do something wrong? Should something more or sth else be changed so that sha256 is being used to generate ca.crt?
I have a lot to learn and plan/hope to experiment a lot. But I'm assuming that the (flash?) storage which holds the firmware only has a limited nr of write cycles. How 'worried' should I be wrt that?
Is it possible to write/deploy things to an USB stick for example, so I don't have to constantly upload new firmware?
Any other tips wrt development are also much appreciated
Code:
admin@BRT-AC828:/tmp/home/root# openssl x509 -noout -text -in /etc/openvpn/server1/ca.crt | grep Signature
Signature Algorithm: sha1WithRSAEncryption
Signature Algorithm: sha1WithRSAEncryption
So this sounded like a good reason to actually try to compile firmware from source code. I followed the instructions from README.TXT and created a Debian Jessie VM (matches Ubuntu 16.04 pretty decently), installed the build dependencies, cd-ed into release/src-qca-ipq806x and ran 'make brt-ac828'. First try failed. Second try failed as the instructions missed the tcl build dependency. Third try was successful but if I would upload that to my router, I wouldn't know if I was running Asus' or my own firmware.
So for the 4th try, I modified "src/router/extendno.conf" to EXTENDNO=diederik-sha256-1 and applied the aforementioned patch to pkitool. That built succeeded too, but upon trying to upload it to my router, I got this error message
Code:
Invalid Firmware Upload
Firmware upgrade unsuccessful. This might result from incorrect image or error transmission, please check the model name BRT-AC828 and version of firmware from support site and try again.
So my first question is then: How or where can change the version number so it's easy to determine what version of "my" code I'm running, but still gets accepted when uploading it to my router?
My assumption here is that maybe my new version number was 'wrong' and therefor rejected. I think a numbering scheme with <CCYYMMDD>-<seq-nr> could be useful, but I'm open to (other) suggestions.
I'm quite certain that I was running my own compiled firmware:
Code:
admin@BRT-AC828:/tmp/home/root# grep sha /rom/easy-rsa/pkitool
$OPENSSL req $BATCH -days $CA_EXPIRE $NODES_REQ -new -newkey rsa:$KEY_SIZE -sha256 \
-in "$FN.csr" $CA_EXT -md sha256 -config "$KEY_CONFIG" ) && \
Did I do something wrong? Should something more or sth else be changed so that sha256 is being used to generate ca.crt?
I have a lot to learn and plan/hope to experiment a lot. But I'm assuming that the (flash?) storage which holds the firmware only has a limited nr of write cycles. How 'worried' should I be wrt that?
Is it possible to write/deploy things to an USB stick for example, so I don't have to constantly upload new firmware?
Any other tips wrt development are also much appreciated