openNDS / openNDS

openNDS (open Network Demarcation Service) is a high performance, small footprint, Captive Portal. It provides a border control gateway between a public local area network and the Internet.
https://opennds.readthedocs.io/
GNU General Public License v2.0
304 stars 76 forks source link

Vars gwname and gatewayhash #612

Closed javierolaya-tech closed 1 week ago

javierolaya-tech commented 1 week ago

Hey @bluewavenet

According to your fas-aes-https.php, should $gwname and $gatewayhash have the same value? Because I am following some parts of your code and I am falling all the time here:

364     if (! file_exists("$logpath"."$gatewayhash")) {
365         # no clients waiting, so:
366         exit(0);
367     } 

It tries to find the a3f51eb3c0317a300b3374a862d87d5326bfbd5b57189c811d33caff6bb34f6e directory

I created the directory with this name: e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 when I did:

190              if (!file_exists("$logpath"."$gwname")) {
191               mkdir("$logpath"."$gwname", 0700);
192              }

Of course I am wrong in some part, but I don't know where... could you please help me?

NOTE: the original name of gatewayname is openNDS%20Node%3a9483c439599c%20

javierolaya-tech commented 1 week ago

@bluewavenet

I encrypted $gatewayname manually and it could be: a3f51eb3c0317a300b3374a862d87d5326bfbd5b57189c811d33caff6bb34f6e

I don't know wth it is e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 when I do: $gwname=hash('sha256', trim($gatewayname));

javierolaya-tech commented 1 week ago

@bluewavenet

Never mind! It works know, I don't know why because I didn't touch anything :-(