pyarmor icon indicating copy to clipboard operation
pyarmor copied to clipboard

[BUG] PyArmor License Bind to MAC Brackets doesn't work properly

Open LuisHenri opened this issue 3 years ago • 3 comments

Hello, I am trying to create a license bind to a MAC address.

PyArmor: v7.0.3

I have this output when I run pyarmor hdinfo:

Default Mac address: "00:ff:89:ec:92:49"
Multiple Mac addresses: "<64:1c:67:e3:35:5e,80:38:fb:de:b1:02,82:38:fb:de:b1:01,80:38:fb:de:b1:01,80:38:fb:de:b1:05>"

And this command when I run getmac (on Windows):

Physical Address    Transport Name                                            
=================== ==========================================================
64-1C-67-E3-35-5E   Media disconnected
80-38-FB-DE-B1-01   \Device\Tcpip_{7CC7B5D3-3E0E-42B4-A5E4-89FF05956512}
80-38-FB-DE-B1-05   Media disconnected
00-FF-89-EC-92-49   Media disconnected

As you can see, the last MAC from getmac is the Default one from hdinfo. However, on hdinfo the default MAC is NOT inside the list of Multiple MAC Addresses.

I try to generate the license with the following command: pyarmor licenses --bind-mac "00:FF:89:EC:92:49" and my test program runs as expected, since that is the Default MAC from hdinfo. However, when I generate the license with angular brackets (as it says in the documentation): pyarmor licenses --bind-mac "<00:FF:89:EC:92:49>" it says to me that the license is not for the machine: image

Generating the license with angular brackets for any of the other MAC addresses from getmac works.

Shouldn't the Default MAC be ALSO inside the List of Multiple MACs? The behavior I expected was "Binding this(ese) license(s) with angular brackets will check if it is(they are) a subset of the Multiple Available MAC Addresses". Did I get it wrong?

LuisHenri avatar Aug 31 '22 13:08 LuisHenri

In Windows the default Mac address is of the first network card found. But Multiple Mac addresses only include physical network cards.

It seems there are duplicated mac addresses in the multiple Mac list, I'll fix this.

jondy avatar Sep 01 '22 02:09 jondy

So, wouldn't it be possible to add non-physical Mac addresses to the Multiple Mac list? Or make the default be only-physical?

LuisHenri avatar Sep 01 '22 03:09 LuisHenri

In future version it will add a flag in license file to add non-physical Mac addresses to multiple Mac list.

jondy avatar Sep 01 '22 23:09 jondy